Repository navigation
xcl run: prepare shaders in the game window before title execution - #2555
Conversation
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.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
Tested: current PR head merged onto current
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. |
… the game window Taken as it is at 5bec587 for a test on a title. One conflict in shaders.rs: the fork's slice of the shader list and its rodata option are kept with the pull request's counting of records and errors. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The driver builds about two pipelines at a time for one process, so the preparation before a title (xcl-dev#2555) stood for minutes on each stretch of large compute programs. The stages are still translated in the host; the compute pipelines are built by worker processes of the same program, each on its own slice of the records: the processors less two, 16 at most, 3 GB of the commit left for each (XCL_PREPARE_WORKERS; 1: as before). With a list of the pipelines an earlier run used, only those are built before the title starts. A worker that fails is logged and the title starts; a worker ends when the host does. A worker reports every record while a title waits on it, and the host logs its progress every 5 s. Measured on a retail title, RTX 5090, 32 threads: the first 92 % of the steps in 85 s (one process: 84 % of one pass after several minutes). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
luckyteagirl
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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_deviceshaders::tests::preparation_matching_adapter_does_not_fall_back_to_other_hardwareshaders::tests::preparation_explicit_warp_does_not_enumerate_hardwareshaders::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.
|
The README conflict with main is resolved at The previously reported RTX 4090 full workspace suite at The remaining required description check requests a completed real-title smoke block from AI use — Codex, GPT-6, resolved the README conflict and checked the existing reports and GitHub Actions results. |
|
Heads-up for anyone posting smoke pairs on
AI use: Claude Code (Claude Opus 5.5) checked |
|
Three launches of Setup: the retail title, release builds, 1 run each. RTX 2070 SUPER:
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. |
Route console VS (hw == 4) and PS (hw == 5) FSSM variants in `xcl shaders --precompile` through `recomp::pso::console_to_dxil_in_outcome` instead of only the manual HLSL translate + compile_cached loop: - Warms the `translated/v2` cache used at runtime for both direct graphics (`XCL_DIRECT_DXIL=all`) and HLSL graphics (`XCL_DIRECT_DXIL=0`), warming at most one runtime VS and one runtime PS variant per container while keeping ES/GS skipped counting and Mode::Mesh handling unchanged. - Adds `recomp::pso::console_to_dxil_in_status` returning `(Compiled, bool)` and typed `recomp::pso::CompileOutcome` / `console_to_dxil_in_outcome` (sharing `INCOMPLETE_TRANSLATION_PREFIX` across both cold translations and `.err`-cached lookups) so `--precompile` increments `already cached` on in-memory or `translated/v2` disk cache hits and `compiled` only when translation or compilation actually runs. On `CompileOutcome::Incomplete`, falls through to the existing per-program `recomp::translate` loop (keeping `Mode::Vertex` / `Mode::Pixel` arms intact) so both standalone `--precompile` and hosted `prepare_for_launch` (xcl-dev#2555) preserve exact skip semantics without failing startup on unsupported shaders. - Reports explicit standalone PS `sampler_base=0` coverage alongside counts of PS and VS records carrying static samplers (which shift paired PS bases at pipeline creation). - Updates `crates/xcl/tests/shaders_e2e.rs` for `xcl-dev#1942`'s shared `container` helper and adds fresh-process end-to-end tests covering direct VS/PS warming, HLSL static-sampler `sampler_base=0` hit vs `sampler_base=1` miss, and incomplete VS (`v_cvt_off_f32_i4`) skip + supported VS warming across cold and warm `.err`-cached runs. Part of xcl-dev#2600 Part of xcl-dev#2508 Part of xcl-dev#1833 Assisted-by: Google Antigravity (Gemini 4 Neon)
The driver builds about two pipelines at a time for one process, so the preparation before a title (#2555) stood for minutes on each stretch of large compute programs. The stages are still translated in the host; the compute pipelines are built by worker processes of the same program, each on its own slice of the records: the processors less two, 16 at most, 3 GB of the commit left for each (XCL_PREPARE_WORKERS; 1: as before). With a list of the pipelines an earlier run used, only those are built before the title starts. A worker that fails is logged and the title starts; a worker ends when the host does. A worker reports every record while a title waits on it, and the host logs its progress every 5 s. Measured on a retail title, RTX 5090, 32 threads: the first 92 % of the steps in 85 s (one process: 84 % of one pass after several minutes). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Follow-up to 7196393192, with the cause of the long first launch (source at
AI use: Gemini (Antigravity) traced the paths. Claude Code (Claude Opus 5.5) checked them at |
Closing the startup shader preparation window (xcl-dev#2555) sets LaunchPreparation::cancel, which precompile() only checked at the outer record loop. Thread the cancellation flag into Pipelines::make_with_cache_path_cancel, Pipelines::make_one (bounded Condvar wait while driver slots are busy), the whole-form split fallback, and the inner FSSM/program/job loops.
The driver builds about two pipelines at a time for one process, so the preparation before a title (xcl-dev#2555) stood for minutes on each stretch of large compute programs. The stages are still translated in the host; the compute pipelines are built by worker processes of the same program, each on its own slice of the records: the processors less two, 16 at most, 3 GB of the commit left for each (XCL_PREPARE_WORKERS; 1: as before). With a list of the pipelines an earlier run used, only those are built before the title starts. A worker that fails is logged and the title starts; a worker ends when the host does. A worker reports every record while a title waits on it, and the host logs its progress every 5 s. Measured on a retail title, RTX 5090, 32 threads: the first 92 % of the steps in 85 s (one process: 84 % of one pass after several minutes). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit b09acbc)
|
One more data point for the startup-preparation first launch, RTX 5080 16 GB, retail 1.0.2.1, main
So on this machine the first launch on AI use: OpenCode, Claude Fable 5.2 ran the launches, read the cache/log and wrote this. |
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.rpfandshaders/**/*.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 -StartupTimeoutSecondssets the extra launcher allowance. Its default is still 120 seconds and the smoke block still reports guest measurement time.Tested
Head
813302f3merges maine120925e. 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 headNVIDIA GeForce RTX 4090, driver 610.88, Intel Core i9-12900K, Windows x64, rustc 1.100.0.
Previous clean head
5bec587753ddf8234193f0f8bb6d6f367315c36d:cargo build --locked --workspaceandcargo build --locked --release -p xcl --bin xclsucceeded.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, warm0x14e0380). 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:
PR: the standard
scripts/smoke.ps1 -Seconds 60run at clean headdefe7ef1reached 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 head813302f3. The end-to-end retail regression requirement remains open.Not tested
AI use