Perf / Silicon Lab (T51/T53): Breaking the VirtualProtect+VEH wall (−86.6% VP, −71.3% VEH, +11.3% 3D FPS) via MEM_PRIVATE | MEM_WRITE_WATCH + OpenExistingHeapFromAddress1 #1534

Open
opened 2026-11-30 00:57:52 +00:00 by POMXARK · 0 comments
POMXARK commented 2026-11-30 00:57:52 +00:00 (Migrated from github.com)
Contributor

Imported from fxceless/victory-fork. Originally posted by POMXARK on 2026-11-30T00:57:52Z.


Summary: Breaking the VirtualProtect + VEH Wall via MEM_PRIVATE | MEM_WRITE_WATCH + OpenExistingHeapFromAddress1 (T51 / T53)

Sharing a verified, drop-in clean-room finding from our bare-metal D3D12 + Win32 VM lab (POMXARK/victory-city-bench) and standalone GPL-3.0 tree (POMXARK/victory-pc-opt@4e591de) tested on NVIDIA RTX 5080 16 GB (ReBAR ON, Agility SDK 1.614.1) + Ryzen 7 5700X + 32 GB DDR4:

1. Root Cause & Bare-Metal Proof (EXP-046 / EXP-048)

  • Backing the un-aliased 185 MiB 32-bit graphics reservation (10+1 MiB descriptor heaps + 27 MiB hot constant ring + 147 MiB skinning) with CreateFileMappingW(SEC_RESERVE) + MapViewOfFile3 (MEM_MAPPED) disables Win32 GetWriteWatch and causes OpenExistingHeapFromFileMapping to refuse SEC_RESERVE, concentrating 700+ VirtualProtect(PAGE_READONLY) calls/f (56.8 ms), 436 VEH faults/f, and 77.9 ms GUARDS lock wait inside those 6 hot 4 MiB buckets.
  • Hardware Probe P1 (victory-city-bench --exp048): ID3D12Device13::OpenExistingHeapFromAddress1 succeeds directly on MEM_PRIVATE | MEM_WRITE_WATCH, while GetWriteWatch(WRITE_WATCH_FLAG_RESET) retains 64/64 (100%, missed_writes == 0) write detection with zero VirtualProtect and zero VEH faults!
Synthetic 174 MiB Bench (24 MiB hot + 2.0 GB/f L1 skinning, 14 subs/f, bg=14) CPU Total CPU memcpy GPU TS VP/f VEH/f Status
M1 Emulated (SEC_RESERVE MEM_MAPPED+VP+VEH+memcpy->L1) 16.12 ms 1.30 ms 0.29 ms 224 224 Baseline
M2 Combo (MEM_PRIVATE|MEM_WRITE_WATCH + L0 Alias DMA -> L1) 5.96 ms (2.70×) 0.00 ms 1.31 ms 0 0 #1 Winner (T53)
M3 WriteWatch (MEM_PRIVATE|MEM_WRITE_WATCH + staging -> L1) 6.59 ms (2.45×) 1.30 ms 0.29 ms 0 0 #2 Shipped (4e591de)
M4 Unguarded GPU Compute Diff (24 MiB L0 CS -> L1) 32.51 ms 0.00 ms 27.56 ms 0 0 Refuted (PCIe wall)
ReBAR GPU_UPLOAD (WC, EXP-046 w/ 3 MiB/f CPU reads) 733.8–774.9 ms 0.00 ms — 0 0 Refuted (4.2 MB/s read cliff)

2. Live --release OOTB Verification (POMXARK/victory-pc-opt@4e591de, xmem.rs, 24/24 unit tests PASS, 0 errors)

  • VirtualProtect (changing protections): 56.77 -> 7.62 ms/f (−86.6%); all 6 hot 32-bit buckets 6 -> 0 (0.00 ms)
  • VEH guard faults: 436 -> 125/f (−71.3%); GUARDS mutex wait: 77.86 -> 43.81 ms/f (−43.7%)
  • copies / Refr: 21.82 -> 16.15 ms (−26.0%) / 20.71 -> 15.80 ms (−23.7%)
  • Matched --release ALL 3D (n=41): 15.44 -> 17.19 FPS (+11.3%, 59.76 ms mean); First 80s 3D: 18.14 FPS (+51.5% vs 11.97 FPS baseline).

3. Ready-to-Reuse Code, Lab & AI Methodology (AGENTS.md)

AI use: Antigravity assisted with building/running the synthetic lab and local A/B runs, parsing telemetry, and drafting this report; reviewed by @POMXARK.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6686557802 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1534). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-11-30T00:57:52Z. --- ### Summary: Breaking the `VirtualProtect` + VEH Wall via `MEM_PRIVATE | MEM_WRITE_WATCH` + `OpenExistingHeapFromAddress1` (`T51` / `T53`) Sharing a verified, drop-in clean-room finding from our bare-metal D3D12 + Win32 VM lab ([`POMXARK/victory-city-bench`](https://github.com/POMXARK/victory-city-bench)) and standalone GPL-3.0 tree ([`POMXARK/victory-pc-opt@4e591de`](https://github.com/POMXARK/victory-pc-opt)) tested on **NVIDIA RTX 5080 16 GB (ReBAR ON, Agility SDK `1.614.1`) + Ryzen 7 5700X + 32 GB DDR4**: #### 1. Root Cause & Bare-Metal Proof (`EXP-046` / `EXP-048`) - Backing the un-aliased `185 MiB` 32-bit graphics reservation (`10+1 MiB` descriptor heaps + `27 MiB` hot constant ring + `147 MiB` skinning) with `CreateFileMappingW(SEC_RESERVE)` + `MapViewOfFile3` (`MEM_MAPPED`) disables Win32 `GetWriteWatch` and causes `OpenExistingHeapFromFileMapping` to refuse `SEC_RESERVE`, concentrating **`700+` `VirtualProtect(PAGE_READONLY)` calls/f (`56.8 ms`)**, **`436` VEH faults/f**, and **`77.9 ms` `GUARDS` lock wait** inside those 6 hot `4 MiB` buckets. - **Hardware Probe `P1` (`victory-city-bench --exp048`):** `ID3D12Device13::OpenExistingHeapFromAddress1` **succeeds directly on `MEM_PRIVATE | MEM_WRITE_WATCH`**, while **`GetWriteWatch(WRITE_WATCH_FLAG_RESET)` retains `64/64` (`100%`, `missed_writes == 0`) write detection** with zero `VirtualProtect` and zero VEH faults! | Synthetic `174 MiB` Bench (`24 MiB` hot + `2.0 GB/f` L1 skinning, `14` subs/f, `bg=14`) | CPU Total | CPU `memcpy` | GPU TS | `VP/f` | `VEH/f` | Status | |---|---:|---:|---:|---:|---:|---| | `M1` Emulated (`SEC_RESERVE MEM_MAPPED`+VP+VEH+`memcpy->L1`) | `16.12 ms` | `1.30 ms` | `0.29 ms` | `224` | `224` | Baseline | | **`M2` Combo (`MEM_PRIVATE\|MEM_WRITE_WATCH` + `L0` Alias DMA `-> L1`)** | **`5.96 ms` (`2.70×`)** | **`0.00 ms`** | `1.31 ms` | **`0`** | **`0`** | **#1 Winner (`T53`)** | | **`M3` WriteWatch (`MEM_PRIVATE\|MEM_WRITE_WATCH` + staging `-> L1`)** | **`6.59 ms` (`2.45×`)** | `1.30 ms` | `0.29 ms` | **`0`** | **`0`** | **#2 Shipped (`4e591de`)** | | `M4` Unguarded GPU Compute Diff (`24 MiB` `L0` CS `-> L1`) | `32.51 ms` | `0.00 ms` | `27.56 ms` | `0` | `0` | **Refuted (PCIe wall)** | | ReBAR `GPU_UPLOAD` (`WC`, `EXP-046` w/ `3 MiB/f` CPU reads) | `733.8–774.9 ms` | `0.00 ms` | — | `0` | `0` | **Refuted (`4.2 MB/s` read cliff)** | #### 2. Live `--release` OOTB Verification (`POMXARK/victory-pc-opt@4e591de`, `xmem.rs`, `24/24` unit tests PASS, `0` errors) - **`VirtualProtect` (`changing protections`):** **`56.77 -> 7.62 ms/f` (`−86.6%`)**; all 6 hot 32-bit buckets **`6 -> 0` (`0.00 ms`)** - **`VEH` guard faults:** **`436 -> 125/f` (`−71.3%`)**; **`GUARDS` mutex wait:** **`77.86 -> 43.81 ms/f` (`−43.7%`)** - **`copies` / `Refr`:** **`21.82 -> 16.15 ms` (`−26.0%`)** / **`20.71 -> 15.80 ms` (`−23.7%`)** - **Matched `--release` ALL 3D (`n=41`):** **`15.44 -> 17.19 FPS` (`+11.3%`, `59.76 ms` mean)**; **First 80s 3D:** **`18.14 FPS`** (`+51.5%` vs `11.97 FPS` baseline). #### 3. Ready-to-Reuse Code, Lab & AI Methodology (`AGENTS.md`) - **Drop-in `xmem.rs` Phase 1 commit (`4e591de`):** https://github.com/POMXARK/victory-pc-opt/commit/4e591ded603afbba499342a37a5568a13fae5c07 - **Reproducible Lab, `AGENTS.md` First-Principles Protocol & 53 Silicon Laws (`T1`–`T53`):** https://github.com/POMXARK/victory-city-bench (`docs/THEOREMS_AND_LAWS.md`, `PROGRESS_RTX5080_R7-5700X_32GB.md`) - **Standalone C-ABI GPU BCPack Library (`v0.16.0`):** https://github.com/POMXARK/bcpack-gpu-sdk *AI use: Antigravity assisted with building/running the synthetic lab and local A/B runs, parsing telemetry, and drafting this report; reviewed by @POMXARK.*
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork#1534
No description provided.