Shaders: warm runtime-selected graphics DXIL variants in --precompile #2613
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2613
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2613"
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?
@Decodere on GitHub · 2026-11-26 01:58 UTC · original
Decodere:fix-precompile-runtime-graphics-variants-2600→main· +290 −19 · 3 files · 1 commits · openRoutes console vertex (
hw == 4) and pixel (hw == 5) FSSM variants inxcl shaders --precompilethroughrecomp::pso::console_to_dxil_in_status, warming the exacttranslated/v2runtime cache variants (includingXCL_DIRECT_DXIL=alldirect graphics variants), distinguishing cache hits from fresh compiles, and explicitly reporting standalone PSsampler_base=0coverage alongside static-sampler shift counts. Part of #2600, Part of #2508, Part of #1833.What is in it
crates/xcl/src/gpu/recomp/pso.rs: addconsole_to_dxil_in_status(blob, stage, sampler_base, split_wave64, windows) -> Result<(Compiled, bool), String>(withconsole_to_dxil_indelegating to it) returning whether the result came from the in-memory ortranslated/v2disk cache (true) vs fresh translation/compilation (false).crates/xcl/src/shaders.rs(precompile): warm at most one runtimeStage::Vertex(hw == 4) and one runtimeStage::Pixel(hw == 5) FSSM variant per container viarecomp::pso::console_to_dxil_in_status(&blob, stage, 0, graphics_split, windows)(and useconsole_to_dxil_in_statusfor compute as well), incrementingcachedon cache hits andcompiledonly on fresh compiles, while preservingES/GSskippedcounting andMode::Meshhandling unchanged.crates/xcl/src/shaders.rs(precompile): trackps_base0,ps_static_samplers, andvs_static_samplersfromCompiled.samplers, print an explicit runtime-path coverage summary line when standalone PS or static-sampler VS records are warmed, and update theprecompiledoc comment.crates/xcl/tests/shaders_e2e.rs: add two fresh-process end-to-end tests (precompile_warms_direct_vs_ps_and_hits_in_fresh_processunderXCL_DIRECT_DXIL=allandprecompile_warms_hlsl_static_samplers_and_reports_base_shiftunderXCL_DIRECT_DXIL=0) verifying coldcompiled 2, already cached 0, errors 0-> warm second-runcompiled 0, already cached 2, errors 0summaries,translated/v2warming, zero-DXC fresh-process cache hits, pairedPS(base=1)miss + distinct DXIL, and separate warm translation/DXC vs nativeCreateGraphicsPipelineStatetimings;time_native_graphics_psonow returnsResult<Option<f64>, String>so root-signature andCreateGraphicsPipelineStateerrors fail with exact HRESULTs once a D3D12 device is available while genuine unavailable-GPU skips route throughrunner::skip_test.Tested
rustc 1.100.0, DXC1.9.2609.5,--release.b49be183: both newshaders_e2etests failed (0 passed; 2 failed) because unmodifiedprecompileneither wrotetranslated/v2entries for VS/PS nor printed thesampler_base=0coverage line.cargo test --release -p xcl --test shaders_e2e -- --nocapture:10 passed, 0 failed, 0 ignored(0skips on both RTX 4060 and WARP):warm_translate_dxc_ms=5.136,native_pso_ms=7.185; HLSL static-sampler VS+PSwarm_translate_dxc_ms=3.338,native_pso_ms=21.347.XCL_ADAPTER=warp,XCL_WARP=1) fresh-process timings: direct VS+PSwarm_translate_dxc_ms=5.067,native_pso_ms=1.874; HLSL static-sampler VS+PSwarm_translate_dxc_ms=3.964,native_pso_ms=2.869.cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture:37test binaries,1437 passed, 0 failed, 47 ignored(SKIPPED GPU/host tests: 29 pre-existing on 32-lane RTX 4060 without D3D12 debug layer — 21 no wave64, 3 per-lane wave32 refused, 3 no D3D12 debug layer, 1 no heap windows, 1 cannot disable driver cache; 0 skipped inshaders_e2e).Regression run
main (
origin/mainancestor889ef3e8aa7f267323ab4879e735e65da6bcef10, ancestor ofb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7):PR:
Not tested
pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode disabled).--precompileover a full retail shader archive (covered via isolated synthetic console VS/PS containers inshaders_e2e).#[ignore]tests.AI use
console_to_dxil_in_statusinpso.rs, theprecompileruntime graphics warming, cache-hit accounting, and coverage reporting inshaders.rs, and the fresh-process direct and HLSL static-sampler tests inshaders_e2e.rs, ran the failing-first, post-fix, workspace, and paired 60 s smoke verifications, and drafted this PR description.@DarkPanda69 on GitHub · 2026-11-26 02:27 UTC · original · edited 2026-11-26 06:56 UTC
Update for head
2d229b9: rerun onmainb49be18, same cards and--nocapture.shaders_e2egives 10 passed, 0 failed, no SKIPPED, on both the RX 9070 XT and the RTX 3060.shaders::gives 10 passed, 0 failed on both, with the same 1 SKIPPED asmain(pso_measurement_compiles_an_exact_synthetic_record).64-lane AMD run (listed as untested) on an RX 9070 XT, plus an RTX 3060: both new end-to-end tests pass on both cards, with no skips.
Head
a3312c0applied onmainb49be18, debug, Windows 11 Pro 26200, card chosen withXCL_ADAPTER:cargo test -p xcl --test shaders_e2e -- --nocapture: 10 passed, 0 failed, no SKIPPED on both cards, withprecompile_warms_direct_vs_ps_and_hits_in_fresh_processandprecompile_warms_hlsl_static_samplers_and_reports_base_shiftamong them.cargo test -p xcl --lib -- shaders::: 10 passed, 0 failed on both cards. 1 SKIPPED, the same onmain:pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache).Not tested: the D3D12 debug-layer tests (no
d3d12SDKLayers.dllhere either), a retail pack, Intel.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@luckyteagirl on GitHub · 2026-11-26 02:30 UTC · original
Tested — AMD Radeon RX 6800M
a3312c055cf3a31f77bcb7b1e278b7479d29dc41(clean detached worktree). Windows 11 Home 10.0.26200, Ryzen 9 5980HX, RX 6800M driver 30.0.13002.13003, rustc 1.99.0, DXC 1.9.2609.5, debug build.XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=1, andXCL_DXC_DIRto the local DXC 1.9.2609 x64 directory. Rancargo test --locked -p xcl --test shaders_e2e -j 1 precompile_warms_ -- --test-threads=1 --nocapturein an isolated target directory under a memory guard: 2 passed, 0 failed, 0 ignored, 8 filtered; noSKIPPEDlines; guard did not trigger.warm_translate_dxc_ms=5.452,native_pso_ms=5.909.warm_translate_dxc_ms=4.994,native_pso_ms=18.077.The child tests assert warm
translated/v2hits and zero DXC compiles on those hits. The numeric native PSO timings show that both cases reachedCreateGraphicsPipelineState. The child inheritsXCL_ADAPTER=6800M; this machine's matching hardware adapter is the RX 6800M. The helper only falls back to WARP when no adapter matches, so this is RX 6800M native-driver evidence rather than a pass inferred from the outer test status alone.Not tested: full workspace suite on this head, release profile, a retail shader archive or paired title smoke, other GPUs, and whether the changed path improves title behavior. Timings are single samples, not a performance comparison.
AI use: OpenAI Codex (GPT-6; exact serving variant unavailable) and a Luna subagent selected the focused test, ran it, checked the exact-head log and adapter-selection code, and drafted this report.
@DavidM1911 on GitHub · 2026-11-26 02:33 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on--test-threads=1rerun (1308 passed, 0 failed, 27 ignored, 79s). Intermittent single-test flake — tracked in #1978.Thanks!
— Devin
@luckyteagirl on GitHub · 2026-11-26 05:36 UTC · original · reviewed
The new VS/PS path increments
compiledafter every successfulconsole_to_dxil_in, including a hit from its in-memory or translated disk cache. That function returns onlyCompiled, so a second--precompilerun can reportcompiled 2, already cached 0for graphics variants even when both came from the cache. The HLSL loop below distinguishes hits. Could the graphics path expose/count the cache outcome (or use a separatewarmedcounter) and add a warm second-run assertion for the summary? Source review ata3312c055cf3a31f77bcb7b1e278b7479d29dc41; I did not run the precompile command. AI-assisted review with Codex.@SzczepanGrela on GitHub · 2026-11-26 06:21 UTC · original · edited 2026-11-26 09:01 UTC
Updated Linux/Wine verification of head
2d229b9f76b605edffed09419328dc2245b97e8aagainstmainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. Unmodified source snapshots, release, existing synthetic fixtures only.Tested
26.3.1-arch3.5, Ryzen 7 7700, CachyOS kernel7.3.0-5-cachyos, GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton8293130ebe370b1+(local asserts-disabled build), DXC1.9.2602.17, Rust1.97.1, MinGW GCC16.2.0. DXGI logs identify the RX 9070.cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --test shaders_e2e --no-run.--nocapture --test-threads=1, then--nocapture --test-threads=4.XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64 XCL_NETWORK=0 VKD3D_SHADER_CACHE_PATH=0, natived3d12,d3d12core,dxgi, andXCL_DXC_DIRpointing to DXC. Application caches and working directories were separate per revision and run; the two graphics fixtures also create their own temporary caches.b49be182d229b9b49be182d229b9Both fresh-process graphics fixtures passed their cold
compiled 2, already cached 0, errors 0and warmcompiled 0, already cached 2, errors 0assertions. They also passed the warmtranslated/v2and zero-DXC-hit assertions; the HLSL fixture checked the distinct PS(base=1) cache miss and DXIL. Native graphics PSO creation completed in both fixtures in both thread modes, with numeric timings and no GPU skips. These runs are correctness checks, not a performance comparison.The earlier static-review item is addressed in source:
time_native_graphics_psoreturnsResult<Option<f64>, String>, propagates root-signature and PSO errors, and both callers useexpect. Genuine no-device returns callrunner::skip_test. The successful runs above did not force either error branch.Not tested
Full workspace suite, retail archives or workloads,
scripts/smoke.ps1, rendered-image correctness, native Windows, NVIDIA/Intel, unavailable-device behavior, forced PSO failures, or cold-cache performance. No title-level regression or FPS result.AI use
OpenAI Codex (GPT-6; exact serving variant unavailable) reviewed the changes, built and ran both revisions, checked source hashes and raw logs, and prepared this update for the account owner's review.
a3312c055cto2d229b9f76@Decodere on GitHub · 2026-11-26 06:43 UTC · original
Thanks @luckyteagirl and @SzczepanGrela — pushed
2d229b9faddressing both review items:recomp::pso::console_to_dxil_in_statusreturning(Compiled, bool)(from_cache) and wired it intoshaders.rs::precompile(CS, VS, and PS) so in-memory andtranslated/v2hits incrementalready cachedinstead ofcompiled. Bothshaders_e2etests now verify coldcompiled 2, already cached 0, errors 0followed by a warm second--precompilerun reportingcompiled 0, already cached 2, errors 0.time_native_graphics_psoto returnResult<Option<f64>, String>so root-signature andCreateGraphicsPipelineStatefailures fail the test with the exact error / HRESULT once a D3D12 device is created, while genuine no-device environments route throughrunner::skip_test("no D3D12 device").shaders_e2e(10/0/0,0skipped), full release workspace (1437/0/47), and paired 60 s RTX 4060 smoke (1546frames,60 60 60,0removals/crashes).@KDenKC on GitHub · 2026-11-26 08:04 UTC · original · edited 2026-11-26 13:28 UTC
Retail title, RTX 5090: the large graphics pipelines now start their driver compile within milliseconds instead of seconds. One 600 s run per side. Our control's precompile was compute-only (see Not tested).
Setup: RTX 5090 32 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11, release,
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1 XCL_NETWORK=0.mainb49be18+ this PR ata3312c05+ #2551 (3567b2e).2d229b9fdiffers only in the counters and tests.xcl shaders <pack> --precompile --used-only --pipelines(graphics included) took 42.3 min: 26,503 shaders, 0 errors;PS warmed at assumed sampler_base=0: 12101 (5765 with static samplers); VS with static samplers shifting paired PS base: 173; 2,812 pipelines, 0 refused.mainb49be18, precompiled with--only cs.Large graphics pipelines (≥ 200 KB DXIL) in the world-start stall (no frames shown). Gap = time from the previous driver compile finishing to this one starting, from the
driver compile start/finishtrace lines:The rest of the stall is the NVIDIA driver's own compile, which this PR does not change. Run-wide graphics compiles with no driver blob: 1,328 taking 106.7 s on the control, 1,447 taking 131.1 s here.
Run totals: both reached 600 s with no removal or crash. Frames shown: 2,163 (control) vs 2,117. Two-second windows with no frame after 120 s: 206 vs 215 of 240. These totals are not a fair A/B, for two reasons:
--used-onlycame from a 200 s run that never reached them.Not tested
mainwith its own full--precompile(graphics included) as the control. That is the cleaner A/B for this PR, and we can run it if useful.2d229b9fitself (only its diff againsta3312c05was read).sampler_base > 0pixel shader paths.AI use: Claude Code (Claude Opus 5.5) built and ran both sides. Gemini (Antigravity) extracted the trace numbers. Claude Code recomputed the gap table from the raw logs and wrote this.
@DavidM1911 on GitHub · 2026-11-26 08:29 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
@Aniseto on GitHub · 2026-11-26 08:32 UTC · original
Ran the shaders end-to-end tests at
2d229b9:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves 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 new fresh-process tests pass here. The timings printed on this adapter were
warm_translate_dxc_ms=3.738 native_pso_ms=12.321(direct VS+PS) andwarm_translate_dxc_ms=3.191 native_pso_ms=21.054(HLSL static-sampler VS+PS). They are single runs, not a benchmark.What this adds: the hardware reports in the thread are on an RTX 4060 (Ada) and WARP, at the earlier head
a3312c0. This is a Blackwell wave32 part at the current head2d229b9, which addressed the review findings.Not tested: a full retail shader archive, a paired 60 s smoke run, the whole workspace suite, AMD and Intel GPUs, native wave64, Wine, release profile, title 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.
github-bot referenced this pull request2026-11-26 12:40:17 +00:00
@KDenKC on GitHub · 2026-11-26 13:28 UTC · original
Correction to 7186156070, with the cleaner control I offered there.
mainb49be18with its own full--precompile --used-only --pipelines(graphics included, 42 min, 0 errors), the same recipe otherwise (200 s warm-up, then 600 s):main, compute-only precompilemain, full precompileSo the large drop in my earlier comment comes mostly from precompiling graphics at all, which
mainalready does. In this measure, this PR takes it from ~23 ms to ~6 ms median (129 to 8 ms worst). I've put a note at the top of the earlier comment.The full-precompile
mainrun used an exe name with a warmer NVIDIA cache. The gap is XCL-side, so that shouldn't move it, but I'm noting it. That run ended with the #2403 removal at 577 s.AI use: Claude Code (Claude Opus 5.5) ran the control, recomputed the gaps from the trace lines and wrote this.
@CryingLaughing on GitHub · 2026-11-26 16:00 UTC · original
Hosted
xcl runverification on currentmainafter #2555. The supported vertex shader warmed correctly. An unsupported loose vertex shader also exposed a startup regression.Five launches compared clean
main8b957bec6f82495aec940944c6bf47faa02db590with its unmodified Git three-way merge with PR head2d229b9f76b605edffed09419328dc2245b97e8a(tree7a620e2bf3335ace3a34de65826b4c964985ad8b). RTX 4080 driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC, DXC 1.8.2502.11, debug. Each used the same synthetic guest, isolated caches, andxcl run <fixture> -- --pr2600-vs-onlywithXCL_DIRECT_DXIL=all XCL_ADAPTER=4080 XCL_ASYNC_PSO=0 XCL_PSO_DISK_CACHE=0 XCL_HEAP_WINDOWS=0 XCL_UMA_WINDOWS=4.24acc6835ffb0a75_Vertex_0_4_1.binbefore the guest ran. A fresh integrated process with only that cache entry and no loose shaders created the same PSO, retained the entry byte for byte, and emitted no targeted direct compile dump or fallback.v_cvt_off_f32_i4, and the guest still requested the separate supported VS. Main reported 0 errors, 1 skip, ran the guest to its PSO marker, and exited 0. The integrated build reported 1 error, 0 skips, loggedincomplete translation, missing: ["v_cvt_off_f32_i4"], and exited 2 before guest entry.Could the hosted path preserve the old skip behavior for incomplete translations? Routing that case through the existing per-program handling would keep the successful cache warmup and let launch proceed past an unused unsupported shader.
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.