VICTORY_BVH_SIZE_COPY: the title's copies of the builder's compacted sizes are done behind their list #32

Manually merged
github merged 1 commit from github-bot/gh-32 into main 2026-11-30 16:22:42 +00:00 AGit
Owner

@⁠MJ26gaming on GitHub · 2026-11-30 12:54 UTC · original
MJ26gaming:pr/bvh-size-copy → main · +140 −2 · 5 files · 1 commits · merged 2026-11-30 16:18 UTC

What

VICTORY_BVH_SIZE_COPY — with the BVH builder on (VICTORY_BVH_BUILDER=1), the title's small buffer copies out of the builder's compacted-size slots are done behind their list (after the size program has run) instead of at submission.

The title copies each new structure's compacted size out of the slot the builder's size program stores in, with a small copy in the same list, and later allocates the compacted destination from that value. Done at submission, the copy read the slot before the GPU wrote it — an older structure's size — so compaction copies overran their room and wrote over the next structure (broken structures, frame-time climb).

  • A copy of ≤ 64 bytes out of a page the size programs store in (or out of a host copy stored in by address), into memory without a host copy, becomes a bottom-of-pipe write from title memory after the list has run.
  • On whenever the builder is on; VICTORY_BVH_SIZE_COPY=0 turns it off. Without the builder nothing changes.
  • A bvh size copy log line counts the copies moved.

Port of VIctory-NVIDIA 1788f11, by way of MJ26gaming/victory-rdna4-linux-rt-MJ26 (f6e40733, 0f116d96).

Measured

RX 9070 XT (RDNA4), Linux / Proton + vkd3d-proton (RADV, Mesa 26.3.1), Ryzen 7 7700, 32 GB. Series X path with RT, same save and place (the cell), the launcher's settings from scripts/play.ps1 (VICTORY_BVH_BUILDER=1 etc.), 300 s runs, first 90 s left out, on/off alternated. Numbers from the present pacing log lines.

run fps (avg) median p50 frames > 100 ms (per min)
on #1 8.85 8.06 288
off #1 7.94 8.10 465
on #2 12.04 14.13 169
off #2 8.81 8.67 359

Frames over 100 ms drop by roughly 40–50 % in both pairs; median fps up in the second pair. Picture checked in a capture run (cell scene correct).

Checks

  • cargo xwin build --release --locked -p victory (stable 1.100; 1.98.1 not installed here): no new warnings (only the existing fetch_update deprecations).
  • New unit tests (size_copies_go_with_the_builder_unless_switched_off, by_address_sources_are_the_shaders_only_when_asked, a_copy_behind_the_list_takes_its_source) and the existing host::place / queue::tests pass under Wine. Full victory-gpu suite not run, per CONTRIBUTING.

🤖 Generated with Claude Code

**@⁠MJ26gaming** on GitHub · 2026-11-30 12:54 UTC · [original](https://github.com/eikkapine/victory-amd/pull/32) `MJ26gaming:pr/bvh-size-copy` → `main` · +140 −2 · 5 files · 1 commits · merged 2026-11-30 16:18 UTC ## What `VICTORY_BVH_SIZE_COPY` — with the BVH builder on (`VICTORY_BVH_BUILDER=1`), the title's small buffer copies out of the builder's compacted-size slots are done **behind their list** (after the size program has run) instead of at submission. The title copies each new structure's compacted size out of the slot the builder's size program stores in, with a small copy in the same list, and later allocates the compacted destination from that value. Done at submission, the copy read the slot before the GPU wrote it — an older structure's size — so compaction copies overran their room and wrote over the next structure (broken structures, frame-time climb). - A copy of ≤ 64 bytes out of a page the size programs store in (or out of a host copy stored in by address), into memory without a host copy, becomes a bottom-of-pipe write from title memory after the list has run. - On whenever the builder is on; `VICTORY_BVH_SIZE_COPY=0` turns it off. Without the builder nothing changes. - A `bvh size copy` log line counts the copies moved. Port of VIctory-NVIDIA `1788f11`, by way of [MJ26gaming/victory-rdna4-linux-rt-MJ26](https://github.com/MJ26gaming/victory-rdna4-linux-rt-MJ26) (`f6e40733`, `0f116d96`). ## Measured RX 9070 XT (RDNA4), Linux / Proton + vkd3d-proton (RADV, Mesa 26.3.1), Ryzen 7 7700, 32 GB. Series X path with RT, same save and place (the cell), the launcher's settings from `scripts/play.ps1` (`VICTORY_BVH_BUILDER=1` etc.), 300 s runs, first 90 s left out, on/off alternated. Numbers from the `present pacing` log lines. | run | fps (avg) | median p50 | frames > 100 ms (per min) | |---|---|---|---| | on #1 | 8.85 | 8.06 | 288 | | off #1 | 7.94 | 8.10 | 465 | | on #2 | 12.04 | 14.13 | 169 | | off #2 | 8.81 | 8.67 | 359 | Frames over 100 ms drop by roughly 40–50 % in both pairs; median fps up in the second pair. Picture checked in a capture run (cell scene correct). ## Checks - `cargo xwin build --release --locked -p victory` (stable 1.100; 1.98.1 not installed here): no new warnings (only the existing `fetch_update` deprecations). - New unit tests (`size_copies_go_with_the_builder_unless_switched_off`, `by_address_sources_are_the_shaders_only_when_asked`, `a_copy_behind_the_list_takes_its_source`) and the existing `host::place` / `queue::tests` pass under Wine. Full `victory-gpu` suite not run, per CONTRIBUTING. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The title copies each new structure's compacted size out of the slot the
builder's size program stores in, with a small buffer copy in the same list.
Done at submission, that copy read the slot before the program ran: an older
structure's size, so compaction copies overran their room and wrote over the
next structure (broken structures, a frame-time climb).

A copy of at most 64 bytes out of a page the size programs store in (or a
host copy stored in by address), into memory without a host copy, is now a
bottom-of-pipe write from title memory after the list has run; a source
stored in by address counts as the shaders' for copies at their place.

On whenever the builder is (VICTORY_BVH_BUILDER=1); VICTORY_BVH_SIZE_COPY=0
turns it off. Without the builder nothing changes. A "bvh size copy" log line
counts the copies put behind their list.

Port of VIctory-NVIDIA 1788f11 by way of
MJ26gaming/victory-rdna4-linux-rt-MJ26 (f6e40733, 0f116d96).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Lxjd7NpP1AL3PmUWscMPHG
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 12:59:36 +00:00
github manually merged commit 09de6bf62b into main 2026-11-30 16:22:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.