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

Open
marquezinii wants to merge 1 commit from upstream-pr/46 into main
marquezinii commented 2026-11-24 20:53:22 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by marquezinii on 2026-11-24T20:53:22Z.


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
<!-- greyfinch-sync:fxceless/victory-fork:issue:6591187975 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/46). Originally posted by [marquezinii](https://github.com/marquezinii) on 2026-11-24T20:53:22Z. --- `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 ```
adriaespii commented 2026-11-24 21:30:43 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by adriaespii on 2026-11-24T21:14:28Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7144666212 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/46#issuecomment-7144666212). Originally posted by [adriaespii](https://github.com/adriaespii) on 2026-11-24T21:14:28Z. --- 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 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/46:upstream-pr/46'
git switch 'upstream-pr/46'

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/46'
git switch 'upstream-pr/46'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/46'
git switch 'upstream-pr/46'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/46'
git switch 'main'
git merge --squash 'upstream-pr/46'
git switch 'main'
git merge --ff-only 'upstream-pr/46'
git switch 'main'
git merge 'upstream-pr/46'
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!46
No description provided.