Hardware ray tracing behind VICTORY_HW_RT=1 (DXR 1.1 ray queries) #81

Open
github-bot wants to merge 8 commits from github-bot/gh-80 into main AGit
Owner

@⁠Mbappinho on GitHub · 2026-12-05 02:31 UTC · original
Mbappinho:hw-rt → main · +14305 −24 · 36 files · 8 commits · open

What this changes

With -RayTracing -More @{ VICTORY_HW_RT = '1' }, the title's own BVH traversal loops run on the card's ray tracing units instead of the software walk. Off by default: without the switch the translator, the heaps and the HLE modules behave as before (the xboxbvh module is not even registered).

  • victory-shader (emit/lower/rayquery.rs): the title's traversal loops (bvh64/bvh32) are lifted into DXR 1.1 RayQuery. A loop the lifter does not recognise keeps the software walk. Root SRV slots t230-t241 carry the host structures; programs with ray queries ask for raytracing tier 1.1.
  • victory-gpu (hwrt.rs): host BLAS/TLAS are built from the console structures and recorded into the title's lists as external work. Heap views of a console structure become views of its host structure, refreshed when that structure is built again.
  • victory-hle (xboxbvh.rs): the module the title asks for its builds, registered only with the switch.
  • README.md: one bullet under Ray tracing.

The base is a port of MJ26gaming/victory-rdna4-linux-rt-MJ26 (dfb4905, 365fad5), itself a port of VIctory-NVIDIA's PR 3706. On top of it, one commit each:

  1. Title memory is read through host::read_into. MJ26's tree asked Windows (VirtualQuery) whether an address was readable; here streamed pages are mapped only once something touches them, so every quant24 vertex buffer and meshlet index buffer was given inactive (11 instances in a TLAS).
  2. plane_upload fills that read no title memory go through defer_host too; before, the remap table and the BLAS inputs were sometimes never written and the card read stale bytes (device removed while loading).
  3. A BLAS geometry's transform is read when the title asks for the build. The title reuses that memory once it has recorded its list: rehydrates read at execution found other data in 4 of 10 geometries (scales up to 1e27), which crashed builds and darkened the GI.
  4. Three fixes from VIctory-SandBar (4b2d4503, 7fb56e9d, 18f73068): top levels name only bottom structures whose build was submitted; the BLAS table fill holds no clone of the TLAS; a geometry whose transform cannot be read is inactive instead of the identity (VICTORY_HWRT_TX_MISSING_OUT, on unless 0).
  5. Cached meshlet decodes are checked against title memory once a frame (VICTORY_HWRT_MESHLET_CHECK, on unless 0, from VIctory-SandBar d8c4d262).

Measured

RX 9070 XT, Ryzen 7 9800X3D, 32 GB, Windows 11. Release builds on 7e701172 (the branch is now on 8f78f14; #78 came in after, no conflict). Series X, -RayTracing -NoPcQuality, no other switch. Same save, standing still outdoors, 60 s to settle then 150 s measured, nobody at the controls; runs alternated.

fps median fps p10 frame ms card ms
main, 2 runs 25 / 26 25 / 26 39.7 / 38.2 14.1 / 13.1
this branch, switch off, 2 runs 26 / 28 25 / 27 38.3 / 35.9 13.0 / 10.1
this branch, VICTORY_HW_RT=1 34 33 29.7 4.1

With the switch off the branch runs as main does (the spread between runs is larger than the difference). With it on, the rays cost the card about 4-5 ms instead of 10-14; the frame is then bound by the CPU side (about 20 ms of preparation per frame in every row).

  • Device removed: 0 in 12 hardware runs on 01852c0d, 966f7e7c and 7e701172 (6 of this branch, 6 of the same commits with my diagnostics). On the older 249f2aab the same commits lost the device once, 28 s into the world. Before commit 3, the device was removed while loading in 1 of 3 plain hardware runs of the last batch without it.
  • Picture: the same scene, nothing missing in either mode. Indirect light is darker with the hardware walk: the GI pass's output is about a third lower (red 3.8 against 5.7-5.9 in my software runs), and the bottom half of the frame 3-7 % darker. In the probe pass, software rays miss more often (mean hit distance about 4,450, where a miss writes 10,000, against 2,000-2,550 with hardware rays). I have no console reference to say which picture is right.
  • Known: the one-frame vegetation dropouts of #43 show with both walks. In my scene, per recorded minute: 13 and 8 with this branch against 5 and 5 on main; with #43's rebase (d61a654) on top, 6 and 5 against 0 and 6. VICTORY_THIN=0 removes them with both walks, at a cost of about 9 fps here with hardware rays. Details: #43
  • #43 and this branch both add a thin-list stream op at after(17) (OLDER there, EXTERNAL here): whichever lands second moves its op to after(18). With that change the two run together (34 fps, no device removed).

Checks

  • cargo clippy --workspace --all-targets --locked -- -D warnings, and with --all-features: clean.
  • cargo test --workspace --locked --no-fail-fast, and with --all-features: 1,732 tests pass; two targets fail, both outside this change: host::stamps::tests::a_submissions_times_are_the_pcs (GPU/CPU clock check) fails 3/3 on main on this PC too; victory-loader's unit tests (a crate this change does not touch, nor its dependencies) hang here when run in parallel (minidump, thread-exit and trap tests) and pass with --test-threads=1.
  • cargo xtask policy: ok.

Made with Claude Code.

**@⁠Mbappinho** on GitHub · 2026-12-05 02:31 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80) `Mbappinho:hw-rt` → `main` · +14305 −24 · 36 files · 8 commits · open ## What this changes With `-RayTracing -More @{ VICTORY_HW_RT = '1' }`, the title's own BVH traversal loops run on the card's ray tracing units instead of the software walk. Off by default: without the switch the translator, the heaps and the HLE modules behave as before (the `xboxbvh` module is not even registered). - `victory-shader` (`emit/lower/rayquery.rs`): the title's traversal loops (bvh64/bvh32) are lifted into DXR 1.1 `RayQuery`. A loop the lifter does not recognise keeps the software walk. Root SRV slots t230-t241 carry the host structures; programs with ray queries ask for raytracing tier 1.1. - `victory-gpu` (`hwrt.rs`): host BLAS/TLAS are built from the console structures and recorded into the title's lists as external work. Heap views of a console structure become views of its host structure, refreshed when that structure is built again. - `victory-hle` (`xboxbvh.rs`): the module the title asks for its builds, registered only with the switch. - `README.md`: one bullet under Ray tracing. The base is a port of MJ26gaming/victory-rdna4-linux-rt-MJ26 (`dfb4905`, `365fad5`), itself a port of VIctory-NVIDIA's PR 3706. On top of it, one commit each: 1. Title memory is read through `host::read_into`. MJ26's tree asked Windows (`VirtualQuery`) whether an address was readable; here streamed pages are mapped only once something touches them, so every quant24 vertex buffer and meshlet index buffer was given inactive (11 instances in a TLAS). 2. `plane_upload` fills that read no title memory go through `defer_host` too; before, the remap table and the BLAS inputs were sometimes never written and the card read stale bytes (device removed while loading). 3. A BLAS geometry's transform is read when the title asks for the build. The title reuses that memory once it has recorded its list: rehydrates read at execution found other data in 4 of 10 geometries (scales up to 1e27), which crashed builds and darkened the GI. 4. Three fixes from VIctory-SandBar (`4b2d4503`, `7fb56e9d`, `18f73068`): top levels name only bottom structures whose build was submitted; the BLAS table fill holds no clone of the TLAS; a geometry whose transform cannot be read is inactive instead of the identity (`VICTORY_HWRT_TX_MISSING_OUT`, on unless `0`). 5. Cached meshlet decodes are checked against title memory once a frame (`VICTORY_HWRT_MESHLET_CHECK`, on unless `0`, from VIctory-SandBar `d8c4d262`). ## Measured RX 9070 XT, Ryzen 7 9800X3D, 32 GB, Windows 11. Release builds on `7e701172` (the branch is now on `8f78f14`; #78 came in after, no conflict). Series X, `-RayTracing -NoPcQuality`, no other switch. Same save, standing still outdoors, 60 s to settle then 150 s measured, nobody at the controls; runs alternated. | | fps median | fps p10 | frame ms | card ms | |---|---|---|---|---| | `main`, 2 runs | 25 / 26 | 25 / 26 | 39.7 / 38.2 | 14.1 / 13.1 | | this branch, switch off, 2 runs | 26 / 28 | 25 / 27 | 38.3 / 35.9 | 13.0 / 10.1 | | this branch, `VICTORY_HW_RT=1` | 34 | 33 | 29.7 | 4.1 | With the switch off the branch runs as `main` does (the spread between runs is larger than the difference). With it on, the rays cost the card about 4-5 ms instead of 10-14; the frame is then bound by the CPU side (about 20 ms of preparation per frame in every row). - Device removed: 0 in 12 hardware runs on `01852c0d`, `966f7e7c` and `7e701172` (6 of this branch, 6 of the same commits with my diagnostics). On the older `249f2aab` the same commits lost the device once, 28 s into the world. Before commit 3, the device was removed while loading in 1 of 3 plain hardware runs of the last batch without it. - Picture: the same scene, nothing missing in either mode. Indirect light is darker with the hardware walk: the GI pass's output is about a third lower (red 3.8 against 5.7-5.9 in my software runs), and the bottom half of the frame 3-7 % darker. In the probe pass, software rays miss more often (mean hit distance about 4,450, where a miss writes 10,000, against 2,000-2,550 with hardware rays). I have no console reference to say which picture is right. - Known: the one-frame vegetation dropouts of #43 show with both walks. In my scene, per recorded minute: 13 and 8 with this branch against 5 and 5 on `main`; with #43's rebase (`d61a654`) on top, 6 and 5 against 0 and 6. `VICTORY_THIN=0` removes them with both walks, at a cost of about 9 fps here with hardware rays. Details: https://git.gtahub.st/github/ReTerryDavis--ReVIctory/pulls/43 - #43 and this branch both add a thin-list stream op at `after(17)` (`OLDER` there, `EXTERNAL` here): whichever lands second moves its op to `after(18)`. With that change the two run together (34 fps, no device removed). ## Checks - `cargo clippy --workspace --all-targets --locked -- -D warnings`, and with `--all-features`: clean. - `cargo test --workspace --locked --no-fail-fast`, and with `--all-features`: 1,732 tests pass; two targets fail, both outside this change: `host::stamps::tests::a_submissions_times_are_the_pcs` (GPU/CPU clock check) fails 3/3 on `main` on this PC too; `victory-loader`'s unit tests (a crate this change does not touch, nor its dependencies) hang here when run in parallel (minidump, thread-exit and trap tests) and pass with `--test-threads=1`. - `cargo xtask policy`: ok. Made with Claude Code.
Off by default: without the switch the translator, the heaps and the HLE
modules behave as before (the xboxbvh module is not even listed).

- victory-shader: the title's BVH traversal loops (bvh64/bvh32) are lifted
  into DXR 1.1 RayQuery (emit/rayquery.rs); a loop the lifter does not
  recognise keeps the software walk. Root SRV slots t230-t241 carry the
  host structures; programs with ray queries ask for raytracing tier 1.1.
- victory-gpu: host BLAS/TLAS built from the console structures
  (hwrt.rs), recorded into the title's lists as external work; heap views
  of a console structure become views of its host structure, refreshed
  when that structure is built again elsewhere.
- victory-hle: xboxbvh module, registered only with the switch.

Ported from MJ26gaming/victory-rdna4-linux-rt-MJ26 (dfb4905, 365fad5),
itself a port of VIctory-NVIDIA PR #3706. GPL-3.0.

Made with Claude Code.
MJ26's tree asked Windows about title addresses (VirtualQuery) before
reading them. Here streamed pages are mapped only once something touches
them, so Windows said "not there" of every page nothing had touched yet:
every quant24 VB and meshlet IB of a run was given inactive (0 decoded,
11 instances in the last TLAS). Title memory is now copied out the way
the layer's own copies read it (host::read_into): a page in the
runtime's table of streamed pages is read there, and a page that is not
there fails the copy instead of faulting.

Made with Claude Code.
defer_host_read with an empty read pushes no blocker, and run_deferred's
skip_refreshes path walks only the blockers: on those submissions the remap
table and the BLAS input stage were never written and the card read the
pooled upload buffer's old bytes. About 2/3 of instance lookups missed, and
stale meshlet indices under rehydrate builds faulted the device (DRED: page
faults inside 64-rehydrate chunks, far from any allocation).

Made with Claude Code.
Title memory behind a transform is reused once the title has recorded its
list: rehydrates read at execution found other data there in 4 of 10
geometries (scales up to 1e27), triangles across the scene that darkened
the GI and crashed builds (device removed while loading). The 48 bytes are
now read with the geometry and staged.

Made with Claude Code.
- Top levels name only bottom structures whose build was submitted
  (SandBar 4b2d4503). as_map is written as lists are recorded, up to a
  frame ahead of the submitting thread, while a TLAS's remap table is
  filled at its submission: it could name a BLAS whose build the card had
  not run yet. Structures are now shown to top levels in the order of
  submission (`shown`, through defer_host so the step runs on every
  submission) and hidden again when evicted or freed with title memory.
  A TLAS takes 4 MB at least so it does not move under lists in flight.
- The BLAS table fill holds no clone of the TLAS (SandBar 7fb56e9d, from
  VIctory-NVIDIA a27e063): a build of it recorded meanwhile took a new
  buffer named in the views before it was built.
- A geometry whose transform can be read neither at the ask nor through a
  copy is given inactive instead of the identity (SandBar 18f73068,
  VICTORY_HWRT_TX_MISSING_OUT, on unless 0). Counted in the TLAS line
  (tx_missing_identity_inactive).

Made with Claude Code.
VICTORY_HWRT_MESHLET_CHECK, on unless 0, from VIctory-SandBar d8c4d262.
cached_meshlet_ib is keyed by address and its entries were let go only
when title memory was unmapped, never when the title wrote the buffer
again or gave the address to another mesh (5-8 dynamic decodes a run
changed within 3 s). A decode now stamps the bytes it read (header,
meshlets, packed triangles, the vertex indices as far as the triangles
reach); a cached decode is looked at once a frame and decoded again when
title memory holds other bytes. The stamp is xored into the refit
topology, so a buffer written anew is built, not refitted from the old
triangles. Counted in the TLAS line (meshlet_trusted_same_changed).
Hand-ported onto title_bytes reads; std's SipHash is the stamp (a test
checks it does not depend on how the bytes are split).

Made with Claude Code.
Made with Claude Code.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 02:32:45 +00:00
Author
Owner

@⁠Mbappinho on GitHub · 2026-12-05 05:00 UTC · original

Two notes on this PR.

  • The Default tests job was cancelled when it hit its 60-minute limit, as on most CI runs tonight, including main's own push run for #78's merge (cancelled at 01:28 UTC). Clippy and the diagnostics tests passed. My local results are in the Checks section above.
  • About the indirect light I described as darker with the hardware walk: most of that gap came from a defect in the software walk. Its rehydrated structures read about half their triangles as zero (pages read before they had a copy on the card). With #87, which fixes that, the software walk's GI pass output comes down to the hardware walk's level (red 3.90 / 3.96 against 3.82 with this PR). The probe hit distance still differs (about 3,100 against 2,475), and I still have no console reference.

Made with Claude Code.

**@⁠Mbappinho** on GitHub · 2026-12-05 05:00 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7432296531) Two notes on this PR. - The `Default tests` job was cancelled when it hit its 60-minute limit, as on most CI runs tonight, including `main`'s own push run for #78's merge (cancelled at 01:28 UTC). Clippy and the diagnostics tests passed. My local results are in the Checks section above. - About the indirect light I described as darker with the hardware walk: most of that gap came from a defect in the software walk. Its rehydrated structures read about half their triangles as zero (pages read before they had a copy on the card). With #87, which fixes that, the software walk's GI pass output comes down to the hardware walk's level (red 3.90 / 3.96 against 3.82 with this PR). The probe hit distance still differs (about 3,100 against 2,475), and I still have no console reference. Made with Claude Code.
Author
Owner

@⁠ReTerryDavis on GitHub · 2026-12-05 09:44 UTC · original

Impressive work—the default-OFF isolation, GPU-side vertex/index sanitization, transform snapshotting, and resource retirement are all super clean, and the vendor-agnostic DXR 1.1 gains look great.

Ready to merge after a straightforward mechanical rebase onto current main (5 small hunks after 7e033dd and 627da77):

  • crates/victory-gpu/src/pipeline/host.rs (SLOT_MEMORY_VAS)
  • crates/victory-gpu/src/watch.rs (title_memory_freed / forget_watch_reservations)
  • crates/victory-shader/src/emit/lower/mod.rs (struct Lower)
  • crates/victory-shader/src/emit/mod.rs (pub use shader::{ ... })
  • crates/victory-shader/src/emit/shader.rs (SLOT_MEMORY_VAS / SLOT_AMD_EXT = 252; no collision with SLOT_TLAS_BASE..=MAX = 230..=241)

One small cleanup while rebasing: in hwrt.rs:68, please avoid unsafe { std::env::set_var("VICTORY_BVH_BUILDER", "0") } inside requested()—checking !hwrt::requested() directly in pipeline.rs's builder toggle is safer under Rust 2024.

**@⁠ReTerryDavis** on GitHub · 2026-12-05 09:44 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7435888399) Impressive work—the default-OFF isolation, GPU-side vertex/index sanitization, transform snapshotting, and resource retirement are all super clean, and the vendor-agnostic DXR 1.1 gains look great. Ready to merge after a straightforward mechanical rebase onto current `main` (5 small hunks after `7e033dd` and `627da77`): - `crates/victory-gpu/src/pipeline/host.rs` (`SLOT_MEMORY_VAS`) - `crates/victory-gpu/src/watch.rs` (`title_memory_freed` / `forget_watch_reservations`) - `crates/victory-shader/src/emit/lower/mod.rs` (`struct Lower`) - `crates/victory-shader/src/emit/mod.rs` (`pub use shader::{ ... }`) - `crates/victory-shader/src/emit/shader.rs` (`SLOT_MEMORY_VAS` / `SLOT_AMD_EXT` = 252; no collision with `SLOT_TLAS_BASE..=MAX` = 230..=241) One small cleanup while rebasing: in `hwrt.rs:68`, please avoid `unsafe { std::env::set_var("VICTORY_BVH_BUILDER", "0") }` inside `requested()`—checking `!hwrt::requested()` directly in `pipeline.rs`'s builder toggle is safer under Rust 2024.
Author
Owner

@⁠staticman256 on GitHub · 2026-12-05 12:09 UTC · original

@⁠Mbappinho users report that the fork here performs RT way better. Is this the same RT implementation? https://github.com/Zelbrad/VIda/tree/rt

Anything you can get from that? I haven't tested this personally for now.

**@⁠staticman256** on GitHub · 2026-12-05 12:09 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7437720864) @⁠Mbappinho users report that the fork here performs RT way better. Is this the same RT implementation? https://github.com/Zelbrad/VIda/tree/rt Anything you can get from that? I haven't tested this personally for now.
github-bot force-pushed github-bot/gh-80 from 0527db45b3 to 9709294b95 2026-12-05 18:01:29 +00:00 Compare
Author
Owner

@⁠Mbappinho on GitHub · 2026-12-05 17:57 UTC · original

Thanks. Rebased onto main at a6b5a998; it also merges cleanly with today's 8bff52be, and cargo check passes on that merge (with #87 too). The five hunks you listed were the only conflicts, each resolved by keeping both sides: SLOT_MEMORY_VAS / SLOT_AMD_EXT (252) next to SLOT_TLAS_BASE..=SLOT_TLAS_MAX (230..=241), forget_watch_reservations then hwrt::title_memory_freed, both sets of fields in struct Lower, and the merged pub use shader::{...}.

The set_var is gone (9709294b): requested() only reads now. pipeline::builder_runs checks !hwrt::requested() next to VICTORY_BVH_BUILDER, and so does the BVH probe's default, so with VICTORY_HW_RT=1 and VICTORY_BVH_BUILDER=1 (what -RayTracing sets) the title's builder and the probe stay off, as before.

Checked on 9709294b: clippy with and without --all-features (with main's own lint failures allowed), policy, the workspace tests but victory-gpu, whose test target does not build on main (overlay/shots.rs, Tab::Lighting): 1092 passed, 0 failed with --all-features on one thread. With the default thread count, victory-loader's lib tests did not finish within 40 minutes, here and on #87's branch (threads::tests::exit_ends_the_other_threads_first and minidump::tests::a_dump_of_this_process_is_written_with_its_threads among the unfinished); neither branch touches victory-loader or its dependencies. Hardware RT runs of the rebased build, no device removal: 20.5-21.6 fps against 32-33 for the branch as first posted, which is a slowdown on current main that I am narrowing down and will detail in a separate comment, not this PR.

Made with Claude Code.

**@⁠Mbappinho** on GitHub · 2026-12-05 17:57 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7442671268) Thanks. Rebased onto `main` at a6b5a998; it also merges cleanly with today's 8bff52be, and `cargo check` passes on that merge (with #87 too). The five hunks you listed were the only conflicts, each resolved by keeping both sides: `SLOT_MEMORY_VAS` / `SLOT_AMD_EXT` (252) next to `SLOT_TLAS_BASE..=SLOT_TLAS_MAX` (230..=241), `forget_watch_reservations` then `hwrt::title_memory_freed`, both sets of fields in `struct Lower`, and the merged `pub use shader::{...}`. The `set_var` is gone (9709294b): `requested()` only reads now. `pipeline::builder_runs` checks `!hwrt::requested()` next to `VICTORY_BVH_BUILDER`, and so does the BVH probe's default, so with `VICTORY_HW_RT=1` and `VICTORY_BVH_BUILDER=1` (what `-RayTracing` sets) the title's builder and the probe stay off, as before. Checked on 9709294b: clippy with and without `--all-features` (with `main`'s own lint failures allowed), policy, the workspace tests but `victory-gpu`, whose test target does not build on `main` (`overlay/shots.rs`, `Tab::Lighting`): 1092 passed, 0 failed with `--all-features` on one thread. With the default thread count, `victory-loader`'s lib tests did not finish within 40 minutes, here and on #87's branch (`threads::tests::exit_ends_the_other_threads_first` and `minidump::tests::a_dump_of_this_process_is_written_with_its_threads` among the unfinished); neither branch touches `victory-loader` or its dependencies. Hardware RT runs of the rebased build, no device removal: 20.5-21.6 fps against 32-33 for the branch as first posted, which is a slowdown on current `main` that I am narrowing down and will detail in a separate comment, not this PR. Made with Claude Code.
Author
Owner

@⁠Mbappinho on GitHub · 2026-12-05 18:38 UTC · original

@⁠ReTerryDavis a heads-up from measuring the rebased branches: on this PC (9800X3D, RX 9070 XT, Windows 11, native 4K, the same save and still scene for every build), current main is much slower than before 627da774, and the cause is the new hot-block rules in watch.rs.

A first-parent bisect, software RT (the title's builder):

build fps copies per frame ([stats] frame detail)
7e033dda 27.4 10.6 ms / 86 MB
627da774 19.3 22.1 ms / 302 MB

Then one exe on 8bff52be with two local switches that bring back the rules from before 627da774: VICTORY_HOT_OLD=1 for hot blocks (500 ms default, 50 ms grace, one step hotter at a time, no jitter, no cool-down step, 8192 kept) and VICTORY_EVICT_OLD=1 for let_go_idle (no 5 s floor, written copies evictable). Software RT, 90 s per run, in this order:

run fps (median / p10) frame prep copies per frame
main 20.7 / 20.4 42.7 ms 19.5 ms / 289 MB
old hot rules 30.5 / 30.0 20.6 ms 10.3 ms / 86 MB
old idle eviction 21.4 / 20.8 41.5 ms 17.8 ms / 288 MB
both 31.2 / 30.5 20.3 ms 10.1 ms / 89 MB
main again 20.9 / 20.5 41.2 ms 17.6 ms / 264 MB

VICTORY_GUARD_HOT=500 alone (the old default) gives back about 1 fps, so the cost is in the rest of the change: the 250 ms grace, the jump from 0 to 2, the cool-down step or the jitter. I have not split those. Hardware RT (#81) shows the same drop: 32-33 fps on 8f78f14a, 20.5-21.6 once rebased.

I understand these rules target the synchronized VirtualProtect storms, and this bench (a still scene, 90 s) measures neither hitches nor long sessions, so I am not asking for a plain revert. A switch, or the old rules by default with the new ones opt-in, would let both be measured. The switch I used is about 40 lines; I can push it to a branch, or run any variant on this PC.

Made with Claude Code.

**@⁠Mbappinho** on GitHub · 2026-12-05 18:38 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7443296798) @⁠ReTerryDavis a heads-up from measuring the rebased branches: on this PC (9800X3D, RX 9070 XT, Windows 11, native 4K, the same save and still scene for every build), current `main` is much slower than before 627da774, and the cause is the new hot-block rules in `watch.rs`. A first-parent bisect, software RT (the title's builder): | build | fps | copies per frame (`[stats] frame detail`) | |---|---|---| | 7e033dda | 27.4 | 10.6 ms / 86 MB | | 627da774 | 19.3 | 22.1 ms / 302 MB | Then one exe on 8bff52be with two local switches that bring back the rules from before 627da774: `VICTORY_HOT_OLD=1` for hot blocks (500 ms default, 50 ms grace, one step hotter at a time, no jitter, no cool-down step, 8192 kept) and `VICTORY_EVICT_OLD=1` for `let_go_idle` (no 5 s floor, written copies evictable). Software RT, 90 s per run, in this order: | run | fps (median / p10) | frame prep | copies per frame | |---|---|---|---| | `main` | 20.7 / 20.4 | 42.7 ms | 19.5 ms / 289 MB | | old hot rules | **30.5 / 30.0** | 20.6 ms | 10.3 ms / 86 MB | | old idle eviction | 21.4 / 20.8 | 41.5 ms | 17.8 ms / 288 MB | | both | 31.2 / 30.5 | 20.3 ms | 10.1 ms / 89 MB | | `main` again | 20.9 / 20.5 | 41.2 ms | 17.6 ms / 264 MB | `VICTORY_GUARD_HOT=500` alone (the old default) gives back about 1 fps, so the cost is in the rest of the change: the 250 ms grace, the jump from 0 to 2, the cool-down step or the jitter. I have not split those. Hardware RT (#81) shows the same drop: 32-33 fps on 8f78f14a, 20.5-21.6 once rebased. I understand these rules target the synchronized `VirtualProtect` storms, and this bench (a still scene, 90 s) measures neither hitches nor long sessions, so I am not asking for a plain revert. A switch, or the old rules by default with the new ones opt-in, would let both be measured. The switch I used is about 40 lines; I can push it to a branch, or run any variant on this PC. Made with Claude Code.
Author
Owner

@⁠Mbappinho on GitHub · 2026-12-05 18:38 UTC · original

@⁠staticman256 I have not run it, but from its source and README: VIda-RT's rt branch is the same family. Its hardware ray tracing is a port of Darner (TrustNo1), as this PR's is through MJ26 (the same rayquery.rs lifting and hwrt.rs host side).

Two things likely explain the reports:

  • Its README's figures are with FSR 4 Quality and frame generation at 3440x1440: about 29 fps drawn, about 58 on screen (i5-13500, RX 9070). The figures in this PR are at native 4K with neither: 32-34 fps on the branch as first posted (9800X3D, RX 9070 XT). Different machines, so not a strict comparison.
  • It is built on ReVIctory v0.5.0. v0.6.0 includes 627da774, which costs about a third of the frame rate on this PC, with or without ray tracing (details in my comment above). Anyone comparing it with current main sees that too.

Two of its additions may be worth a look later: VICTORY_HWRT_MIN_T=1 (off by default there: running-minimum hit-distance accumulators clamped to the committed hit) and filling the card to 70% of its memory against flicker.

Made with Claude Code.

**@⁠Mbappinho** on GitHub · 2026-12-05 18:38 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7443297851) @⁠staticman256 I have not run it, but from its source and README: VIda-RT's `rt` branch is the same family. Its hardware ray tracing is a port of Darner (TrustNo1), as this PR's is through MJ26 (the same `rayquery.rs` lifting and `hwrt.rs` host side). Two things likely explain the reports: - Its README's figures are with FSR 4 Quality and frame generation at 3440x1440: about 29 fps drawn, about 58 on screen (i5-13500, RX 9070). The figures in this PR are at native 4K with neither: 32-34 fps on the branch as first posted (9800X3D, RX 9070 XT). Different machines, so not a strict comparison. - It is built on ReVIctory v0.5.0. v0.6.0 includes 627da774, which costs about a third of the frame rate on this PC, with or without ray tracing (details in my comment above). Anyone comparing it with current `main` sees that too. Two of its additions may be worth a look later: `VICTORY_HWRT_MIN_T=1` (off by default there: running-minimum hit-distance accumulators clamped to the committed hit) and filling the card to 70% of its memory against flicker. Made with Claude Code.
Author
Owner

@⁠Saksukella on GitHub · 2026-12-05 19:27 UTC · original

Tested the rebased PR #81 (9709294) merged cleanly onto current main (8bff52b) + PR #87 (3aa8562) on **AMD Radeon RX 9070 XT (

**@⁠Saksukella** on GitHub · 2026-12-05 19:27 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7444008368) Tested the rebased PR #81 (9709294) merged cleanly onto current main (8bff52b) + PR #87 (3aa8562) on **AMD Radeon RX 9070 XT (
Author
Owner

@⁠staticman256 on GitHub · 2026-12-05 19:38 UTC · original

@⁠Mbappinho

Nice find on the hot-block slowdown. I had a go at a small fix based on your numbers, diff attached.
I think the new 250 ms window makes too many pages "hot", so they get copied every frame even though the game only writes them every few frames. The diff goes back to 50 ms for that and keeps the 250 ms only so a hitch doesn't reset things.
I can't reproduce the slowdown on my PC, so I can't tell if it works. Could you try it on your bench?
It's on by default, and VICTORY_HOT_ENTER=0 gives the current behaviour, so one build can compare both.

hot-enter-2.patch

**@⁠staticman256** on GitHub · 2026-12-05 19:38 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7444154319) @⁠Mbappinho Nice find on the hot-block slowdown. I had a go at a small fix based on your numbers, diff attached. I think the new 250 ms window makes too many pages "hot", so they get copied every frame even though the game only writes them every few frames. The diff goes back to 50 ms for that and keeps the 250 ms only so a hitch doesn't reset things. I can't reproduce the slowdown on my PC, so I can't tell if it works. Could you try it on your bench? It's on by default, and VICTORY_HOT_ENTER=0 gives the current behaviour, so one build can compare both. [hot-enter-2.patch](https://github.com/user-attachments/files/35919722/hot-enter-2.patch)
Author
Owner

@⁠Mbappinho on GitHub · 2026-12-05 22:53 UTC · original

@⁠staticman256 Thanks, measured. One exe, 8bff52be plus your hot-enter-2.patch as attached; same PC, scene and bench as above (software RT, 90 s per run), in this order:

run fps (median / p10) frame prep copies per frame
VICTORY_HOT_ENTER=0 21.4 / 21.2 41.2 ms 18.8 ms / 280 MB
patch (default) 29.8 / 28.4 25.9 ms 12.4 ms / 152 MB
old rules (my local switch, another exe on the same base) 32.3 / 31.8 20.2 ms 9.9 ms / 85 MB
patch (default) 29.7 / 28.7 25.8 ms 12.0 ms / 154 MB
VICTORY_HOT_ENTER=0 21.1 / 20.5 42.1 ms 18.9 ms / 284 MB

So the narrow entry gives back most of the drop (+8.5 fps, copies 280 -> 153 MB), and about 2.5 fps are still missing against the rules from before 627da774, with copies at 153 MB against 85. What is left would be in what the patch keeps: the jump from 0 to 2, the cool-down step, the jitter or the 1000 ms ceiling. No device removal in any run, and the patch's watch tests pass here. This bench still says nothing of hitches; I am glad to run a next variant.

Made with Claude Code.

**@⁠Mbappinho** on GitHub · 2026-12-05 22:53 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7447141662) @⁠staticman256 Thanks, measured. One exe, 8bff52be plus your hot-enter-2.patch as attached; same PC, scene and bench as above (software RT, 90 s per run), in this order: | run | fps (median / p10) | frame prep | copies per frame | |---|---|---|---| | `VICTORY_HOT_ENTER=0` | 21.4 / 21.2 | 41.2 ms | 18.8 ms / 280 MB | | patch (default) | **29.8 / 28.4** | 25.9 ms | 12.4 ms / 152 MB | | old rules (my local switch, another exe on the same base) | 32.3 / 31.8 | 20.2 ms | 9.9 ms / 85 MB | | patch (default) | **29.7 / 28.7** | 25.8 ms | 12.0 ms / 154 MB | | `VICTORY_HOT_ENTER=0` | 21.1 / 20.5 | 42.1 ms | 18.9 ms / 284 MB | So the narrow entry gives back most of the drop (+8.5 fps, copies 280 -> 153 MB), and about 2.5 fps are still missing against the rules from before 627da774, with copies at 153 MB against 85. What is left would be in what the patch keeps: the jump from 0 to 2, the cool-down step, the jitter or the 1000 ms ceiling. No device removal in any run, and the patch's watch tests pass here. This bench still says nothing of hitches; I am glad to run a next variant. Made with Claude Code.
Author
Owner

@⁠PillowFullOfBricks on GitHub · 2026-12-05 23:42 UTC · original · edited 2026-12-06 01:06 UTC

@⁠Mbappinho there won't be a next version from me because I don't have this problem and cannot reproduce it to test. The above blob was just claude's attempt at fixing it from description and commit alone. Feel free to adapt and push the code as its own PR.

**@⁠PillowFullOfBricks** on GitHub · 2026-12-05 23:42 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/80#issuecomment-7447780402) · edited 2026-12-06 01:06 UTC @⁠Mbappinho there won't be a next version from me because I don't have this problem and cannot reproduce it to test. The above blob was just claude's attempt at fixing it from description and commit alone. Feel free to adapt and push the code as its own PR.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/81/head:github-bot/gh-80'
git switch 'github-bot/gh-80'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-80'
git switch 'github-bot/gh-80'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-80'
git switch 'github-bot/gh-80'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-80'
git switch 'main'
git merge --squash 'github-bot/gh-80'
git switch 'main'
git merge --ff-only 'github-bot/gh-80'
git switch 'main'
git merge 'github-bot/gh-80'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.