Shader tests: measure the emulated ray-tracing node test on the card #46

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

@⁠marquezinii on GitHub · 2026-11-24 20:53 UTC · original
marquezinii:bench/bvh-node-test → main · +128 −2 · 2 files · 1 commits · open

docs/fork-ray-tracing.md listed the GPU cost of the emulated ray-tracing path as unmeasured. This measures the one piece that can be measured without the game: the emulated image_bvh64_intersect_ray node test.

node_test_cost (ignored, like the other benchmarks) takes the node test's synthetic program from intersect_tests.rs, wraps the instruction in a loop that folds each result's low bit into the ray origin so every pass depends on the one before, and dispatches 65,535 groups of 32 threads. Before timing, it checks the last result of one group against bvh::intersect run the same number of times, so the loop really ran. The time of a one-pass run is subtracted to drop the per-dispatch setup and copies.

RTX 5070 (driver 621.40), release build, four runs (three of them on an idle card, one after rebasing on 4e17478):

nodes tests/s across the card
box (16- and 32-bit bounds) 48.3-50.2 G
triangle 91.3-94.8 G

The nodes stay in cache (every group reads the same 32 records), so this is the test's arithmetic only. The doc now gives these numbers with a rough frame budget and says what is still unmeasured: node fetches through title memory, traversal, divergence.

One thing I ran into: compute loops are cut at 4,096 passes (count_iteration), so past that the timing stopped growing. The benchmark stays at 4,000.

cargo clippy --workspace --all-targets -- -D warnings (default and --all-features), cargo test -p victory-shader intersect and cargo xtask policy pass. No game data involved.

cargo test --release -p victory-shader node_test_cost -- --ignored --nocapture
**@⁠marquezinii** on GitHub · 2026-11-24 20:53 UTC · [original](https://github.com/fxceless/victory-fork/pull/46) `marquezinii:bench/bvh-node-test` → `main` · +128 −2 · 2 files · 1 commits · open `docs/fork-ray-tracing.md` listed the GPU cost of the emulated ray-tracing path as unmeasured. This measures the one piece that can be measured without the game: the emulated `image_bvh64_intersect_ray` node test. `node_test_cost` (ignored, like the other benchmarks) takes the node test's synthetic program from `intersect_tests.rs`, wraps the instruction in a loop that folds each result's low bit into the ray origin so every pass depends on the one before, and dispatches 65,535 groups of 32 threads. Before timing, it checks the last result of one group against `bvh::intersect` run the same number of times, so the loop really ran. The time of a one-pass run is subtracted to drop the per-dispatch setup and copies. RTX 5070 (driver 621.40), release build, four runs (three of them on an idle card, one after rebasing on `4e17478`): | nodes | tests/s across the card | |-------|-------------------------| | box (16- and 32-bit bounds) | 48.3-50.2 G | | triangle | 91.3-94.8 G | The nodes stay in cache (every group reads the same 32 records), so this is the test's arithmetic only. The doc now gives these numbers with a rough frame budget and says what is still unmeasured: node fetches through title memory, traversal, divergence. One thing I ran into: compute loops are cut at 4,096 passes (`count_iteration`), so past that the timing stopped growing. The benchmark stays at 4,000. `cargo clippy --workspace --all-targets -- -D warnings` (default and `--all-features`), `cargo test -p victory-shader intersect` and `cargo xtask policy` pass. No game data involved. ``` cargo test --release -p victory-shader node_test_cost -- --ignored --nocapture ```
An ignored benchmark runs image_bvh64_intersect_ray in a loop over the
node tests' box and triangle cases, checks the last result against the
reference after as many passes, and times it across 65,535 groups. On an
RTX 5070: about 49 G box-node and 92 G triangle-node tests a second, with
nodes in cache. The ray-tracing write-up now gives that instead of
"unmeasured", with what the number leaves out.

The loop stays under the 4,096 passes a compute loop is cut at; past
that the time stopped growing.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:10 +00:00
Author
Owner

@⁠adriaespii on GitHub · 2026-11-24 21:14 UTC · original

Independent AMD RDNA4 benchmark and test run on commit 7e2e36f:

  • Hardware: AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (x86_64-pc-windows-msvc)
  • cargo test --release -p victory-shader node_test_cost -- --ignored --nocapture:
    box nodes (16- and 32-bit bounds): 77.6 G tests/s across the card (12.9 ps a test)
    triangle nodes: 99.6 G tests/s across the card (10.0 ps a test)
    
  • cargo clippy --workspace --all-targets -- -D warnings: 0 warnings
  • cargo test -p victory-shader: 210 passed, 0 failed, 3 ignored

AI use: Antigravity (Gemini 4 Neon) ran the benchmark/tests locally and wrote this report.

**@⁠adriaespii** on GitHub · 2026-11-24 21:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/46#issuecomment-7144666212) Independent AMD RDNA4 benchmark and test run on commit `7e2e36f`: - **Hardware:** AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (`x86_64-pc-windows-msvc`) - `cargo test --release -p victory-shader node_test_cost -- --ignored --nocapture`: ``` box nodes (16- and 32-bit bounds): 77.6 G tests/s across the card (12.9 ps a test) triangle nodes: 99.6 G tests/s across the card (10.0 ps a test) ``` - `cargo clippy --workspace --all-targets -- -D warnings`: 0 warnings - `cargo test -p victory-shader`: 210 passed, 0 failed, 3 ignored *AI use: Antigravity (Gemini 4 Neon) ran the benchmark/tests locally and wrote this report.*
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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