Add a synthetic D3D12 diagnostics overhead benchmark #1050

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

@⁠fladit123 on GitHub · 2026-11-25 17:31 UTC · original
fladit123:bench/d3d12-diagnostics → main · +745 −0 · 4 files · 1 commits · open

Summary

Adds an ignored, standalone Cargo benchmark for measuring the overhead of public D3D12 diagnostics using a synthetic 512-dispatch compute workload.

The benchmark measures CPU recording, submission, fence completion, GPU queue timestamps and timestamp instrumentation overhead. Every submission verifies all 512 output words.

Related to #1021 and #437. This benchmark does not measure VIctory's per-operation marker formatting or the compact records proposed in #437.

What is included

  • Standalone Cargo fixture under tests/fixtures/d3d12-diagnostics.
  • Five diagnostic configurations, isolated in fresh processes.
  • Explicit hardware and WARP adapter selection and verification.
  • Paired measurements with and without timestamp queries.
  • CSV-compatible sample output.
  • Output correctness, fence completion and device-loss checks.
  • Reproduction instructions and measurement methodology.

Results

Median microseconds per command list:

Adapter Mode CPU recording Fence completion Queue interval
RTX 4060 Off 57.8 144.3 25.600
RTX 4060 Breadcrumbs 90.6 252.0 89.536
RTX 4060 Breadcrumbs + page faults 89.2 242.8 89.536
RTX 4060 Debug 195.2 302.8 25.600
RTX 4060 GPU-based validation 905.0 1870.4 744.448
WARP Off 25.7 1282.7 602.5
WARP Breadcrumbs 39.5 1875.6 1051.8
WARP Breadcrumbs + page faults 44.5 1877.5 1053.8
WARP Debug 119.1 1394.1 610.4
WARP GPU-based validation 649.1 2839.6 1386.1

CPU and fence measurements use timestamp-free runs. Queue intervals use timestamped runs.

On the RTX 4060, enabling auto-breadcrumbs increased median CPU recording time by approximately 57% and median fence completion time by approximately 75%. The measured queue interval increased from 25.600 to 89.536 µs.

The RTX baseline's paired median timestamp instrumentation overhead through fence completion was +5.4 µs (IQR: −2.8 to +8.4 µs).

The incremental cost of page-fault reporting was inconclusive for this workload.

Validation

  • HEAD: 95404ff7bcbc01d64c21963d600739414ce22fd3.
  • Base: ca8829ff551d2a8558daae74f8aa48d0b1ff7d70.
  • Validated Git tree: b9873b8056a8e0c52c256e1e1f01ab82a1d4a628, unchanged after the commit identity amendment.
  • Windows 11 build 26300.10075.
  • Intel Core i5-12400F, 32 GB RAM.
  • NVIDIA GeForce RTX 4060 8 GB, driver 610.88.
  • Rust 1.98.1, MSVC, release profile.
  • Hardware and WARP adapters explicitly verified.
  • Three rounds, fresh process per mode and round.
  • Eight warm-up pairs and 31 measured pairs per process.
  • 93 measured pairs per mode and adapter; 1,860 measured submissions in the final session.
  • Every submission passed output correctness and fence completion checks.
  • Fixture formatting, Clippy with -D warnings, hardware and WARP benchmark runs, and asset-policy checks passed.
  • No production runtime changes or proprietary assets.

Reproduction

From the repository root:

$manifest = 'tests/fixtures/d3d12-diagnostics/Cargo.toml'

$env:VICTORY_D3D12_BENCH_ADAPTER = '10de:2882'
cargo test --locked --release --manifest-path $manifest --test diagnostics -- --ignored --nocapture d3d12_diagnostics_overhead

$env:VICTORY_D3D12_BENCH_ADAPTER = 'warp'
cargo test --locked --release --manifest-path $manifest --test diagnostics -- --ignored --nocapture d3d12_diagnostics_overhead

Remove-Item Env:VICTORY_D3D12_BENCH_ADAPTER

The hardware selector can be replaced with the appropriate hexadecimal vendor and device IDs, or hardware to select the first non-software adapter.

Limitations

  • Results describe one synthetic compute workload on one machine.
  • Dynamic GPU clocks and background desktop activity limit interpretation of small differences.
  • Samples are grouped into three independent processes per mode and adapter.
  • WARP is a software execution control, not a physical GPU performance comparison.
  • No game frame times, device-removal handling, memory consumption or runtime-specific DRED overhead were measured.
  • The complete runtime workspace suite was not run because it requires the separately excluded BCPack table. The standalone fixture does not require it.
  • Results should not be extrapolated directly to game performance.

AI assistance

OpenAI Codex (gpt-6.2-sol, high reasoning effort) implemented and validated the benchmark.

ChatGPT (GPT-6.2) assisted with task selection, static patch review and reporting.

**@⁠fladit123** on GitHub · 2026-11-25 17:31 UTC · [original](https://github.com/fxceless/victory-fork/pull/1050) `fladit123:bench/d3d12-diagnostics` → `main` · +745 −0 · 4 files · 1 commits · open ## Summary Adds an ignored, standalone Cargo benchmark for measuring the overhead of public D3D12 diagnostics using a synthetic 512-dispatch compute workload. The benchmark measures CPU recording, submission, fence completion, GPU queue timestamps and timestamp instrumentation overhead. Every submission verifies all 512 output words. Related to #1021 and #437. This benchmark does not measure VIctory's per-operation marker formatting or the compact records proposed in #437. ## What is included - Standalone Cargo fixture under `tests/fixtures/d3d12-diagnostics`. - Five diagnostic configurations, isolated in fresh processes. - Explicit hardware and WARP adapter selection and verification. - Paired measurements with and without timestamp queries. - CSV-compatible sample output. - Output correctness, fence completion and device-loss checks. - Reproduction instructions and measurement methodology. ## Results Median microseconds per command list: | Adapter | Mode | CPU recording | Fence completion | Queue interval | |---|---|---:|---:|---:| | RTX 4060 | Off | 57.8 | 144.3 | 25.600 | | RTX 4060 | Breadcrumbs | 90.6 | 252.0 | 89.536 | | RTX 4060 | Breadcrumbs + page faults | 89.2 | 242.8 | 89.536 | | RTX 4060 | Debug | 195.2 | 302.8 | 25.600 | | RTX 4060 | GPU-based validation | 905.0 | 1870.4 | 744.448 | | WARP | Off | 25.7 | 1282.7 | 602.5 | | WARP | Breadcrumbs | 39.5 | 1875.6 | 1051.8 | | WARP | Breadcrumbs + page faults | 44.5 | 1877.5 | 1053.8 | | WARP | Debug | 119.1 | 1394.1 | 610.4 | | WARP | GPU-based validation | 649.1 | 2839.6 | 1386.1 | CPU and fence measurements use timestamp-free runs. Queue intervals use timestamped runs. On the RTX 4060, enabling auto-breadcrumbs increased median CPU recording time by approximately 57% and median fence completion time by approximately 75%. The measured queue interval increased from 25.600 to 89.536 µs. The RTX baseline's paired median timestamp instrumentation overhead through fence completion was +5.4 µs (IQR: −2.8 to +8.4 µs). The incremental cost of page-fault reporting was inconclusive for this workload. ## Validation - HEAD: `95404ff7bcbc01d64c21963d600739414ce22fd3`. - Base: `ca8829ff551d2a8558daae74f8aa48d0b1ff7d70`. - Validated Git tree: `b9873b8056a8e0c52c256e1e1f01ab82a1d4a628`, unchanged after the commit identity amendment. - Windows 11 build 26300.10075. - Intel Core i5-12400F, 32 GB RAM. - NVIDIA GeForce RTX 4060 8 GB, driver 610.88. - Rust 1.98.1, MSVC, release profile. - Hardware and WARP adapters explicitly verified. - Three rounds, fresh process per mode and round. - Eight warm-up pairs and 31 measured pairs per process. - 93 measured pairs per mode and adapter; 1,860 measured submissions in the final session. - Every submission passed output correctness and fence completion checks. - Fixture formatting, Clippy with `-D warnings`, hardware and WARP benchmark runs, and asset-policy checks passed. - No production runtime changes or proprietary assets. ## Reproduction From the repository root: ```powershell $manifest = 'tests/fixtures/d3d12-diagnostics/Cargo.toml' $env:VICTORY_D3D12_BENCH_ADAPTER = '10de:2882' cargo test --locked --release --manifest-path $manifest --test diagnostics -- --ignored --nocapture d3d12_diagnostics_overhead $env:VICTORY_D3D12_BENCH_ADAPTER = 'warp' cargo test --locked --release --manifest-path $manifest --test diagnostics -- --ignored --nocapture d3d12_diagnostics_overhead Remove-Item Env:VICTORY_D3D12_BENCH_ADAPTER ``` The hardware selector can be replaced with the appropriate hexadecimal vendor and device IDs, or `hardware` to select the first non-software adapter. ## Limitations - Results describe one synthetic compute workload on one machine. - Dynamic GPU clocks and background desktop activity limit interpretation of small differences. - Samples are grouped into three independent processes per mode and adapter. - WARP is a software execution control, not a physical GPU performance comparison. - No game frame times, device-removal handling, memory consumption or runtime-specific DRED overhead were measured. - The complete runtime workspace suite was not run because it requires the separately excluded BCPack table. The standalone fixture does not require it. - Results should not be extrapolated directly to game performance. ## AI assistance OpenAI Codex (`gpt-6.2-sol`, high reasoning effort) implemented and validated the benchmark. ChatGPT (GPT-6.2) assisted with task selection, static patch review and reporting.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:56:38 +00:00
Author
Owner

@⁠fladit123 on GitHub · 2026-11-25 22:04 UTC · original

Moving this out of draft after reviewing the fixture and checking its compatibility with current main.

The standalone benchmark provides a synthetic baseline for the overhead of public D3D12 diagnostics, with explicit adapter selection, isolated diagnostic configurations, paired timestamp measurements, and output validation.

It may be useful when investigating #1021 and evaluating the diagnostic trade-offs discussed in #437. It does not measure VIctory-specific marker formatting or compact operation records, so those costs remain separate.

The original measurements and their limitations are documented in the PR description. Feedback and independent hardware measurements are welcome.

**@⁠fladit123** on GitHub · 2026-11-25 22:04 UTC · [original](https://github.com/fxceless/victory-fork/pull/1050#issuecomment-7175908365) Moving this out of draft after reviewing the fixture and checking its compatibility with current main. The standalone benchmark provides a synthetic baseline for the overhead of public D3D12 diagnostics, with explicit adapter selection, isolated diagnostic configurations, paired timestamp measurements, and output validation. It may be useful when investigating #1021 and evaluating the diagnostic trade-offs discussed in #437. It does not measure VIctory-specific marker formatting or compact operation records, so those costs remain separate. The original measurements and their limitations are documented in the PR description. Feedback and independent hardware measurements are welcome.
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/1050/head:github-bot/gh-1050'
git switch 'github-bot/gh-1050'

Merge

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