Skip to content

GPU: add hardware microbenchmark for card compare shaders - #1208

Open
ByFxbian wants to merge 2 commits into
fxceless:mainfrom
ByFxbian:bench/card-hash-hardware
Open

ByFxbian wants to merge 2 commits into
fxceless:mainfrom
ByFxbian:bench/card-hash-hardware

Conversation

@ByFxbian

Copy link
Copy Markdown

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:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant