GPU: add hardware microbenchmark for card compare shaders #1205

Open
ByFxbian wants to merge 2 commits from upstream-pr/1208 into main
ByFxbian commented 2026-11-26 00:06:49 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ByFxbian on 2026-11-26T00:06:49Z.


Summary

Adds an opt-in hardware microbenchmark comparing the existing CARD_COMPARE and CARD_COMPARE_WIDE shaders from #1014.

No production shader code, runtime behavior, defaults or dependencies are changed.

Hardware and results

  • NVIDIA GeForce RTX 3070 (8 GiB VRAM)
  • NVIDIA driver 610.88
  • AMD Ryzen 5 5600X
  • 32 GiB RAM
  • Resizable BAR disabled
  • Rust 1.98.1

Median GPU execution time per pass, compare-and-store mode, without the debug layer:

Input size Original (µs) Wide (µs) Speedup
64 KiB 192.120 5.792 33.17x
256 KiB 231.792 5.808 39.91x
1 MiB 312.128 5.888 53.01x
4 MiB 660.480 7.168 92.14x
16 MiB 701.440 41.984 16.71x
64 MiB 776.704 163.840 4.74x
256 MiB 1112.064 624.640 1.78x

The wide implementation was faster in all 21 tested configurations. Repeated measurements confirmed the overall improvement.

Validation

  • Both existing WARP card compare tests pass.
  • Both shaders pass hardware correctness checks.
  • Nonzero skew, output offsets, partial spans, aligned boundary coverage and compare-mode semantics are tested.
  • D3D12 debug layer: 0 errors, 0 warnings.
  • Hardware benchmark passes after rebasing onto dc4c0fcd.

Existing upstream failures

A separate, unmodified upstream worktree was tested for comparison:

Result Upstream This branch
Passed 192 192
Failed 2 2
Ignored 5 6

Both branches reproduce the same existing test failures:

  • warp_budget_saturates_without_wraparound_and_preserves_draw_fields (related: #849, #847)
  • written_pages_are_reported_to_every_asker (related: #1008)

The repository-wide asset policy also reports two existing oversized diagnostic logs on both branches.

These unrelated failures are not addressed by this PR.

Reproduction

cargo test --release --locked -p victory-gpu bench_card_compare_hardware -- --ignored --nocapture --test-threads=1

Enable D3D12 debug validation with:

$env:VICTORY_CARD_COMPARE_DEBUG = "1"

Limitations

  • Synthetic data only.
  • Repeated passes reuse the same memory addresses.
  • Timings include intra-batch UAV barriers.
  • Allocation, uploads and CPU fence waits are excluded.
  • Logical throughput is not physical memory bandwidth.

These measurements are not gameplay FPS measurements. No commercial game files were used.

AI-assisted implementation using OpenAI Codex and ChatGPT. All hardware measurements were performed locally.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6616393552 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1208). Originally posted by [ByFxbian](https://github.com/ByFxbian) on 2026-11-26T00:06:49Z. --- ## Summary Adds an opt-in hardware microbenchmark comparing the existing `CARD_COMPARE` and `CARD_COMPARE_WIDE` shaders from #1014. No production shader code, runtime behavior, defaults or dependencies are changed. ## Hardware and results - NVIDIA GeForce RTX 3070 (8 GiB VRAM) - NVIDIA driver 610.88 - AMD Ryzen 5 5600X - 32 GiB RAM - Resizable BAR disabled - Rust 1.98.1 Median GPU execution time per pass, compare-and-store mode, without the debug layer: | Input size | Original (µs) | Wide (µs) | Speedup | | --- | ---: | ---: | ---: | | 64 KiB | 192.120 | 5.792 | 33.17x | | 256 KiB | 231.792 | 5.808 | 39.91x | | 1 MiB | 312.128 | 5.888 | 53.01x | | 4 MiB | 660.480 | 7.168 | 92.14x | | 16 MiB | 701.440 | 41.984 | 16.71x | | 64 MiB | 776.704 | 163.840 | 4.74x | | 256 MiB | 1112.064 | 624.640 | 1.78x | The wide implementation was faster in all 21 tested configurations. Repeated measurements confirmed the overall improvement. ## Validation - Both existing WARP card compare tests pass. - Both shaders pass hardware correctness checks. - Nonzero skew, output offsets, partial spans, aligned boundary coverage and compare-mode semantics are tested. - D3D12 debug layer: **0 errors, 0 warnings**. - Hardware benchmark passes after rebasing onto `dc4c0fcd`. ## Existing upstream failures A separate, unmodified upstream worktree was tested for comparison: | Result | Upstream | This branch | | --- | ---: | ---: | | Passed | 192 | 192 | | Failed | 2 | 2 | | Ignored | 5 | 6 | Both branches reproduce the same existing test failures: - `warp_budget_saturates_without_wraparound_and_preserves_draw_fields` (related: #849, #847) - `written_pages_are_reported_to_every_asker` (related: #1008) The repository-wide asset policy also reports two existing oversized diagnostic logs on both branches. These unrelated failures are not addressed by this PR. ## Reproduction ```powershell cargo test --release --locked -p victory-gpu bench_card_compare_hardware -- --ignored --nocapture --test-threads=1 ``` Enable D3D12 debug validation with: ```powershell $env:VICTORY_CARD_COMPARE_DEBUG = "1" ``` ## Limitations - Synthetic data only. - Repeated passes reuse the same memory addresses. - Timings include intra-batch UAV barriers. - Allocation, uploads and CPU fence waits are excluded. - Logical throughput is not physical memory bandwidth. These measurements are not gameplay FPS measurements. No commercial game files were used. AI-assisted implementation using OpenAI Codex and ChatGPT. All hardware measurements were performed locally.
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/1208:upstream-pr/1208'
git switch 'upstream-pr/1208'

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