Shaders: stop ray traversal sooner (512) in programs with the node test #305

Closed
urielbeaupre wants to merge 581 commits from upstream-pr/305 into main
urielbeaupre commented 2026-11-27 15:08:59 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by urielbeaupre on 2026-11-27T15:08:59Z.


Summary

With -RayTracing on an NVIDIA RTX 4070 Ti (12 GB), most of the ray-tracing cost was lanes that never finish traversal. This stops traversal loops sooner, in the programs that walk structures only.

  • Change: loops of programs that contain image_bvh*_intersect_ray now stop at 512 iterations (VICTORY_SHADER_TRACE_LOOP_LIMIT; part of the translation). Every other compute loop keeps 4,096; pixel/mesh limits are unchanged.
  • Result (Series S, -Machine 4070 -RayTracing, same unattended opening, warm caches, run twice):
limit 4,096 limit 512
Median fps over the run 12.1 13.9
Dorm room: render fps / GPU EST 11.7 / 72.8 ms 15.8 / 41.5 ms
Orange light patches in the dorm present present (same)

No difference in lighting seen between the two in the same scenes; the existing patches are there at both limits.

How it was found

  • VICTORY_GPU_TIMING=1 with VICTORY_D3D12_DRED=1 (per-command times need full DRED, not light): CS_ScreenProbes_TraceRays_RayBinning_BVH_Mixed (f22a76fcb967ee59) took 41 ms a frame, single dispatches up to 157 ms; RaytraceVBuffer (6d7fe7745ab9c6d8) 8.8 ms; everything else under 1 ms.
  • Their time follows the translator's loop limit (4,096 → 41 ms, 512 → 4.9 ms), so most lanes run until the limit stops them.
  • Not wave64 emulation: both are wave32 with no barriers (VICTORY_SHADER_CENSUS).
  • The title's own iteration cap in that program (s_cmp_le_u32 s32, s43, s32 from the constant buffer at user data 5, table byte 0x1c0, dword 0x78) reads 65,535 at run time (VICTORY_PROBE_ROOT, added here): the title counts on sound structures.
  • A VICTORY_MEMORY_DUMP walked offline: PC-built structures (0x8000, 0x8004) have thousands of nodes reached twice and children outside them; a few static ones are still packed on the card (byte for byte title memory) though a builder dispatch named them.
  • Ruled out with measurements:
    • stale compacted sizes: only 4 of 1,364 copies in 2.5 min used a size that was too small (counter added to VICTORY_BVH_TRACE);
    • missing real pages: all ~620 pages left without a copy were uncommitted addresses;
    • packed structures streaming in after the dispatch was recorded: none;
    • upload order: the late uploads go up before the lists.

The root cause of the broken PC-built structures is still open (notes added to docs/fork-ray-tracing.md under Known gaps). This limits the cost of the lanes that walk them.

Diagnostics added (diagnostics builds only)

  • VICTORY_SHADER_COMPUTE_LOOP_LIMIT=<n>: the loop limit for every compute program.
  • VICTORY_PROBE_ROOT=<hash>,<user data>[,<table byte>]: logs a program's constant buffer at its dispatches.
  • VICTORY_BVH_TRACE=1: also counts copies recorded while the size slot still held its old value, and whether the size was too small.
  • VICTORY_MEMORY_DUMP: also writes title memory laid out like the arenas (title-<n>.bin).

Tests

  • cargo test -p victory-shader --lib: 321 passed, 0 failed, 4 ignored (before rebasing onto b67e8d8).
  • cargo test -p victory-gpu --features diagnostics --lib memory: 25 passed.
  • cargo clippy -p victory-shader -p victory-gpu --features victory-gpu/diagnostics: no warnings.
  • In game: the runs above, RTX 4070 Ti 12 GB, Ryzen 9 7900X, 64 GB, driver 621.40.

🤖 Generated with Claude Code

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5528871723 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305). Originally posted by [urielbeaupre](https://github.com/urielbeaupre) on 2026-11-27T15:08:59Z. --- ## Summary With `-RayTracing` on an NVIDIA RTX 4070 Ti (12 GB), most of the ray-tracing cost was lanes that never finish traversal. This stops traversal loops sooner, in the programs that walk structures only. - **Change:** loops of programs that contain `image_bvh*_intersect_ray` now stop at **512** iterations (`VICTORY_SHADER_TRACE_LOOP_LIMIT`; part of the translation). Every other compute loop keeps 4,096; pixel/mesh limits are unchanged. - **Result** (Series S, `-Machine 4070 -RayTracing`, same unattended opening, warm caches, run twice): | | limit 4,096 | limit 512 | |---|---|---| | Median fps over the run | 12.1 | **13.9** | | Dorm room: render fps / GPU EST | 11.7 / 72.8 ms | **15.8 / 41.5 ms** | | Orange light patches in the dorm | present | present (same) | No difference in lighting seen between the two in the same scenes; the existing patches are there at both limits. ## How it was found - `VICTORY_GPU_TIMING=1` with `VICTORY_D3D12_DRED=1` (per-command times need full DRED, not `light`): `CS_ScreenProbes_TraceRays_RayBinning_BVH_Mixed` (`f22a76fcb967ee59`) took **41 ms** a frame, single dispatches up to 157 ms; `RaytraceVBuffer` (`6d7fe7745ab9c6d8`) 8.8 ms; everything else under 1 ms. - Their time follows the translator's loop limit (4,096 → 41 ms, 512 → 4.9 ms), so most lanes run until the limit stops them. - Not wave64 emulation: both are wave32 with no barriers (`VICTORY_SHADER_CENSUS`). - The title's own iteration cap in that program (`s_cmp_le_u32 s32, s43`, `s32` from the constant buffer at user data 5, table byte `0x1c0`, dword `0x78`) reads **65,535** at run time (`VICTORY_PROBE_ROOT`, added here): the title counts on sound structures. - A `VICTORY_MEMORY_DUMP` walked offline: PC-built structures (`0x8000`, `0x8004`) have thousands of nodes reached twice and children outside them; a few static ones are still packed on the card (byte for byte title memory) though a builder dispatch named them. - **Ruled out** with measurements: - stale compacted sizes: only 4 of 1,364 copies in 2.5 min used a size that was too small (counter added to `VICTORY_BVH_TRACE`); - missing real pages: all ~620 pages left without a copy were uncommitted addresses; - packed structures streaming in after the dispatch was recorded: none; - upload order: the late uploads go up before the lists. The root cause of the broken PC-built structures is still open (notes added to `docs/fork-ray-tracing.md` under Known gaps). This limits the cost of the lanes that walk them. ## Diagnostics added (diagnostics builds only) - `VICTORY_SHADER_COMPUTE_LOOP_LIMIT=<n>`: the loop limit for every compute program. - `VICTORY_PROBE_ROOT=<hash>,<user data>[,<table byte>]`: logs a program's constant buffer at its dispatches. - `VICTORY_BVH_TRACE=1`: also counts copies recorded while the size slot still held its old value, and whether the size was too small. - `VICTORY_MEMORY_DUMP`: also writes title memory laid out like the arenas (`title-<n>.bin`). ## Tests - `cargo test -p victory-shader --lib`: 321 passed, 0 failed, 4 ignored (before rebasing onto `b67e8d8`). - `cargo test -p victory-gpu --features diagnostics --lib memory`: 25 passed. - `cargo clippy -p victory-shader -p victory-gpu --features victory-gpu/diagnostics`: no warnings. - In game: the runs above, RTX 4070 Ti 12 GB, Ryzen 9 7900X, 64 GB, driver 621.40. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
TaynanGT commented 2026-11-27 15:26:22 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T15:26:22Z.


@urielbeaupre The 4070 Ti runs show the cost of the long traversal on that route. I updated 81bd48d to keep 4,096 as the default and key the disk cache on both loop limits. This lets VICTORY_SHADER_TRACE_LOOP_LIMIT=512 use its own translations in the same-scene comparison. The dorm artefacts are still part of the image check.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7222058598 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7222058598). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T15:26:22Z. --- @urielbeaupre The 4070 Ti runs show the cost of the long traversal on that route. I updated `81bd48d` to keep 4,096 as the default and key the disk cache on both loop limits. This lets `VICTORY_SHADER_TRACE_LOOP_LIMIT=512` use its own translations in the same-scene comparison. The dorm artefacts are still part of the image check.
urielbeaupre commented 2026-11-27 15:44:01 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by urielbeaupre on 2026-11-27T15:44:01Z.


Thanks for 81bd48d. Keeping 4,096 as the default fits what I found next. I've added 8137f71 on top of it with the cause of the long traversal:

  • Title buffers took stores by address only after a builder dispatch had been given them as a UAV. The builder also writes structures into buffers it only gets by address, and those stores were dropped.
  • The new VICTORY_MEMORY_CLOSED_NOTES=1 (diagnostics) logs them: about 1,000 pages across 10 title buffers (1.5 to 12 MiB) in two minutes of ray tracing.
  • With every title buffer's copy taking the stores (new default, VICTORY_BVH_OPEN_ALL=0 restores the old behaviour), at the default 4,096 limit, RTX 4070 Ti, Series S, -RayTracing:
closed (before) open
CS_ScreenProbes_TraceRays_RayBinning_BVH_Mixed, ms/frame (median, VICTORY_GPU_TIMING) 41.8 6.0
RaytraceVBuffer, ms/frame 10.5 2.8
Compacted structures in a dump: children outside them / wrong parent links 2,972 / 2,884 140 / 77
Same unattended opening, median fps (slowest quarter) 12.1 (8.2) 14.1 (10.9)
Dorm, GPU EST 72.8 ms 46.2 ms

There was no crash or device removal in four runs. The stores still go to the copies on the card, not to title memory.

The orange light patches in the dorm look the same with the buffers open or closed, and at 512 or 4,096, so I think they're a separate issue. Still open, also in the notes: non-compacted built structures (0x8000; my offline walk may misread their layout) and an occasional static structure left packed on the card.

Tests: victory-shader lib 327 passed; victory-gpu (diagnostics) memory tests 25 passed; clippy clean on both crates.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7222415181 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7222415181). Originally posted by [urielbeaupre](https://github.com/urielbeaupre) on 2026-11-27T15:44:01Z. --- Thanks for `81bd48d`. Keeping 4,096 as the default fits what I found next. I've added `8137f71` on top of it with the cause of the long traversal: - Title buffers took stores by address only after a builder dispatch had been given them as a UAV. The builder also writes structures into buffers it only gets by address, and those stores were dropped. - The new `VICTORY_MEMORY_CLOSED_NOTES=1` (diagnostics) logs them: about 1,000 pages across 10 title buffers (1.5 to 12 MiB) in two minutes of ray tracing. - With every title buffer's copy taking the stores (new default, `VICTORY_BVH_OPEN_ALL=0` restores the old behaviour), at the **default 4,096** limit, RTX 4070 Ti, Series S, `-RayTracing`: | | closed (before) | open | |---|---|---| | `CS_ScreenProbes_TraceRays_RayBinning_BVH_Mixed`, ms/frame (median, `VICTORY_GPU_TIMING`) | 41.8 | **6.0** | | `RaytraceVBuffer`, ms/frame | 10.5 | **2.8** | | Compacted structures in a dump: children outside them / wrong parent links | 2,972 / 2,884 | **140 / 77** | | Same unattended opening, median fps (slowest quarter) | 12.1 (8.2) | **14.1 (10.9)** | | Dorm, GPU EST | 72.8 ms | 46.2 ms | There was no crash or device removal in four runs. The stores still go to the copies on the card, not to title memory. The orange light patches in the dorm look the same with the buffers open or closed, and at 512 or 4,096, so I think they're a separate issue. Still open, also in the notes: non-compacted built structures (`0x8000`; my offline walk may misread their layout) and an occasional static structure left packed on the card. Tests: `victory-shader` lib 327 passed; `victory-gpu` (diagnostics) memory tests 25 passed; clippy clean on both crates.
TaynanGT commented 2026-11-27 15:54:04 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T15:54:04Z.


@urielbeaupre The drop from 41.8 to 6.0 ms at the full 4,096 limit is the result to follow. It ties the slow traversal to builder stores that were being dropped. I’d compare the same route with the buffer change alone and track VRAM and copy-back alongside the timings. The orange patches still have their own repro.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7222616788 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7222616788). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T15:54:04Z. --- @urielbeaupre The drop from 41.8 to 6.0 ms at the full 4,096 limit is the result to follow. It ties the slow traversal to builder stores that were being dropped. I’d compare the same route with the buffer change alone and track VRAM and copy-back alongside the timings. The orange patches still have their own repro.
urielbeaupre commented 2026-11-27 16:16:34 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by urielbeaupre on 2026-11-27T16:16:34Z.


Same route (the unattended opening), -RayTracing, trace limit 4,096. The only difference between the two runs is the buffer change. Medians over the run come from the frame lines; VRAM is the "card's own: in use" line (43 and 46 samples):

VICTORY_BVH_OPEN_ALL=0 open (default)
fps (slowest quarter) 12.1 (8.2) 14.1 (10.9)
VRAM in use, median / max 8,264 / 9,051 MB 8,393 / 9,068 MB
copy-back per frame 23.9 ms, 57 MB 20.9 ms, 55 MB
copies up per frame 22.0 ms, 146 MB 24.9 ms, 144 MB
preparing total 59.7 ms 58.0 ms

VRAM is up about 130 MB at the median, and copy-back and copies are within noise.

One thing to check before you merge. In a non-RT run with the buffers open, I saw multicoloured garbage on a character's face and neck in the bar cutscene. The same moment rendered cleanly in an earlier run with the buffers closed. It may be intermittent and unrelated, but opening every title buffer also lets non-builder shaders that store by address reach those buffers. I'm running the closed/open pair on that cutscene now. I'm also preparing a narrower version that opens a buffer only when a builder dispatch names an address inside it (root views or 64-bit constants), so other shaders keep the old behaviour. I'll post both.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7223067189 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7223067189). Originally posted by [urielbeaupre](https://github.com/urielbeaupre) on 2026-11-27T16:16:34Z. --- Same route (the unattended opening), `-RayTracing`, trace limit 4,096. The only difference between the two runs is the buffer change. Medians over the run come from the frame lines; VRAM is the "card's own: in use" line (43 and 46 samples): | | `VICTORY_BVH_OPEN_ALL=0` | open (default) | |---|---|---| | fps (slowest quarter) | 12.1 (8.2) | 14.1 (10.9) | | VRAM in use, median / max | 8,264 / 9,051 MB | 8,393 / 9,068 MB | | copy-back per frame | 23.9 ms, 57 MB | 20.9 ms, 55 MB | | copies up per frame | 22.0 ms, 146 MB | 24.9 ms, 144 MB | | preparing total | 59.7 ms | 58.0 ms | VRAM is up about 130 MB at the median, and copy-back and copies are within noise. One thing to check before you merge. In a non-RT run with the buffers open, I saw multicoloured garbage on a character's face and neck in the bar cutscene. The same moment rendered cleanly in an earlier run with the buffers closed. It may be intermittent and unrelated, but opening every title buffer also lets non-builder shaders that store by address reach those buffers. I'm running the closed/open pair on that cutscene now. I'm also preparing a narrower version that opens a buffer only when a builder dispatch names an address inside it (root views or 64-bit constants), so other shaders keep the old behaviour. I'll post both.
urielbeaupre commented 2026-11-27 16:19:02 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by urielbeaupre on 2026-11-27T16:19:02Z.


Follow-up on the face artefact: it isn't from this change. The same multicoloured garbage on the bar cutscene character's face and neck showed up in a run with VICTORY_BVH_OPEN_ALL=0 (buffers closed, otherwise identical, ray tracing off). It's intermittent and happens with or without the buffer change, so it has its own repro like the orange patches.

I'll still post the narrower variant (open only the title buffers a builder dispatch names) with its own timings, in case you'd rather keep other programs' stores by address closed.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7223115274 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7223115274). Originally posted by [urielbeaupre](https://github.com/urielbeaupre) on 2026-11-27T16:19:02Z. --- Follow-up on the face artefact: it isn't from this change. The same multicoloured garbage on the bar cutscene character's face and neck showed up in a run with `VICTORY_BVH_OPEN_ALL=0` (buffers closed, otherwise identical, ray tracing off). It's intermittent and happens with or without the buffer change, so it has its own repro like the orange patches. I'll still post the narrower variant (open only the title buffers a builder dispatch names) with its own timings, in case you'd rather keep other programs' stores by address closed.
TaynanGT commented 2026-11-27 16:20:57 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T16:20:57Z.


@urielbeaupre The closed-buffer run confirms the face mosaic has its own repro. At 4,096, the full-buffer change adds about 130 MB of median local VRAM and takes copy-back from 23.9 to 20.9 ms in this pair. The builder-targeted variant is the next one I’d measure on that same route, including builders that pass addresses through constants.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7223154102 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7223154102). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T16:20:57Z. --- @urielbeaupre The closed-buffer run confirms the face mosaic has its own repro. At 4,096, the full-buffer change adds about 130 MB of median local VRAM and takes copy-back from 23.9 to 20.9 ms in this pair. The builder-targeted variant is the next one I’d measure on that same route, including builders that pass addresses through constants.
urielbeaupre commented 2026-11-27 17:05:49 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by urielbeaupre on 2026-11-27T17:05:49Z.


e7de67f is the builder-targeted variant, now the default. A title buffer is opened when a builder dispatch names an address inside it: root views, 64-bit addresses in two constants, and 256-byte-unit constants. Other programs keep the old rule. VICTORY_BVH_OPEN_NAMED=0 restores closed buffers, and VICTORY_BVH_OPEN_ALL=1 keeps the open-everything variant as a test.

With VICTORY_MEMORY_CLOSED_NOTES=1, two minutes of ray tracing dropped no store by address. Before, about 1,000 pages across 10 buffers were dropped. 34 buffers were opened for the builder.

A correction to my earlier 41.8 → 6.0 ms. Those two numbers came from different stretches: the 41.8 is the dorm, played by hand; the 6.0 is the unattended opening. Measured side by side with the same method (unattended opening, warm-up run first, 0 pipelines being made, 100 s, VICTORY_GPU_TIMING=1, VICTORY_D3D12_DRED=1, 4,096):

CS_ScreenProbes_TraceRays_RayBinning_BVH_Mixed, ms/frame median worst dispatch
closed (OPEN_NAMED=0) 14.6 255
builder-named (default) 11.2 238
all open (OPEN_ALL=1) 12.3 431

In this window, mostly cutscenes, run-to-run variation is about as large as the differences, so it doesn't show the large effect. The dump result stands (compacted structures: 2,972 → 140 children outside them, 2,884 → 77 wrong parent links). The dorm still needs a side-by-side; I'll run the three variants for long enough to reach it and post the numbers.

Separately, on the CPU side, same method with ray tracing off: PR #284 + PR #294 merged on this branch gave a median of 20.0 fps (slowest quarter 16.2), against 16.5 and 16.9 (12.5 and 13.7) for two baseline runs. I'll post that on those PRs too.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7224021916 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7224021916). Originally posted by [urielbeaupre](https://github.com/urielbeaupre) on 2026-11-27T17:05:49Z. --- `e7de67f` is the builder-targeted variant, now the default. A title buffer is opened when a builder dispatch names an address inside it: root views, 64-bit addresses in two constants, and 256-byte-unit constants. Other programs keep the old rule. `VICTORY_BVH_OPEN_NAMED=0` restores closed buffers, and `VICTORY_BVH_OPEN_ALL=1` keeps the open-everything variant as a test. With `VICTORY_MEMORY_CLOSED_NOTES=1`, two minutes of ray tracing dropped **no** store by address. Before, about 1,000 pages across 10 buffers were dropped. 34 buffers were opened for the builder. **A correction to my earlier 41.8 → 6.0 ms.** Those two numbers came from different stretches: the 41.8 is the dorm, played by hand; the 6.0 is the unattended opening. Measured side by side with the same method (unattended opening, warm-up run first, 0 pipelines being made, 100 s, `VICTORY_GPU_TIMING=1`, `VICTORY_D3D12_DRED=1`, 4,096): | `CS_ScreenProbes_TraceRays_RayBinning_BVH_Mixed`, ms/frame | median | worst dispatch | |---|---|---| | closed (`OPEN_NAMED=0`) | 14.6 | 255 | | builder-named (default) | 11.2 | 238 | | all open (`OPEN_ALL=1`) | 12.3 | 431 | In this window, mostly cutscenes, run-to-run variation is about as large as the differences, so it doesn't show the large effect. The dump result stands (compacted structures: 2,972 → 140 children outside them, 2,884 → 77 wrong parent links). The dorm still needs a side-by-side; I'll run the three variants for long enough to reach it and post the numbers. Separately, on the CPU side, same method with ray tracing off: PR #284 + PR #294 merged on this branch gave a median of 20.0 fps (slowest quarter 16.2), against 16.5 and 16.9 (12.5 and 13.7) for two baseline runs. I'll post that on those PRs too.
TaynanGT commented 2026-11-27 17:08:52 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T17:08:52Z.


@urielbeaupre The 41.8 and 6.0 ms came from different scenes, and I treated them as a pair earlier. I’ll use 14.6, 11.2 and 12.3 ms for closed, named and all-open in the matched opening at 4,096. For the dorm, keep the three modes on the same save and camera. The 34 opened buffers and zero dropped stores give us a concrete result to check again alongside local VRAM and copy-back time.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7224080235 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7224080235). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T17:08:52Z. --- @urielbeaupre The 41.8 and 6.0 ms came from different scenes, and I treated them as a pair earlier. I’ll use 14.6, 11.2 and 12.3 ms for closed, named and all-open in the matched opening at 4,096. For the dorm, keep the three modes on the same save and camera. The 34 opened buffers and zero dropped stores give us a concrete result to check again alongside local VRAM and copy-back time.
urielbeaupre commented 2026-11-27 17:22:22 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by urielbeaupre on 2026-11-27T17:22:22Z.


These are dorm dumps for the builder-named default (e7de67f) and VICTORY_BVH_OPEN_NAMED=0, on the same save and camera: the unattended opening, idle in the dorm, VICTORY_MEMORY_DUMP taken 190 s after input starts, -RayTracing, limit 4,096. The structures the trace walks were checked offline (children walked from the 4 top levels and their instances, parent links checked against the tree):

compacted built structures (0x8004) closed builder-named
structures walked 166 354
children outside the structure 4,614 (27.8 per structure) 1,866 (5.3)
wrong parent links 4,705 (28.3) 575 (1.6)
nodes reached twice 3,020 (18.2) 4,999 (14.1)
structures with any defect 35% 34%

With the builder's stores reaching their buffers, roughly twice as many compacted structures exist, which suggests many builds never got that far when closed. Per structure, children outside them drop by 81% and wrong parent links by 94%. Nodes reached twice only drop by 22%, and a third of the structures still have some defect, so a second, smaller cause remains. Static structures left packed on the card are unchanged: 3 in each dump.

The dorm timing for the three modes on this save/camera is queued for the next window, alongside VRAM and copy-back.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7224332277 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7224332277). Originally posted by [urielbeaupre](https://github.com/urielbeaupre) on 2026-11-27T17:22:22Z. --- These are dorm dumps for the builder-named default (`e7de67f`) and `VICTORY_BVH_OPEN_NAMED=0`, on the same save and camera: the unattended opening, idle in the dorm, `VICTORY_MEMORY_DUMP` taken 190 s after input starts, `-RayTracing`, limit 4,096. The structures the trace walks were checked offline (children walked from the 4 top levels and their instances, parent links checked against the tree): | compacted built structures (`0x8004`) | closed | builder-named | |---|---|---| | structures walked | 166 | 354 | | children outside the structure | 4,614 (27.8 per structure) | 1,866 (5.3) | | wrong parent links | 4,705 (28.3) | 575 (1.6) | | nodes reached twice | 3,020 (18.2) | 4,999 (14.1) | | structures with any defect | 35% | 34% | With the builder's stores reaching their buffers, roughly twice as many compacted structures exist, which suggests many builds never got that far when closed. Per structure, children outside them drop by 81% and wrong parent links by 94%. Nodes reached twice only drop by 22%, and a third of the structures still have some defect, so a second, smaller cause remains. Static structures left packed on the card are unchanged: 3 in each dump. The dorm timing for the three modes on this save/camera is queued for the next window, alongside VRAM and copy-back.
TaynanGT commented 2026-11-27 17:29:24 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T17:29:24Z.


@urielbeaupre The per-structure counts make the dorm comparison clear even though 354 structures were available with the named buffers and 166 with them closed. I’ll record 27.8 to 5.3 for out-of-range children and 28.3 to 1.6 for parent links. About a third still show a defect. Keep the timings and memory measurements tied to this same save and camera.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7224463182 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7224463182). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T17:29:24Z. --- @urielbeaupre The per-structure counts make the dorm comparison clear even though 354 structures were available with the named buffers and 166 with them closed. I’ll record 27.8 to 5.3 for out-of-range children and 28.3 to 1.6 for parent links. About a third still show a defect. Keep the timings and memory measurements tied to this same save and camera.
urielbeaupre commented 2026-11-27 18:06:32 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by urielbeaupre on 2026-11-27T18:06:32Z.


14c6a05 fixes the static structures left packed on the card.

Memory::place took a page into an arena at submission but left held.taken at 0. The next bring() of that page treated it as never taken and sent all of title memory's bytes up again. Title memory still holds the packed bytes, because nothing the builder stores comes back, so an unpacked structure reverted to 0x8102 and stayed that way.

The page now gets the write-watch number from before the copy, the same as bring(). VICTORY_PLACE_TAKEN=0 restores the old behaviour.

Dorm dumps, same save and camera, builder-named default:

static structures left packed
VICTORY_PLACE_TAKEN=0 (4 dumps) 3, 3, 2, 0
on (3 dumps) 0, 0, 0

It does not measurably change the share of broken compacted built structures: 11 to 43% from dump to dump either way, so that has another cause. For those, a BVH-trace pairing of compacted structures with their copy sources found that 11 of the 16 broken ones with a source still in the dump were copied from a sound source, so the damage happens at or after the copy. I don't expect a measurable frame-time change from this one and haven't timed it.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7225132873 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7225132873). Originally posted by [urielbeaupre](https://github.com/urielbeaupre) on 2026-11-27T18:06:32Z. --- `14c6a05` fixes the static structures left packed on the card. `Memory::place` took a page into an arena at submission but left `held.taken` at 0. The next `bring()` of that page treated it as never taken and sent all of title memory's bytes up again. Title memory still holds the packed bytes, because nothing the builder stores comes back, so an unpacked structure reverted to `0x8102` and stayed that way. The page now gets the write-watch number from before the copy, the same as `bring()`. `VICTORY_PLACE_TAKEN=0` restores the old behaviour. Dorm dumps, same save and camera, builder-named default: | | static structures left packed | |---|---| | `VICTORY_PLACE_TAKEN=0` (4 dumps) | 3, 3, 2, 0 | | on (3 dumps) | 0, 0, 0 | It does **not** measurably change the share of broken compacted built structures: 11 to 43% from dump to dump either way, so that has another cause. For those, a BVH-trace pairing of compacted structures with their copy sources found that 11 of the 16 broken ones with a source still in the dump were copied from a sound source, so the damage happens at or after the copy. I don't expect a measurable frame-time change from this one and haven't timed it.
TaynanGT commented 2026-11-27 18:12:17 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T18:12:17Z.


@urielbeaupre All three captures with the stamp enabled had zero static structures left packed. I pulled the page-stamp change into #342 on current main. The isolated test reproduced the overwrite, preserved the GPU update, and still copied a later CPU write. The compacted structures remain a separate copy-path question.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7225239126 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7225239126). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T18:12:17Z. --- @urielbeaupre All three captures with the stamp enabled had zero static structures left packed. I pulled the page-stamp change into #342 on current main. The isolated test reproduced the overwrite, preserved the GPU update, and still copied a later CPU write. The compacted structures remain a separate copy-path question.
Aniseto commented 2026-11-28 09:21:59 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Aniseto on 2026-11-28T09:21:59Z.


Ran the victory-shader library suite at 14c6a05 on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build; VICTORY_D3D12_ADAPTER=NVIDIA.

cargo test -p victory-shader --lib -- --test-threads=1
336 passed; 0 failed; 18 ignored; 0 measured; 0 filtered out      (exit 0)

All 336 tests pass with 18 ignored and no skips. This is the first datapoint from an RTX 5070 Ti in the thread; the reports there are on RTX 4070 Ti and other cards. The trace-loop limit change is opt-in and I did not run a title with it enabled, so the 12.1 -> 13.9 fps comparison was not reproduced here.

Not tested: a -RayTracing title session, the memory-by-address tests (separate crate), a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7237191893 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7237191893). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-28T09:21:59Z. --- Ran the victory-shader library suite at `14c6a05` on an NVIDIA Blackwell desktop part: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build; `VICTORY_D3D12_ADAPTER=NVIDIA`. ``` cargo test -p victory-shader --lib -- --test-threads=1 336 passed; 0 failed; 18 ignored; 0 measured; 0 filtered out (exit 0) ``` All 336 tests pass with 18 ignored and no skips. This is the first datapoint from an RTX 5070 Ti in the thread; the reports there are on RTX 4070 Ti and other cards. The trace-loop limit change is opt-in and I did not run a title with it enabled, so the 12.1 -> 13.9 fps comparison was not reproduced here. Not tested: a `-RayTracing` title session, the memory-by-address tests (separate crate), a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
TaynanGT commented 2026-11-29 11:23:56 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T11:23:56Z.


Thanks for the full shader suite result. The 336 passing tests add useful coverage on the 5070 Ti, but don't reproduce the earlier FPS result. I'd keep the traversal cap opt-in pending a matched visual and frame-time comparison.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7255084540 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7255084540). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T11:23:56Z. --- Thanks for the full shader suite result. The 336 passing tests add useful coverage on the 5070 Ti, but don't reproduce the earlier FPS result. I'd keep the traversal cap opt-in pending a matched visual and frame-time comparison.
TaynanGT commented 2026-11-30 17:12:14 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:12:14Z.


main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7285882088 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/305#issuecomment-7285882088). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:12:14Z. --- `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
TaynanGT/Vice-Tay!305
No description provided.