Report exact frame deadline counts and DXGI present outcomes #1128

Manually merged
github merged 1 commit from github-bot/gh-1128 into main 2026-11-29 08:22:31 +00:00 AGit
Owner

@⁠ghptc on GitHub · 2026-11-28 13:43 UTC · original
ghptc:perf/pacing → main · +111 −4 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC

Report exact frame deadlines and DXGI present outcomes

The meter already emits per-window percentiles and counts over 50 and 100 ms. To compare an entire route at 30 or 60 Hz, each new summary includes the count of actual inter-meter intervals, their summed nanoseconds and strictly missed rational deadlines. The first meter call contributes only its present outcome. Consecutive windows retain the last timestamp. Each batch has a sequence number and an orderly meter drop reports its partial batch. A process abort can lose its final open window.

The production DXGI call and existing tearing retry feed signed HRESULTs into the meter. Each logical frame has one final outcome, either S_OK, another success status, or failure. The same summary counts physical API attempts, refusals, and logical retries. S_OK describes API acceptance. Physical refreshes, visible pixel correctness and interpolated frames require separate evidence. Setting VICTORY_FRAME_SAMPLES=1 emits nanoseconds in one line per batch for pooled percentiles. The existing frame-time text stays parseable. Microsoft’s Present contract

Tests. A native CPU fixture covers the two neighboring integer nanoseconds around both deadlines, first-call handling, uneven windows, S_OK, occlusion, failure and both retry outcomes. The Windows-target crate and tests type-checked with default and diagnostics features. DXGI was not executed in this validation.

Prior work. The NVIDIA-fork’s frame meter search found #341. Its implementation already prints the interval spread, which this patch preserves. Searches for frame budget, deadlines and present outcomes found no duplicate implementation. Original meter PR · Base implementation

Reproduce

From this independent PR head with the pinned Rust toolchain on Linux, compile the production module directly.

set -eu
scratch=$(mktemp -d)
printf '#[path="%s/crates/victory-gpu/src/host/pacing.rs"] mod production;\n' "$PWD" > "$scratch/test.rs"
rustc --edition=2024 --test -A dead_code "$scratch/test.rs" -o "$scratch/check"
"$scratch/check" --test-threads=1

On Windows use cargo test --release --locked -j 2 -p victory-gpu --lib host::pacing::tests -- --test-threads=1. The fixture drives the production accumulator across two windows, with and without a retry. The Windows target type-checked with and without diagnostics. The CPU regressions passed again on the submitted commit. Gameplay timings and driver overhead remain unmeasured.

**@⁠ghptc** on GitHub · 2026-11-28 13:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1128) `ghptc:perf/pacing` → `main` · +111 −4 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC # Report exact frame deadlines and DXGI present outcomes The meter already emits per-window percentiles and counts over 50 and 100 ms. To compare an entire route at 30 or 60 Hz, each new summary includes the count of actual inter-meter intervals, their summed nanoseconds and strictly missed rational deadlines. The first meter call contributes only its present outcome. Consecutive windows retain the last timestamp. Each batch has a sequence number and an orderly meter drop reports its partial batch. A process abort can lose its final open window. The production DXGI call and existing tearing retry feed signed HRESULTs into the meter. Each logical frame has one final outcome, either S_OK, another success status, or failure. The same summary counts physical API attempts, refusals, and logical retries. S_OK describes API acceptance. Physical refreshes, visible pixel correctness and interpolated frames require separate evidence. Setting `VICTORY_FRAME_SAMPLES=1` emits nanoseconds in one line per batch for pooled percentiles. The existing frame-time text stays parseable. [Microsoft’s Present contract](https://learn.microsoft.com/en-us/windows/win32/api/dxgi/nf-dxgi-idxgiswapchain-present) **Tests.** A native CPU fixture covers the two neighboring integer nanoseconds around both deadlines, first-call handling, uneven windows, S_OK, occlusion, failure and both retry outcomes. The Windows-target crate and tests type-checked with default and diagnostics features. DXGI was not executed in this validation. **Prior work.** The NVIDIA-fork’s frame meter search found #341. Its implementation already prints the interval spread, which this patch preserves. Searches for frame budget, deadlines and present outcomes found no duplicate implementation. [Original meter PR](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/341) · [Base implementation](https://github.com/trustno1-coder/VIctory-NVIDIA/commit/9fed8976afae12af511fe15f82a41b6b0955d948) ## Reproduce From this independent PR head with the pinned Rust toolchain on Linux, compile the production module directly. ```bash set -eu scratch=$(mktemp -d) printf '#[path="%s/crates/victory-gpu/src/host/pacing.rs"] mod production;\n' "$PWD" > "$scratch/test.rs" rustc --edition=2024 --test -A dead_code "$scratch/test.rs" -o "$scratch/check" "$scratch/check" --test-threads=1 ``` On Windows use `cargo test --release --locked -j 2 -p victory-gpu --lib host::pacing::tests -- --test-threads=1`. The fixture drives the production accumulator across two windows, with and without a retry. The Windows target type-checked with and without diagnostics. The CPU regressions passed again on the submitted commit. Gameplay timings and driver overhead remain unmeasured.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:33:54 +00:00
github manually merged commit 59ae74f78d into main 2026-11-29 08:22:31 +00:00
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!1128
No description provided.