Recompiler: defer large per-lane compute shaders to compact direct DXIL #2786
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2796"
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 Saksukella on 2026-11-26T13:42:48Z.
Under
XCL_PER_LANE=1,pso::direct_compute()previously ranlower_dxil::compute_with()beforegpu::dxil::kernel::translate_compute_rodata()and returned immediately onOk(k), bypassingcompact::automatic_plan()andsplit_compute(). As a result, large repetitive branch-heavy compute shaders emitted monolithic multi-megabyte DXIL and triggered large driver-compiler commit spikes. This PR routes compact-qualified compute shaders throughpso::choose_compute_kernel()first (falling back to per-lane on error rather than dropping to HLSL) and caps per-lane compute DXIL at512 KiBwhen a smaller or split per-instruction alternative is available.What is in it
crates/xcl/src/gpu/dxil/mod.rs: makecompactpub(crate).crates/xcl/src/gpu/dxil/compact.rs: addprefers_compact(code, split_compute)backed byautomatic_plan_impl(&cfg, None, split_compute)so early deferral requires bothlarge()(orsplit_compute && atomic_candidate()) andautomatic_planrepetition/table-size qualification.crates/xcl/src/gpu/recomp/lower_dxil.rs: addpub(crate) const MAX_COMPUTE_DXIL_BYTES: usize = 512 << 10.crates/xcl/src/gpu/recomp/pso.rs: addchoose_compute_kernel()indirect_compute()so:pso::direct_compute()rather thanlower_dxil::compute_with()(keepingxcl shadersper-lane coverage surveys clean);translate_compute_rodata(), it logs a warning and falls back tolower_dxil::compute_with()instead of dropping straight to HLSL;512 KiB, it compares againsttranslate_compute_rodata()(logging warnings on error) and picks whichever is split or smaller;#[cfg(test)] mod pr2796_tests.crates/xcl/src/gpu/dxil/compact_tests.rs: addprefers_compact_requires_both_large_and_automatic_planverifying large repetitive programs defer while small and large non-repetitive programs do not.Tested
32.0.32029.2010), AMD Ryzen 9 7900X, 32 GB RAM, Windows 11 Pro (build26200),rustc 1.100.0 (0ef1bc386 2026-11-09); debug (tests) and release (xcl.exe).cargo test --lib -p xcl pso -- --test-threads=4: 250 passed, 0 failed, 1 ignored (2.69s), including all 3pr2796_testscases (SKIPPED:shaders::tests::pso_measurement_compiles_an_exact_synthetic_recordrequires Windows Developer Mode).cargo test --lib -p xcl prefers_compact -- --test-threads=4: 1 passed, 0 failed (0.20s).cargo check --workspace: passed.Regression run
Not tested
cargo test --workspacerun (targetedpso+prefers_compactsuites +cargo check --workspace+ 60sTitleID 7952987Asmoke run were executed).AI use
automatic_planrebase,choose_compute_kernelunit test authoring, and verification; all diffs, tests, and hardware smoke runs were verified locally.Imported from ivall/xcl. Originally posted by ettehn on 2026-11-26T13:47:25Z.
Independent Windows/NVIDIA check on
7a8056faf35e7c24d38e639ae893b89ff775a2c0. The only local change was a test probe using the existing syntheticrepeatedfixture. The default selection produced byte-identical output to the expected forced form in both cases.A single-block fixture independently confirmed the instruction gate:
compact::largewas false at 9,999 non-terminators and true at 10,000. Two existing small GPU tests confirmed plain/compact output parity and matching loop-budget behavior.Windows 11 build 26200, Ryzen 9 8945HX, RTX 5070 Ti Laptop GPU (12 GB, driver 621.24), Rust 1.97.1 MSVC debug, DXC 1.8.2502.11,
XCL_ADAPTER=NVIDIA XCL_REQUIRE_GPU=wave64:4 passed, 0 failed, 0 ignored, no reported skips. The threshold fixtures were translated only. This run did not measure NVIDIA driver compile commit, run the full workspace suite, or launch a retail title.
OpenAI Codex assisted with the probe and verification. The exact model identifier was unavailable in this session.
Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-26T14:25:32Z.
Update for head
960f4fc: still passes on both cards. On the neweramd-devc32c91a,gpu::dxil::compactplus the new test gives 13 passed, 0 failed, 0 SKIPPED on the RTX 3060 and the RX 9070 XT,per_lane_compute_defers_branch_heavy_program_to_compact_pathok on both.Update for head
efb6e48: same result on both cards. Onamd-devb5c0275,gpu::dxil::compactgives 12 passed, 0 failed, 0 SKIPPED on the RTX 3060 and the RX 9070 XT (11 without the PR), and the newper_lane_compute_defers_branch_heavy_program_to_compact_pathpasses by name on both.NVIDIA run for the Not tested line, with the RX 9070 XT from the same PC.
Tested: pass, head
7a8056fapplied on its baseamd-devb5c0275, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, card picked withXCL_ADAPTER.cargo test -p xcl --lib -- gpu::dxil::compact --test-threads=4 --nocapture:amd-devwithout the PR gives the same counts on both cards.Not tested: a title run or the
cs 56c0cd3b82a00c6edriver compile on NVIDIA; Intel.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by Saksukella on 2026-11-26T14:32:37Z.
Follow-up in \
efb6e48e: during live \XCL_PER_LANE=1\ testing we found \lower_dxil::compute_with()\ in \pso.rs\ returned before \gpu::dxil::kernel::translate_compute(), bypassing \compact::large()\ and still emitting \2,673,860 B\ DXIL for \cs 56c0cd3b82a00c6e. Deferring \compact::large(&cfg)\ out of \lower_dxil::compute_with()\ (and falling back when per-lane DXIL exceeds \512 KiB\ and compact/split is smaller) now routes \cs 56c0cd3b82a00c6e\ through compact form at runtime (\160,534 B, \16.7x\ smaller), cutting 180s RX 9070 XT peak commit from \63,298 MB\ to \34,190 MB\ (-29.1 GB). Re-verified with \7/7\ CPU \compact\ tests and fresh 60s RX 9070 XT smoke (\1661\ frames, \60 61 60, \Imported from ivall/xcl. Originally posted by frozht on 2026-11-26T14:59:05Z.
Test report on a retail compute shader that crosses the new threshold but does not take the compact form. Linux/RADV, tested at head
7a8056fa(beforeefb6e48e), not onamd-dev.Setup: RX 7900 XT 20 GB (gfx1100), Mesa 26.2.6 RADV, vkd3d-proton
30b0eb9bunder Wine (wine-staging 11.22), Ryzen 9 5900X, 32 GB, Linux 7.3, release build (x86_64-pc-windows-gnu). Base:mainb49be183+ #877, #684, #1993, #2127 (our Wine stack).7a8056fawas cherry-picked on top (one conflict incompact.rsaroundautomatic_plan, resolved by keepingmain'sautomatic_plan), plus a local print of thecompactdecision inputs. Shader: retail title from #505,cs 84eee477d68b6fdf, built alone offline withxcl shaders <pack> --measure-psoandXCL_DIRECT_DXIL=1, under a 12 GB memory cap.7a8056fa)compact::large()wanted)So the lower threshold now asks
wanted()about this shader, the dedup gate keeps it plain, and the output does not change. Nothing regresses for this shader. It also gets no benefit, but it does not need one: on the direct path RADV builds it in ~3.8 s.For context, not about this PR: the same record through the default HLSL → DXC path (1,403,484 B DXIL) never finishes on RADV. ACO's register spiller grows past 12 GB within ~50 s, and a debug Mesa 26.2.6 build hits the spiller assert of https://gitlab.freedesktop.org/mesa/mesa/-/issues/15722. So the large-shader commit spikes the PR describes for AMD's Windows driver have a Linux counterpart on the HLSL path, which compact form does not reach.
Not tested: head
efb6e48eand theXCL_PER_LANEpath; theamd-devbase; Windows; the PR's unit tests (not run here); an in-game run with the PR.AI use: Claude Code (Claude Opus 5.5) built the probe, ran the measurements and wrote this report. Numbers checked against the run logs before posting.
Imported from ivall/xcl. Originally posted by Saksukella on 2026-11-26T15:52:28Z.
Rebased cleanly onto
amd-dev(c32c91a3, which already picked up Part 17a8056fain53995420) at960f4fc2.This PR now contains only the remaining
XCL_PER_LANE=1deferral to compact/split direct DXIL (lower_dxil::compute_with()+pso.rs::direct_compute()fallback totranslate_compute_rodata()), verified with 8/8 CPUcompacttests and a fresh 60s RX 9070 XT smoke (1,655frames,60 60 60,0crashes,0device removals,15,221 MBpeak commit).[PR #2796] DXIL: trigger compact form on branch-heavy shaders to prevent driver compile commit spikesto [PR #2796] Recompiler: defer large per-lane compute shaders to compact direct DXILImported from ivall/xcl. Originally posted by Aniseto on 2026-11-26T16:27:23Z.
Ran the compact-DXIL and per-lane routing tests at
960f4fcon 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.
All 12 pass, including the new
per_lane_compute_defers_branch_heavy_program_to_compact_pathand fivegpu_*tests that compile and run compact DXIL on the real adapter. This is the rebased head960f4fc(targetsamd-dev); the NVIDIA report from ettehn in the thread was on the earlier head7a8056fa, and DarkPanda69 checked this head on other cards. This adds a desktop Blackwell part on driver 32.0.16.2124 with DXC 1.9.2609.5.Not tested: the large branch-heavy program behind
XCL_PER_LANE=1from the description, the full workspace suite, a paired 60 s smoke run, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, 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 bielfreedom on 2026-11-26T17:22:34Z.
AMD Windows data for #2796: on an RX 9070 XT, the new thresholds change one retail compute program out of 2,689. That program builds about 1.6× slower in AMD's driver and with 4× the peak memory. On
mainit is split into 11 pieces; the compact form replaces them with one whole program.First, the branch. It now carries 256 commits against
main(77+ files) and does not merge cleanly. I measured only this PR's own threshold commit (7a8056f): thecompact::largechange, applied by hand ontomainb49be18. The newer960f4fcdefers large per-lane compute programs to the compact form. As far as I can tell, the per-lane path is the 32-lane-GPU one, which this native wave64 card does not take; I did not build it.Setup
xcl shadersthat writes every program's DXIL size and everyCreateComputePipelineStatetime to a file.xcl shaders <retail shaders.rpf> --precompile --only cs [--pipelines]withXCL_DIRECT_DXIL=1,XCL_PSO_DISK_CACHE=0, one driver thread, and a fresh translation cache and exe name per run, so every build is cold.Which programs change, all 2,689 compute programs (translation only)
mainb6101d83892d44a5, 865,336 → 278,384 B56c0cd3b82a00c6e, the example in the description, is already compact onmainhere, so it does not change.Driver,
b6101d83892d44a5alone, switch windows, 2 interleaved roundsmainSo on AMD this program was better off split. This looks like what #2810 describes for automatic compact lowering: the compact whole replaces a split plan that was available. One option is to leave the threshold alone for programs that already split.
Not tested: NVIDIA, GPU output, and a title run.
AI use: Claude Code (Claude Opus 5.5) built the binaries, ran the measurements and wrote this report; I posted it.
Imported from ivall/xcl. Originally posted by Saksukella on 2026-11-26T17:33:41Z.
Thanks for the thorough RX 9070 XT measurement! Two quick clarifications on the current PR head (
960f4fc2):amd-dev(notmain) and is a single commit (960f4fc2, 2 files) cleanly on top ofamd-dev(c32c91a3).960f4fc2: The earliercompact::largethreshold commit (7a8056f) is no longer in this PR — it was already picked intoamd-devas53995420. What remains here is solely theXCL_PER_LANE=1deferral (lower_dxil::compute_with()returningNonefor large branch-heavy programs sopso.rs::direct_compute()falls back totranslate_compute_rodata()). WhenXCL_PER_LANE=1is enabled (including on RX 9070 XT runs testing per-lane lowering),cs 56c0cd3b82a00c6epreviously bypassedtranslate_compute_rodata()and emitted a 2.67 MB (32,279-block,36,143-PHI) per-lane DXIL blob; with960f4fc2it takes the standard split/compact direct DXIL path (160 KB).Your
b6101d83892d44a5finding (compact whole vs 11-piece split, matching #2810) is great data for the53995420threshold already onamd-dev, and is orthogonal to960f4fc2since960f4fc2defers directly totranslate_compute_rodata()'s normal split/compact selection.Imported from ivall/xcl. Originally posted by bielfreedom on 2026-11-26T17:40:17Z.
Correction to my comment above. This PR's base is
amd-dev, notmain, so my note on 256 commits was wrong: againstamd-devit is one commit. The threshold change I measured is already onamd-devas53995420. I reran everything onamd-devc32c91a, on the same RX 9070 XT, the same way.53995420onamd-dev(A/B by reverting it)amd-dev's defaults, 1,616 compute programs are translated (XCL_RT_GATE=holdholds back 1,073). Again onlyb6101d83892d44a5changes: plain 611,608 B → compact 171,240 B with switch windows, and 461,036 → 142,872 B with heap windows.XCL_RT_GATE=0, 2 interleaved rounds:amd-dev53995420revertedSo on
amd-devthe compact whole builds about as fast as the 11 pieces. The 1.6× slowdown I reported ismain's compact form only. The peak memory still roughly doubles, which matters little at 1.25 GB.This PR's own commit (
960f4fc) onamd-dev: no DXIL byte changes on this native wave64 card, over the 1,616 programs translated by default, as expected for the per-lane path.AI use: Claude Code (Claude Opus 5.5) built the binaries, ran the measurements and wrote this correction; I posted it.
Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-26T17:52:44Z.
Tested - retail title on native Windows AMD RDNA2, PR head
960f4fc230fd610b2f64a448801edf9d2d4f7ca4onamd-devc32c91a3Tool: OpenCode with DeepSeek V4.1 Flash 1017
Windows 11 IoT Enterprise LTSC 26100; release build; DXC 1.9.2602.17.
cargo test --release -p xcl --lib -- gpu::dxil::compact --skip gpu_:8 passed, 0 failed, 0 ignored, 0 skipped, 1638 filtered out, including
per_lane_compute_defers_branch_heavy_program_to_compact_path.XCL_PER_LANE=1 XCL_DIRECT_DXIL=1plusXCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=1 XCL_RUN_SECONDS=240, no other XCL_* variables;warm shader/pipeline caches; baseline first, PR second.
amd-devc32c91a3960f4fc2The deferral fires on this title: the PR logs 7
large/branch-heavy compute program: deferring to per-instruction/compact direct DXILlines between 116 s and 218 s; the baseline logs none.Both trees then log
direct DXIL compact form: 20965 blocks of 672 kinds(baseline 129.9 s,PR 129.5 s). That is the compact form the report gives for
cs 56c0cd3b82a00c6e, so on thispart the baseline already reaches it; the line itself does not name the shader.
Peak commit and presents are unchanged, so the 36+ GiB per-lane spike does not reproduce here:
the largest driver compile is 0.44 MB DXIL on the baseline and 0.36 MB on the PR, against the
2.6 MB DXIL in the report. Under
XCL_PER_LANE=1both trees skip many draws and stoppresenting around 105 s; the title still stalls on its loading screen, so there is no world or
FPS comparison. No crash, 0 failed pipelines, 0 DXIL failures, 0 errors. The baseline's last
frame dump was black (0 non-dark samples) and the PR's was not; both come from the stalled
screen, so I do not treat that as a regression.
Not tested: the standard non-per-lane path (this change only runs under
XCL_PER_LANE),NVIDIA/RDNA4, world/FPS, full workspace, debug build.
AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests, read the logs and wrote this comment; the figures and the deferral/compact lines were checked against the run logs.
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T13:48:34Z.
Two contributors checked independently and found that #2341 solves the same problem (for #2688) in a different way: #1607, group D150. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-27T17:11:34Z.
Review of
960f4fc2(baseamd-dev), diff only; I did not build or run it. Four readers reached the same verdict independently, so these are one set of findings:large(), notwanted().compute_withnow refuses any program withcompact::large(&cfg)(2000 blocks or 10000 instructions), but the compact form is only taken whencompact::wantedalso holds (mostly repeated blocks, small tables). The shader84eee477in this PR's comments (834 blocks, 16,713 instructions) islargebut notwanted, and gives a byte-identical 958,940 B result: it only pays an extra CFG build and a doomed translation. A program that islargebut notwantedalso loses the old per-lane output and falls totranslate_compute_rodata.translate_compute_rodata(...)?inpso.rs::direct_computefails for a deferred program, the error goes up to HLSL/DXC, where the old code returnedOk. The over-512 KiB branch keeps the old output; the early-defer branch should do the same (or the PR should say why per-instruction always wins).if let Ok(alt) = translate_compute_rodata(...)drops the error, so a >512 KiB per-lane blob is kept with no log line. Log the error.amd-devtip (7c795f5e).Compiled.dxilis built withk.dxil.into()there (I checkedpso.rsaround lines 1054 and 1064); the diff still builds it from a plainVec<u8>.56c0cd3b, hard caps of 20k instructions and 1 MiB). The two need one threshold and one byte limit before either merges; one reader suggests #2341 first formain, then this PR replacing its hard errors incompute_withwith thelarge()pre-gate and the compare-and-keep inpso.rs.XCL_PER_LANE(where this PR does nothing), insidetranslate_compute_rodata, and the 509,896 B record is below the 512 KiB line; #2947 addressed it. This PR sends more programs into that same path.The unit test fails without the fix, but only pins the 2000-block gate in
compute_with: it does not coverpso.rs, the 512 KiB branch, or the 10000-instruction threshold.AI use: Gemini 4 Hydrogen High (agy2 and agy3, Antigravity) and Muse Spark 1.3 (o5, pi) each read this PR's diff, comments and the touched code and wrote their own report; Claude Code (Claude Sonnet 5.5, coordinator) compared the reports, checked findings 4 and the
large()/wanted()split againstamd-dev7c795f5e, and wrote this text. The rest was not re-verified by the coordinator. Nothing was built or run. The comment was posted without the account owner reading it first.Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-27T19:42:26Z.
merge-check
base:
7c795f5eefhead:
960f4fc230merge: clean
build: cargo build --workspace -> failed (pso.rs:1055 and :1068:
Compiled.dxilis nowArc<Vec<u8>>, the PR passesVec<u8>; two E0308 errors on amd-dev7c795f5e)tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run on the PR as is (the lib tests do not compile). Base amd-dev: 1802 passed, 18 failed, 48 ignored. With a local
.into()added at the two sites (not in the PR): 1802 passed, 19 failed, 48 ignored; failing: the 18 base failures (fuzz_validate_and_gpu_1, dispatch_chain_native_wave64_builds_whole, f32_programs_on_the_gpu, console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly, 4 list_x tests, the e2e/offline-pipeline tests, and others, all failing on the base too) plus compositor_releases_root_sig_and_rejects_invalid_planes, which is flaky (fails in some full lib runs on base+PR, passes alone and in other full runs; unrelated code). The new per_lane_compute_defers_branch_heavy_program_to_compact_path passes.review: Read the whole diff (4 files, +38/-2) and iggyvilla's 17:11Z review of this head. In the merge result: (1) HOLDS: compute_with defers on compact::large() (2000 blocks / 10000 instructions) without wanted(), so a large but not repetitive program loses the per-lane output and pays a CFG build for nothing. (2) HOLDS: after the early defer,
translate_compute_rodata(...)?in pso.rs direct_compute still ends in?for a deferred program, so an error there goes to HLSL/DXC instead of keeping the per-lane DXIL. (3) HOLDS:if let Ok(alt) = translate_compute_rodata(...)in the over-512 KiB branch drops the error with no log line. (4) HOLDS, and is a blocker: the PR no longer builds on amd-dev7c795f5e(see build). (5) Overlap with #2341 (same function, caps): not checked here. (6) Not re-checked; the diff changes nothing for runs without XCL_PER_LANE=1. Test gap holds: the unit test pins only the 2000-block gate in compute_with, not pso.rs, the 512 KiB branch or the 10000-instruction gate. Needs a rebase and the fixes above.performance: Only runs under XCL_PER_LANE=1 (off by default): no cost by default. With it on, large programs take the compact/split form (less commit per the PR's and relativespace2K's reports); a large non-repetitive program pays an extra CFG build plus a translation that yields the same DXIL. No title run: not done because the build fails.
verdict: not yet: rebase onto amd-dev (Arc<Vec> change at pso.rs 1055/1068), then the review points 1-3 and the test gap
hardware / tool and model: AMD Radeon RX 7800 XT (RDNA3, 16 GB), driver 32.0.31035.1003, Windows 11 build 26200, AMD Ryzen 7 5700X3D, debug build, rustc 1.100.0; Claude Code (Claude Sonnet 5.5)
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T12:30:05Z.
merge-check claim
head:
960f4fc230Imported from ivall/xcl. Originally posted by throny on 2026-11-28T12:45:28Z.
merge-check
base:
7c795f5e(amd-dev)head:
960f4fc230merge: clean
build: cargo build --workspace -> FAILED (2 x E0308)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run (the merge result does not build)
review: blocking: merged onto the current amd-dev it does not compile, although GitHub shows no conflict: Compiled::dxil is an Arc<Vec> on the branch now and the PR's two new returns pass a plain Vec (E0308 at gpu/recomp/pso.rs:1055 and the second site). Also still open from the first check: the early defer uses the size test without the wanted test; a failed rodata translation still sends a deferred program to HLSL; one error is dropped without a log line; and the per-lane survey in 'xcl shaders' now counts large programs as per-lane failures.
performance: the route changes only with XCL_PER_LANE=1 (off by default), but the source change alters the direct-DXIL identity, so every tester re-translates the compute shaders once.
verdict: not yet: rebase (.into() at both sites) and the open points of the first check; I will rerun on the new head.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read). An NVIDIA card: it says nothing about AMD driver behaviour, so a check from an AMD tester is the one that counts for that.
Imported from ivall/xcl. Originally posted by Saksukella on 2026-11-29T00:09:52Z.
@throny Rewritten cleanly onto
main(227d2cb388) and retargeted this PR's base branch tomain.Summary of changes addressing review feedback:
main'scompact::automatic_plan&Compiled:compact::prefers_compact(code, o.split)now delegates directly toautomatic_plan_impl(&cfg, None, split_compute)(checkinglarge()/atomic_candidate, table-word cap, and repetition ratio) so large non-repetitive programs do not pay a doomed compact attempt or lose per-lane lowering.Compiledpreservesdispatch_remap: None.pso::choose_compute_kernel(). When aprefers_compactshader failstranslate_compute_rodata(), it logs a warning and falls back tolower_dxil::compute_with()instead of dropping straight to HLSL. In the> 512 KiBcomparison branch, errors fromtranslate_compute_rodata()are logged viaxlog_warn!before keeping the per-lane DXIL.xcl shadersper-lane survey: Early deferral lives inpso::direct_compute()rather thanlower_dxil::compute_with(), soxcl shadersdoes not count deferred large shaders as per-lane lowering failures.cargo test --lib -p xcl pso -- --test-threads=4: 250 passed, 0 failed, 1 ignored (includingpr2796_testsproperly gated under#[cfg(test)]).cargo test --lib -p xcl prefers_compact -- --test-threads=4: 1 passed, 0 failed.cargo check --workspace: passed.smoke.ps1(TitleID 7952987A, headd01016e37de3):1689frames shown (main227d2cb388:1674),0device removals,0crashes,17683 MBpeak commit.Imported from ivall/xcl. Originally posted by throny on 2026-11-29T00:30:05Z.
merge-check claim
head:
d01016e37dRe-check of the head rebased onto main.
Imported from ivall/xcl. Originally posted by throny on 2026-11-29T00:47:00Z.
merge-check
base:
fa204595head:
d01016e37dmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2612 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at
fa204595: 2608 passed, 0 failed, 49 ignored.review: re-check of the rewrite onto main. Of my earlier points: the build failure is moot on main; the fall to HLSL after a failed compact translation and the dropped error are answered (it falls back to per-lane and logs); the routing moved out of the lowering into one chooser, which answers the survey point as far as read. Partly answered: the choice "prefers compact" is now made from size, table words and repetition, but without the lowering data the real plan uses, so it can pick compact where the real plan would not; the program then gets plain per-instruction output, which is valid, only not what was intended. New: XCL_DIRECT_COMPACT=0 is not honoured by that choice. The main issue is #2341, which I checked as safe yesterday and which aims at the same thing: both insert at the same spot (the second to merge conflicts), and if both land, #2341's refusals make most of this PR's routing unreachable. One of the two should be merged, not both; this one is the more careful routing, #2341 the smaller one. That is a maintainer's choice, and it qualifies my "safe" on #2341 in the same way. Process: AI use names no model, and the smoke run does not reach this code without XCL_PER_LANE=1.
performance: with the switch on, giant programs avoid the per-lane form. It changes direct-DXIL sources (every direct-DXIL entry is re-translated once) and a file in the pipeline-layout list (I did not trace what that rebuilds).
verdict: not yet: decide between this and #2341 first; then honour XCL_DIRECT_COMPACT=0 and name the model.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:58:26Z.
Triage (#1607) – head
d01016e#2341 (D150, merged as
640a8e0e) addressed the same problem on main:lower_dxil::compute_withnow refuses programs of 20,000 or more instructions and per-lane DXIL over 1 MiB, so they fall back to the per-instruction/compact form. This PR solves it differently: it prefers the per-instruction form whenevercompact::automatic_planqualifies (10,000 insts, 2,000 blocks, or split atomic candidates), and it caps per-lane at 512 KiB, keeping the smaller form. It conflicts with main'spso::direct_compute. After a rebase it should explain what it adds beyond #2341's caps. On the compact-preferred path, a per-instruction failure is not recorded incoverage::record_fallback.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.