GPU: add hardware microbenchmark for card compare shaders #1208

Open
github-bot wants to merge 2 commits from github-bot/gh-1208 into main AGit
Owner

@⁠ByFxbian on GitHub · 2026-11-26 00:06 UTC · original
ByFxbian:bench/card-hash-hardware → main · +517 −2 · 2 files · 2 commits · open

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.

**@⁠ByFxbian** on GitHub · 2026-11-26 00:06 UTC · [original](https://github.com/fxceless/victory-fork/pull/1208) `ByFxbian:bench/card-hash-hardware` → `main` · +517 −2 · 2 files · 2 commits · open ## 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:59:33 +00:00
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/1208/head:github-bot/gh-1208'
git switch 'github-bot/gh-1208'

Merge

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