Report exact frame deadline counts and DXGI present outcomes #1128

Merged
ghptc merged 1 commit from upstream-pr/1128 into main 2026-11-29 08:16:57 +00:00
ghptc commented 2026-11-28 13:43:53 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-28T13:43:53Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5540733537 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1128). Originally posted by [ghptc](https://github.com/ghptc) on 2026-11-28T13:43:53Z. --- # 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://github.com/trustno1-coder/VIctory-NVIDIA/pull/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.
Sign in to join this conversation.
No reviewers
No labels
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.

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