Attribute observed graphics queue gaps to lane states #1126

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

@⁠ghptc on GitHub · 2026-11-28 13:43 UTC · original
ghptc:perf/queue → main · +294 −20 · 8 files · 1 commits · merged 2026-11-29 08:16 UTC

Attribute observed graphics queue gaps to lane states

An observed completion of VIctory’s newest graphics fence opens an interval. The next instrumented send closes it. The old message described every microsecond outside marked submit work as time the title had not submitted. The lane can already contain submitted lists whose translation or dependencies are incomplete.

This change labels the remainder accurately and adds VICTORY_QUEUE_GAPS=1. An exclusive observer accumulates microseconds during marked submit work, a parked lane with no entries, recording/fence/value-blocked heads, mixed heads, a notified lane awaiting recheck, and unknown activity. The readiness decision supplies the head classification. New notifications invalidate the parked classification under the lane mutex. Timed polling shares the same readiness decision. A periodic report cuts any open interval at its boundary and exports an independently reconcilable total. The old clock continues to charge a whole interval when it closes. Device removal, a failed event registration and a failed wait cannot open a new observed interval.

In diagnostics builds a short timeline can correlate demand for an unfinished recording with its queued/dequeued/closed identity, actual pipeline condition waits on that worker, and GPU timestamps. Enable the gap switch as well to see lane state and marked work transitions. Recording identities are local to their live allocation. The trace writer’s loss counter and clipped edges matter. No scheduling order, dependency test, PSO budget or buffer ownership rule is changed by the telemetry. The opt-in accounting takes a mutex near readiness and notification. Observer overhead under a real workload is unmeasured.

Tests. Synthetic mixed blockers and a delayed recording verify exact time conservation across report boundaries and submit-work overlap. A native fixture drives the production generic consumer through no entries → delayed folded recording → wake → send using a CPU job backend. The added Windows lane regression checks that a fence-guarded job only runs after the producer. All Windows-target tests type-checked with default features and diagnostics. Actual driver timing is a subsequent measurement.

Prior work. Searches of open and closed NVIDIA-fork PRs for “card clock”, “queue starvation”, “nothing of ours queued”, and timeline titles found keep-awake, submission and existing trace changes. The calibrated timestamp lifetime fix, timeline wait aggregation, and eight-core contention report supply complementary measurements. No matching lane/observer intersection was found in the reviewed results. Timestamp fix · Timeline test #598 · Contention #833

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/gaps.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::gaps::tests -- --test-threads=1. Also run cargo test --release --locked -j 2 -p victory-gpu --lib queue::behind::tests::a_delayed_fence_reports_its_head_until_the_producer_finishes -- --exact --test-threads=1 on Windows. 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/1126) `ghptc:perf/queue` → `main` · +294 −20 · 8 files · 1 commits · merged 2026-11-29 08:16 UTC # Attribute observed graphics queue gaps to lane states An observed completion of VIctory’s newest graphics fence opens an interval. The next instrumented send closes it. The old message described every microsecond outside marked submit work as time the title had not submitted. The lane can already contain submitted lists whose translation or dependencies are incomplete. This change labels the remainder accurately and adds `VICTORY_QUEUE_GAPS=1`. An exclusive observer accumulates microseconds during marked submit work, a parked lane with no entries, recording/fence/value-blocked heads, mixed heads, a notified lane awaiting recheck, and unknown activity. The readiness decision supplies the head classification. New notifications invalidate the parked classification under the lane mutex. Timed polling shares the same readiness decision. A periodic report cuts any open interval at its boundary and exports an independently reconcilable total. The old clock continues to charge a whole interval when it closes. Device removal, a failed event registration and a failed wait cannot open a new observed interval. In diagnostics builds a short timeline can correlate demand for an unfinished recording with its queued/dequeued/closed identity, actual pipeline condition waits on that worker, and GPU timestamps. Enable the gap switch as well to see lane state and marked work transitions. Recording identities are local to their live allocation. The trace writer’s loss counter and clipped edges matter. No scheduling order, dependency test, PSO budget or buffer ownership rule is changed by the telemetry. The opt-in accounting takes a mutex near readiness and notification. Observer overhead under a real workload is unmeasured. **Tests.** Synthetic mixed blockers and a delayed recording verify exact time conservation across report boundaries and submit-work overlap. A native fixture drives the production generic consumer through no entries → delayed folded recording → wake → send using a CPU job backend. The added Windows lane regression checks that a fence-guarded job only runs after the producer. All Windows-target tests type-checked with default features and diagnostics. Actual driver timing is a subsequent measurement. **Prior work.** Searches of open and closed NVIDIA-fork PRs for “card clock”, “queue starvation”, “nothing of ours queued”, and timeline titles found keep-awake, submission and existing trace changes. The calibrated timestamp lifetime fix, timeline wait aggregation, and eight-core contention report supply complementary measurements. No matching lane/observer intersection was found in the reviewed results. [Timestamp fix](https://github.com/trustno1-coder/VIctory-NVIDIA/commit/2cffd2dfbae99a959c14db9a3c1e25e2d879c6e7) · [Timeline test #598](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/598) · [Contention #833](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/issues/833) ## 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/gaps.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::gaps::tests -- --test-threads=1`. Also run `cargo test --release --locked -j 2 -p victory-gpu --lib queue::behind::tests::a_delayed_fence_reports_its_head_until_the_producer_finishes -- --exact --test-threads=1` on Windows. 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:51 +00:00
github-bot force-pushed github-bot/gh-1126 from 25f168c8e7 to 6e3f83970a 2026-11-28 20:06:11 +00:00 Compare
github manually merged commit 22dd358087 into main 2026-11-29 08:22:11 +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!1126
No description provided.