VICTORY_REHYDRATE_PREP=1: make the geometry of the builder's unpack calls ready first (opt-in) #33

Merged
MJ26gaming merged 1 commit from upstream-pr/33 into main 2026-11-30 16:18:06 +00:00
MJ26gaming commented 2026-11-30 12:54:51 +00:00 (Migrated from github.com)

Imported from eikkapine/jaxe. Originally posted by MJ26gaming on 2026-11-30T12:54:51Z.


What

VICTORY_REHYDRATE_PREP=1 (off by default) — before the title's batched RehydrateRaytracingAccelerationStructure call unpacks packed (static) acceleration structures, the geometry each item reads (vertex and index buffers, transform) is made ready in by-address memory.

The unpacking reads that geometry through pointers inside its build inputs, which the by-address memory never sees. A page without a host copy then reads 0 at a stage that runs once, so the structure is unpacked with zero or stale floats and stays wrong for the rest of the run. In arena dumps of eight launches the same static prop's structure was byte-identical in five and had every float zero (or ~1e-12) in the three slowest — this is one source of "some launches are slow".

  • The import is wrapped after binding (LoadedImage::wrap_imports, new, generic); each item's geometry ranges go through memory::prepare_inputs before the original runs.
  • =1 on, =log only counts pages that had no copy, unset/other: nothing is wrapped.

Import hook after BackseatDrivers-Unbound/VIctory-AMD-RT. Port of MJ26gaming/victory-rdna4-linux-rt-MJ26 54437e26.

Measured

RX 9070 XT (RDNA4), Linux / Proton + vkd3d-proton (RADV, Mesa 26.3.1). Series X path with RT, the cell, scripts/play.ps1 settings, 300 s runs, first 90 s left out, on/off alternated, present pacing numbers:

run fps (avg) median p50 frames > 100 ms (per min)
on #1 8.03 8.39 473
off #1 7.22 8.19 419
on #2 8.95 8.29 323
off #2 8.24 8.24 404

Within noise on frame rate here: it is a correctness fix for launches that unpack a structure from zeros, which a few runs don't reliably hit. In our tree (with VICTORY_BVH_KEEP_REPLACED=1 and VICTORY_MEMORY_PEEL=2) it measured 25.57 vs 22.07 fps averaged over four alternated pairs, though launch-to-launch variance still dominated there too. Off by default, so nothing changes unless asked. Picture checked in a capture run.

Checks

  • cargo xwin build --release --locked -p victory (stable 1.100): no new warnings.
  • Full victory-gpu suite not run, per CONTRIBUTING.

🤖 Generated with Claude Code

<!-- greyfinch-sync:eikkapine/jaxe:issue:5565683346 --> Imported from [eikkapine/jaxe](https://github.com/eikkapine/jaxe/pull/33). Originally posted by [MJ26gaming](https://github.com/MJ26gaming) on 2026-11-30T12:54:51Z. --- ## What `VICTORY_REHYDRATE_PREP=1` (off by default) — before the title's batched `RehydrateRaytracingAccelerationStructure` call unpacks packed (static) acceleration structures, the geometry each item reads (vertex and index buffers, transform) is made ready in by-address memory. The unpacking reads that geometry through pointers inside its build inputs, which the by-address memory never sees. A page without a host copy then reads 0 at a stage that runs once, so the structure is unpacked with zero or stale floats and stays wrong for the rest of the run. In arena dumps of eight launches the same static prop's structure was byte-identical in five and had every float zero (or ~1e-12) in the three slowest — this is one source of "some launches are slow". - The import is wrapped after binding (`LoadedImage::wrap_imports`, new, generic); each item's geometry ranges go through `memory::prepare_inputs` before the original runs. - `=1` on, `=log` only counts pages that had no copy, unset/other: nothing is wrapped. Import hook after [BackseatDrivers-Unbound/VIctory-AMD-RT](https://github.com/BackseatDrivers-Unbound/VIctory-AMD-RT). Port of [MJ26gaming/victory-rdna4-linux-rt-MJ26](https://github.com/MJ26gaming/victory-rdna4-linux-rt-MJ26) `54437e26`. ## Measured RX 9070 XT (RDNA4), Linux / Proton + vkd3d-proton (RADV, Mesa 26.3.1). Series X path with RT, the cell, `scripts/play.ps1` settings, 300 s runs, first 90 s left out, on/off alternated, `present pacing` numbers: | run | fps (avg) | median p50 | frames > 100 ms (per min) | |---|---|---|---| | on #1 | 8.03 | 8.39 | 473 | | off #1 | 7.22 | 8.19 | 419 | | on #2 | 8.95 | 8.29 | 323 | | off #2 | 8.24 | 8.24 | 404 | Within noise on frame rate here: it is a correctness fix for launches that unpack a structure from zeros, which a few runs don't reliably hit. In our tree (with `VICTORY_BVH_KEEP_REPLACED=1` and `VICTORY_MEMORY_PEEL=2`) it measured 25.57 vs 22.07 fps averaged over four alternated pairs, though launch-to-launch variance still dominated there too. Off by default, so nothing changes unless asked. Picture checked in a capture run. ## Checks - `cargo xwin build --release --locked -p victory` (stable 1.100): no new warnings. - Full `victory-gpu` suite not run, per CONTRIBUTING. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
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
eikkapine/jaxe!33
No description provided.