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

Open
github-bot wants to merge 1 commit from github-bot/gh-1084 into main AGit
Owner

@⁠SpaghettiMaster545 on GitHub · 2026-11-25 18:49 UTC · original
SpaghettiMaster545:pr/ray-probe → main · +154 −8 · 6 files · 1 commits · open

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.
**@⁠SpaghettiMaster545** on GitHub · 2026-11-25 18:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/1084) `SpaghettiMaster545:pr/ray-probe` → `main` · +154 −8 · 6 files · 1 commits · open ## 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.
With VICTORY_RAY_PROBE=1 (part of the translation), each node test read from
title memory adds, per wave, to words after the fault notes: tests, box
tests, boxes with a child hit, triangle tests, triangle hits, triangle hits
within the ray's extent, and nodes whose first half had no copy. The host
reads them from the mapped faults buffer each frame and logs them ("ray
probe: ..."). Off, the translation is as before. The faults buffer is
RAY_PROBE_DWORDS longer.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:57:12 +00:00
Author
Owner

@⁠FIJI1299 on GitHub · 2026-11-25 19:37 UTC · original

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).
**@⁠FIJI1299** on GitHub · 2026-11-25 19:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/1084#issuecomment-7172549394) 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 has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/intersect.rs
  • crates/victory-shader/src/emit/intersect_tests.rs
  • crates/victory-shader/src/emit/mod.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/1084/head:github-bot/gh-1084'
git switch 'github-bot/gh-1084'

Merge

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