xcl run: prepare shaders in the game window before title execution #2555

Open
github-bot wants to merge 4 commits from github-bot/gh-2555 into main AGit
Owner

@⁠bmjask on GitHub · 2026-11-25 22:46 UTC · original
bmjask:shaders/startup-preparation → main · +439 −45 · 11 files · 4 commits · open

Part of #2508. Titles with a discoverable shader pack or loose shader containers can spend their first draws waiting for known compute pipelines. Run the existing precompiler on each graphical launch before the host maps or executes the title. The D3D12 presenter owns the same game window throughout preparation and gameplay.

What is in it

  • A dark preparation view in the presentation HWND reports processed records and holds at 99% until workers finish successfully. It shows seconds without a completed record and elapsed time since recovery from a gap of at least five seconds.

  • Prepare supported stages and compute pipelines for root shaders.rpf and shaders/**/*.dxbc, including the chain-root whole form for split compute shaders. Reuse the runtime cache. A compile failure or cancellation stops the launch.

  • With presentation off, preparation runs headlessly. Null-renderer runs and titles without either input retain their existing launch behavior. Graphics PSOs requiring runtime state are still created during play.

  • For a cold full pack, scripts/smoke.ps1 -StartupTimeoutSeconds sets the extra launcher allowance. Its default is still 120 seconds and the smoke block still reports guest measurement time.

Tested

  • Head 813302f3 merges main e120925e. The README conflict resolution retains both preparation and compute-cache notes. The GPU suite results below were recorded before this merge. Windows CI for the merge head

  • NVIDIA GeForce RTX 4090, driver 610.88, Intel Core i9-12900K, Windows x64, rustc 1.100.0.

  • Previous clean head 5bec587753ddf8234193f0f8bb6d6f367315c36d: cargo build --locked --workspace and cargo build --locked --release -p xcl --bin xcl succeeded. cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output: 1,427 passed, 0 failed, 46 ignored. 25 explicit GPU skip messages across 15 tests (wave size, unsupported per-lane forms and heap-fallback configuration).

  • Local cold and warm launches of the repository test title with one split compute shader both completed with zero failed title checks. The same HWND was used for preparation and swap-chain creation on each launch (cold 0xd60f6e, warm 0x14e0380). The cold pass built two pieces and the whole pipeline; the warm process loaded 3/3 blobs.

  • The repository e2e title test now compares the preparation HWND with the HWND passed to the successful DXGI swap-chain creation. The HWND identity test passed in the clean full-suite run. An additional WM_CLOSE check on a local fixture stopped before guest execution and exited with code 2. On the full archive we visually verified the progress bar and timer in the shared game window.

Regression run

main:

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 4090
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1020 (PresentX 1020)
presents per 2 s (last 3): 47 47 41
device removals: 0
crashes: 0
peak commit: 15910 MB

PR: the standard scripts/smoke.ps1 -Seconds 60 run at clean head defe7ef1 reached the preparation view and its 180-second process deadline while processing 26,503 records. The launcher and host exited before guest execution; the script emitted no smoke block. No real-title smoke block is available for merge head 813302f3. The end-to-end retail regression requirement remains open.

Not tested

  • Hardware other than the RTX 4090, archive formats outside the documented sources, and full-archive completion through the first real-title frame. No world-entry speedup is claimed.

AI use

  • Codex, GPT-6, implemented the change, wrote tests, ran local checks and drafted this description.
**@⁠bmjask** on GitHub · 2026-11-25 22:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2555) `bmjask:shaders/startup-preparation` → `main` · +439 −45 · 11 files · 4 commits · open Part of #2508. Titles with a discoverable shader pack or loose shader containers can spend their first draws waiting for known compute pipelines. Run the existing precompiler on each graphical launch before the host maps or executes the title. The D3D12 presenter owns the same game window throughout preparation and gameplay. **What is in it** - A dark preparation view in the presentation HWND reports processed records and holds at 99% until workers finish successfully. It shows seconds without a completed record and elapsed time since recovery from a gap of at least five seconds. - Prepare supported stages and compute pipelines for root `shaders.rpf` and `shaders/**/*.dxbc`, including the chain-root whole form for split compute shaders. Reuse the runtime cache. A compile failure or cancellation stops the launch. - With presentation off, preparation runs headlessly. Null-renderer runs and titles without either input retain their existing launch behavior. Graphics PSOs requiring runtime state are still created during play. - For a cold full pack, `scripts/smoke.ps1 -StartupTimeoutSeconds` sets the extra launcher allowance. Its default is still 120 seconds and the smoke block still reports guest measurement time. **Tested** - Head `813302f3` merges main `e120925e`. The README conflict resolution retains both preparation and compute-cache notes. The GPU suite results below were recorded before this merge. [Windows CI for the merge head](https://github.com/xcl-dev/xcl/actions/runs/45844519281) - NVIDIA GeForce RTX 4090, driver 610.88, Intel Core i9-12900K, Windows x64, rustc 1.100.0. - Previous clean head `5bec587753ddf8234193f0f8bb6d6f367315c36d`: `cargo build --locked --workspace` and `cargo build --locked --release -p xcl --bin xcl` succeeded. `cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output`: 1,427 passed, 0 failed, 46 ignored. 25 explicit GPU skip messages across 15 tests (wave size, unsupported per-lane forms and heap-fallback configuration). - Local cold and warm launches of the repository test title with one split compute shader both completed with zero failed title checks. The same HWND was used for preparation and swap-chain creation on each launch (cold `0xd60f6e`, warm `0x14e0380`). The cold pass built two pieces and the whole pipeline; the warm process loaded 3/3 blobs. - The repository e2e title test now compares the preparation HWND with the HWND passed to the successful DXGI swap-chain creation. The HWND identity test passed in the clean full-suite run. An additional WM_CLOSE check on a local fixture stopped before guest execution and exited with code 2. On the full archive we visually verified the progress bar and timer in the shared game window. **Regression run** main: ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 4090 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1020 (PresentX 1020) presents per 2 s (last 3): 47 47 41 device removals: 0 crashes: 0 peak commit: 15910 MB ``` PR: the standard `scripts/smoke.ps1 -Seconds 60` run at clean head `defe7ef1` reached the preparation view and its 180-second process deadline while processing 26,503 records. The launcher and host exited before guest execution; the script emitted no smoke block. No real-title smoke block is available for merge head `813302f3`. The end-to-end retail regression requirement remains open. **Not tested** - Hardware other than the RTX 4090, archive formats outside the documented sources, and full-archive completion through the first real-title frame. No world-entry speedup is claimed. **AI use** - Codex, GPT-6, implemented the change, wrote tests, ran local checks and drafted this description.
Count completed records in the offline shader path and display progress while the launcher waits for the worker. Warm both pieces and the whole compute fallback for split records. A cancelled or unsuccessful pass leaves the host unstarted.
Keep the guest behind the preparation gate in the host. The presenter owns its window throughout warm-up and swap-chain creation. Let its message thread draw progress and handle cancellation until the guest is ready. Leave the runtime clock and input timing anchored to title startup.
The host starts the measured title interval only after the shader gate succeeds. Let a full-pack run specify a longer launcher deadline and record that setting in the evidence manifest. Keep the default timeout and regression block unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:33:41 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 23:08 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on --test-threads=1 rerun (1301 passed, 0 failed, 26 ignored, 76s). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-25 23:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7177196686) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1 failure under parallel scheduling; clean on `--test-threads=1` rerun (**1301 passed, 0 failed, 26 ignored**, 76s). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978. Thanks! — Devin
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 01:36 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 01:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7179942806) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Author
Owner

@⁠SlopTart on GitHub · 2026-11-26 05:04 UTC · original

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of clock_advances_during_a_stall_and_remembers_recovery, close_before_the_ready_message_cancels_the_handoff, only_a_successful_join_releases_the_last_percent: 3 passed. Timing note: verified against this head on 2026-11-26; the PR has since gone unmergeable as upstream moved, results refer to the tested head. Real title execution and the game-window handoff itself are outside this lane; the state-machine tests around it run here.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-26 05:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7183159304) **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). `gpu_` suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of `clock_advances_during_a_stall_and_remembers_recovery`, `close_before_the_ready_message_cancels_the_handoff`, `only_a_successful_join_releases_the_last_percent`: 3 passed. Timing note: verified against this head on 2026-11-26; the PR has since gone unmergeable as upstream moved, results refer to the tested head. Real title execution and the game-window handoff itself are outside this lane; the state-machine tests around it run here. **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 06:55 UTC · original · reviewed

Could startup shader preparation use the title's adapter fallback? On main, a configured adapter that no longer matches any device produces a warning and falls back to automatic selection. With a shader pack present on this head, Pipelines::for_adapter returns an error for the same setting and the host exits before the title can use that fallback. A launch fixture with shader input, an unmatched adapter name, and an available automatic adapter would cover the regression. The standalone shader CLI can keep reporting a selector mismatch.

Source review at 5bec587753ddf8234193f0f8bb6d6f367315c36d. No title run. AI-assisted review with Codex (GPT-6.2 Sol).

**@⁠luckyteagirl** on GitHub · 2026-11-26 06:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/2555#pullrequestreview-6069734887) · **reviewed** Could startup shader preparation use the title's adapter fallback? On main, a configured adapter that no longer matches any device produces a warning and falls back to automatic selection. With a shader pack present on this head, `Pipelines::for_adapter` returns an error for the same setting and the host exits before the title can use that fallback. A launch fixture with shader input, an unmatched adapter name, and an available automatic adapter would cover the regression. The standalone shader CLI can keep reporting a selector mismatch. Source review at `5bec587753ddf8234193f0f8bb6d6f367315c36d`. No title run. AI-assisted review with Codex (GPT-6.2 Sol).
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 12:28 UTC · original · reviewed

Needs changes — keep the useful work. Checked head 5bec587753ddf8234193f0f8bb6d6f367315c36d.

Startup preparation uses strict adapter creation even though the title falls back when the configured adapter is unavailable. The local repair makes startup selection follow the title: an unmatched selector falls back to automatic selection, matching candidates are tried in order, and failed matching devices can fall back to WARP. Offline selection remains strict. The fixtures inject enumeration and creation outcomes; they do not select a real adapter.

Local validation: head plus an uncommitted repair and regression fixtures: 4 passed, 0 failed, 0 ignored, 0 skipped. These are CPU checks of the local repair, not a claim that the unmodified PR passed them. Separate negative-control checks produced 2 passes and 2 expected failures.

Build command: cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated target> (only the private absolute target path is replaced here). Each selected test executable was then run separately as <test-exe> <exact-name> --exact --test-threads=1 --nocapture.

Selected exact tests
  • shaders::tests::preparation_missing_adapter_uses_the_first_working_automatic_device
  • shaders::tests::preparation_matching_adapter_does_not_fall_back_to_other_hardware
  • shaders::tests::preparation_explicit_warp_does_not_enumerate_hardware
  • shaders::tests::offline_pipeline_selection_remains_strict

Latest-main source comparison: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7; full-head merge-tree result: conflicts. This is a source compatibility check, not a tested integration build. Local repair patch SHA-256: 87d85b84dc58068c86e878d75780bc810b94c765c8cbba7a3608105487378511.

Windows 11 Pro build 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug tests. RTX 3060 Ti / driver 32.0.16.1714 is present but was not exercised. No full-suite, GPU or title result is claimed; installed builds and game data were untouched.

AI use: Codex (GPT-6) reviewed the source, prepared the local repair/fixtures, ran the checks and drafted this report.

Optional temporary Discord for coordinating this contributor work, helping test and comparing results.

**@⁠Prime1997** on GitHub · 2026-11-26 12:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2555#pullrequestreview-6074128546) · **reviewed** **Needs changes — keep the useful work.** Checked head `5bec587753ddf8234193f0f8bb6d6f367315c36d`. Startup preparation uses strict adapter creation even though the title falls back when the configured adapter is unavailable. The local repair makes startup selection follow the title: an unmatched selector falls back to automatic selection, matching candidates are tried in order, and failed matching devices can fall back to WARP. Offline selection remains strict. The fixtures inject enumeration and creation outcomes; they do not select a real adapter. **Local validation:** head plus an uncommitted repair and regression fixtures: **4 passed, 0 failed, 0 ignored, 0 skipped**. These are CPU checks of the local repair, not a claim that the unmodified PR passed them. Separate negative-control checks produced 2 passes and 2 expected failures. Build command: `cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated target>` (only the private absolute target path is replaced here). Each selected test executable was then run separately as `<test-exe> <exact-name> --exact --test-threads=1 --nocapture`. <details><summary>Selected exact tests</summary> - `shaders::tests::preparation_missing_adapter_uses_the_first_working_automatic_device` - `shaders::tests::preparation_matching_adapter_does_not_fall_back_to_other_hardware` - `shaders::tests::preparation_explicit_warp_does_not_enumerate_hardware` - `shaders::tests::offline_pipeline_selection_remains_strict` </details> Latest-main source comparison: `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`; full-head merge-tree result: conflicts. This is a source compatibility check, not a tested integration build. Local repair patch SHA-256: `87d85b84dc58068c86e878d75780bc810b94c765c8cbba7a3608105487378511`. Windows 11 Pro build 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug tests. RTX 3060 Ti / driver 32.0.16.1714 is present but was not exercised. No full-suite, GPU or title result is claimed; installed builds and game data were untouched. AI use: Codex (GPT-6) reviewed the source, prepared the local repair/fixtures, ran the checks and drafted this report. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating this contributor work, helping test and comparing results.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2555/head:github-bot/gh-2555'
git switch 'github-bot/gh-2555'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2555'
git switch 'github-bot/gh-2555'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2555'
git switch 'github-bot/gh-2555'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2555'
git switch 'main'
git merge --squash 'github-bot/gh-2555'
git switch 'main'
git merge --ff-only 'github-bot/gh-2555'
git switch 'main'
git merge 'github-bot/gh-2555'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.