xcl run: skip startup shader preparation when no pipeline device exists (#2958) #2983
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2983"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by retrope13 on 2026-11-27T07:09:43Z.
Fixes #2958.
What is in it
When
xcl runstarts a title with ashaders.rpfpack or looseshaders/*.dxbcfiles, startup shader preparation (present::preparation::before_guest→shaders::prepare_for_launch) previously aborted the run with exit code2(No pipeline device: ...) if no D3D12 pipeline device could be created. This blocked device-less test lanes as well as real-GPU machines with an unmatchableXCL_ADAPTER/d3d12_adapter(wherereal::init_with_remapwould otherwise warn and fall back toauto/ WARP /Backend::Null).crates/xcl/src/shaders.rs:prepare_for_launchvalidatesshaders.rpf/shaders/and checksprogress.cancelfirst, keeping corrupt/empty packs, I/O errors, and cancellation fatal (exit 2).Pipelines::for_adapteronce for startup preparation; onErr, logsxlog_warn!("Shader preparation skipped (no pipeline device: {e}) – starting the title without it")and returnsOk(LaunchPreparationStatus::SkippedNoDevice).xcl shaders --precompile --pipelinesfailing withexit 2(xcl shaders: No pipeline device: ...).startup_preparation_skips_when_no_pipeline_device_is_availableandstartup_preparation_keeps_bad_pack_and_cancel_fatal_without_device.crates/xcl/src/hle/d3d12x/present/preparation.rs:SkippedNoDevice(honoring cancellation, attachingkbm, and clearing the preparation screen without painting100%) while preserving single-HWND handoff whenbackend_before_guest()falls back to a usable adapter.crates/xcl/tests/launcher_e2e.rs:missing_pipeline_device_skips_shader_preparation_and_reaches_host_loaderandshaders_cli_precompile_pipelines_fails_without_device.README.md:Tested
32.0.16.2140), Intel Core i5-14500HX,rustc 1.100.0(debug)XCL_ADAPTER=NVIDIA cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 1,459 passed, 1 failed (unrelated parallel VRAM-delta underflow flake inhle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, passed 1/1 standalone), 47 ignoredcargo test --locked -p xcl --lib startup_preparation_: 2 passed, 0 failedcargo test --locked -p xcl --lib preparation::tests::: 3 passed, 0 failedcargo test --locked -p xcl --test launcher_e2e: 9 passed, 0 failedcargo test --locked -p xcl --test e2e: 4 passed, 0 failedRegression run
main (
c2ee10e4):xcl runonxcl_testtitle+shaders/vertex.dxbcwithXCL_ADAPTER=nonexistentexited with code2(xcl: No pipeline device: ...) beforebackend_before_guest().PR (
bce0653c): same command logsShader preparation skipped (no pipeline device: ...), falls back to RTX 4060 with same-HWND handoff (0x907c8→0x907c8), and finishes withxcl_testtitle: done, failures: 0(exit0).Not tested
Backend::Nullfallback).MessageBoxW.AI use
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-27T08:37:03Z.
Checked on the device-less lane where #2958 came from: Ubuntu 24.04 in Docker, WineHQ 11.0, Xvfb, no GPU (so no vkd3d device and no WARP),
x86_64-pc-windows-gnudebug, Rust 1.100.0.On
827b27d7(cargo test -p xcl --target x86_64-pc-windows-gnu --test e2e): the skip works. The log saysShader preparation skipped (no pipeline device: Call failed. (0x80004005)) – starting the title without it, and the title starts. The other three e2e tests pass.test_title_runs_and_game_folder_is_untouchedstill fails afterwards, because the title then panics:That is
Chain::tile_level'sdst[o..o + e], which, unlike the detile path above it (src.get(..)), has no bounds check.For comparison,
main83b00818withXCL_PREPARE=0: the title also starts, then its own GPU checks fail one after another (CreatePlacedResourceX hr=0x1,CreateGraphicsPipelineS…, PresentX, DirectStorage status0x8000000a, …), and it exits0xc0000005. So without a device the e2e title cannot pass either way. This PR turns the early exit 2 into the title's own failures, which is what #2958 asked for. Thetile_levelpanic is a separate robustness point that a device-less run happens to reach.Not checked: a GPU machine with an unmatchable
XCL_ADAPTER, Windows.AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment.
Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T10:30:07Z.
I compared clean main
623d02e465a17497a757a4ce867f482b0a6c8f3band clean PR head827b27d73c48fae94b1d23fe9ed508bd70e23ef5on Windows 11 26200.9974, RTX 5070 Ti Laptop (621.24), Rust 1.97.1 MSVC, SDK DXC 1.8.2502.11, debug. I ran the repository test title with the same synthetic compute shader in bothshaders.rpfandshaders/loose.dxbc, starting each run with empty cache and title data directories.precompiling 1 shaders. Main reported PSOs made / disk hits as1 / 0for the pack and1 / 1for the loose input. This head reported1 / 0and2 / 1. Each run produced the same single driver-cache filename and reported zero refusals. The second PSO summary now includes the first input’s PSO count, although it follows a separate per-input header.XCL_ADAPTER, main stopped in preparation (exit 2). This head skipped preparation for both inputs, fell back to the NVIDIA adapter, reused the preparation HWND for the swap chain, and exited 0 with zero test-title failures.Scope was synthetic Windows startup and selector fallback. I did not test a device-less host, retail startup, or GPU performance.
AI use: OpenAI Codex (GPT-6) prepared the inputs, ran the comparisons, and drafted this report.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T12:17:32Z.
Tested
Clean
827b27d73c48fae94b1d23fe9ed508bd70e23ef5on Windows 11 build 26200.9974, Ryzen 7 3800X, Rust 1.100.0 MSVC, Intel Arc A770 driver 32.0.101.9175, DXC/DXIL 1.9.2609.5. Built withcargo test -j 2 --locked -p xcl --lib --test launcher_e2e --no-run. Ranxcl run <synthetic-title-folder>in three fresh processes withXCL_ADAPTER=A770 XCL_NETWORK=0, each under its own shared Arc lock. The fixtures used a deliberately invalid title executable so the loader boundary was observable.0x7C10002. The backend identified the Arc A770.XCL_PREPARE=0logged the bypass and reached the same loader error without shader-build or PSO counters.Three controls passed their expected-outcome checks. No runtime skips. Executable SHA-256 matched before, under, and after each lock acquisition.
Not tested
A native device-less lane, guest startup, HWND handoff, workspace suite and retail smoke.
AI use
T3 Code / Codex (
gpt-6.2-sol) ran the original verification, independently reproduced the cases reported here, and wrote this report.Imported from ivall/xcl. Originally posted by LocranKing on 2026-11-27T13:59:42Z.
Tested PR #2983 (
827b27d7) on Windows 11 (origin/main06f90c19baseline vs#2983), including unit tests,launcher_e2e, and a live launcher check with an unmatchableXCL_ADAPTER.Environment
32.0.16.2140)Unit & integration tests
cargo test --locked -p xcl --lib -- startup_preparation_skips_when_no_pipeline_device --nocapture:shaders::tests::startup_preparation_skips_when_no_pipeline_device_is_available— ok (1 passed, 0 failed)cargo test --locked -p xcl --test launcher_e2e -- --nocapture:missing_pipeline_device_skips_shader_preparation_and_reaches_host_loader,shaders_cli_precompile_pipelines_fails_without_device, etc.)Live title A/B with invalid
XCL_ADAPTER(withoutXCL_PREPARE=0)Set
XCL_ADAPTER=NonexistentAdapter999on a warm DXIL cache (lockhart,15 ssmoke):origin/main(06f90c19): Aborted during startup shader prep withexit: 0x2:[0.388] [ERROR] Shader preparation: No pipeline device: XCL_ADAPTER / d3d12_adapter "nonexistentadapter999" matches no hardware adapter (have: 0 = NVIDIA GeForce RTX 3060 Ti)#2983(827b27d7): Skipped startup shader preparation, fell back toauto, launched the title cleanly, and exited0x0(2frames shown,0crashes /0removals):[0.291] [WARN ] Shader preparation skipped (no pipeline device: XCL_ADAPTER / d3d12_adapter "nonexistentadapter999" matches no hardware adapter (have: 0 = NVIDIA GeForce RTX 3060 Ti)) – starting the title without it[0.386] [WARN ] D3D12: XCL_ADAPTER / d3d12_adapter "nonexistentadapter999" matches no hardware adapter (have: 0 = NVIDIA GeForce RTX 3060 Ti) – using autoImported from ivall/xcl. Originally posted by retrope13 on 2026-11-28T09:44:41Z.
Merged latest
main(e429936c) intofix/prep-no-device-2958at81f3e5ccto resolve the conflicts incrates/xcl/src/shaders.rsaround the newpso_corpus/warm_library/ worker-based startup preparation flow (keeping corrupt packs/corpora, cancellation, andxcl shaders --precompile --pipelinesfatal while skipping startup preparation when no pipeline device is available).Re-verified locally on Windows 11 (
NVIDIA GeForce RTX 4060 Laptop GPU,rustc 1.100.1, DXC1.9.2602.17):cargo check --locked -p xcl --lib --bins --tests— passXCL_ADAPTER=NVIDIAshaders::tests::— 22 passed, 0 failedXCL_ADAPTER=NVIDIAshaders::warm_library::tests::— 4 passed, 0 failedXCL_ADAPTER=NVIDIAshaders::pso_corpus::tests::— 1 passed, 0 failed--test launcher_e2e— 9 passed, 0 failedXCL_ADAPTER=NVIDIA --test shaders_e2e— 9 passed, 0 failed(Conflict resolution and local test commands assisted by Antigravity (Gemini 4).)
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T09:55:05Z.
Ran the startup-preparation tests at
81f3e5ccon an NVIDIA Blackwell desktop part:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
Both unit tests pass, covering the skip when no pipeline device is available and the fatal cases for a bad pack or cancellation. The head is the merge of current
main; the thread has a device-less Linux run, a Windows run on RTX 5070 Ti Laptop and other NVIDIA checks, but none on a desktop RTX 5070 Ti. I did not run a title with an unmatchable adapter here.Not tested:
launcher_e2e, a title run withXCL_ADAPTERset to a nonexistent adapter, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, game data.AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by retrope13 on 2026-11-29T10:35:35Z.
Rebased
fix/prep-no-device-2958cleanly ontomain(d8bd9a38) as a single commit at7d569414, resolving the 3 conflicts incrates/xcl/src/shaders.rsaround the newtitle_inputs()helper andXCL_PREPARE_HISTORY_PRESENT(milestone::prepare_launch) path so missing-device skips startup preparation cleanly on both paths while keeping corrupt packs/corpora, cancellation, andxcl shaders --precompile --pipelinesfatal.Re-verified locally on Windows 11 (
NVIDIA GeForce RTX 4060 Laptop GPU,rustc 1.100.1, DXC1.9.2602.17):cargo check --locked -p xcl --lib --bins --tests— passXCL_ADAPTER=NVIDIAshaders::tests::— 24 passed, 0 failedXCL_ADAPTER=NVIDIAshaders::warm_library::tests::— 4 passed, 0 failedXCL_ADAPTER=NVIDIAshaders::pso_corpus::tests::— 1 passed, 0 failedXCL_ADAPTER=NVIDIAshaders::milestone::tests::— 9 passed, 0 failed--test launcher_e2e— 9 passed, 0 failedXCL_ADAPTER=NVIDIA --test shaders_e2e— 9 passed, 0 failed(Rebase and local test verification assisted by Antigravity (Gemini 4).)
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:16:57Z.
Triage (#1607) – head
653c7edThis is the only open PR for #2958. It follows the plan in that issue.
prepare_for_launchnow opens the pipeline device once, up front. If that fails, it returnsSkippedNoDeviceand the title starts; a bad pack and cancel are still errors. Thexcl shaders --pipelinesCLI keeps its exit code 2. The tests inject the device opener and cover both paths.The CI failure is
standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, which this diff does not touch. The lib suite stopped there, so the newlauncher_e2etests did not run in CI.One small point: in the
prepare_title_inputsworker path, the launcher's ownPipelinesdevice now stays open while the worker processes run. Before this change, that path never created a device.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.