D3D12.X: prioritize ranked pipeline preloads #3284

Merged
bmjask merged 1 commit from upstream-pr/3284 into main 2026-11-29 13:31:33 +00:00
bmjask commented 2026-11-29 04:41:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T04:41:20Z.


Known pipelines from earlier runs currently compete with up to 4,096 unknown speculative builds during startup. This defers unknown build-ahead while ranked preloads remain queued, then resumes the existing policy unchanged. Part of #1833.

What is in it

  • build_queue.rs: report whether ranked preload work remains queued, with a focused queue-state test.
  • pso_async.rs: admit unknown build-ahead only after the ranked queue drains, while short-circuiting disabled and low-commit probes, with a policy/evaluation-order test.
  • README.md: document the startup scheduling behavior.

Tested

  • Windows 11 Pro build 26200; Intel Core i9-12900K; NVIDIA GeForce RTX 4090, driver 32.0.16.1088; Rust 1.100.0 x86_64-pc-windows-msvc; debug tests and release runtime.
  • .\scripts\test.ps1 on identical-tree commit f60b3cda: 2,610 passed, 0 failed, 49 ignored. 28 passing GPU cases emitted SKIPPED for unavailable adapter/features and are not claimed as exercised coverage.
  • Three alternating 35-second exact-main pairs on pre-review commit 4dc371bd (the review fix only short-circuits disabled/low-commit probes) with the same cache and environment: main 815/801/814 frames (810.0 average), PR 816/814/813 (814.3 average, +0.5%). Main built 6,234–6,292 pipelines; PR built 2,238–2,310 (about 64% fewer). Every run had 0 bind-wait ms, 0 crashes and 0 device removals.
  • Exact-head frame 620 rendered the account picker correctly. Runtime comparison used XCL_PREPARE=0, XCL_COHERENT_MB=4095, XCL_UMA_DRIVER=mixed:1536:1792, XCL_TEXTURE_LEVEL_PAGES=1, XCL_DIRECT_DXIL=1, XCL_SKIP_BINK=non-looping, and XCL_PSO_AHEAD=4096.

Regression run

xcl-smoke v1
commit: fa204595a488c60c6c5f905244f0172072c9c2a9
gpu: NVIDIA GeForce RTX 4090
title: private-retail-title
seconds: 60
exit: 0x0
frames shown: 1568 (PresentX 1568)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 15392 MB
xcl-smoke v1
commit: ecf7e4009a17fb1e87db0b7fcff632b0c2069902
gpu: NVIDIA GeForce RTX 4090
title: private-retail-title
seconds: 60
exit: 0x0
frames shown: 1562 (PresentX 1562)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15872 MB

Not tested

  • AMD or Intel GPUs, other retail titles, or title progression beyond the account-picker screen.
  • First-run performance without ranked history; that path is behaviorally unchanged and covered only by unit tests.

AI use

  • Codex with GPT-5 implemented the queue policy and tests, reviewed the diff, and ran the reported verification. Measurements and smoke blocks were produced on the hardware listed above.
<!-- greyfinch-sync:ivall/xcl:issue:5547619350 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3284). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-29T04:41:20Z. --- Known pipelines from earlier runs currently compete with up to 4,096 unknown speculative builds during startup. This defers unknown build-ahead while ranked preloads remain queued, then resumes the existing policy unchanged. Part of #1833. **What is in it** - `build_queue.rs`: report whether ranked preload work remains queued, with a focused queue-state test. - `pso_async.rs`: admit unknown build-ahead only after the ranked queue drains, while short-circuiting disabled and low-commit probes, with a policy/evaluation-order test. - `README.md`: document the startup scheduling behavior. **Tested** - Windows 11 Pro build 26200; Intel Core i9-12900K; NVIDIA GeForce RTX 4090, driver 32.0.16.1088; Rust 1.100.0 x86_64-pc-windows-msvc; debug tests and release runtime. - `.\scripts\test.ps1` on identical-tree commit `f60b3cda`: 2,610 passed, 0 failed, 49 ignored. 28 passing GPU cases emitted `SKIPPED` for unavailable adapter/features and are not claimed as exercised coverage. - Three alternating 35-second exact-main pairs on pre-review commit `4dc371bd` (the review fix only short-circuits disabled/low-commit probes) with the same cache and environment: main 815/801/814 frames (810.0 average), PR 816/814/813 (814.3 average, +0.5%). Main built 6,234–6,292 pipelines; PR built 2,238–2,310 (about 64% fewer). Every run had 0 bind-wait ms, 0 crashes and 0 device removals. - Exact-head frame 620 rendered the account picker correctly. Runtime comparison used `XCL_PREPARE=0`, `XCL_COHERENT_MB=4095`, `XCL_UMA_DRIVER=mixed:1536:1792`, `XCL_TEXTURE_LEVEL_PAGES=1`, `XCL_DIRECT_DXIL=1`, `XCL_SKIP_BINK=non-looping`, and `XCL_PSO_AHEAD=4096`. **Regression run** ``` xcl-smoke v1 commit: fa204595a488c60c6c5f905244f0172072c9c2a9 gpu: NVIDIA GeForce RTX 4090 title: private-retail-title seconds: 60 exit: 0x0 frames shown: 1568 (PresentX 1568) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 15392 MB ``` ``` xcl-smoke v1 commit: ecf7e4009a17fb1e87db0b7fcff632b0c2069902 gpu: NVIDIA GeForce RTX 4090 title: private-retail-title seconds: 60 exit: 0x0 frames shown: 1562 (PresentX 1562) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15872 MB ``` **Not tested** - AMD or Intel GPUs, other retail titles, or title progression beyond the account-picker screen. - First-run performance without ranked history; that path is behaviorally unchanged and covered only by unit tests. **AI use** - Codex with GPT-5 implemented the queue policy and tests, reviewed the diff, and ran the reported verification. Measurements and smoke blocks were produced on the hardware listed above.
andrewDoing commented 2026-11-29 04:51:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T04:51:30Z.


A small way to preserve the old disabled path on 4dc371bd: short-circuit at the call site. Passing three evaluated bools to ahead_room_for currently calls GlobalMemoryStatusEx and takes the build-queue mutex to scan jobs even with XCL_PSO_AHEAD=0. Under low commit it also scans a queue whose answer cannot change admission. spawn_backlog_worker calls ahead_room while holding the backlog mutex, before checking for a demanded spared build.

I compiled the exact ahead_room and BuildQueue sources, injected a controlled commit result and counted calls to the commit and queue accessors. With a real ranked job queued, one disabled probe made 1 commit query and 1 queue scan on the PR versus 0 and 0 with short-circuiting. Enabled with insufficient commit gave 1 and 1 versus 1 and 0. Enabled with sufficient commit gave 1 and 1 on both and deferred ahead work. Promoting the only ranked job to Foreground resumed admission on both. This measures avoidable calls, not elapsed frame or bind time.

The small change tested was:

ahead_cap() > 0
    && super::real::big_compile_commit_free(AHEAD_FREE)
    && !queue().has_ranked_preloads_queued()

A policy test using lazy predicates or call counters can retain the disabled/low-commit guarantee. No GPU or title run. OpenAI Codex traced the caller, ran the CPU control and drafted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7250903110 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3284#issuecomment-7250903110). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-29T04:51:30Z. --- A small way to preserve the old disabled path on 4dc371bd: short-circuit at the call site. Passing three evaluated bools to ahead_room_for currently calls GlobalMemoryStatusEx and takes the build-queue mutex to scan jobs even with XCL_PSO_AHEAD=0. Under low commit it also scans a queue whose answer cannot change admission. spawn_backlog_worker calls ahead_room while holding the backlog mutex, before checking for a demanded spared build. I compiled the exact ahead_room and BuildQueue sources, injected a controlled commit result and counted calls to the commit and queue accessors. With a real ranked job queued, one disabled probe made 1 commit query and 1 queue scan on the PR versus 0 and 0 with short-circuiting. Enabled with insufficient commit gave 1 and 1 versus 1 and 0. Enabled with sufficient commit gave 1 and 1 on both and deferred ahead work. Promoting the only ranked job to Foreground resumed admission on both. This measures avoidable calls, not elapsed frame or bind time. The small change tested was: ```rust ahead_cap() > 0 && super::real::big_compile_commit_free(AHEAD_FREE) && !queue().has_ranked_preloads_queued() ``` A policy test using lazy predicates or call counters can retain the disabled/low-commit guarantee. No GPU or title run. OpenAI Codex traced the caller, ran the CPU control and drafted this comment.
bmjask commented 2026-11-29 05:00:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T05:00:44Z.


Addressed in f60b3cda. ahead_room_for now takes lazy predicates: disabled build-ahead evaluates neither commit nor queue state, low commit evaluates only the commit predicate, and the ranked-queue scan occurs only after both gates pass. The focused evaluation-order test and the full suite pass; the final 60 s retail-title smoke is also clean.

<!-- greyfinch-sync:ivall/xcl:comment:7250994459 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3284#issuecomment-7250994459). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-29T05:00:44Z. --- Addressed in f60b3cda. `ahead_room_for` now takes lazy predicates: disabled build-ahead evaluates neither commit nor queue state, low commit evaluates only the commit predicate, and the ranked-queue scan occurs only after both gates pass. The focused evaluation-order test and the full suite pass; the final 60 s retail-title smoke is also clean.
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
xcl-dev/xcl!3284
No description provided.