Diagnostics: VICTORY_RAY_PROBE counts what the ray/node tests of title memory find #1082

Open
SpaghettiMaster545 wants to merge 1 commit from upstream-pr/1084 into main
SpaghettiMaster545 commented 2026-11-25 18:49:11 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by SpaghettiMaster545 on 2026-11-25T18:49:11Z.


What it adds

A diagnostic for whether the ray walks find anything: VICTORY_RAY_PROBE=1 makes every ray/node test of title memory count what it found.

Why

With the structure builder on, rooms can stay black, and the log can't tell an empty structure from a walk that never reaches the triangles. The probe gives the counts.

What changes

  • Translation (the switch is part of the translation, so it joins the shader cache key): each node test read from title memory adds, per wave, to eight words after the fault notes:
    • node tests;
    • box tests, and boxes with a child hit;
    • triangle tests, triangle hits, and triangle hits within the ray's extent;
    • nodes whose first half had no copy.
  • Host: the faults buffer is RAY_PROBE_DWORDS (8) dwords longer. Once a frame the host reads the words from its mapping, clears them and logs a line: "ray probe: node tests of title memory since the last frame".
  • Off (the default): the translation is byte for byte as before, and nothing is logged.

What it showed us

With the builder on, the walks made tens of millions of node tests a frame. Half the box tests had a child hit, and no node page lacked a copy. But triangle tests were only 1-5 % of box tests, with few hits. That pointed at the box test: empty child slots counted as hits and sorted ahead of the real children. #213 fixes that here.

The probe costs the GPU about 4 s a frame, so it is for single diagnostic runs only.

How it was tested

  • On this branch (based on main d510ee4): cargo test --locked -p victory-shader --lib intersect passes (7). The new the_ray_probe_counts_node_tests_and_still_validates translates the node test with the probe on and checks that the module still validates.
  • cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warnings reports nothing in the changed files; it stops on lints main already has elsewhere in victory-gpu.
  • In game, in our integration tree, with the builder on: the counts above.
  • GPU and driver: NVIDIA GeForce RTX 5070 Ti, driver 621.40, Windows 11.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6611401869 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1084). Originally posted by [SpaghettiMaster545](https://github.com/SpaghettiMaster545) on 2026-11-25T18:49:11Z. --- ## What it adds A diagnostic for whether the ray walks find anything: `VICTORY_RAY_PROBE=1` makes every ray/node test of title memory count what it found. ## Why With the structure builder on, rooms can stay black, and the log can't tell an empty structure from a walk that never reaches the triangles. The probe gives the counts. ## What changes - **Translation** (the switch is part of the translation, so it joins the shader cache key): each node test read from title memory adds, per wave, to eight words after the fault notes: - node tests; - box tests, and boxes with a child hit; - triangle tests, triangle hits, and triangle hits within the ray's extent; - nodes whose first half had no copy. - **Host:** the faults buffer is `RAY_PROBE_DWORDS` (8) dwords longer. Once a frame the host reads the words from its mapping, clears them and logs a line: "ray probe: node tests of title memory since the last frame". - **Off** (the default): the translation is byte for byte as before, and nothing is logged. ## What it showed us With the builder on, the walks made tens of millions of node tests a frame. Half the box tests had a child hit, and no node page lacked a copy. But triangle tests were only 1-5 % of box tests, with few hits. That pointed at the box test: empty child slots counted as hits and sorted ahead of the real children. #213 fixes that here. The probe costs the GPU about 4 s a frame, so it is for single diagnostic runs only. ## How it was tested - On this branch (based on `main` d510ee4): `cargo test --locked -p victory-shader --lib intersect` passes (7). The new `the_ray_probe_counts_node_tests_and_still_validates` translates the node test with the probe on and checks that the module still validates. - `cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warnings` reports nothing in the changed files; it stops on lints `main` already has elsewhere in `victory-gpu`. - In game, in our integration tree, with the builder on: the counts above. - GPU and driver: NVIDIA GeForce RTX 5070 Ti, driver 621.40, Windows 11.
FIJI1299 commented 2026-11-25 20:09:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by FIJI1299 on 2026-11-25T19:37:23Z.


Tested commit cdcb7c4 on Windows:

Environment

  • OS: Windows 11 (Build 26100)
  • CPU: AMD Ryzen 5 9600X 6-Core Processor
  • RAM: 32 GB
  • GPU: NVIDIA GeForce RTX 5070 (12 GB VRAM, driver 621.40, wave32)
  • DXC: 1.8.2502.11 (Windows SDK 10.0.26100.0)

Results

  • victory-shader test suite (cargo test -p victory-shader --lib): 216 passed, 0 failed, 3 ignored (103.81s), including the new VICTORY_RAY_PROBE test in intersect_tests.rs.
  • victory-gpu diagnostics memory tests (cargo test -p victory-gpu --features diagnostics --lib memory): Passed cleanly.
  • victory-gpu test suite (cargo test -p victory-gpu --lib -- --skip warp_budget_saturates): 181 passed, 0 failed, 5 ignored, 1 filtered out (0.99s).
  • Filtered test (1): indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields (pre-existing failure on main).
<!-- greyfinch-sync:fxceless/victory-fork:comment:7172549394 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1084#issuecomment-7172549394). Originally posted by [FIJI1299](https://github.com/FIJI1299) on 2026-11-25T19:37:23Z. --- Tested commit `cdcb7c4` on Windows: ### Environment * **OS:** Windows 11 (Build 26100) * **CPU:** AMD Ryzen 5 9600X 6-Core Processor * **RAM:** 32 GB * **GPU:** NVIDIA GeForce RTX 5070 (12 GB VRAM, driver `621.40`, `wave32`) * **DXC:** `1.8.2502.11` (Windows SDK `10.0.26100.0`) ### Results * **`victory-shader` test suite (`cargo test -p victory-shader --lib`):** **216 passed, 0 failed, 3 ignored** (`103.81s`), including the new `VICTORY_RAY_PROBE` test in `intersect_tests.rs`. * **`victory-gpu` diagnostics memory tests (`cargo test -p victory-gpu --features diagnostics --lib memory`):** Passed cleanly. * **`victory-gpu` test suite (`cargo test -p victory-gpu --lib -- --skip warp_budget_saturates`):** **181 passed, 0 failed, 5 ignored, 1 filtered out** (`0.99s`). * **Filtered test (1):** `indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields` (pre-existing failure on `main`).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1084:upstream-pr/1084'
git switch 'upstream-pr/1084'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1084'
git switch 'upstream-pr/1084'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1084'
git switch 'upstream-pr/1084'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1084'
git switch 'main'
git merge --squash 'upstream-pr/1084'
git switch 'main'
git merge --ff-only 'upstream-pr/1084'
git switch 'main'
git merge 'upstream-pr/1084'
git push origin 'main'
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
fxceless/victory-fork!1082
No description provided.