Shaders: prepare post-present pipeline history #3271

Merged
bmjask merged 1 commit from upstream-pr/3271 into main 2026-11-29 13:31:46 +00:00
bmjask commented 2026-11-29 02:57:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T02:57:23Z.


Part of #2088. A recorded run can first request split compute variants after its final present, so preparing only an earlier present leaves those driver pipelines on the launch path. This adds an explicit post-present history selection and prepares the indirect-chain forms that the recording used.

What is in it

  • crates/xcl/src/shaders/milestone.rs: select the final manifest tail, tolerate unavailable post-present compute sources, and carry recorded indirect use into preparation
  • crates/xcl/src/shaders.rs: build required indirect pieces with at most two workers and keep scheduler-only settings out of the reusable warm identity
  • README.md: document XCL_PREPARE_HISTORY_PRESENT=tail

Tested

  • NVIDIA GeForce RTX 4090, driver 32.0.16.1088; Intel Core i9-12900K; Windows 11 Pro; Rust 1.100.0 MSVC
  • cargo test -p xcl --lib required_indirect_piece_preparation_is_capped_at_two_workers -- --test-threads=1: 1 passed, 0 failed, 0 ignored
  • cargo test -p xcl --lib warm_settings_ignore_worker_identity_but_keep_backend_changes -- --test-threads=1: 1 passed, 0 failed, 0 ignored
  • cargo test -p xcl --lib shaders::milestone -- --test-threads=1: 11 passed, 0 failed, 0 ignored
  • cargo test -p xcl --lib pipeline_selection_tests -- --test-threads=1: 3 passed, 0 failed, 0 ignored
  • .\scripts\test.ps1: 2,611 passed, 0 failed, 49 ignored; 28 GPU tests reported SKIPPED
  • cargo build --release -p xcl: passed
  • A two-worker five-minute preparation sample reached 468 of 734 recorded compute recipes. Its eight >=1 s driver calls averaged 37.8 s versus 44.2 s for the prior cold sample (about 14% lower); this is a small sample, not a whole-run speedup claim.

Regression run

Both runs used the same hard-linked title view and XCL_PREPARE=0 so the 60-second runtime comparison did not repeat the staged corpus preparation.

xcl-smoke v1
commit: fa204595a488c60c6c5f905244f0172072c9c2a9
gpu: NVIDIA GeForce RTX 4090
title: 2b5bba9b
seconds: 60
exit: 0x0
frames shown: 1584 (PresentX 1584)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15122 MB
xcl-smoke v1
commit: 8f075e85c0abc85dad432c608cbe7f0b2c21a548
gpu: NVIDIA GeForce RTX 4090
title: 2b5bba9b
seconds: 60
exit: 0x0
frames shown: 1558 (PresentX 1558)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15329 MB

Not tested

  • AMD hardware
  • Completing all 734 recorded post-present compute recipes on this final commit; 468 were confirmed during development
  • The smoke pair deliberately skips preparation and therefore checks runtime regression, not the new startup selection itself

AI use

  • Codex with GPT-5 wrote and reviewed the code and tests, ran the measurements and test suite, and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5546995473 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3271). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-29T02:57:23Z. --- Part of #2088. A recorded run can first request split compute variants after its final present, so preparing only an earlier present leaves those driver pipelines on the launch path. This adds an explicit post-present history selection and prepares the indirect-chain forms that the recording used. **What is in it** - `crates/xcl/src/shaders/milestone.rs`: select the final manifest tail, tolerate unavailable post-present compute sources, and carry recorded indirect use into preparation - `crates/xcl/src/shaders.rs`: build required indirect pieces with at most two workers and keep scheduler-only settings out of the reusable warm identity - `README.md`: document `XCL_PREPARE_HISTORY_PRESENT=tail` **Tested** - NVIDIA GeForce RTX 4090, driver 32.0.16.1088; Intel Core i9-12900K; Windows 11 Pro; Rust 1.100.0 MSVC - `cargo test -p xcl --lib required_indirect_piece_preparation_is_capped_at_two_workers -- --test-threads=1`: 1 passed, 0 failed, 0 ignored - `cargo test -p xcl --lib warm_settings_ignore_worker_identity_but_keep_backend_changes -- --test-threads=1`: 1 passed, 0 failed, 0 ignored - `cargo test -p xcl --lib shaders::milestone -- --test-threads=1`: 11 passed, 0 failed, 0 ignored - `cargo test -p xcl --lib pipeline_selection_tests -- --test-threads=1`: 3 passed, 0 failed, 0 ignored - `.\scripts\test.ps1`: 2,611 passed, 0 failed, 49 ignored; 28 GPU tests reported `SKIPPED` - `cargo build --release -p xcl`: passed - A two-worker five-minute preparation sample reached 468 of 734 recorded compute recipes. Its eight >=1 s driver calls averaged 37.8 s versus 44.2 s for the prior cold sample (about 14% lower); this is a small sample, not a whole-run speedup claim. **Regression run** Both runs used the same hard-linked title view and `XCL_PREPARE=0` so the 60-second runtime comparison did not repeat the staged corpus preparation. ```text xcl-smoke v1 commit: fa204595a488c60c6c5f905244f0172072c9c2a9 gpu: NVIDIA GeForce RTX 4090 title: 2b5bba9b seconds: 60 exit: 0x0 frames shown: 1584 (PresentX 1584) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15122 MB ``` ```text xcl-smoke v1 commit: 8f075e85c0abc85dad432c608cbe7f0b2c21a548 gpu: NVIDIA GeForce RTX 4090 title: 2b5bba9b seconds: 60 exit: 0x0 frames shown: 1558 (PresentX 1558) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 15329 MB ``` **Not tested** - AMD hardware - Completing all 734 recorded post-present compute recipes on this final commit; 468 were confirmed during development - The smoke pair deliberately skips preparation and therefore checks runtime regression, not the new startup selection itself **AI use** - Codex with GPT-5 wrote and reviewed the code and tests, ran the measurements and test suite, and drafted this description.
andrewDoing commented 2026-11-29 03:03:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T03:03:29Z.


The tail boundary is the last recorded present milestone. This can precede the actual last present by 1,023 frames. The recorder emits powers of two through 1,024, then every 1,024th present. With zero presents, tail selection currently accepts the entire first-use history.

I compiled the current production present_milestone predicate and launch_selection disk reader from 8f075e85's tree in a bounded Windows harness. I wrote a synthetic compute first-use A immediately before the final present, then B immediately after. With 3 and 2,047 presents the reader selected A and B. With 4 and 2,048 it selected only B. Every control kept a repeated B once, ignored graphics without a recipe, and retained the exact graphics recipe. A separate zero-present recording also returned its compute and exact graphics entries.

This matters near the 4,096-entry limit: earlier work since the last milestone counts against the same cap as genuinely post-present work. If milestone-tail preparation is intended, I suggest naming the boundary in the README and deciding explicitly what zero presents should mean. An exact last-present boundary would require additional information from the recorder. This checks manifest selection, before shader lookup or driver compilation. No launch-time or title measurement. OpenAI Codex built and ran the controls and drafted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7249813191 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3271#issuecomment-7249813191). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-29T03:03:29Z. --- The tail boundary is the **last recorded present milestone**. This can precede the actual last present by 1,023 frames. The recorder emits powers of two through 1,024, then every 1,024th present. With zero presents, tail selection currently accepts the entire first-use history. I compiled the current production present_milestone predicate and launch_selection disk reader from 8f075e85's tree in a bounded Windows harness. I wrote a synthetic compute first-use A immediately before the final present, then B immediately after. With 3 and 2,047 presents the reader selected A and B. With 4 and 2,048 it selected only B. Every control kept a repeated B once, ignored graphics without a recipe, and retained the exact graphics recipe. A separate zero-present recording also returned its compute and exact graphics entries. This matters near the 4,096-entry limit: earlier work since the last milestone counts against the same cap as genuinely post-present work. If milestone-tail preparation is intended, I suggest naming the boundary in the README and deciding explicitly what zero presents should mean. An exact last-present boundary would require additional information from the recorder. This checks manifest selection, before shader lookup or driver compilation. No launch-time or title measurement. OpenAI Codex built and ran the controls and drafted this comment.
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!3271
No description provided.