+68% rendered FPS with per-pipeline profiling on RTX 4070 SUPER #4904

Closed
github-bot wants to merge 1 commit from github-bot/gh-4903 into main AGit
Owner

@⁠adraenor on GitHub · 2026-12-01 13:17 UTC · original
adraenor:pr/batch-pipeline-timestamps → main · +153 −4 · 3 files · 1 commits · closed without merging

In-game results on an RTX 4070 SUPER

With per-pipeline GPU timing enabled, batching timestamp readbacks raised the rendered frame rate from 8.30 to 13.95 FPS (+67.9%) in the tested scene. With the default settings both builds averaged about 14 FPS.

Per-pipeline timing Main, two runs (FPS) This patch, two runs (FPS) Difference in means
Off (default) 14.12, 14.22 13.72, 14.46 −0.6%
On 8.26, 8.35 13.92, 13.97 +67.9%

These are eight separate launches, with two comparisons in opposite orders per setting. Each restored the same save and a copy of the same preloaded pipeline library. Both builds used hardware DXR, DLSS Quality, 2560 × 1440 output, and 2× frame generation on driver 616.92. The engine's frame log counts rendered frames before generation. The car was stationary in the same outdoor scene, with changing traffic and lighting.

Each measurement covers 60 seconds after at least 30 seconds in the scene without reported compilation activity. The initial warm-up launches were excluded. Runtime logs show zero shader translations or driver compilation events during all eight measured windows. With timing on, the 95th-percentile frame times were 221 and 196 ms on main, and 72 and 73 ms with the patch.

What it changes

When per-pipeline profiling is enabled, each binding currently inserts a separate GPU-to-readback resolve for its two timestamps. A command list now records both timestamps in their original positions and resolves contiguous pairs together at close. For 512 consecutive bindings this reduces 512 resolves to one. Gaps owned by other lists and the end of the ring split the ranges. Resetting a discarded recording clears its ranges.

Enable the profiler with --set VICTORY_CARD_METER_PIPELINES=1 while the card meter is on. Grouped readback applies automatically. Per-pipeline profiling stays off by default. Normal play already avoids these per-binding queries.

How it was tested

  • Tested commit 9372551e on an NVIDIA GeForce RTX 4070 SUPER. The synthetic D3D12 test uses a direct queue and 512 timestamp pairs per command list, checks every pair after fence completion, and alternates the immediate and grouped implementations.
  • Four warm-up lists precede 20 measured lists per implementation. Median time from recording through fence completion fell from 1,950.5 µs to 335 µs for 512 pairs.
  • To reproduce, set VICTORY_CARD_METER_PIPELINES=1 and run cargo test --release --locked -p victory-gpu --lib compare_pipeline_timestamp_readbacks -- --ignored --nocapture --test-threads=1.
  • cargo test --locked -p victory-gpu passed, including 1,096 library tests (67 ignored). The separate release hardware test exercises the ignored comparison. The repository asset-policy check passed on 464 files.

Checked for overlap

  • Searched open and closed issues and PRs for timestamp resolves, card-meter changes and upload rings, and inspected the open PRs touching the profiler. Related work includes #3671 (label lifetime), #4229 (report rows), #3080 (default timing policy), #3650 and #2884 (GPU diagnostics). #4000 already proposes a fence-retired upload ring, so this port covers timestamp readback only.

AI contribution by GPT-6.2-Astra high for adraenor.

**@⁠adraenor** on GitHub · 2026-12-01 13:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4903) `adraenor:pr/batch-pipeline-timestamps` → `main` · +153 −4 · 3 files · 1 commits · closed without merging ## In-game results on an RTX 4070 SUPER With per-pipeline GPU timing enabled, batching timestamp readbacks raised the rendered frame rate from **8.30 to 13.95 FPS (+67.9%)** in the tested scene. With the default settings both builds averaged about 14 FPS. | Per-pipeline timing | Main, two runs (FPS) | This patch, two runs (FPS) | Difference in means | | --- | --- | --- | --- | | Off (default) | 14.12, 14.22 | 13.72, 14.46 | −0.6% | | On | 8.26, 8.35 | 13.92, 13.97 | +67.9% | These are eight separate launches, with two comparisons in opposite orders per setting. Each restored the same save and a copy of the same preloaded pipeline library. Both builds used hardware DXR, DLSS Quality, 2560 × 1440 output, and 2× frame generation on driver 616.92. The engine's frame log counts rendered frames before generation. The car was stationary in the same outdoor scene, with changing traffic and lighting. Each measurement covers 60 seconds after at least 30 seconds in the scene without reported compilation activity. The initial warm-up launches were excluded. Runtime logs show zero shader translations or driver compilation events during all eight measured windows. With timing on, the 95th-percentile frame times were 221 and 196 ms on main, and 72 and 73 ms with the patch. ## What it changes When per-pipeline profiling is enabled, each binding currently inserts a separate GPU-to-readback resolve for its two timestamps. A command list now records both timestamps in their original positions and resolves contiguous pairs together at close. For 512 consecutive bindings this reduces 512 resolves to one. Gaps owned by other lists and the end of the ring split the ranges. Resetting a discarded recording clears its ranges. Enable the profiler with `--set VICTORY_CARD_METER_PIPELINES=1` while the card meter is on. Grouped readback applies automatically. Per-pipeline profiling stays off by default. Normal play already avoids these per-binding queries. ## How it was tested - Tested commit `9372551e` on an NVIDIA GeForce RTX 4070 SUPER. The synthetic D3D12 test uses a direct queue and 512 timestamp pairs per command list, checks every pair after fence completion, and alternates the immediate and grouped implementations. - Four warm-up lists precede 20 measured lists per implementation. Median time from recording through fence completion fell from 1,950.5 µs to 335 µs for 512 pairs. - To reproduce, set `VICTORY_CARD_METER_PIPELINES=1` and run `cargo test --release --locked -p victory-gpu --lib compare_pipeline_timestamp_readbacks -- --ignored --nocapture --test-threads=1`. - `cargo test --locked -p victory-gpu` passed, including 1,096 library tests (67 ignored). The separate release hardware test exercises the ignored comparison. The repository asset-policy check passed on 464 files. ## Checked for overlap - [x] Searched open and closed issues and PRs for timestamp resolves, card-meter changes and upload rings, and inspected the open PRs touching the profiler. Related work includes #3671 (label lifetime), #4229 (report rows), #3080 (default timing policy), #3650 and #2884 (GPU diagnostics). #4000 already proposes a fence-retired upload ring, so this port covers timestamp readback only. AI contribution by **GPT-6.2-Astra high** for **adraenor**.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:21:36 +00:00
Author
Owner

@⁠tyr0nsur on GitHub · 2026-12-01 13:30 UTC · original

Independent Windows run on RTX 4060, driver 621.14, Rust 1.98.1, exact unmodified 9372551e. I ran cargo test --release --locked -p victory-gpu --lib cardmeter::tests::compare_pipeline_timestamp_readbacks -- --exact --ignored --nocapture --test-threads=1 with VICTORY_CARD_METER_PIPELINES=1, then repeated the same test binary in two fresh processes. All timestamp-order checks passed.

Process Immediate Grouped
1 2,161.5 µs 355.5 µs
2 2,125.5 µs 325.5 µs
3 2,164 µs 342 µs

These are medians from recording through fence completion for 512 pairs, with per-pipeline timing enabled. The range split/ring wrap unit test also passed.

A separate local test used the production HostList::used_pipeline, close and reset paths. It interleaved two recordings, submitted A first and verified B's readback slots were untouched, then submitted B and checked its pairs. It also discarded a left-open recording, reused the list and confirmed only the new recording wrote its timestamp pair. That test passed as well. This was synthetic D3D12 work, with no game FPS measured.

**@⁠tyr0nsur** on GitHub · 2026-12-01 13:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4903#issuecomment-7312738738) Independent Windows run on RTX 4060, driver 621.14, Rust 1.98.1, exact unmodified `9372551e`. I ran `cargo test --release --locked -p victory-gpu --lib cardmeter::tests::compare_pipeline_timestamp_readbacks -- --exact --ignored --nocapture --test-threads=1` with `VICTORY_CARD_METER_PIPELINES=1`, then repeated the same test binary in two fresh processes. All timestamp-order checks passed. | Process | Immediate | Grouped | | --- | ---: | ---: | | 1 | 2,161.5 µs | 355.5 µs | | 2 | 2,125.5 µs | 325.5 µs | | 3 | 2,164 µs | 342 µs | These are medians from recording through fence completion for 512 pairs, with per-pipeline timing enabled. The range split/ring wrap unit test also passed. A separate local test used the production `HostList::used_pipeline`, `close` and `reset` paths. It interleaved two recordings, submitted A first and verified B's readback slots were untouched, then submitted B and checked its pairs. It also discarded a left-open recording, reused the list and confirmed only the new recording wrote its timestamp pair. That test passed as well. This was synthetic D3D12 work, with no game FPS measured.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-12-01 13:38 UTC · original

Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree.

Base 5fabb46eaf6ed8771321787f8871051abde69b9b, head 9372551e6eb181a71bfecdca76d8634d7656cb76. git diff --numstat → README.md 1/1, crates/victory-gpu/src/cardmeter.rs 139/1, crates/victory-gpu/src/host.rs 13/2.

Note for the "new test" check: a_list_is_named_by_the_pipelines_it_binds already exists on the base at cardmeter.rs (git grep -F on 5fabb46e matches), so this extends the existing test rather than adding one — the new coverage is the batched readback arm.

git diff --check "5fabb46e..9372551e" → no output, exit 0.

$env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4903'
cargo test --locked -p victory-gpu --lib -- cardmeter::tests::a_list_is_named_by_the_pipelines_it_binds --exact --test-threads=1 --quiet

Result: running 1 test, test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1162 filtered out.

The test drives the naming logic off plain lists; no device opened, GPU/driver N/A. No game data.

**@⁠cloph-dsp** on GitHub · 2026-12-01 13:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4903#issuecomment-7312950952) Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree. Base `5fabb46eaf6ed8771321787f8871051abde69b9b`, head `9372551e6eb181a71bfecdca76d8634d7656cb76`. `git diff --numstat` → README.md 1/1, crates/victory-gpu/src/cardmeter.rs 139/1, crates/victory-gpu/src/host.rs 13/2. Note for the "new test" check: `a_list_is_named_by_the_pipelines_it_binds` already exists on the base at cardmeter.rs (git grep -F on `5fabb46e` matches), so this extends the existing test rather than adding one — the new coverage is the batched readback arm. `git diff --check "5fabb46e..9372551e"` → no output, exit 0. ``` $env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4903' cargo test --locked -p victory-gpu --lib -- cardmeter::tests::a_list_is_named_by_the_pipelines_it_binds --exact --test-threads=1 --quiet ``` Result: `running 1 test`, `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1162 filtered out`. The test drives the naming logic off plain lists; no device opened, GPU/driver N/A. No game data.
github-bot closed this pull request 2026-12-01 18:30:36 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:28 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4903#issuecomment-7321011440) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4904
No description provided.