Hardware ray tracing and card memory: #262, #274, #306, #323 and #328 together, current with main #342

Open
github-bot wants to merge 12 commits from github-bot/gh-342 into main AGit
Owner

@⁠LOCKhart07 on GitHub · 2026-12-03 18:05 UTC · original
LOCKhart07:rt-all → main · +21585 −137 · 33 files · 12 commits · open

This is a utility PR: everything from #262, #274, #306, #323 and #328 in one branch that is current with main. Those five stay open for reading the changes one at a time; this one is for trying or merging the whole set without the stack. Nothing here is new beyond the two merge commits.

What is in it

PR What Switch (all off by default)
#262 Hardware ray tracing: structure walks lifted to ray queries, host structures by a builder tap VICTORY_HW_RT=1
#274 The title's structure builder runs only where the title reads its result VICTORY_HW_RT_LEAN_BUILDER=1
#306 Card memory: send buffers used again, structures in shared blocks, textures placed tight none (always on)
#323 Idle updatable structures built again as compact ones VICTORY_HW_RT_DEMOTE=1
#328 Sparse blocks of long-lived structures emptied and given back VICTORY_HW_RT_PACK=1

The descriptions, measurements and limits of each are in its own PR.

How it was brought up to main

Main had moved 111 commits past the stack's base. Two files conflicted:

  • crates/victory-gpu/src/descriptor/host.rs, TextureQueue::scan. Main now walks only the due front of the queue and keeps counts as slots change. #306 had added a count of slots held back for want of room to the old full walk. Main's walk is kept; the held-back count runs before it and walks only the held slots.
  • crates/victory-shader/src/lib.rs, TRANSLATOR_VERSION. Main went 13 to 19; #262 went 13 to 14 for two fixes that change output with the switches off. Both sets are in, so it is 20. Cached translations are made again once.

#274 merged without conflicts. The other files merged as they were.

Checked

  • Diagnostics and release builds: no warnings.
  • victory-gpu tests: 412 passed, 6 failed, 23 ignored. Main alone fails the same 6 (two indirect::tests::host_list_*, four watch::). descriptor::tests::views_die_with_their_resource crashes the test binary on main too, so it was skipped in both.
  • victory-shader tests: 426 passed, 0 failed (main: 415).
  • The 64 saved ray-tracing programs still lift whole on main's translator: 397 of 397 loops, all 64 validated.
  • All four switches read == "1" and none is set in run.conf.default, run.sh or the presets.

Not done

  • This merged build has not been run in play. Every measurement in the five PRs is from before the merge.
  • docs/SETTINGS.md has no rows yet for VICTORY_HW_RT, VICTORY_HW_RT_LEAN_BUILDER, VICTORY_HW_RT_DEMOTE, VICTORY_HW_RT_PACK, or the two default-on ones (VICTORY_HW_RT_REFIT, VICTORY_HW_RT_ARENA).
  • How many warmed pipelines are made again after the translator bump was not measured.

Known from my own play on the stack before the merge

RX 9070 XT 16 GB, RADV, 2560x1440, hardware ray tracing on.

  • Long sessions still fill the card. Sessions of 15 and 36 minutes ended with the card and shared memory both full. Host structures grow as the world streams: about 3.2 GB after 15 minutes, of which about 1.3 GB had been named by no top-level structure for over five minutes. Nothing here releases those.
  • One session of 4.5 minutes ended in a GPU read page fault with memory not full. Its cause is not known.

🤖 Generated with Claude Code

**@⁠LOCKhart07** on GitHub · 2026-12-03 18:05 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/342) `LOCKhart07:rt-all` → `main` · +21585 −137 · 33 files · 12 commits · open This is a utility PR: everything from #262, #274, #306, #323 and #328 in one branch that is current with main. Those five stay open for reading the changes one at a time; this one is for trying or merging the whole set without the stack. Nothing here is new beyond the two merge commits. ## What is in it | PR | What | Switch (all off by default) | |---|---|---| | #262 | Hardware ray tracing: structure walks lifted to ray queries, host structures by a builder tap | `VICTORY_HW_RT=1` | | #274 | The title's structure builder runs only where the title reads its result | `VICTORY_HW_RT_LEAN_BUILDER=1` | | #306 | Card memory: send buffers used again, structures in shared blocks, textures placed tight | none (always on) | | #323 | Idle updatable structures built again as compact ones | `VICTORY_HW_RT_DEMOTE=1` | | #328 | Sparse blocks of long-lived structures emptied and given back | `VICTORY_HW_RT_PACK=1` | The descriptions, measurements and limits of each are in its own PR. ## How it was brought up to main Main had moved 111 commits past the stack's base. Two files conflicted: - `crates/victory-gpu/src/descriptor/host.rs`, `TextureQueue::scan`. Main now walks only the due front of the queue and keeps counts as slots change. #306 had added a count of slots held back for want of room to the old full walk. Main's walk is kept; the held-back count runs before it and walks only the held slots. - `crates/victory-shader/src/lib.rs`, `TRANSLATOR_VERSION`. Main went 13 to 19; #262 went 13 to 14 for two fixes that change output with the switches off. Both sets are in, so it is 20. **Cached translations are made again once.** #274 merged without conflicts. The other files merged as they were. ## Checked - Diagnostics and release builds: no warnings. - `victory-gpu` tests: 412 passed, 6 failed, 23 ignored. Main alone fails the same 6 (two `indirect::tests::host_list_*`, four `watch::`). `descriptor::tests::views_die_with_their_resource` crashes the test binary on main too, so it was skipped in both. - `victory-shader` tests: 426 passed, 0 failed (main: 415). - The 64 saved ray-tracing programs still lift whole on main's translator: 397 of 397 loops, all 64 validated. - All four switches read `== "1"` and none is set in `run.conf.default`, `run.sh` or the presets. ## Not done - **This merged build has not been run in play.** Every measurement in the five PRs is from before the merge. - `docs/SETTINGS.md` has no rows yet for `VICTORY_HW_RT`, `VICTORY_HW_RT_LEAN_BUILDER`, `VICTORY_HW_RT_DEMOTE`, `VICTORY_HW_RT_PACK`, or the two default-on ones (`VICTORY_HW_RT_REFIT`, `VICTORY_HW_RT_ARENA`). - How many warmed pipelines are made again after the translator bump was not measured. ## Known from my own play on the stack before the merge RX 9070 XT 16 GB, RADV, 2560x1440, hardware ray tracing on. - Long sessions still fill the card. Sessions of 15 and 36 minutes ended with the card and shared memory both full. Host structures grow as the world streams: about 3.2 GB after 15 minutes, of which about 1.3 GB had been named by no top-level structure for over five minutes. Nothing here releases those. - One session of 4.5 minutes ended in a GPU read page fault with memory not full. Its cause is not known. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The title's ray-tracing programs walk the console's structures in a loop
of their own. With VICTORY_HW_RT=1 the translator recognises each such
loop and writes a DXIL RayQuery in its place, keeping the title's own
hit tests, masks and ordering rules as the candidate and commit steps.
A loop it cannot prove equivalent stays as translated before.

Ported from VIctory-NVIDIA PR #3706 (GPL-3.0), with the lifter's
exactness rules of dakisback2/VIctory-Nvidia-Linux (85b0b11b, 5485daf7)
by way of Leslie-d-a/VIctory-NVIDIA-HWRT; see the header of
emit/rayquery.rs.

New here: the 14 loops those leave unlifted (6 programs, given a forced
miss there). The console compiler reuses three registers as loop scratch
on the lanes that run the loop and reads their old values on the lanes
that do not; the lane sets pass through mask joins the lifter could not
relate. Joins whose inputs are all one mask now collapse to it, and the
reading lanes are refuted against the loop's entry lanes by an exact
search (Bools::sat_with; out of budget refuses). All 64 ray-tracing
programs and their 397 loops lift and pass the DXIL validator.

Two fixes on the way, with the switch off too (translator version up):
the sign of zero in v_mad_legacy, and partial stores through a counter
view. Apart from those, the output with the switch off is unchanged.

`victory translate` names an emit panic per program and prints a
ray-tracing summary. A run refuses the switch until the host side is in.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The host side of the lifted ray queries. Started from VIctory-NVIDIA
PR #3706 (GPL-3.0) as ported to RADV by
MJ26gaming/victory-rdna4-linux-rt-MJ26 365fad515; see the header of
hwrt.rs for what was taken and what was left out.

The title's structure builder keeps running (a tap, not a replacement):
its build, refit and copy calls are passed on, and the same triangles
and instances go into host bottom- and top-level structures that the
lifted programs trace.

- Inputs follow the console builder's rules: only a NaN in X makes a
  triangle inactive; infinite and far positions pass through; indices
  and meshlets past the stated counts read the title's real bytes.
  Every departure is counted by what it changed, and bytes that cannot
  be read are a counted loss, never a silent zero.
- No budget evicts a structure and no instance is masked.
- Host work is recorded in the title's lists at the title's call, and a
  ledger keeps it in the card's order. Structures that are not refit
  are compacted exactly.
- Loss counters are printed with the frame-rate lines; all 0 over the
  check runs.
- VICTORY_RT_STAMPS=rt (diagnostics) stamps only the ray-tracing
  dispatches and the host builds. Over two 5 minute runs in the same
  place: trace passes 5.4 ms a frame as translated loops, 0.9 ms as
  ray queries, plus 0.5 ms for the host builds.
- A run takes VICTORY_HW_RT=1. Not yet checked hit for hit against the
  console's own walk on a captured frame.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
In free play the host structures grew past 7 GB in a few minutes and
kept growing. Measured by what each buffer holds, almost all of it was
structures kept at the driver's largest size:

- An updatable structure costs about four times a compacted one's bytes
  a triangle on RADV (its refit needs a fixed leaf region), and the
  title allows updates of many structures it never updates, or updates
  once. A structure is now built without ALLOW_UPDATE on the host, and
  becomes updatable only when the title updates it again within a
  second of its last update; an update short of that is built in full,
  the same triangles.
- Every structure built without ALLOW_UPDATE is compacted by the host
  once built, through the tickets the title's own COMPACT copies use:
  rehydrates (ready-made on the console, never copied by the title) and
  the title's builds it does not copy.
- Structures the title builds over are dropped: the builder's own
  prebuild sizes are tapped, and a structure kept at an address inside
  the bytes a new build was given goes, as with freed title memory.

The report says where the bytes are: alive by what they hold, in the
tap's map or outside it, updatable ones by their last update and by
how many updates they had, the host's own cost (buffers made,
compaction points), and the console's bytes next to the host's where
the console's are known. An event the card's order refuses is logged
with what the ledger held there.

Over a 3 minute drive: 7.3 GB and growing before; steady between 2.1
and 2.5 GB after, every loss counter 0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
With hardware ray tracing nothing of ours reads what the title's
structure builder writes: every traversal loop is a ray query on the
host's structures, and those are built from the title's inputs. The
title reads one result of it: the compacted size a build is asked for,
which is the node count of the tree that build made, read back a frame
or two later to size the copy. No other program can give that number.

With the switch (only with VICTORY_HW_RT=1) each request of a tapped
call is kept or skipped:

- A bottom-level build that carries postbuild descriptions is kept:
  the builder runs it as ever and the title reads its own size. A copy
  of a structure a kept build made is kept too.
- Every other build, update, top-level build, rehydrate and copy is
  skipped. The title's export is still called, so its checks and
  results stay its own, between two marks in the list: the builder's
  dispatches recorded between them are dropped when the list is
  translated, before anything is bound. A batch is given to the export
  as runs, in its order.
- A request that asks a size and cannot be kept (a top-level build, an
  update of a structure no kept build made) is skipped, counted and
  logged as an error. None was seen.

The builder's stages run all or none, so whole calls are kept or
skipped, and a kept stage reads only what a kept one wrote.

A report line counts requests kept, skipped by kind, copies, losses
and dispatches dropped; an error is logged if a dispatch reads title
memory by address while the switch is on (a program not lifted).

By the builder's own stamps, standing still: 2.05 ms of card time a
frame before, 0.1 ms with the switch (98 dispatches dropped a frame).
Driving: 1.4 ms mean. Losses 0 in both, every hardware ray-tracing
loss counter 0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Four files of the shader crate conflicted with #283, which fixed the same two things another way:

- legacy_fmad's zero addend: kept this branch's form, worked on the bits (-0 gives +0, and a NaN addend comes out quieted as the console's arithmetic gives it); main's comparison against zero covers the sign alone.
- the joined mask and number test, the image store test and the container hash test: kept this branch's, which check more (a full and a partial wave, every channel mask against the store of one, the validator's hash).

TRANSLATOR_VERSION 14: main's 13 is the legacy multiply, and this branch changes the legacy mad's NaN and partial stores through a counter view with the switch off.

Shader crate tests: 412 passed, 0 failed. The gpu crate's hardware ray-tracing tests: 43 passed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Every submission in flight made an upload buffer of its own for what it sends up, sized to what was asked, and kept it until the submission was done. A buffer given back was used again only by a request of the same size, so most were made new: about 570 MB of them stood on the card at the end of a six minute run.

Now a buffer is made at the next power of two (64 KiB at least) and, once its submission is done, kept spare for the next request of that size. Spare buffers not taken for 10 s are let go, and so is what passes 768 MB of spare; both go through host::retire, as other memory the card may still read.

Measured on an RX 9070 XT (RADV), 2560x1440, six minutes with the camera turning, hardware ray tracing on: 3 buffers alive (0.9 MB), 6 made in the whole run, 3 let go by the trim, none for the cap. Three runs, no error line, no device loss.

Two report lines say it: what submissions send up (alive, in flight, spare, made, let go), and the host's buffers by who makes them.

Tests: host::send, 6 passed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Every host bottom-level structure was a committed buffer of its own: 73,703 buffers made in 6.9 s of one play (the longest 73 ms), and 363 MB lost to their 64 KiB placement.

Now they are cut from 64 MiB blocks at 4 KiB (VICTORY_HW_RT_ARENA, on by default; =0 gives every structure its own buffer as before). Two sets of blocks, by how long a structure lives: one for those built in full and not updatable, which are compacted or replaced soon and go; one for updatable, copied and compacted ones, which stay. Mixed in one set, the short-lived left holes among the long-lived and no block ever emptied: 1,664 MB of blocks for 888 MB of structures. A piece is given back when the structure is dropped, which host::retire already does only after the lists that used it, so it rests no further and is free at once. Top-level structures keep their own buffers.

Measured on an RX 9070 XT (RADV), 2560x1440, six minutes with the camera turning: 32 structure buffers made in 11 ms (the longest 5 ms); 20 blocks (1,280 MB) for 1,023 MB of structures, nothing resting, 6 of the short-lived set's blocks made and 4 given back. Three runs, all loss counters 0, no error line. The gain is in the buffers no longer made; the bytes are about what the buffers took (a different scene from the 363 MB above, so not a pair).

Report lines with it, which the next changes are read from:
- the blocks of structures of each set (alive, held, resting, free, made, given back);
- the build memory (scratch, instances and sanitised copies): what lists hold now, asked for against handed out, buffers made and how long that took, the spare by size and how much of it was not taken lately;
- texture blocks by the tenth of them textures hold, their free space, and the textures' copy footprints against the pieces they lie in (what the pieces' rounding costs);
- the texture queue's slots held back for want of room on the card.

Tests: pool 13 passed, hwrt 47 passed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Every texture cut from a texture block was asked at 64 KiB, so each took a multiple of 64 KiB. Most of the title's textures are small: their copy footprints came to 1,599 MB in 2,760 MB of pieces, 1,161 MB of rounding.

Now a texture is asked with D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT where the host says it has it (D3D12_FEATURE_D3D12_TIGHT_ALIGNMENT, tier 1 or more), and its piece is the size at the alignment the host answers: 4 KiB multiples for a small one (256 bytes for the smallest), 64 KiB as before for a large one. The host is asked once and the texture is made with the description the size was asked for. A host without the tier is asked as before.

The earlier 4 KiB placement (VICTORY_POOL_SMALL, removed after two device losses on 2026-11-25) asked at 4 KiB and, refused, asked again at 0; the flag is never refused. What those losses were was not proven. The new test places 11 kinds of small texture three times over back to back from 0x6000 into a heap (the kind and place of those losses first), in each of the three ways of asking, writes every level with bytes of its own, reads them back by a copy and then by a shader through a view of the whole chain and one of each level, and compares with the same texture on a 64 KiB multiple: 500 reads compared, none differ, on an RX 9070 XT (RADV), where the driver lays such textures out at 4 KiB (so nothing is padded).

Measured there, 2560x1440, six minutes with the camera turning, against the run before it (not a pair: the scene streams): rounding 1,161 MB -> 108 MB (2,014 MB of footprints in 2,123 MB of pieces); texture blocks 64 -> 56; slots held back for want of room on the card 152 -> 0; host copies let go for room 6,495 MB -> 3,359 MB; card in use 13,326 -> 13,020 MB with 415 MB more of texture loaded. No error line, no device loss, the picture looked right.

Tests: pool 14 passed (the new one among them), resource 16, texture 11.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A structure the title updates twice within a second is built with ALLOW_UPDATE from then on and stays so for good. Much of what earns that is updated for a while and then left alone (it is still read by the top level). On RADV an updatable structure keeps a fixed layout of about 177 bytes a triangle that compaction cannot shrink, against about 46 for a compacted one, so the idle ones hold most of the structure memory they do not need.

With the switch on:

- A build of an updatable structure keeps its inputs (the staged vertex, index and transform pieces and the geometry descriptions) with the structure, in pieces of its own. Inputs under 256 KiB, inputs decoded or staged in place, boxes and copies are not kept, and such a structure is left as it is.
- At the card point at the start of a submission, every 250 ms, structures not updated and not read as a refit source for 10 s are built again from the kept inputs without ALLOW_UPDATE, at most 16 MiB of them a pass, and then compacted by the path that exists. The swap is an event in card order like a compaction, so reads and copies tapped before it see the old structure and those after it the new one.
- An update of such a structure is never a refit: it is a full build, and the existing rule makes it updatable again if the title keeps updating it. The wait before it is put to sleep again doubles each time, up to 80 s.
- The old structure, its inputs and the scratch are let go only after the submissions that may use them are done, as elsewhere.

The kept inputs come from a pool of their own. Sharing the build pool made it overflow its 256 MB of spare pieces every frame (39,166 buffers made in five minutes); with their own pool none are let go past the bound.

This also changes the pool of build pieces itself, switch or no switch: a spare piece is picked by how lately it was used and one idle for 10 s is let go. That part alone was not shown to gain anything in play.

Measured on an RX 9070 XT (RADV, Mesa 26.3.1), 2560x1440, nine minutes of driving, one run: 448 structures put to sleep, 444 of them compacted, 1,695 MB -> 455 MB; none failed; 25 were updated afterwards and 24 became updatable again; inputs held at the end 129 MB; the card points took 387 ms in all, the longest 10.8 ms; 120 idle updatable structures left (25 MB: small ones and one staged in place). No error line, no device loss, every loss counter 0, the picture looked as before.

What it does not do: the freed bytes stay inside the 64 MiB structure blocks until a block empties (1,487 MB free in 49 blocks at the end), and the card still fills, because compacted structures nothing names any more are never let go. Buffers made for builds are more than without the switch (about 2,300 a minute against about 600), though the longest wait for one was shorter (57 ms against 203 ms). Other drivers and cards were not tried.

Tests: hwrt 57 passed (the verdict table, the swap at the card point, refits and copies tapped before the swap, an update after it not a refit, what is kept, the pick and the wait, the pool of kept pieces).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Long-lived bottom-level structures share 64 MiB blocks, and a block goes back to the card only when nothing is left in it. When compaction, or the rebuild of idle updatable structures, shrinks what the blocks hold, the survivors stay spread over all of them: at the end of one nine-minute play 49 blocks (3,136 MB) held 1,648 MB, and none had emptied in the last four minutes. The holes are used again by later structures, so this is a high-water mark rather than fragmentation, but the card does not get the memory back.

With the switch on:

- Updatable structures are cut from blocks of their own. They are never moved, and so no longer pin a block of the others.
- At the card point at the start of a submission, every 250 ms, while more than a quarter of the long-lived blocks' bytes is free (four blocks' worth at least), the emptiest blocks are marked to be emptied, as many as the free bytes of the rest can take with 128 MB to spare. Nothing new is cut from a marked block while another has room.
- Structures in marked blocks are copied (a clone) into the fullest block that stays, at most 8 MB and 32 structures a card point, and put in their place in card order as a compaction is: reads and copies tapped before see the one moved from, those after the one moved into. A move never makes a block; no room is a skip, counted.
- A structure is moved only if the tap and the ledger agree on it, it is not updatable, no write of its address is tapped and not yet in card order, no compaction waits at its address, it is 10 s old, and it was not moved in the last 60 s (the ledger's alias names one structure back).
- The one moved from is let go only after the submissions that may use it are done, as elsewhere. A top-level structure built before the move keeps it until its next build.

With the switch off nothing is marked or moved and updatable structures stay where they were. Three things on shared paths change form but not result: the texture report's count of blocks cut from again is kept per pool, a structure piece is given back through a function that also looks for a mark (there is none), and a compacted structure is stamped with when it was made. The new report line prints with the switch off too.

Measured on an RX 9070 XT (RADV, Mesa 26.3.1), 2560x1440, one play of 36 minutes on my local tree (this change with a counting-only switch of mine also on): 31 blocks marked, 25 empty after moves and 3 by themselves, 17 given back to the card (1,088 MB); 4,080 structures moved (822 MB) in two bursts of about half a minute; the card points' part 238 ms in all, the longest 1.7 ms; no try found no room; the old places not yet free came to 210 MB at most. Every loss counter 0, the two of card order among them (a write after a newer one at the same address, a refit or copy whose source is not the one assumed).

That play ended in a device loss at minute 36, with the card and the memory shared with it both full and structures grown from 2.4 GB to 3.8 GB in the last quarter of an hour. The last move was 17 minutes before it and the blocks were 98% full by then. What caused it is not known, and this change does not stop that growth: it returns space that is free, no more.

Not tried: this branch itself in play (the diagnostics build compiles and its tests pass), other cards or drivers, the cost of the copies on the card (not measured; the bytes a card point moves are bounded).

Tests: hwrt 64 passed (7 new: the verdict table, the swap, a compaction waiting, copies tapped before a move and two moves back, the pick, the blocks of updatable ones, the count of blocks), pool 18 passed (4 new: the marking, the destination, the fallback, an emptied marked block).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Brings the lifted ray queries and host structures (VICTORY_HW_RT=1), the
structure blocks, the send-memory and texture-block changes, and the two
structure-memory switches (VICTORY_HW_RT_DEMOTE=1, VICTORY_HW_RT_PACK=1)
up to main. All of these switches stay off by default.

Two files conflicted:

- crates/victory-gpu/src/descriptor/host.rs, TextureQueue::scan. Main
  now walks only the due front of `by_due` and reads the kinds of slots
  from counts kept as slots change; this side had added, to the old walk
  of every slot, the count of slots held back for want of room on the
  card (QUEUE_HELD). Kept main's walk and counts, and put the held-back
  count before it: it walks `held` alone, not every slot.

- crates/victory-shader/src/lib.rs, TRANSLATOR_VERSION. Main went from
  13 to 19, this side from 13 to 14 for two fixes that change
  translations with the switches off (the sign of zero in
  v_mad_legacy, partial stores through a counter view). Both sets of
  changes are in, so the version is 20: translations cached by either
  side are made again.

Nothing else needed a change: the other files merged as they were, and
the 64 ray-tracing programs still lift whole on main's translator (397
of 397 loops, all 64 validated).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Brings VICTORY_HW_RT_LEAN_BUILDER=1 (off by default; only with
VICTORY_HW_RT=1): the title's structure builder runs only where the
title reads its result.

Nothing conflicted. The change to the work a title list runs at a place
of its own (it is now given the draw state too) merged with the
hardware ray-tracing operations recorded the same way, and the report
line is called from the hardware ray-tracing report as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 18:12:56 +00:00
Author
Owner

@⁠DrArroway on GitHub · 2026-12-03 21:41 UTC · original

First RDNA 2 real-play data point on the merged branch (with all four switches enabled), plus the warm-cache recompile measurement noted under "Not done".

Setup & build

  • GPU / System: AMD Radeon RX 6900 XT (1002:73bf) (RDNA 2, 16 GB VRAM), Ryzen 9 7900X (12C/24T), 62 GiB RAM, CachyOS kernel 7.3.7-1-cachyos, GE-Proton11-15-x86_64, repo-patched Mesa (deps/mesa-inst) + vkd3d-proton.
  • Build: main (95858c5) + #342 (a70bd85) merged cleanly with 0 conflicts; release build finished in 58.2 s with 0 warnings.
  • Settings: VICTORY_OUTPUT=2560x1440, VICTORY_FSR_4K=quality, VICTORY_FIDELITYFX_FRAMEGEN=1, VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1, VICTORY_UI_PLANE=3840x2160, VICTORY_HW_RT=1, VICTORY_HW_RT_LEAN_BUILDER=1, VICTORY_HW_RT_DEMOTE=1, VICTORY_HW_RT_PACK=1, VICTORY_PLACED_COPIED=1, VICTORY_PARTS_ONE_CALL=1, VICTORY_KEEP_HOST_BUFFERS=1, VICTORY_SKIP_BINK=1.

Shader translation & pipeline warm after TRANSLATOR_VERSION = 20 + VICTORY_HW_RT=1

  • ./run.sh shaders VICTORY_HW_RT=1: 25,694 shaders cached in 90 s (0 unexpected failures).
  • ./run.sh warm VICTORY_HW_RT=1: 94,440 known, 0 made before (70bffa7193b5e74f), all 94,440 rebuilt in 139 s across 12 processes (0 bad, 0 refused by the host; per-pipeline: 2.5 ms median, 25.6 ms p90, 222.7 ms p99, 2,851 ms max — much faster than a cold 330 s warm because RADV's on-disk cache still served unchanged pipelines).

Play session results (47m 06s, free play)

  • Visuals: Looked great overall — hardware RT reflections/shadows rendered cleanly with no obvious artifacts.
  • Hardware RT parity (#262): 64 / 64 RT programs lifted, 423,857,011 BLAS instances resolved, and every loss counter stayed at 0 for the entire 47-minute session.
  • VICTORY_HW_RT_LEAN_BUILDER=1 (#274): 160,657 requests kept; skipped 9 builds, 1,635,604 updates, 299,635 top-level builds, and 75,121 rehydrates; 66,596 copies kept (0 skipped, 0 lost).
  • VICTORY_HW_RT_DEMOTE=1 (#323): 1,760 built again without ALLOW_UPDATE, 1,742 compacted (5,640 MB -> 3,757 MB), 17 made updatable again.
  • VICTORY_HW_RT_PACK=1 (#328): 242 blocks marked, 194 emptied after 5,554 moves (5,595 MB), 127 blocks (8,128 MB) returned to the card (4 updatable blocks alive = 256 MB).

Performance vs main (45591b0, software RT, same 1440p + FSR4 Quality + Direct FG)

  • First ~14 min (while fitting in 16 GB VRAM, n=164): 24.86 median / 26.37 avg real FPS (peak 53.53), vs 23.8 median real FPS on our 79-minute 45591b0 software-RT baseline.
  • Minutes 15–47 (after VRAM overflowed 16 GB, n=380): 21.27 median / 21.46 avg real FPS, trending down to 15.4 FPS (14.1 ms preparing_ms) right before the crash as sweeps and paging ramped up.
  • Overall (531 tools/session-fps.sh samples): 22.6 median / 22.5 avg real FPS (7.6 ms avg preparing).

Long-session VRAM growth & crash at 47m 06s

Matches the long-session growth already noted in the PR description — compacted BLASes accumulated steadily until card VRAM overflowed:

Time Host RT structure memory Card VRAM (vram) Shared (shared) Texture pool
0m 0 MB 4,742 / 15,466 MB 9,403 MB 512 MB
6m 886 MB 12,825 / 15,437 MB 12,233 MB 3,584 MB
12m 1,986 MB 13,849 / 15,433 MB 13,720 MB 3,648 MB
14m — 15,950 / 16,368 MB 15,306 MB 3,520 MB
24m 7,027 MB 19,996 / 16,368 MB 14,037 MB 3,456 MB
33m — 22,046 / 16,368 MB (peak) 15,461 MB 3,264 MB
47m (crash) 10,490 MB (20,999 compacted = 10,078 MB) 21,587 / 16,368 MB 16,860 MB 3,264 MB
  • At 47m 06s, texture room was pinned at 92% of budget (sweeping every ~1.2 s), and the session ended in 0x887A0005 (host GPU device removed after 3 submissions sent ahead of 63 lists) 10.8 ms after a sweep (522 texture host copies / 10,381 KiB let go).
  • journalctl -k recorded the same RDNA 2 read page fault we previously saw under 92% VRAM sweep pressure (#271 / #239):
    amdgpu 0000:03:00.0: [gfxhub] page fault (src_id:0 ring:24 vmid:7 pasid:24272)
    amdgpu 0000:03:00.0:  Process main pid 95808 thread page residency pid 95985
    amdgpu 0000:03:00.0:   in page starting at address 0x00008000328bd000 from client 0x1b (UTCL2)
    amdgpu 0000:03:00.0: GCVM_L2_PROTECTION_FAULT_STATUS:0x00701431
    amdgpu 0000:03:00.0:          Faulty UTCL2 client ID: SQC (data) (0xa)
    amdgpu 0000:03:00.0:          PERMISSION_FAULTS: 0x3  RW: 0x0
    amdgpu 0000:03:00.0: ring gfx_0.0.0 timeout, signaled seq=7603711, emitted seq=7603713
    
**@⁠DrArroway** on GitHub · 2026-12-03 21:41 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/342#issuecomment-7393170922) First RDNA 2 real-play data point on the merged branch (with all four switches enabled), plus the warm-cache recompile measurement noted under "Not done". ### Setup & build - **GPU / System:** `AMD Radeon RX 6900 XT (1002:73bf)` (RDNA 2, 16 GB VRAM), Ryzen 9 7900X (12C/24T), 62 GiB RAM, CachyOS kernel `7.3.7-1-cachyos`, `GE-Proton11-15-x86_64`, repo-patched Mesa (`deps/mesa-inst`) + vkd3d-proton. - **Build:** `main` (`95858c5`) + `#342` (`a70bd85`) merged cleanly with 0 conflicts; release build finished in `58.2 s` with 0 warnings. - **Settings:** `VICTORY_OUTPUT=2560x1440`, `VICTORY_FSR_4K=quality`, `VICTORY_FIDELITYFX_FRAMEGEN=1`, `VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1`, `VICTORY_UI_PLANE=3840x2160`, `VICTORY_HW_RT=1`, `VICTORY_HW_RT_LEAN_BUILDER=1`, `VICTORY_HW_RT_DEMOTE=1`, `VICTORY_HW_RT_PACK=1`, `VICTORY_PLACED_COPIED=1`, `VICTORY_PARTS_ONE_CALL=1`, `VICTORY_KEEP_HOST_BUFFERS=1`, `VICTORY_SKIP_BINK=1`. ### Shader translation & pipeline warm after `TRANSLATOR_VERSION = 20` + `VICTORY_HW_RT=1` - `./run.sh shaders VICTORY_HW_RT=1`: **`25,694` shaders cached in `90 s`** (`0` unexpected failures). - `./run.sh warm VICTORY_HW_RT=1`: **`94,440` known, `0` made before (`70bffa7193b5e74f`), all `94,440` rebuilt in `139 s`** across 12 processes (`0` bad, `0` refused by the host; per-pipeline: `2.5 ms` median, `25.6 ms` p90, `222.7 ms` p99, `2,851 ms` max — much faster than a cold `330 s` warm because RADV's on-disk cache still served unchanged pipelines). ### Play session results (`47m 06s`, free play) - **Visuals:** Looked great overall — hardware RT reflections/shadows rendered cleanly with no obvious artifacts. - **Hardware RT parity (`#262`):** **`64 / 64` RT programs lifted**, **`423,857,011`** BLAS instances resolved, and **every loss counter stayed at `0`** for the entire 47-minute session. - **`VICTORY_HW_RT_LEAN_BUILDER=1` (`#274`):** `160,657` requests kept; skipped `9` builds, `1,635,604` updates, `299,635` top-level builds, and `75,121` rehydrates; `66,596` copies kept (`0` skipped, **`0` lost**). - **`VICTORY_HW_RT_DEMOTE=1` (`#323`):** `1,760` built again without `ALLOW_UPDATE`, `1,742` compacted (`5,640 MB -> 3,757 MB`), `17` made updatable again. - **`VICTORY_HW_RT_PACK=1` (`#328`):** `242` blocks marked, `194` emptied after `5,554` moves (`5,595 MB`), `127` blocks (`8,128 MB`) returned to the card (`4` updatable blocks alive = `256 MB`). ### Performance vs `main` (`45591b0`, software RT, same 1440p + FSR4 Quality + Direct FG) - **First ~14 min (while fitting in 16 GB VRAM, `n=164`):** **`24.86` median / `26.37` avg real FPS** (peak `53.53`), vs **`23.8` median real FPS** on our 79-minute `45591b0` software-RT baseline. - **Minutes 15–47 (after VRAM overflowed 16 GB, `n=380`):** **`21.27` median / `21.46` avg real FPS**, trending down to `15.4` FPS (`14.1 ms` `preparing_ms`) right before the crash as sweeps and paging ramped up. - **Overall (`531` `tools/session-fps.sh` samples):** `22.6` median / `22.5` avg real FPS (`7.6 ms` avg preparing). ### Long-session VRAM growth & crash at `47m 06s` Matches the long-session growth already noted in the PR description — compacted BLASes accumulated steadily until card VRAM overflowed: | Time | Host RT structure memory | Card VRAM (`vram`) | Shared (`shared`) | Texture pool | |---|---:|---:|---:|---:| | `0m` | `0 MB` | `4,742 / 15,466 MB` | `9,403 MB` | `512 MB` | | `6m` | `886 MB` | `12,825 / 15,437 MB` | `12,233 MB` | `3,584 MB` | | `12m` | `1,986 MB` | `13,849 / 15,433 MB` | `13,720 MB` | `3,648 MB` | | `14m` | — | `15,950 / 16,368 MB` | `15,306 MB` | `3,520 MB` | | `24m` | `7,027 MB` | `19,996 / 16,368 MB` | `14,037 MB` | `3,456 MB` | | `33m` | — | `22,046 / 16,368 MB` (peak) | `15,461 MB` | `3,264 MB` | | `47m` (crash) | **`10,490 MB`** (`20,999` compacted = `10,078 MB`) | **`21,587 / 16,368 MB`** | **`16,860 MB`** | `3,264 MB` | - At `47m 06s`, texture room was pinned at `92%` of budget (sweeping every ~1.2 s), and the session ended in `0x887A0005` (`host GPU device removed after 3 submissions sent ahead of 63 lists`) **`10.8 ms` after a `sweep`** (`522` texture host copies / `10,381 KiB` let go). - `journalctl -k` recorded the same RDNA 2 read page fault we previously saw under `92%` VRAM sweep pressure (`#271` / `#239`): ```text amdgpu 0000:03:00.0: [gfxhub] page fault (src_id:0 ring:24 vmid:7 pasid:24272) amdgpu 0000:03:00.0: Process main pid 95808 thread page residency pid 95985 amdgpu 0000:03:00.0: in page starting at address 0x00008000328bd000 from client 0x1b (UTCL2) amdgpu 0000:03:00.0: GCVM_L2_PROTECTION_FAULT_STATUS:0x00701431 amdgpu 0000:03:00.0: Faulty UTCL2 client ID: SQC (data) (0xa) amdgpu 0000:03:00.0: PERMISSION_FAULTS: 0x3 RW: 0x0 amdgpu 0000:03:00.0: ring gfx_0.0.0 timeout, signaled seq=7603711, emitted seq=7603713 ```
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-03 21:49 UTC · original

Ran the test suites of this branch (a70bd85) natively on Windows 11 (MSVC, D3D12) with one NVIDIA desktop card plus WARP, as a data point next to RADV under Wine. Builds were --offline --locked, and I compared against main runs on the same machine.

victory-gpu --lib (--skip descriptor::tests::views_die_with_their_resource)

  • PR: 413 passed, 5 failed, 23 ignored
  • main: 338 passed, 5 failed, 23 ignored (main has 10 gpu tests this branch lacks, since the branch is 14 commits behind)
  • The 5 failures are the same ones main has on this machine: indirect::tests::host_list_* (two), the two pipeline::host::tests library loads, and the flaky watch::tests::the_rest_of_the_one_asking_has_a_number_of_its_own. No regressions.
  • 85 of the 86 new tests here ran and passed. The missing one, host::rtstamps::tests::the_ray_tracing_mode_stamps_every_kind_but_the_others, sits behind the diagnostics feature, and I couldn't build that feature offline because of missing crates, so it didn't run.

victory-shader --lib

  • PR: 425 passed, 1 failed, 5 ignored
  • main: 414 passed, 1 failed, 4 ignored
  • The one failure is the known emit::size_tests::a_reused_descriptor_register_read_only_behind_its_flag. It fails the same way as on main: warp: compute_pipeline failed: The parameter is incorrect. at emit/waterfall_tests.rs:128.
  • All 11 new tests that aren't ignored pass. The modified a_counter_texture_is_set_by_a_store_of_one_channel and mask_operations_on_a_joined_number_give_the_number pass too.
  • the_local_shader_cache_lifts_its_ray_queries is ignored, and I didn't run it since it needs a local shader cache.

victory-hle

  • The 5 new xboxbvh tests pass.
  • There are no new integration tests in the diff.

Did any RT test actually run on the card? Mostly no, and I think that's worth saying plainly.

  • The 64 hwrt tests and the builder_lean, send and pool ledger tests are CPU-side bookkeeping. the_card_programs_follow_the_cpu_rules_and_compile only compiles HLSL with FXC.
  • No test builds an acceleration structure, traces a ray query or calls BuildRaytracingAccelerationStructure on a device.
  • a_ray_query_program_validates_and_makes_a_pipeline_on_warp took the full path, not one of its early returns: dxil.dll validated the program and WARP made the compute pipeline.
  • The only new tests on the hardware device are the two pool placed-texture tests, and they ran there; host() was not None.
  • With a temporary print, I checked that this card reports D3D12_RAYTRACING_TIER_1_2 and hwrt::supported() is true. So the hardware path is available here, it just isn't exercised by the tests.

Env switches

  • With VICTORY_HW_RT=1 VICTORY_HW_RT_PACK=1 VICTORY_HW_RT_DEMOTE=1 VICTORY_HW_RT_LEAN_BUILDER=1 set, victory-gpu gets one extra failure, and VICTORY_HW_RT_PACK=1 alone is enough to cause it. The test is hwrt::tests::structures_are_cut_from_blocks_by_how_long_they_live, at hwrt.rs:7876, with assertion left == right failed: Updatable, left: Some(Updatable), right: Some(Long). It calls lived(), which reads pack_on() from the environment. Using lived_when(origin, false) in the test would make it independent of the switch.
  • Same kind of thing on the shader side: with VICTORY_HW_RT_LIFT=0, rayquery_tests::a_node_test_outside_a_traversal_loop_keeps_the_software_walk_and_says_why fails at rayquery_tests.rs:82 with VICTORY_HW_RT_LIFT=0: no loop lifted, because the reason string changes.
  • Neither happens with the default environment. VICTORY_HW_RT=1 on the shader rayquery and intersect tests changes nothing.

Clippy (-p victory-gpu -p victory-shader --all-targets, compared with main)

  • Two new warnings, both in victory-gpu/src/hwrt.rs:
    • unneeded_wildcard_pattern at 1682, on vertex_count: _, ..
    • wrong_self_convention at 1024, on fn to_list(&mut self)
  • Otherwise it's the same as main, including the existing E0603 in the guard_runs bench.

Nothing in the suites came close to a large memory commit.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-03 21:49 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/342#issuecomment-7393347953) Ran the test suites of this branch (a70bd85) natively on Windows 11 (MSVC, D3D12) with one NVIDIA desktop card plus WARP, as a data point next to RADV under Wine. Builds were --offline --locked, and I compared against main runs on the same machine. **victory-gpu --lib** (`--skip descriptor::tests::views_die_with_their_resource`) - PR: 413 passed, 5 failed, 23 ignored - main: 338 passed, 5 failed, 23 ignored (main has 10 gpu tests this branch lacks, since the branch is 14 commits behind) - The 5 failures are the same ones main has on this machine: `indirect::tests::host_list_*` (two), the two `pipeline::host::tests` library loads, and the flaky `watch::tests::the_rest_of_the_one_asking_has_a_number_of_its_own`. No regressions. - 85 of the 86 new tests here ran and passed. The missing one, `host::rtstamps::tests::the_ray_tracing_mode_stamps_every_kind_but_the_others`, sits behind the `diagnostics` feature, and I couldn't build that feature offline because of missing crates, so it didn't run. **victory-shader --lib** - PR: 425 passed, 1 failed, 5 ignored - main: 414 passed, 1 failed, 4 ignored - The one failure is the known `emit::size_tests::a_reused_descriptor_register_read_only_behind_its_flag`. It fails the same way as on main: `warp: compute_pipeline failed: The parameter is incorrect.` at `emit/waterfall_tests.rs:128`. - All 11 new tests that aren't ignored pass. The modified `a_counter_texture_is_set_by_a_store_of_one_channel` and `mask_operations_on_a_joined_number_give_the_number` pass too. - `the_local_shader_cache_lifts_its_ray_queries` is ignored, and I didn't run it since it needs a local shader cache. **victory-hle** - The 5 new `xboxbvh` tests pass. - There are no new integration tests in the diff. **Did any RT test actually run on the card?** Mostly no, and I think that's worth saying plainly. - The 64 `hwrt` tests and the `builder_lean`, `send` and `pool` ledger tests are CPU-side bookkeeping. `the_card_programs_follow_the_cpu_rules_and_compile` only compiles HLSL with FXC. - No test builds an acceleration structure, traces a ray query or calls BuildRaytracingAccelerationStructure on a device. - `a_ray_query_program_validates_and_makes_a_pipeline_on_warp` took the full path, not one of its early returns: dxil.dll validated the program and WARP made the compute pipeline. - The only new tests on the hardware device are the two `pool` placed-texture tests, and they ran there; `host()` was not None. - With a temporary print, I checked that this card reports D3D12_RAYTRACING_TIER_1_2 and `hwrt::supported()` is true. So the hardware path is available here, it just isn't exercised by the tests. **Env switches** - With `VICTORY_HW_RT=1 VICTORY_HW_RT_PACK=1 VICTORY_HW_RT_DEMOTE=1 VICTORY_HW_RT_LEAN_BUILDER=1` set, victory-gpu gets one extra failure, and `VICTORY_HW_RT_PACK=1` alone is enough to cause it. The test is `hwrt::tests::structures_are_cut_from_blocks_by_how_long_they_live`, at `hwrt.rs:7876`, with `assertion left == right failed: Updatable, left: Some(Updatable), right: Some(Long)`. It calls `lived()`, which reads `pack_on()` from the environment. Using `lived_when(origin, false)` in the test would make it independent of the switch. - Same kind of thing on the shader side: with `VICTORY_HW_RT_LIFT=0`, `rayquery_tests::a_node_test_outside_a_traversal_loop_keeps_the_software_walk_and_says_why` fails at `rayquery_tests.rs:82` with `VICTORY_HW_RT_LIFT=0: no loop lifted`, because the reason string changes. - Neither happens with the default environment. `VICTORY_HW_RT=1` on the shader rayquery and intersect tests changes nothing. **Clippy** (`-p victory-gpu -p victory-shader --all-targets`, compared with main) - Two new warnings, both in `victory-gpu/src/hwrt.rs`: - `unneeded_wildcard_pattern` at 1682, on `vertex_count: _, ..` - `wrong_self_convention` at 1024, on `fn to_list(&mut self)` - Otherwise it's the same as main, including the existing E0603 in the `guard_runs` bench. Nothing in the suites came close to a large memory commit. AI-assisted: yes
Author
Owner

@⁠CorvetteCole on GitHub · 2026-12-04 01:36 UTC · original

Hardware data point for the merged branch on RDNA3, native 1440p, switches measured one at a time.

Setup

  • GPU: RX 7900 XTX (RDNA3 / GFX11, 24 GB), RADV from the pinned Mesa 26.3.1 build (deps/mesa-inst), Linux.
  • Build: 45591b0 (main) merged with this PR's head a70bd85f — merged without conflicts.
  • Settings: native 1440p (VICTORY_RENDER_SCALE=1.0), VICTORY_SHADER_OPT=63, VICTORY_WARM=0, VKD3D_UNTYPED_VEC_SSBO=1 (local vkd3d-proton/dxil-spirv change that lowers byte-address SSBO loads to buffer_load_b128; not in this repo), separate shader/victory caches per arm.
  • Method: ABBA ordering, 85 s per run, mean frame time of the last 8 samples, drops=0 on every run, same scene each time.

Frame time

Arm Frame time FPS vs HW_RT=0
VICTORY_HW_RT=0 36.49 ms (36.42 / 36.56) 27.40 —
VICTORY_HW_RT=1 34.70 ms (34.71 / 34.69) 28.82 −1.79 ms (−4.9%)
HW_RT=1 + VICTORY_HW_RT_LEAN_BUILDER=1 33.36 ms (33.29 / 33.42) 30.0 −3.13 ms (−1.19 ms vs HW_RT=1 alone)
HW_RT=1 + VICTORY_HW_RT_DEMOTE=1 34.76 ms 28.8 noise / slight regression vs HW_RT=1
HW_RT=1 + VICTORY_HW_RT_PACK=1 34.39 ms 29.1 −0.16 ms vs HW_RT=1
all three of LEAN_BUILDER + DEMOTE + PACK 33.34 ms 30.0 same as LEAN_BUILDER=1 alone
  • HW_RT=1 run: DXR 1.1 detected, lifted 1 of 1, on the software walk: none, every hardware-RT loss counter stayed at 0. VRAM went up by about 1.4 GB (10.6 → 12.0 GB).
  • Visual parity: I captured the same scene on all six arms and compared them; no differences other than the animated TV content.

Where the time went (per-pass GPU timestamps, HW_RT=0 vs HW_RT=1 + LEAN_BUILDER=1)

Measured with VICTORY_CARD_TILES (every command stamped, scaled back to the clean frame time) and VICTORY_RT_STAMPS=rt.

  • The whole ray-tracing stack went from 7.45 ms to 2.53 ms (−4.92 ms): software structure builder 3.40 → 0.21 ms, software walks 4.05 → 0 ms, replaced by 1.52 ms of hardware ray-query programs and 0.80 ms of host structure builds (TLAS build 0.56 ms ×5/frame, BLAS builds + refits 0.24 ms).
  • Follow-up checks on non-RT passes, clocks, and flags:
    • Fast-mode per-dispatch times for the hottest non-RT passes are identical between HW_RT=0 and HW_RT=1 + LEAN_BUILDER=1 (5cf00dc3: 1.154 vs 1.167 ms, 34fb51b8: 0.581 vs 0.593 ms, 2dc364df: 0.557 vs 0.572 ms, 25ebc920/48e74d16: 0.547 vs 0.549 ms). Clocks and power show no throttling (3069 vs 3046 MHz SCLK, 255 vs 262 W against a 327 W cap).
    • VICTORY_HW_RT_ARENA=0 vs =1 on HW_RT=1 + LEAN_BUILDER=1: 33.41 vs 33.42 ms (no frame-time difference; gpu_wait dropped 21.7 → 18.0 ms).
    • Without the local VKD3D_UNTYPED_VEC_SSBO=1 patch (stock vkd3d-proton), HW_RT=1 + LEAN_BUILDER=1 is even slightly faster at 33.27 ms (30.06 fps) vs 33.43 ms with =1.
  • Everything else is flat (graphics ≈ 9.3 → 9.5 ms, barriers ≈ 1.0 ms, GPU idle 0.9 → 1.3 ms).

I only measured this scene at 1440p without frame generation, so I can't speak to long-session VRAM growth beyond what is already reported above.

**@⁠CorvetteCole** on GitHub · 2026-12-04 01:36 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/342#issuecomment-7398023877) Hardware data point for the merged branch on RDNA3, native 1440p, switches measured one at a time. ### Setup - **GPU:** RX 7900 XTX (RDNA3 / GFX11, 24 GB), RADV from the pinned Mesa 26.3.1 build (`deps/mesa-inst`), Linux. - **Build:** `45591b0` (main) merged with this PR's head `a70bd85f` — merged without conflicts. - **Settings:** native 1440p (`VICTORY_RENDER_SCALE=1.0`), `VICTORY_SHADER_OPT=63`, `VICTORY_WARM=0`, `VKD3D_UNTYPED_VEC_SSBO=1` (local vkd3d-proton/dxil-spirv change that lowers byte-address SSBO loads to `buffer_load_b128`; not in this repo), separate shader/victory caches per arm. - **Method:** ABBA ordering, 85 s per run, mean frame time of the last 8 samples, `drops=0` on every run, same scene each time. ### Frame time | Arm | Frame time | FPS | vs `HW_RT=0` | |---|---:|---:|---:| | `VICTORY_HW_RT=0` | 36.49 ms (36.42 / 36.56) | 27.40 | — | | `VICTORY_HW_RT=1` | 34.70 ms (34.71 / 34.69) | 28.82 | **−1.79 ms (−4.9%)** | | `HW_RT=1` + `VICTORY_HW_RT_LEAN_BUILDER=1` | **33.36 ms** (33.29 / 33.42) | **30.0** | **−3.13 ms** (−1.19 ms vs `HW_RT=1` alone) | | `HW_RT=1` + `VICTORY_HW_RT_DEMOTE=1` | 34.76 ms | 28.8 | noise / slight regression vs `HW_RT=1` | | `HW_RT=1` + `VICTORY_HW_RT_PACK=1` | 34.39 ms | 29.1 | −0.16 ms vs `HW_RT=1` | | all three of `LEAN_BUILDER` + `DEMOTE` + `PACK` | 33.34 ms | 30.0 | same as `LEAN_BUILDER=1` alone | - `HW_RT=1` run: DXR 1.1 detected, `lifted 1 of 1, on the software walk: none`, every hardware-RT loss counter stayed at `0`. VRAM went up by about 1.4 GB (10.6 → 12.0 GB). - Visual parity: I captured the same scene on all six arms and compared them; no differences other than the animated TV content. ### Where the time went (per-pass GPU timestamps, `HW_RT=0` vs `HW_RT=1` + `LEAN_BUILDER=1`) Measured with `VICTORY_CARD_TILES` (every command stamped, scaled back to the clean frame time) and `VICTORY_RT_STAMPS=rt`. - The whole ray-tracing stack went from **7.45 ms to 2.53 ms (−4.92 ms)**: software structure builder 3.40 → 0.21 ms, software walks 4.05 → 0 ms, replaced by 1.52 ms of hardware ray-query programs and 0.80 ms of host structure builds (TLAS build 0.56 ms ×5/frame, BLAS builds + refits 0.24 ms). - Follow-up checks on non-RT passes, clocks, and flags: - Fast-mode per-dispatch times for the hottest non-RT passes are identical between `HW_RT=0` and `HW_RT=1 + LEAN_BUILDER=1` (`5cf00dc3`: 1.154 vs 1.167 ms, `34fb51b8`: 0.581 vs 0.593 ms, `2dc364df`: 0.557 vs 0.572 ms, `25ebc920/48e74d16`: 0.547 vs 0.549 ms). Clocks and power show no throttling (`3069` vs `3046 MHz` SCLK, `255` vs `262 W` against a `327 W` cap). - `VICTORY_HW_RT_ARENA=0` vs `=1` on `HW_RT=1 + LEAN_BUILDER=1`: `33.41` vs `33.42 ms` (no frame-time difference; `gpu_wait` dropped `21.7 → 18.0 ms`). - Without the local `VKD3D_UNTYPED_VEC_SSBO=1` patch (stock vkd3d-proton), `HW_RT=1 + LEAN_BUILDER=1` is even slightly faster at **`33.27 ms` (`30.06 fps`)** vs `33.43 ms` with `=1`. - Everything else is flat (graphics ≈ 9.3 → 9.5 ms, barriers ≈ 1.0 ms, GPU idle 0.9 → 1.3 ms). I only measured this scene at 1440p without frame generation, so I can't speak to long-session VRAM growth beyond what is already reported above.
Author
Owner

@⁠abomalocaris on GitHub · 2026-12-04 04:14 UTC · original

Play-test data for this bundle on an RX 9070 XT 16 GB

The description says the merged set had not been run in play, so here is what I measured.

Setup: RX 9070 XT 16 GB, Ryzen 7 9800X3D, 32 GB RAM, CachyOS (kernel 7.3.7), proton-cachyos-slr, this repo's patched Mesa 26.3.1 and vkd3d-proton. Series X profile, 2560x1440 output with FSR 4 quality (1706x960 render), ray tracing on, VICTORY_PAGES=0, VICTORY_PLACED_COPIED=1, 30 fps (title interval), VICTORY_VRAM_BUDGET_MB=17000 with VICTORY_TEXTURE_ROOM_PERCENT=87 and VICTORY_TEXTURE_ROOM_CAP_PERCENT=87.

Build: main at 00aa4d3 with this PR merged (plus #216 and #344 merged locally; #216's switches off unless said).

Tests are scripted with a virtual gamepad on one free-roam save, so runs are comparable: "spin" turns the camera in place for 3 minutes, "run" walks and pans for 3.4 or 10 minutes. Frame rates are means over the run from VICTORY_PRESENT_TIMING; "waited" is the sum of slots_after_let_go from #216's stats: vram line.

Test Switches fps GPU wait Card in use (max) Copies let go Waited
run, 3.4 min none 28.7 12.1 ms 11.7 GB 0 0
run, 3.4 min HW_RT LEAN_BUILDER DEMOTE PACK 29.8 1.5 ms 13.8 GB 4,696 0
spin, 3 min (x4) none 26.6 to 26.9 12.2 to 13.2 ms 14.0 GB 16k to 31k 9 to 51
spin, 3 min (x5, three of them with #216's switches on) all four 28.3 to 29.2 5.2 to 8.5 ms 14.2 to 14.3 GB 53k to 60k 207 to 360
run, 10 min none 28.5 12.9 ms 14.0 GB 63,772 134
run, 10 min all four 29.7 3.3 ms 14.9 GB 142,899 10,060

What I take from it:

  • No crash in 7 runs with the four switches on, or in 6 runs with them off and #216's switches off (see my note on #216 for what happened with those on).
  • Without hardware ray tracing the bundle is already a clear gain here. The same tests on 8fd0a70 gave 24.5 fps (run) and 23.8 fps (spin) with GPU wait of 16 to 21 ms and about 14 GB on the card. I can't split that gain between #306 and what main merged in between.
  • With hardware ray tracing the trace cost is gone (GPU wait 1.5 to 8.5 ms) and the frame sits at the 30 cap, but the card fills: about 2 GB more in "others", and over 10 minutes 10,060 slots waited for a copy that had been let go, against 134 without it. On a 16 GB card at 1440p that is the trade: about 1 fps under the cap for many more objects that go black for a moment.
  • All hardware ray-tracing loss counters stayed 0 and the lean builder reported 0 lost.

One run of each configuration per row unless a count is given. Happy to rerun with other switches.

Written with AI assistance (Claude Code); the runs and observations are from my own machine.

**@⁠abomalocaris** on GitHub · 2026-12-04 04:14 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/342#issuecomment-7400986322) **Play-test data for this bundle on an RX 9070 XT 16 GB** The description says the merged set had not been run in play, so here is what I measured. Setup: RX 9070 XT 16 GB, Ryzen 7 9800X3D, 32 GB RAM, CachyOS (kernel 7.3.7), `proton-cachyos-slr`, this repo's patched Mesa 26.3.1 and vkd3d-proton. Series X profile, 2560x1440 output with FSR 4 quality (1706x960 render), ray tracing on, `VICTORY_PAGES=0`, `VICTORY_PLACED_COPIED=1`, 30 fps (title interval), `VICTORY_VRAM_BUDGET_MB=17000` with `VICTORY_TEXTURE_ROOM_PERCENT=87` and `VICTORY_TEXTURE_ROOM_CAP_PERCENT=87`. Build: `main` at `00aa4d3` with this PR merged (plus #216 and #344 merged locally; #216's switches off unless said). Tests are scripted with a virtual gamepad on one free-roam save, so runs are comparable: "spin" turns the camera in place for 3 minutes, "run" walks and pans for 3.4 or 10 minutes. Frame rates are means over the run from `VICTORY_PRESENT_TIMING`; "waited" is the sum of `slots_after_let_go` from #216's `stats: vram` line. | Test | Switches | fps | GPU wait | Card in use (max) | Copies let go | Waited | |---|---|---|---|---|---|---| | run, 3.4 min | none | 28.7 | 12.1 ms | 11.7 GB | 0 | 0 | | run, 3.4 min | `HW_RT` `LEAN_BUILDER` `DEMOTE` `PACK` | 29.8 | 1.5 ms | 13.8 GB | 4,696 | 0 | | spin, 3 min (x4) | none | 26.6 to 26.9 | 12.2 to 13.2 ms | 14.0 GB | 16k to 31k | 9 to 51 | | spin, 3 min (x5, three of them with #216's switches on) | all four | 28.3 to 29.2 | 5.2 to 8.5 ms | 14.2 to 14.3 GB | 53k to 60k | 207 to 360 | | run, 10 min | none | 28.5 | 12.9 ms | 14.0 GB | 63,772 | 134 | | run, 10 min | all four | 29.7 | 3.3 ms | 14.9 GB | 142,899 | 10,060 | What I take from it: - **No crash** in 7 runs with the four switches on, or in 6 runs with them off and #216's switches off (see my note on #216 for what happened with those on). - **Without hardware ray tracing the bundle is already a clear gain here.** The same tests on `8fd0a70` gave 24.5 fps (run) and 23.8 fps (spin) with GPU wait of 16 to 21 ms and about 14 GB on the card. I can't split that gain between #306 and what `main` merged in between. - **With hardware ray tracing the trace cost is gone** (GPU wait 1.5 to 8.5 ms) and the frame sits at the 30 cap, but the card fills: about 2 GB more in "others", and over 10 minutes 10,060 slots waited for a copy that had been let go, against 134 without it. On a 16 GB card at 1440p that is the trade: about 1 fps under the cap for many more objects that go black for a moment. - All hardware ray-tracing loss counters stayed 0 and the lean builder reported 0 lost. One run of each configuration per row unless a count is given. Happy to rerun with other switches. _Written with AI assistance (Claude Code); the runs and observations are from my own machine._
Author
Owner

@⁠tommiehansen on GitHub · 2026-12-04 11:20 UTC · original

@⁠goldfishdev A quick heads-up regarding #342: this has become an important foundation for further hardware RT optimization, particularly #429 (batched RT structure invalidation) and #452 (immutable BLAS remap snapshots).

There are already encouraging gameplay results: adding #429 on top of #374 was reported to improve driving performance from roughly 15–25 to 25–40 FPS on an RX 7900 XTX. While that is a qualitative report rather than a controlled benchmark, it highlights the potential of the follow-up work. #452 also shows substantial isolated CPU and upload-cost reductions, with gameplay validation still pending.

Landing @⁠LOCKhart07's #342 when it is ready would provide a common baseline for further development, testing and review, and substantially simplify the dependent PRs.

Would it be possible to prioritize reviewing #342, or clarify what remains before it can land?

Thanks for all the work on keeping upstream moving.

**@⁠tommiehansen** on GitHub · 2026-12-04 11:20 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/342#issuecomment-7409971127) @⁠goldfishdev A quick heads-up regarding #342: this has become an important foundation for further hardware RT optimization, particularly #429 (batched RT structure invalidation) and #452 (immutable BLAS remap snapshots). There are already encouraging gameplay results: adding #429 on top of #374 was reported to improve driving performance from roughly 15–25 to 25–40 FPS on an RX 7900 XTX. While that is a qualitative report rather than a controlled benchmark, it highlights the potential of the follow-up work. #452 also shows substantial isolated CPU and upload-cost reductions, with gameplay validation still pending. Landing @⁠LOCKhart07's #342 when it is ready would provide a common baseline for further development, testing and review, and substantially simplify the dependent PRs. Would it be possible to prioritize reviewing #342, or clarify what remains before it can land? Thanks for all the work on keeping upstream moving.
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 12:02 UTC · original · edited 2026-12-05 11:24 UTC

This is superseded as a PR, but the observation stands: it is the only branch where the lean builder sits on top of the packed-structures work, so it is the one to test the whole thing on. As a PR it adds one line (crate::builder_lean::report(frames) at crates/victory-gpu/src/hwrt.rs:3473) and re-merges what the five smaller PRs already contain, doubling the review surface for no new code.

The findings worth acting on elsewhere:

  • Eight switches, none documented: VICTORY_HW_RT (hwrt.rs:100), _REFIT (:121), _DEMOTE (:1142), _PACK (:1293), _ARENA (:1859), _LEAN_BUILDER (builder_lean.rs:45), _LIFT/_WHY (emit/mod.rs:229,246). Zero occurrences in docs/SETTINGS.md and run.conf.default, in a tree where every other switch is in both. And _REFIT, _ARENA and _LIFT default on underneath an off-by-default master switch — nobody will guess that from the tree.
  • The scope is honest in your own description and it is a 1.0-sized feature wearing a flag: host DXR 1.1 is required and errors otherwise (hwrt.rs:6667), and the only measurements are one person's RADV card.

If the stack lands, the lean-builder merge is 10 minutes of work to repeat; it is not a reason to keep 21k lines open. And the question the maintainer actually has to answer first is #262's approach, not this one.

Whether it still has work of its own is the maintainer's call, not mine.

**@⁠Luxuride** on GitHub · 2026-12-04 12:02 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/342#issuecomment-7410898331) · edited 2026-12-05 11:24 UTC This is superseded as a PR, but the observation stands: it is the only branch where the lean builder sits on top of the packed-structures work, so it is the one to *test* the whole thing on. As a PR it adds one line (`crate::builder_lean::report(frames)` at `crates/victory-gpu/src/hwrt.rs:3473`) and re-merges what the five smaller PRs already contain, doubling the review surface for no new code. The findings worth acting on elsewhere: - Eight switches, none documented: `VICTORY_HW_RT` (`hwrt.rs:100`), `_REFIT` (`:121`), `_DEMOTE` (`:1142`), `_PACK` (`:1293`), `_ARENA` (`:1859`), `_LEAN_BUILDER` (`builder_lean.rs:45`), `_LIFT`/`_WHY` (`emit/mod.rs:229,246`). Zero occurrences in `docs/SETTINGS.md` and `run.conf.default`, in a tree where every other switch is in both. And `_REFIT`, `_ARENA` and `_LIFT` default **on** underneath an off-by-default master switch — nobody will guess that from the tree. - The scope is honest in your own description and it is a 1.0-sized feature wearing a flag: host DXR 1.1 is required and errors otherwise (`hwrt.rs:6667`), and the only measurements are one person's RADV card. If the stack lands, the lean-builder merge is 10 minutes of work to repeat; it is not a reason to keep 21k lines open. And the question the maintainer actually has to answer first is #262's approach, not this one. Whether it still has work of its own is the maintainer's call, not mine.
Author
Owner

@⁠LOCKhart07 on GitHub · 2026-12-04 14:34 UTC · original

Split as asked; this merge is no longer needed. Its one line of its own (builder_lean::report) is in rt-3-lean. The stack is seven branches, each with only its own change, bottom at #468.

From the reports here, fixed in the branch that owns each:

  • all switches documented in docs/SETTINGS.md and run.conf.default, with the three that default on under an off master switch said to be so;
  • structures_are_cut_from_blocks_by_how_long_they_live no longer reads VICTORY_HW_RT_PACK (reproduced: 85 passed and 1 failed with the switches set, 86 passed after);
  • the ray-query tests no longer depend on VICTORY_HW_RT_LIFT;
  • both clippy warnings (unneeded_wildcard_pattern, wrong_self_convention).

Thanks to everyone who ran it. The loss counters at 0 in every report are quoted in the new PR, with the caveat that a counter is not a hit-for-hit comparison.

This one can be closed.

**@⁠LOCKhart07** on GitHub · 2026-12-04 14:34 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/342#issuecomment-7414543407) Split as asked; this merge is no longer needed. Its one line of its own (`builder_lean::report`) is in `rt-3-lean`. The stack is seven branches, each with only its own change, bottom at #468. From the reports here, fixed in the branch that owns each: - all switches documented in `docs/SETTINGS.md` and `run.conf.default`, with the three that default on under an off master switch said to be so; - `structures_are_cut_from_blocks_by_how_long_they_live` no longer reads `VICTORY_HW_RT_PACK` (reproduced: 85 passed and 1 failed with the switches set, 86 passed after); - the ray-query tests no longer depend on `VICTORY_HW_RT_LIFT`; - both clippy warnings (`unneeded_wildcard_pattern`, `wrong_self_convention`). Thanks to everyone who ran it. The loss counters at 0 in every report are quoted in the new PR, with the caveat that a counter is not a hit-for-hit comparison. This one can be closed.
Author
Owner

@⁠tommiehansen on GitHub · 2026-12-04 15:14 UTC · original

@⁠LOCKhart07 Thanks for splitting the HWRT stack. I'm currently adapting the important #429 (RT structure invalidation), #452 (BLAS remap snapshots), and related HWRT optimization work to your new seven-branch stack starting at #468.

The integration is in progress, using rt-7-reuse as the foundation. I'll update the relevant PRs with isolated diffs and fresh benchmark results as each change is validated, so they can be reviewed as follow-ups to your new stack rather than depending on #342.

Thanks for your work on this!

**@⁠tommiehansen** on GitHub · 2026-12-04 15:14 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/342#issuecomment-7415562728) @⁠LOCKhart07 Thanks for splitting the HWRT stack. I'm currently adapting the important #429 (RT structure invalidation), #452 (BLAS remap snapshots), and related HWRT optimization work to your new seven-branch stack starting at #468. The integration is in progress, using `rt-7-reuse` as the foundation. I'll update the relevant PRs with isolated diffs and fresh benchmark results as each change is validated, so they can be reviewed as follow-ups to your new stack rather than depending on #342. Thanks for your work on this!
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
  • crates/victory-shader/src/lib.rs
  • crates/victory-shader/src/structure.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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