memory: VICTORY_BVH_EAGER places title memory in place ahead of the walks (RT: −80% zero-read pages, −4 ms) #25

Closed
github-bot wants to merge 1 commit from gh-pr/25/head into gh-pr/25/base
Owner

@⁠LOCKhart07 on GitHub · 2026-11-30 11:47 UTC · original
LOCKhart07:bvh-eager → main · +21 −0 · 1 files · 1 commits · closed without merging

With ray tracing on, title memory that can go in place (Memory::direct()) only goes in place on first touch, one cell at a time (put_in_place). So the frame that first touches a page reads 0: memory.rs calls these late faults, and the builder's LeafRehydration hits them too.

VICTORY_BVH_EAGER=1 (off by default) places them ahead of time:

  • at the first ready(), put_whole over um::SPACE, so every page that can go in place does at once;
  • on a fault where put_in_place succeeds, put_whole of the page's whole STRETCH (128 MiB) instead of just its cell, for memory committed later.

Measured (RX 9070 XT 16 GB, 7800X3D, Fedora 44, Mesa 26.3.1 + mesa.patch, Wine 11.21 Staging; cd811c1, Series X, 2560x1440, RT on; the same scripted 8-minute bench, ~8.5–9k draws):

"no copy" pages frame (median) VRAM
without (6 runs) 527–660 36.5–37.8 ms ~11.1 GB
VICTORY_BVH_EAGER=1 134 31.5–33.1 ms 11.2 GB

A 4-minute VICTORY_FAULT_TAGS=1 run: late 1,018 → 0, there 708 → 38, LeafRehydration faults 292 → 0. VRAM doesn't move because nothing is copied.

What it doesn't fix: the distant shadow trace's outside/top addresses stay the same (details in #23).

Not checked: whether put_whole over the whole space at the first walk causes a hitch on slower CPUs (I didn't see one here), or how it interacts with title memory released and committed again later (let_go). If you'd rather have it on by default, or only the per-stretch half, I can change it.

🤖 Generated with Claude Code

**@⁠LOCKhart07** on GitHub · 2026-11-30 11:47 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/25) `LOCKhart07:bvh-eager` → `main` · +21 −0 · 1 files · 1 commits · closed without merging With ray tracing on, title memory that can go in place (`Memory::direct()`) only goes in place on first touch, one cell at a time (`put_in_place`). So the frame that first touches a page reads 0: memory.rs calls these `late` faults, and the builder's `LeafRehydration` hits them too. `VICTORY_BVH_EAGER=1` (off by default) places them ahead of time: - at the first `ready()`, `put_whole` over `um::SPACE`, so every page that can go in place does at once; - on a fault where `put_in_place` succeeds, `put_whole` of the page's whole `STRETCH` (128 MiB) instead of just its cell, for memory committed later. **Measured** (RX 9070 XT 16 GB, 7800X3D, Fedora 44, Mesa 26.3.1 + mesa.patch, Wine 11.21 Staging; `cd811c1`, Series X, 2560x1440, RT on; the same scripted 8-minute bench, ~8.5–9k draws): | | "no copy" pages | frame (median) | VRAM | |---|---|---|---| | without (6 runs) | 527–660 | 36.5–37.8 ms | ~11.1 GB | | `VICTORY_BVH_EAGER=1` | **134** | **31.5–33.1 ms** | 11.2 GB | A 4-minute `VICTORY_FAULT_TAGS=1` run: `late` 1,018 → 0, `there` 708 → 38, `LeafRehydration` faults 292 → 0. VRAM doesn't move because nothing is copied. What it doesn't fix: the distant shadow trace's `outside`/`top` addresses stay the same (details in #23). Not checked: whether `put_whole` over the whole space at the first walk causes a hitch on slower CPUs (I didn't see one here), or how it interacts with title memory released and committed again later (`let_go`). If you'd rather have it on by default, or only the per-stretch half, I can change it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With ray tracing, pages that can go in place (direct()) are only placed on first touch, one cell at a time, so the frame that touches them reads 0 (memory.rs "late"; LeafRehydration's faults too). VICTORY_BVH_EAGER=1 places every placeable page at the first ready() (put_whole over um::SPACE), and on a fault places the page's whole 128 MiB stretch. Off by default.

RX 9070 XT, cd811c1, RT on, 8-min scripted bench: "no copy" pages 527-660 -> 134, frame 36.5-37.8 -> 31.5-33.1 ms, VRAM unchanged (in place). Tagged run: late 1,018 -> 0, LeafRehydration faults 292 -> 0. The distant trace's outside/top faults are not affected (issue #23).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DJe9WTewVmLUUPkT6dTccK
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 07:41:33 +00:00
github-bot closed this pull request 2026-12-01 07:41:33 +00:00

Pull request closed

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