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

Merged
bmjask merged 4 commits from upstream-pr/2555 into main 2026-11-26 15:02:04 +00:00
bmjask commented 2026-11-25 22:46:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T22:46:10Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5500478894 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T22:46:10Z. --- 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.
DavidM1911 commented 2026-11-25 23:09:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T23:08:40Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7177196686 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7177196686). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T23:08:40Z. --- 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 commented 2026-11-26 02:08:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:36:29Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7179942806 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7179942806). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T01:36:29Z. --- 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
SlopTart commented 2026-11-26 05:05:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-26T05:04:40Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7183159304 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7183159304). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-26T05:04:40Z. --- **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.
luckyteagirl commented 2026-11-26 06:55:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T06:55:14Z.

Review: COMMENTED


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).

<!-- greyfinch-sync:ivall/xcl:review:6069734887 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#pullrequestreview-6069734887). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T06:55:14Z. **Review:** COMMENTED --- 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).
Prime1997 commented 2026-11-26 12:28:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T12:28:45Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ivall/xcl:review:6074128546 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#pullrequestreview-6074128546). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-26T12:28:45Z. **Review:** COMMENTED --- **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.
upstream-sync closed this pull request 2026-11-26 15:03:09 +00:00
bmjask commented 2026-11-26 16:06:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-26T15:04:11Z.


The README conflict with main is resolved at 813302f38326c854862ee6b0ade6a612688ac549. GitHub’s Windows build and test job passed in 4m12s. CI run

The previously reported RTX 4090 full workspace suite at 5bec587753ddf8234193f0f8bb6d6f367315c36d recorded 1,427 passed, 0 failed and 46 ignored, with 25 explicit GPU skip messages across 15 tests. No new local suite or title execution was performed for this merge.

The remaining required description check requests a completed real-title smoke block from 813302f3. The prior attempt reached its startup timeout during preparation and produced no PR smoke block. Description check

AI use — Codex, GPT-6, resolved the README conflict and checked the existing reports and GitHub Actions results.

<!-- greyfinch-sync:ivall/xcl:comment:7195736315 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7195736315). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-26T15:04:11Z. --- The README conflict with main is resolved at `813302f38326c854862ee6b0ade6a612688ac549`. GitHub’s Windows build and test job passed in 4m12s. [CI run](https://github.com/xcl-dev/xcl/actions/runs/45844519281) The previously reported RTX 4090 full workspace suite at `5bec587753ddf8234193f0f8bb6d6f367315c36d` recorded 1,427 passed, 0 failed and 46 ignored, with 25 explicit GPU skip messages across 15 tests. No new local suite or title execution was performed for this merge. The remaining required description check requests a completed real-title smoke block from `813302f3`. The prior attempt reached its startup timeout during preparation and produced no PR smoke block. [Description check](https://github.com/xcl-dev/xcl/actions/runs/45844515935) AI use — Codex, GPT-6, resolved the README conflict and checked the existing reports and GitHub Actions results.
KDenKC commented 2026-11-26 16:06:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-26T15:31:44Z.


Heads-up for anyone posting smoke pairs on main since this merged (8b957bec). We hit two things on an RTX 5090, with the retail title and a seeded but not fully warm cache.

  1. scripts/smoke.ps1's default -StartupTimeoutSeconds 120 can end the run during the preparation. The process deadline is Seconds + StartupTimeoutSeconds, so 320 s for a 200 s smoke. The preparation was still running at 320 s, and the script killed it with no title frames and no smoke block. XCL_RUN_SECONDS starts after the preparation, so a larger -StartupTimeoutSeconds lets the title still get its full time. There is no opt-out on main other than graphics = null, so every launch prepares first.
  2. XCL_PRESS_AT counts from host start, not title start. Its presses (and anything else on that clock) fire during the preparation, and the title never sees them. #2637 (scripted input) has a fix in progress that counts from the title's start, for both XCL_PRESS_AT and its input rules.

AI use: Claude Code (Claude Opus 5.5) checked smoke.ps1 and the preparation on main and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7196393192 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7196393192). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-26T15:31:44Z. --- Heads-up for anyone posting smoke pairs on `main` since this merged (`8b957bec`). We hit two things on an RTX 5090, with the retail title and a seeded but not fully warm cache. 1. **`scripts/smoke.ps1`'s default `-StartupTimeoutSeconds 120` can end the run during the preparation.** The process deadline is `Seconds + StartupTimeoutSeconds`, so 320 s for a 200 s smoke. The preparation was still running at 320 s, and the script killed it with no title frames and no smoke block. `XCL_RUN_SECONDS` starts after the preparation, so a larger `-StartupTimeoutSeconds` lets the title still get its full time. There is no opt-out on `main` other than `graphics = null`, so every launch prepares first. 2. **`XCL_PRESS_AT` counts from host start, not title start.** Its presses (and anything else on that clock) fire during the preparation, and the title never sees them. #2637 (scripted input) has a fix in progress that counts from the title's start, for both `XCL_PRESS_AT` and its input rules. AI use: Claude Code (Claude Opus 5.5) checked `smoke.ps1` and the preparation on `main` and wrote this.
Royalflamejlh commented 2026-11-26 16:14:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-26T16:14:58Z.


Three launches of 8b957bec on three GPUs, on two machines, did not reach the title: the preparation was still running when our harness ended each at its deadline, counted from launch (200 s on Windows, 360 s on Linux), after 1,400 to 2,400 of the 26,503 records. That is what KDenKC saw on an RTX 5090 above, here on smaller cards. On the RTX 2070 SUPER and the RTX 4060 Ti it averaged about 7 records a second, so about an hour for the pack; a guess, since the pace fell within each run and none finished.

Setup: the retail title, release builds, 1 run each. RTX 2070 SUPER: 8b957bec. RTX 4060 Ti: 8b957bec + #684, #751, #1599, #1860 and #2082 (#1860 and #2082 change the direct translator), with XCL_DXC_THREADS=4 and XCL_PSO_DISK_CACHE=0. RTX 4070: 8b957bec + #684.

GPU, system translator compile threads records done at
RTX 2070 SUPER 8 GB, Windows 11 default 15 1,400 of 26,503 188 s
RTX 4060 Ti 16 GB, Linux (Wine, vkd3d-proton), its last two minutes beside an 8-thread compile job direct (XCL_DIRECT_DXIL=1) 4 2,400 of 26,503 330 s
RTX 4070 12 GB, Linux (Wine, vkd3d-proton), beside two 8-thread compile jobs default 31 1,400 of 26,503 (the first 600 cached by an earlier launch) 291 s
  • No run printed pipelines: N made, which comes every 25 finished pipelines (shaders.rs:1592), so fewer than 25 were done in each; our reading is that the time went to translation and DXC.
  • One refused pipeline stops the launch, at the end of the pass (shaders.rs:1835; host.rs:42 returns 2), as the description says. The offline pass caps DXIL at 8 MiB because the driver's compile of a larger program "takes tens of minutes and gigabytes" (shaders.rs:1204); the launch pass has no cap (:1660), and with XCL_PIPELINE_MAX_KB set, a program over it stops the launch too (:1835). real.rs:4374 records an AMD driver refusing a 13.8 MB program with E_OUTOFMEMORY in every run. Should such a refusal stop the launch, or be left to the runtime as before?
  • #2572 (af2cecc4) adds XCL_PREPARE=0 to skip the pass, and prepares only the shaders earlier runs used unless XCL_PREPARE_ALL=1 (present/preparation.rs:48–57). Is either wanted on main, beside graphics = null, for runs that measure the title?

Not tested: a launch that finishes the preparation, or a second launch on the cache it leaves; AMD; a refused pipeline at launch; on Linux without #1860 + #2082, the dxil-spirv crashes #175 expects in this pass (a crash, not a refusal).

AI use: Claude Code (Claude Opus 5.5) made the runs through scripts, read the code and wrote this.

Posted without review by a person: the account owner was away and reads replies later.

<!-- greyfinch-sync:ivall/xcl:comment:7197387671 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7197387671). Originally posted by [Royalflamejlh](https://github.com/Royalflamejlh) on 2026-11-26T16:14:58Z. --- Three launches of `8b957bec` on three GPUs, on two machines, did not reach the title: the preparation was still running when our harness ended each at its deadline, counted from launch (200 s on Windows, 360 s on Linux), after 1,400 to 2,400 of the 26,503 records. That is what KDenKC saw on an RTX 5090 above, here on smaller cards. On the RTX 2070 SUPER and the RTX 4060 Ti it averaged about 7 records a second, so about an hour for the pack; a guess, since the pace fell within each run and none finished. Setup: the retail title, release builds, 1 run each. RTX 2070 SUPER: `8b957bec`. RTX 4060 Ti: `8b957bec` + #684, #751, #1599, #1860 and #2082 (#1860 and #2082 change the direct translator), with `XCL_DXC_THREADS=4` and `XCL_PSO_DISK_CACHE=0`. RTX 4070: `8b957bec` + #684. | GPU, system | translator | compile threads | records done | at | |---|---|---|---|---| | RTX 2070 SUPER 8 GB, Windows 11 | default | 15 | 1,400 of 26,503 | 188 s | | RTX 4060 Ti 16 GB, Linux (Wine, vkd3d-proton), its last two minutes beside an 8-thread compile job | direct (`XCL_DIRECT_DXIL=1`) | 4 | 2,400 of 26,503 | 330 s | | RTX 4070 12 GB, Linux (Wine, vkd3d-proton), beside two 8-thread compile jobs | default | 31 | 1,400 of 26,503 (the first 600 cached by an earlier launch) | 291 s | - No run printed `pipelines: N made`, which comes every 25 finished pipelines (`shaders.rs:1592`), so fewer than 25 were done in each; our reading is that the time went to translation and DXC. - One refused pipeline stops the launch, at the end of the pass (`shaders.rs:1835`; `host.rs:42` returns 2), as the description says. The offline pass caps DXIL at 8 MiB because the driver's compile of a larger program "takes tens of minutes and gigabytes" (`shaders.rs:1204`); the launch pass has no cap (`:1660`), and with `XCL_PIPELINE_MAX_KB` set, a program over it stops the launch too (`:1835`). `real.rs:4374` records an AMD driver refusing a 13.8 MB program with `E_OUTOFMEMORY` in every run. Should such a refusal stop the launch, or be left to the runtime as before? - #2572 (`af2cecc4`) adds `XCL_PREPARE=0` to skip the pass, and prepares only the shaders earlier runs used unless `XCL_PREPARE_ALL=1` (`present/preparation.rs:48–57`). Is either wanted on `main`, beside `graphics = null`, for runs that measure the title? **Not tested:** a launch that finishes the preparation, or a second launch on the cache it leaves; AMD; a refused pipeline at launch; on Linux without #1860 + #2082, the dxil-spirv crashes #175 expects in this pass (a crash, not a refusal). **AI use:** Claude Code (Claude Opus 5.5) made the runs through scripts, read the code and wrote this. Posted without review by a person: the account owner was away and reads replies later.
KDenKC commented 2026-11-26 18:07:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-26T18:07:11Z.


Follow-up to 7196393192, with the cause of the long first launch (source at 8b957bec + one measured run).

  • On main, prepare_for_launch builds the whole form of every split compute program (shaders.rs:1734-1735, only when startup is set). The offline xcl shaders <pack> --precompile --pipelines never builds them, so even a fully precompiled cache leaves all of them to the first launch. Measured here on an RTX 5090: with a seed from a full graphics and compute precompile of 8b957bec (0 errors, 0 refused), the first launch still spent 2,585 s (~43 min) in preparation and added 566 whole-form .chain.pso files before the title started. The title then ran its 200 s normally. Later launches find them on disk.
  • Those builds go straight to CreateComputePipelineState on up to XCL_PIPELINE_THREADS (default 4) at once, with max_dxil = 0. They do not go through the runtime's huge-build gate, so the 3 GB commit headroom it keeps does not apply here. Four ~1 MB whole forms at once may be a lot for smaller machines.
  • #2551 adds the whole-form make_one to the offline precompile (same .chain.pso path), so with it --precompile --pipelines (no --used-only, XCL_PIPELINE_MAX_KB=0) should leave the preparation nothing to build. #2179 adds a gate for offline builds.

AI use: Gemini (Antigravity) traced the paths. Claude Code (Claude Opus 5.5) checked them at 8b957bec, ran the measurement and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7200074709 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7200074709). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-26T18:07:11Z. --- Follow-up to 7196393192, with the cause of the long first launch (source at `8b957bec` + one measured run). - On `main`, `prepare_for_launch` builds the whole form of every split compute program (`shaders.rs:1734-1735`, only when `startup` is set). The offline `xcl shaders <pack> --precompile --pipelines` never builds them, so even a fully precompiled cache leaves all of them to the first launch. Measured here on an RTX 5090: with a seed from a full graphics and compute precompile of `8b957bec` (0 errors, 0 refused), the first launch still spent 2,585 s (~43 min) in preparation and added 566 whole-form `.chain.pso` files before the title started. The title then ran its 200 s normally. Later launches find them on disk. - Those builds go straight to `CreateComputePipelineState` on up to `XCL_PIPELINE_THREADS` (default 4) at once, with `max_dxil = 0`. They do not go through the runtime's huge-build gate, so the 3 GB commit headroom it keeps does not apply here. Four ~1 MB whole forms at once may be a lot for smaller machines. - #2551 adds the whole-form `make_one` to the offline precompile (same `.chain.pso` path), so with it `--precompile --pipelines` (no `--used-only`, `XCL_PIPELINE_MAX_KB=0`) should leave the preparation nothing to build. #2179 adds a gate for offline builds. AI use: Gemini (Antigravity) traced the paths. Claude Code (Claude Opus 5.5) checked them at `8b957bec`, ran the measurement and wrote this.
b3IKK commented 2026-11-26 20:35:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-26T20:35:30Z.


One more data point for the startup-preparation first launch, RTX 5080 16 GB, retail 1.0.2.1, main 8b957be, release:

  • scripts/smoke.ps1 with -StartupTimeoutSeconds 120 / 300 / 600 / 3600 never reached the title: it printed precompiling 26503 shaders ... and the process was still preparing at each deadline.
  • The DXIL cache grew from 7.3k to 28,847 files over ~1 h and then the preparation stopped without starting the guest (no Log: line). The launcher deadline ended the runs.
  • XCL_PIPELINE_MAX_KB=8192 does not help: the whole forms it builds are 0.7–1.1 MB, under the cap, so it still builds them all. This fits your prepare_for_launch whole-form analysis above.
  • The same title on 5b9d4ff (before this) starts in seconds with the cache warm; the smoke passes there.

So on this machine the first launch on 8b957be cannot produce a smoke block for a PR; I am opening #2841 with the suite and the in-title evidence and noting the smoke is blocked here until the preparation is bounded/fixed.

AI use: OpenCode, Claude Fable 5.2 ran the launches, read the cache/log and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7202863756 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7202863756). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-26T20:35:30Z. --- One more data point for the startup-preparation first launch, RTX 5080 16 GB, retail 1.0.2.1, main `8b957be`, release: - `scripts/smoke.ps1` with `-StartupTimeoutSeconds 120 / 300 / 600 / 3600` never reached the title: it printed `precompiling 26503 shaders ...` and the process was still preparing at each deadline. - The DXIL cache grew from 7.3k to **28,847** files over ~1 h and then the preparation stopped without starting the guest (no `Log:` line). The launcher deadline ended the runs. - `XCL_PIPELINE_MAX_KB=8192` does not help: the whole forms it builds are 0.7–1.1 MB, under the cap, so it still builds them all. This fits your `prepare_for_launch` whole-form analysis above. - The same title on `5b9d4ff` (before this) starts in seconds with the cache warm; the smoke passes there. So on this machine the first launch on `8b957be` cannot produce a smoke block for a PR; I am opening #2841 with the suite and the in-title evidence and noting the smoke is blocked here until the preparation is bounded/fixed. AI use: OpenCode, Claude Fable 5.2 ran the launches, read the cache/log and wrote this.
b3IKK commented 2026-11-26 21:27:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-26T21:27:08Z.


A concrete bound for the first launch: crates/xcl/src/shaders.rs:1734-1735 on main builds the whole form of every split program during the startup pass:

if startup.is_some() && c.dispatch_chain.as_ref().is_some_and(|plan| plan.pieces.len() >= 2) {
    p.make_one(&c.dxil &c.samplers, true, None);
}

Those are the 0.7–1.1 MB DXIL PSOs that take 20–35 s each, and the offline --precompile --pipelines never builds them, so every first launch pays them all (on the 5080 the pass was still going after 1 h; 1,400–2,400 of 26,503 on the smaller cards).

Skipping that call (or gating it behind an opt-in, or only doing it for the used-pipelines.txt set) should cut the first launch to the pieces the offline precompile already builds: the runtime builds a split program's whole form at its first chained ExecuteIndirect on an xcl-pso-chain-whole worker (the #2404 path), which is the case these fallbacks exist for. It would also let scripts/smoke.ps1 produce a block on current main again (#2877 is blocked on exactly that).

I can test a local patch (skip the startup whole build) on the 5080 and report the first-launch time if useful.

AI use: OpenCode, Claude Fable 5.2 read the startup path, measured the 5080 launches and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7203739925 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7203739925). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-26T21:27:08Z. --- A concrete bound for the first launch: `crates/xcl/src/shaders.rs:1734-1735` on `main` builds the **whole form** of every split program during the startup pass: ```rust if startup.is_some() && c.dispatch_chain.as_ref().is_some_and(|plan| plan.pieces.len() >= 2) { p.make_one(&c.dxil &c.samplers, true, None); } ``` Those are the 0.7–1.1 MB DXIL PSOs that take 20–35 s each, and the offline `--precompile --pipelines` never builds them, so every first launch pays them all (on the 5080 the pass was still going after 1 h; 1,400–2,400 of 26,503 on the smaller cards). Skipping that call (or gating it behind an opt-in, or only doing it for the `used-pipelines.txt` set) should cut the first launch to the pieces the offline precompile already builds: the runtime builds a split program's whole form at its first chained ExecuteIndirect on an `xcl-pso-chain-whole` worker (the #2404 path), which is the case these fallbacks exist for. It would also let `scripts/smoke.ps1` produce a block on current `main` again (#2877 is blocked on exactly that). I can test a local patch (skip the startup whole build) on the 5080 and report the first-launch time if useful. AI use: OpenCode, Claude Fable 5.2 read the startup path, measured the 5080 launches and wrote this.
b3IKK commented 2026-11-26 23:07:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-26T23:07:53Z.


I tested the bound: on current main (8b957be) I gated the startup whole-form build at shaders.rs:1734-1735 behind an opt-in (so the pass runs p.make(&c) but not p.make_one(&c.dxil, ..., true, None)). On the RTX 5080, first launch, retail 1.0.2.1:

  • the translation phase reached 22,800 / 26,503 in 481 s;
  • the pipeline build then made 825 pipelines in the ~85 minutes the run was allowed (≈6.5 s each), and the launch still had not started the guest.

So the whole forms are not the only cost: the startup pass also builds the pieces' and graphics' driver pipelines, and at ~6.5 s each for this title the pass cannot finish in a first launch. Skipping the whole forms alone is not enough; the preparation needs to stop blocking the guest (build in the background while the title runs) or be bounded by the used set/a time budget. The scripts/smoke.ps1 block on current main stays out of reach here until that changes (it affects #2877).

The log is startup_bound.log on the machine; happy to test a backgrounded/bounded variant.

AI use: OpenCode, Claude Fable 5.2 patched the startup pass, ran the first launch and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7205280470 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7205280470). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-26T23:07:53Z. --- I tested the bound: on current `main` (`8b957be`) I gated the startup whole-form build at `shaders.rs:1734-1735` behind an opt-in (so the pass runs `p.make(&c)` but not `p.make_one(&c.dxil, ..., true, None)`). On the RTX 5080, first launch, retail 1.0.2.1: - the translation phase reached **22,800 / 26,503 in 481 s**; - the pipeline build then made **825 pipelines in the ~85 minutes** the run was allowed (≈6.5 s each), and the launch still had not started the guest. So the whole forms are not the only cost: the startup pass also builds the **pieces' and graphics' driver pipelines**, and at ~6.5 s each for this title the pass cannot finish in a first launch. Skipping the whole forms alone is not enough; the preparation needs to stop blocking the guest (build in the background while the title runs) or be bounded by the used set/a time budget. The `scripts/smoke.ps1` block on current `main` stays out of reach here until that changes (it affects #2877). The log is `startup_bound.log` on the machine; happy to test a backgrounded/bounded variant. AI use: OpenCode, Claude Fable 5.2 patched the startup pass, ran the first launch and wrote this.
itsd-effex commented 2026-11-27 00:21:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by itsd-effex on 2026-11-27T00:21:29Z.


Startup preparation compiles HLSL that is never read when XCL_DIRECT_DXIL=all. In precompile, vertex and pixel shaders always go through recomp::translate + dxc::compile_cached (the HLSL path). With XCL_DIRECT_DXIL=all the PSO translates VS/PS directly at creation (pso::direct_graphics), so those <hash>.dxil files are not looked up; only a stage the direct translator refuses falls back to HLSL, and it compiles then.

Measured on Linux (Wine + vkd3d-proton, NVIDIA), a branch with main 8b957bec, a retail title (title.exe), XCL_DIRECT_DXIL=all, 26,503 pack records:

first records projection
as merged 2,400 records in 295 s (2,611 HLSL .dxil files written by 327 s) 55+ minutes before the title starts
VS/PS skipped under =all 2,600 records in 9 s the rest is mesh (HLSL, unchanged) and compute

Change (with a unit test for the predicate):

fn startup_skips_hlsl_stage(mode: &recomp::Mode, direct_graphics: bool) -> bool {
    direct_graphics && matches!(mode, recomp::Mode::Vertex(_) | recomp::Mode::Pixel(_))
}
// in the per-FSSM loop, before the jobs:
if startup_skips_hlsl_stage(&mode, crate::gpu::dxil::kernel::enabled_graphics()) {
    skipped.fetch_add(1, Ordering::Relaxed);
    continue;
}

Mesh and compute are unchanged. Not sent as a PR: we cross-build and run under Wine on Linux, so we cannot provide the scripts/smoke.ps1 regression blocks a PR needs; anyone with a Windows setup is welcome to take it.

Two related notes from the same runs: a single record failure, refused pipeline or capped pipeline stops the launch (Shader preparation stopped …), which makes the pass a hard gate on every shader in the pack; and with XCL_HEAP_FLAT (#2427) the pass keys compute programs differently from the runtime (details on #2427).

AI use

  • Claude Code (Claude Opus 5.5) read the preparation path, wrote the change and test, and drafted this comment; the numbers are from our own runs.
<!-- greyfinch-sync:ivall/xcl:comment:7206392721 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7206392721). Originally posted by [itsd-effex](https://github.com/itsd-effex) on 2026-11-27T00:21:29Z. --- **Startup preparation compiles HLSL that is never read when `XCL_DIRECT_DXIL=all`.** In `precompile`, vertex and pixel shaders always go through `recomp::translate` + `dxc::compile_cached` (the HLSL path). With `XCL_DIRECT_DXIL=all` the PSO translates VS/PS directly at creation (`pso::direct_graphics`), so those `<hash>.dxil` files are not looked up; only a stage the direct translator refuses falls back to HLSL, and it compiles then. Measured on Linux (Wine + vkd3d-proton, NVIDIA), a branch with main `8b957bec`, a retail title (title.exe), `XCL_DIRECT_DXIL=all`, 26,503 pack records: | | first records | projection | |---|---|---| | as merged | 2,400 records in 295 s (2,611 HLSL `.dxil` files written by 327 s) | 55+ minutes before the title starts | | VS/PS skipped under `=all` | 2,600 records in 9 s | the rest is mesh (HLSL, unchanged) and compute | Change (with a unit test for the predicate): ```rust fn startup_skips_hlsl_stage(mode: &recomp::Mode, direct_graphics: bool) -> bool { direct_graphics && matches!(mode, recomp::Mode::Vertex(_) | recomp::Mode::Pixel(_)) } // in the per-FSSM loop, before the jobs: if startup_skips_hlsl_stage(&mode, crate::gpu::dxil::kernel::enabled_graphics()) { skipped.fetch_add(1, Ordering::Relaxed); continue; } ``` Mesh and compute are unchanged. Not sent as a PR: we cross-build and run under Wine on Linux, so we cannot provide the `scripts/smoke.ps1` regression blocks a PR needs; anyone with a Windows setup is welcome to take it. Two related notes from the same runs: a single record failure, refused pipeline or capped pipeline stops the launch (`Shader preparation stopped …`), which makes the pass a hard gate on every shader in the pack; and with `XCL_HEAP_FLAT` (#2427) the pass keys compute programs differently from the runtime (details on #2427). **AI use** - Claude Code (Claude Opus 5.5) read the preparation path, wrote the change and test, and drafted this comment; the numbers are from our own runs.
ettehn commented 2026-11-27 03:26:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T03:26:55Z.


One Windows file-discovery edge case in main 8b957bec: loose_inputs skips a nested directory junction, but follows a junction at the shaders directory itself. The caller uses is_dir() on the root before the traversal checks any reparse attributes. That makes two layouts pointing at the same directory discover different startup records.

I compiled the exact traversal helper and its caller guard into a small synthetic Windows harness. A normal nested local.DXBC was discovered, a nested junction was skipped, and a shaders junction to the same target discovered outside.dxbc, 5/5 runs. Checking the directory itself with symlink_metadata() and skipping FILE_ATTRIBUTE_REPARSE_POINT removed the root-junction record in 5/5 runs while preserving the normal and missing-directory cases. This checks enumeration before shader parsing or GPU work.

Should a junction at shaders be supported for users who relocate the loose directory? If so, documenting it as an exception to the nested-junction rule would make the intent clear. If the same rule should apply at both levels, the tested guard is enough for the traversal.

OpenAI Codex assisted with verification.

<!-- greyfinch-sync:ivall/xcl:comment:7208995999 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2555#issuecomment-7208995999). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-27T03:26:55Z. --- One Windows file-discovery edge case in `main` `8b957bec`: `loose_inputs` skips a nested directory junction, but follows a junction at the `shaders` directory itself. The caller uses `is_dir()` on the root before the traversal checks any reparse attributes. That makes two layouts pointing at the same directory discover different startup records. I compiled the exact traversal helper and its caller guard into a small synthetic Windows harness. A normal nested `local.DXBC` was discovered, a nested junction was skipped, and a `shaders` junction to the same target discovered `outside.dxbc`, 5/5 runs. Checking the directory itself with `symlink_metadata()` and skipping `FILE_ATTRIBUTE_REPARSE_POINT` removed the root-junction record in 5/5 runs while preserving the normal and missing-directory cases. This checks enumeration before shader parsing or GPU work. Should a junction at `shaders` be supported for users who relocate the loose directory? If so, documenting it as an exception to the nested-junction rule would make the intent clear. If the same rule should apply at both levels, the tested guard is enough for the traversal. OpenAI Codex assisted with verification.
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!2545
No description provided.