Memory: track private BVH arena writes #364

Closed
github-bot wants to merge 1 commit from github-bot/gh-364 into main AGit
Owner

@⁠Sr-0w on GitHub · 2026-11-26 19:04 UTC · original
agent2/bvh-arena-writes → main · +128 −20 · 4 files · 1 commits · closed without merging

Add the opt-in switch VICTORY_PORT_BVH_ARENA_WRITES=1. The runtime records its CPU writes into private BVH arenas in the existing write journal. It records which 4 KiB pieces changed within each 64 KiB page, then uses those notes when preparing a submission. With 26 arenas of 64 MiB each, this removes repeated Windows write-watch queries for those allocations.

Both arena population paths record writes. The existing shadow refresh and upload ordering still apply. The switch is off by default and applies only to private arenas. The directory, title buffers, and source title pages retain the existing write-watch path.

Measurements

RX 7800 XT 16 GB, Series X, ray tracing enabled, five renderer ports, warm cache and steady boat scene in a retail game. Values cover the last 90 seconds of each run.

Configuration FPS Frame ms CPU preparing ms/frame Write-watch calls/frame Write-watch ms/frame Flight settle ms/frame
Arena tracking off 9.8 102.8 77.8 563 19.3 12.8
Arena tracking on 9.2 109.5 67.7 459 8.2 55.6
Arena tracking on + separate CBV-in-place change (#363) 11.1 90.0 77.1 425 10.1 0.5

Arena tracking alone removes 104 write-watch calls and saves 10.1 ms of CPU preparation per frame. In that run, the submitting thread hit the CBV upload-fill dependency once per frame, up from 0.2 times per frame, and flight settle time increased. The combined run includes a separate CBV-in-place patch and is 12.8 ms/frame faster than the reference. Its frame-time improvement measures both changes together.

The coordinator checked contact sheets from the arena-only and combined runs. The boat scene looked unchanged, with ray tracing and BVH-built geometry intact.

Verification

  • Diagnostics build passed with cargo build --locked --profile diag -p victory --features diagnostics.
  • Three targeted CPU tests passed, including the new journal test for writes after a snapshot and the existing memory tests. The journal test also passed with VICTORY_PAGE_PARTS=0 and VICTORY_PORT_JOURNAL=1.
  • cargo clippy --locked -p victory-gpu --features diagnostics --lib completed with the existing unnecessary_mut_passed warning in the unrelated guard-opening call.

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-26 19:04 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/364) `agent2/bvh-arena-writes` → `main` · +128 −20 · 4 files · 1 commits · closed without merging Add the opt-in switch `VICTORY_PORT_BVH_ARENA_WRITES=1`. The runtime records its CPU writes into private BVH arenas in the existing write journal. It records which 4 KiB pieces changed within each 64 KiB page, then uses those notes when preparing a submission. With 26 arenas of 64 MiB each, this removes repeated Windows write-watch queries for those allocations. Both arena population paths record writes. The existing shadow refresh and upload ordering still apply. The switch is off by default and applies only to private arenas. The directory, title buffers, and source title pages retain the existing write-watch path. ## Measurements RX 7800 XT 16 GB, Series X, ray tracing enabled, five renderer ports, warm cache and steady boat scene in a retail game. Values cover the last 90 seconds of each run. | Configuration | FPS | Frame ms | CPU preparing ms/frame | Write-watch calls/frame | Write-watch ms/frame | Flight settle ms/frame | |---|---:|---:|---:|---:|---:|---:| | Arena tracking off | 9.8 | 102.8 | 77.8 | 563 | 19.3 | 12.8 | | Arena tracking on | 9.2 | 109.5 | 67.7 | 459 | 8.2 | 55.6 | | Arena tracking on + separate CBV-in-place change (#363) | 11.1 | 90.0 | 77.1 | 425 | 10.1 | 0.5 | Arena tracking alone removes 104 write-watch calls and saves 10.1 ms of CPU preparation per frame. In that run, the submitting thread hit the CBV upload-fill dependency once per frame, up from 0.2 times per frame, and flight settle time increased. The combined run includes a separate CBV-in-place patch and is 12.8 ms/frame faster than the reference. Its frame-time improvement measures both changes together. The coordinator checked contact sheets from the arena-only and combined runs. The boat scene looked unchanged, with ray tracing and BVH-built geometry intact. ## Verification - Diagnostics build passed with `cargo build --locked --profile diag -p victory --features diagnostics`. - Three targeted CPU tests passed, including the new journal test for writes after a snapshot and the existing memory tests. The journal test also passed with `VICTORY_PAGE_PARTS=0` and `VICTORY_PORT_JOURNAL=1`. - `cargo clippy --locked -p victory-gpu --features diagnostics --lib` completed with the existing `unnecessary_mut_passed` warning in the unrelated guard-opening call. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:09:57 +00:00
github-bot closed this pull request 2026-11-27 14:52:45 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.