Recompiler: preserve compute prologue dominance in direct DXIL #3154

Merged
KaniaKrzysztof merged 2 commits from upstream-pr/3154 into main 2026-11-30 01:36:04 +00:00
KaniaKrzysztof commented 2026-11-28 13:13:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KaniaKrzysztof on 2026-11-28T13:13:41Z.


Part of #1269 and #2088. A branched DispatchX prologue could reject direct DXIL twice on the same compute program. The first failure appended createHandleFromBinding after the entry terminator. With that repaired, compact lowering stored an EXEC value in entry before its phi was defined at the prologue join.

What is in it

  • ee1efda inserts lazy static sampler creation and annotation before the terminator and restores the caller's insertion state (dxil/lower_image.rs). The two-sampler fixture checks exact point/linear outputs and inactive sentinels (recomp/tests.rs).
  • 43902aa keeps each register alloca in entry and places its first store after the initializer's definition (dxil/lower.rs). Both DispatchX paths reach the join before the compact loop. The entry allocation dominates the store, the phi dominates its value, and the memoized slot is initialized once. Constants and entry loads retain their entry initialization. A forced-compact EXEC fixture covers full and partial groups (dxil/kernel.rs).

Tested

Edited after rerunning the full suite without the XCL_* overrides used in the earlier local setup. That setup overrode both the Agility SDK and DXC directories. The rerun passed on the same driver. We did not isolate which override caused the earlier failures.

Both clean checkouts ran scripts/test.ps1 with its default four test threads on an RTX 4090, driver 621.40. Both loaded the system D3D12Core 10.0.26100.9818 and Windows SDK DXC/DXIL 1.9.2602.17.

Revision Passed Failed Ignored Exit code
main 10d27297 2,152 0 48 0
PR head 43902aa2 2,153 0 48 0

All five previously failing texture tests and the D32S8 VRAM test passed on both revisions. The static-sampler and compact EXEC regression tests passed on the PR head. Each run reported 25 GPU skips. The nine optional XCL_SAMPLE_* inputs were unset.

Compilation and GPU timing. On the 2070, one affected program produced 1,214,520 bytes of compact DXIL, versus 9,370,880 bytes through the archived fallback. Translation wall time was 7.08 s versus 95.0 s. One repaired native PSO call took 38.91 s with 836 MiB process peak commit. The driver reported one creation, zero confirmed misses and one unknown. A cold native speedup is unmeasured.

During full-pack pre-menu shader preparation for a newer retail game on RTX 4090, PR head 43902aa2 rebuilt the affected compute shader from a private cache copy with its three prior translations set aside. The new compact DXIL was 1,214,520 bytes, down from 9,370,880 bytes for the archived HLSL fallback (87.0% smaller). Its SHA-256 matched the compact DXIL independently produced on RTX 2070.

On a synthetic 128-iteration wave32 loop, initial medians were 8.976 µs HLSL and 22.096 µs repaired compact (2.46×; 54 timestamps each). Three fresh-process comparisons of byte-identical guest inputs against a CPU oracle gave 8.992–9.008 µs HLSL, 21.920–21.968 µs historical compact (7f0eea29) and 21.856–21.952 µs repaired compact (120 timestamps per form per process). The overhead already existed on this loop.

Regression run

RTX 4090, newer retail game, 60 seconds per revision, networking off, startup preparation disabled, separate fresh XCL caches. Publisher provenance is unverified.

Main

xcl-smoke v1
commit: 10d272970f25b02b72ebe3c883d02d74d4d4763b
gpu: NVIDIA GeForce RTX 4090
title: newer retail game
seconds: 60
exit: 0x0
frames shown: 980 (PresentX 980)
presents per 2 s (last 3): 57 54 60
device removals: 0
crashes: 0
peak commit: 15515 MB

PR head

xcl-smoke v1
commit: 43902aa2a05f56f870f6db60fb9b46e47833c0e8
gpu: NVIDIA GeForce RTX 4090
title: newer retail game
seconds: 60
exit: 0x0
frames shown: 1042 (PresentX 1042)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15511 MB

The operator observed the menu on both revisions. Each log records the affected guest compute shader during startup. Neither log confirms that the repaired compact lowering ran or that the GPU dispatched that shader.

Minecraft Preview 4× MSAA. The startup crash has a verified fix in #1087. On November 24, 2026, Minecraft Preview 1.18.3064.0 reached the menu and completed 60 seconds on that PR’s head with 3,421 frames on RTX 4090 and 3,412 on RTX 2070, both with zero crashes and zero device removals. On November 27, an independent Intel Arc probe reproduced the default multisampled depth-view failure on the parent and verified the fix. #1087 remains open. Retail verification · Independent probe

Not tested

Execution and timing of the affected compute shader with representative in-game resources, and AMD hardware.

AI use

We used OpenAI Codex with GPT-6.2 Astra to investigate the two defects, write the fixes and synthetic tests, run validation on both hosts and prepare this report.

<!-- greyfinch-sync:ivall/xcl:issue:5540479315 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154). Originally posted by [KaniaKrzysztof](https://github.com/KaniaKrzysztof) on 2026-11-28T13:13:41Z. --- Part of #1269 and #2088. A branched DispatchX prologue could reject direct DXIL twice on the same compute program. The first failure appended `createHandleFromBinding` after the entry terminator. With that repaired, compact lowering stored an EXEC value in entry before its phi was defined at the prologue join. **What is in it** - `ee1efda` inserts lazy static sampler creation and annotation before the terminator and restores the caller's insertion state (`dxil/lower_image.rs`). The two-sampler fixture checks exact point/linear outputs and inactive sentinels (`recomp/tests.rs`). - `43902aa` keeps each register alloca in entry and places its first store after the initializer's definition (`dxil/lower.rs`). Both DispatchX paths reach the join before the compact loop. The entry allocation dominates the store, the phi dominates its value, and the memoized slot is initialized once. Constants and entry loads retain their entry initialization. A forced-compact EXEC fixture covers full and partial groups (`dxil/kernel.rs`). **Tested** *Edited after rerunning the full suite without the `XCL_*` overrides used in the earlier local setup. That setup overrode both the Agility SDK and DXC directories. The rerun passed on the same driver. We did not isolate which override caused the earlier failures.* Both clean checkouts ran `scripts/test.ps1` with its default four test threads on an RTX 4090, driver 621.40. Both loaded the system D3D12Core `10.0.26100.9818` and Windows SDK DXC/DXIL `1.9.2602.17`. | Revision | Passed | Failed | Ignored | Exit code | |---|---:|---:|---:|---:| | `main` `10d27297` | 2,152 | 0 | 48 | 0 | | PR head `43902aa2` | 2,153 | 0 | 48 | 0 | All five previously failing texture tests and the D32S8 VRAM test passed on both revisions. The static-sampler and compact `EXEC` regression tests passed on the PR head. Each run reported 25 GPU skips. The nine optional `XCL_SAMPLE_*` inputs were unset. **Compilation and GPU timing.** On the 2070, one affected program produced 1,214,520 bytes of compact DXIL, versus 9,370,880 bytes through the archived fallback. Translation wall time was 7.08 s versus 95.0 s. One repaired native PSO call took 38.91 s with 836 MiB process peak commit. The driver reported one creation, zero confirmed misses and one unknown. A cold native speedup is unmeasured. During full-pack pre-menu shader preparation for a **newer retail game** on RTX 4090, PR head `43902aa2` rebuilt the affected compute shader from a private cache copy with its three prior translations set aside. The new compact DXIL was **1,214,520 bytes**, down from **9,370,880 bytes** for the archived HLSL fallback (**87.0% smaller**). Its SHA-256 matched the compact DXIL independently produced on RTX 2070. On a synthetic 128-iteration wave32 loop, initial medians were 8.976 µs HLSL and 22.096 µs repaired compact (2.46×; 54 timestamps each). Three fresh-process comparisons of byte-identical guest inputs against a CPU oracle gave 8.992–9.008 µs HLSL, 21.920–21.968 µs historical compact (`7f0eea29`) and 21.856–21.952 µs repaired compact (120 timestamps per form per process). The overhead already existed on this loop. **Regression run** RTX 4090, **newer retail game**, 60 seconds per revision, networking off, startup preparation disabled, separate fresh XCL caches. Publisher provenance is unverified. Main ``` xcl-smoke v1 commit: 10d272970f25b02b72ebe3c883d02d74d4d4763b gpu: NVIDIA GeForce RTX 4090 title: newer retail game seconds: 60 exit: 0x0 frames shown: 980 (PresentX 980) presents per 2 s (last 3): 57 54 60 device removals: 0 crashes: 0 peak commit: 15515 MB ``` PR head ``` xcl-smoke v1 commit: 43902aa2a05f56f870f6db60fb9b46e47833c0e8 gpu: NVIDIA GeForce RTX 4090 title: newer retail game seconds: 60 exit: 0x0 frames shown: 1042 (PresentX 1042) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15511 MB ``` The operator observed the menu on both revisions. Each log records the affected guest compute shader during startup. Neither log confirms that the repaired compact lowering ran or that the GPU dispatched that shader. **Minecraft Preview 4× MSAA.** The startup crash has a verified fix in #1087. On November 24, 2026, Minecraft Preview 1.18.3064.0 reached the menu and completed 60 seconds on that PR’s head with 3,421 frames on RTX 4090 and 3,412 on RTX 2070, both with zero crashes and zero device removals. On November 27, an independent Intel Arc probe reproduced the default multisampled depth-view failure on the parent and verified the fix. #1087 remains open. [Retail verification](https://github.com/xcl-dev/xcl/pull/1087#issuecomment-7141973447) · [Independent probe](https://github.com/xcl-dev/xcl/pull/1087#issuecomment-7216619715) **Not tested** Execution and timing of the affected compute shader with representative in-game resources, and AMD hardware. **AI use** We used OpenAI Codex with GPT-6.2 Astra to investigate the two defects, write the fixes and synthetic tests, run validation on both hosts and prepare this report.
Aniseto commented 2026-11-28 13:34:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T13:34:46Z.


Ran the static-sampler-from-code test at bacb6f04 on 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.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_static_samplers_from_constants_in_code -- --test-threads=1
1 passed; 0 failed; 0 ignored; 0 measured; 2029 filtered out      (exit 0)

The test passes, covering the lazy static-sampler handle inserted before the entry terminator when a compute prologue branches. The PR description lists a full release workspace run that did not finish and twelve failures, six of them the known main failures from #3093; I ran only this targeted test, so I am not reporting a suite result. The PR has no comments yet.

Not tested: the full workspace suite, the forced-compact slot fixture, a paired smoke run, a retail title, 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.

<!-- greyfinch-sync:ivall/xcl:comment:7240035285 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7240035285). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-28T13:34:46Z. --- Ran the static-sampler-from-code test at `bacb6f04` on 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. ``` XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_static_samplers_from_constants_in_code -- --test-threads=1 1 passed; 0 failed; 0 ignored; 0 measured; 2029 filtered out (exit 0) ``` The test passes, covering the lazy static-sampler handle inserted before the entry terminator when a compute prologue branches. The PR description lists a full release workspace run that did not finish and twelve failures, six of them the known `main` failures from #3093; I ran only this targeted test, so I am not reporting a suite result. The PR has no comments yet. Not tested: the full workspace suite, the forced-compact slot fixture, a paired smoke run, a retail title, 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.
Royalflamejlh commented 2026-11-28 15:55:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-28T15:55:20Z.


At bacb6f04 (on main e429936c), a direct-only survey of a retail title's 1,636 compute programs translated 1,275 of them directly in the split wave64 form and 1,437 in the native wave64 form, against 708 and 1,000 on main; 0 validator failures, 0 panics, and no "instruction after a terminator" left in either form.

Setup: Linux, Wine 11.21 Staging, CPU only (no GPU), Rust 1.98.0, release, x86_64-pc-windows-gnu; xcl shaders <pack> --direct --sample 0 --split 1 and --split 0, 8 threads.

scratch_ptr (lower_mem.rs:2373) has the same pattern as the static sampler: it switches to init.entry to allocate xcl_scratch and appends after the guard's terminator. No compute program of this title reaches it (the survey is the same with it fixed), but this test fails at bacb6f04 with "direct DXIL builder error: instruction after a terminator in block Block(0)":

#[test]
fn compute_scratch_is_allocated_before_the_dispatch_limit_guard() {
    use crate::gpu::recomp::CsInterface;
    let code = prog(&[
        ("V_MOV_B32", "ENC_VOP1", &[("VDST", 1), ("SRC0", 133)], None),
        ("SCRATCH_STORE_DWORD", "ENC_FLAT_SCRATCH", &[("ADDR", 0), ("DATA", 1), ("SADDR", 0x7F)], None),
        ("SCRATCH_LOAD_DWORD", "ENC_FLAT_SCRATCH", &[("ADDR", 0), ("VDST", 2), ("SADDR", 0x7F)], None),
        ("S_ENDPGM", "ENC_SOPP", &[], None),
    ]);
    let cs = CsInterface { threads: [64, 1, 1], ..Default::default() };
    let ko = KernelOptions { wave64: true, split: false, mem_windows: 1, sampler_base: 0 };
    super::kernel::translate_compute(&code, ko, &cs).unwrap_or_else(|e| panic!("{}", &e[..e.len().min(800)]));
}

It passes with the same two lines your sampler change uses, in scratch_ptr:

                let cur = self.cur();
                let before = self.s.m.set_insert_before_term(true);
                self.s.m.set_block(self.init.entry);
                // … the alloca as it is …
                self.s.m.set_block(cur);
                self.s.m.set_insert_before_term(before);

Not tested: a GPU, Windows, the whole suite, a title run.

AI use: Claude Code (Claude Opus 5.5) ran the surveys and the test and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7241838917 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7241838917). Originally posted by [Royalflamejlh](https://github.com/Royalflamejlh) on 2026-11-28T15:55:20Z. --- At `bacb6f04` (on `main` `e429936c`), a direct-only survey of a retail title's 1,636 compute programs translated 1,275 of them directly in the split wave64 form and 1,437 in the native wave64 form, against 708 and 1,000 on `main`; 0 validator failures, 0 panics, and no "instruction after a terminator" left in either form. Setup: Linux, Wine 11.21 Staging, CPU only (no GPU), Rust 1.98.0, release, `x86_64-pc-windows-gnu`; `xcl shaders <pack> --direct --sample 0 --split 1` and `--split 0`, 8 threads. `scratch_ptr` (`lower_mem.rs:2373`) has the same pattern as the static sampler: it switches to `init.entry` to allocate `xcl_scratch` and appends after the guard's terminator. No compute program of this title reaches it (the survey is the same with it fixed), but this test fails at `bacb6f04` with "direct DXIL builder error: instruction after a terminator in block Block(0)": ```rust #[test] fn compute_scratch_is_allocated_before_the_dispatch_limit_guard() { use crate::gpu::recomp::CsInterface; let code = prog(&[ ("V_MOV_B32", "ENC_VOP1", &[("VDST", 1), ("SRC0", 133)], None), ("SCRATCH_STORE_DWORD", "ENC_FLAT_SCRATCH", &[("ADDR", 0), ("DATA", 1), ("SADDR", 0x7F)], None), ("SCRATCH_LOAD_DWORD", "ENC_FLAT_SCRATCH", &[("ADDR", 0), ("VDST", 2), ("SADDR", 0x7F)], None), ("S_ENDPGM", "ENC_SOPP", &[], None), ]); let cs = CsInterface { threads: [64, 1, 1], ..Default::default() }; let ko = KernelOptions { wave64: true, split: false, mem_windows: 1, sampler_base: 0 }; super::kernel::translate_compute(&code, ko, &cs).unwrap_or_else(|e| panic!("{}", &e[..e.len().min(800)])); } ``` It passes with the same two lines your sampler change uses, in `scratch_ptr`: ```rust let cur = self.cur(); let before = self.s.m.set_insert_before_term(true); self.s.m.set_block(self.init.entry); // … the alloca as it is … self.s.m.set_block(cur); self.s.m.set_insert_before_term(before); ``` **Not tested:** a GPU, Windows, the whole suite, a title run. **AI use:** Claude Code (Claude Opus 5.5) ran the surveys and the test and wrote this comment.
CharlyRien commented 2026-11-28 17:03:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-28T17:03:32Z.


A test of this PR on one retail compute program, on NVIDIA. It also shows a cache trap for anyone testing it on an existing cache.

Setup:

  • RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631.
  • Builds: main e429936c, and this PR's head bacb6f04 on it, release.
  • One compute program of the retail title, the one our main run stalled on while loading. Fresh, empty DXIL cache, xcl shaders <folder> --precompile, then the same with --pipelines --threads 1. No title.

Measured:

main e429936c this PR bacb6f04
direct DXIL fails: "instruction after a terminator in block Block(0)" 1,214,602 B, validated
what the runtime uses the HLSL fallback, 9,370,880 B of DXIL the direct DXIL
translation – 7.1 s
driver pipeline build not finished after 575 s (our title run, stuck on the loading art) about 54 s

The cache trap (Read, and what we hit):

  • translated::cached_rerouted in gpu/recomp/pso.rs looks a program up under the HLSL path's identity first, then under rerouted_identity.
  • When the direct translator fails on an enormous program, the HLSL fallback is stored under the HLSL path's identity. That identity does not follow the direct translator's version or sources: direct_output_identity only goes into rerouted_identity.
  • So once main has stored this program's fallback, a build with this PR finds it first and never translates the program again.
  • We hit that: our first run of this PR used a copy of the cache from a main run, and it served main's 9,370,880 B fallback for this program, unchanged.

Deduced: to see this PR's effect on a title, start from a cache without that file. A durable fix could look up rerouted_identity first, or key an enormous program's fallback by rerouted_identity as well, so that a fixed direct translator retries it.

Not tested: a title run with this PR on a clean cache; other programs (with this PR's build, 4 other programs of the title still fell back, with "multidimensional groups need the HLSL console-linear thread reorder", a different reason); other cards and drivers; AMD.

AI use: Claude Code with Claude Opus 5.5 built both commits, ran the test on this machine, read the cache code and wrote this. The person running these tests asked for this post.

<!-- greyfinch-sync:ivall/xcl:comment:7242721036 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7242721036). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-11-28T17:03:32Z. --- A test of this PR on one retail compute program, on NVIDIA. It also shows a cache trap for anyone testing it on an existing cache. **Setup:** - RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631. - Builds: `main` `e429936c`, and this PR's head `bacb6f04` on it, release. - One compute program of the retail title, the one our `main` run stalled on while loading. Fresh, empty DXIL cache, `xcl shaders <folder> --precompile`, then the same with `--pipelines --threads 1`. No title. **Measured:** | | `main` `e429936c` | this PR `bacb6f04` | |---|---|---| | direct DXIL | fails: "instruction after a terminator in block Block(0)" | **1,214,602 B**, validated | | what the runtime uses | the HLSL fallback, 9,370,880 B of DXIL | the direct DXIL | | translation | – | 7.1 s | | driver pipeline build | not finished after 575 s (our title run, stuck on the loading art) | **about 54 s** | **The cache trap (Read, and what we hit):** - `translated::cached_rerouted` in `gpu/recomp/pso.rs` looks a program up under the HLSL path's identity first, then under `rerouted_identity`. - When the direct translator fails on an enormous program, the HLSL fallback is stored under the HLSL path's identity. That identity does not follow the direct translator's version or sources: `direct_output_identity` only goes into `rerouted_identity`. - So once `main` has stored this program's fallback, a build with this PR finds it first and never translates the program again. - We hit that: our first run of this PR used a copy of the cache from a `main` run, and it served `main`'s 9,370,880 B fallback for this program, unchanged. **Deduced:** to see this PR's effect on a title, start from a cache without that file. A durable fix could look up `rerouted_identity` first, or key an enormous program's fallback by `rerouted_identity` as well, so that a fixed direct translator retries it. **Not tested:** a title run with this PR on a clean cache; other programs (with this PR's build, 4 other programs of the title still fell back, with "multidimensional groups need the HLSL console-linear thread reorder", a different reason); other cards and drivers; AMD. AI use: Claude Code with Claude Opus 5.5 built both commits, ran the test on this machine, read the cache code and wrote this. The person running these tests asked for this post.
afpruivo commented 2026-11-28 17:20:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-28T17:20:42Z.


Test report on RTX 3090 for bacb6f04: no new test failures, and on a retail title's shader pack the sampler fix lets 567 more compute programs translate through direct DXIL (43.3 % → 77.9 %).

Tested

  • NVIDIA GeForce RTX 3090 24 GB, driver 621.40, i5-13600K, Windows 11 Pro 26300, Rust 1.99.1; tests in debug, the pack run in release.

  • cargo test --workspace --no-fail-fast -- --test-threads=4 on bacb6f04: 2127 passed, 10 failed, 48 ignored (9 distinct tests).

    • The new tests pass: gpu_static_samplers_from_constants_in_code and gpu_compact_slots_use_the_dispatch_prologues_exec_mask.
    • None of the failures comes from this PR. Seven fail on main e429936c on this card in every run (#3093). two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs is a flake on main (#3185). alloc_pool::tests::submit_marking_calls_out_unlocked_and_revalidates_the_queue_marker ("queue Signal must run outside STATE") failed once under the full suite, but passes 5/5 alone on both main and this PR.
  • SKIPPED: 21 "no wave64", 2 debug-layer cases (no d3d12SDKLayers.dll), 3 f16 / conversion cases the per-lane form refuses, 1 heap windows.

  • xcl shaders <shaders.rpf> --direct --validate --only cs --sample 100000, on the newer retail title (TitleID 7952987A), every compute program validated:

    main e429936c this PR bacb6f04
    CS translated 708 / 1636 (43.3 %) 1275 / 1636 (77.9 %)
    "instruction after a terminator in block Block(0)" 567 0
    validator failures / panics 0 / 0 0 / 0

    Among them are the two most expensive compute programs on this title's direct queue in play, scattering_transmittance_system:CS_Gather_Classified_9 and _11 (dump hashes 2504944a10775aeb, 95bc3980ec624295). Each runs once per frame through ExecuteIndirect, for 7.5 and 9.3 ms per frame on nvidia-dev (XCL_GPU_TIMES). On main the direct form refuses both, at the first static sampler used outside the entry block, so they take the HLSL path.

Not tested

  • AMD and wave64 hardware.
  • Play: I haven't run the title on this PR, so I don't know whether the direct forms of these programs are faster than the HLSL ones, or whether they draw the same picture.
  • The second commit (bacb6f04, compact register slots) only through the suite and the pack run above. I didn't isolate which programs need it.

AI use: Claude Code (Claude Opus 5.5) ran the tests and the pack comparison and drafted this. I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7242943336 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7242943336). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-11-28T17:20:42Z. --- **Test report on RTX 3090 for `bacb6f04`: no new test failures, and on a retail title's shader pack the sampler fix lets 567 more compute programs translate through direct DXIL (43.3 % → 77.9 %).** **Tested** - NVIDIA GeForce RTX 3090 24 GB, driver 621.40, i5-13600K, Windows 11 Pro 26300, Rust 1.99.1; tests in debug, the pack run in release. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on `bacb6f04`: 2127 passed, 10 failed, 48 ignored (9 distinct tests). - The new tests pass: `gpu_static_samplers_from_constants_in_code` and `gpu_compact_slots_use_the_dispatch_prologues_exec_mask`. - None of the failures comes from this PR. Seven fail on `main` `e429936c` on this card in every run (#3093). `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` is a flake on `main` (#3185). `alloc_pool::tests::submit_marking_calls_out_unlocked_and_revalidates_the_queue_marker` ("queue Signal must run outside STATE") failed once under the full suite, but passes 5/5 alone on both `main` and this PR. - SKIPPED: 21 "no wave64", 2 debug-layer cases (no `d3d12SDKLayers.dll`), 3 f16 / conversion cases the per-lane form refuses, 1 heap windows. - `xcl shaders <shaders.rpf> --direct --validate --only cs --sample 100000`, on the newer retail title (TitleID 7952987A), every compute program validated: | | `main` `e429936c` | this PR `bacb6f04` | |---|---|---| | CS translated | 708 / 1636 (43.3 %) | 1275 / 1636 (77.9 %) | | "instruction after a terminator in block Block(0)" | 567 | 0 | | validator failures / panics | 0 / 0 | 0 / 0 | Among them are the two most expensive compute programs on this title's direct queue in play, `scattering_transmittance_system:CS_Gather_Classified_9` and `_11` (dump hashes `2504944a10775aeb`, `95bc3980ec624295`). Each runs once per frame through ExecuteIndirect, for 7.5 and 9.3 ms per frame on `nvidia-dev` (`XCL_GPU_TIMES`). On `main` the direct form refuses both, at the first static sampler used outside the entry block, so they take the HLSL path. **Not tested** - AMD and wave64 hardware. - Play: I haven't run the title on this PR, so I don't know whether the direct forms of these programs are faster than the HLSL ones, or whether they draw the same picture. - The second commit (`bacb6f04`, compact register slots) only through the suite and the pack run above. I didn't isolate which programs need it. AI use: Claude Code (Claude Opus 5.5) ran the tests and the pack comparison and drafted this. I checked it before posting.
Eterst commented 2026-11-28 18:52:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Eterst on 2026-11-28T18:52:18Z.


A side effect to plan for when this lands: with the entry block fixed, more of a retail title's huge compute programs translate directly and come in under the 8 MiB XCL_PIPELINE_MAX_KB cap, so a precompile with --pipelines now has the driver build them. Each such build takes far more memory than a worker is budgeted.

Setup: RTX 4070 SUPER 12 GB (driver 621.40), Ryzen 7 5700X, 32 GB RAM, Windows 10 19045, Rust 1.100.0, release. Not a clean main: a local test tree (main of 11-27 with d9403543 ported by hand) with this PR's two commits applied by hand, and ad19a1c1. So the numbers are about the driver's cost, not about main's precompile code.

Measured (xcl shaders <pack> --precompile --only cs --pipelines, a RAM guard ending the process below 0.4 GB free):

pipelines built at once result
12 ended by the guard at 523 s: 18.1 GB private, 0.39 GB free (1,100 of 2,689 pipelines made)
4 ended by the guard after about 70 s: 15.7 GB private
1 finished: 18.8 min, 2,687 made, 0 refused, 2 still over the cap
  • During the first run the cache gained three compute DXIL files of 4,518,940, 4,360,108 and 4,224,036 bytes, the largest of that run. Private memory climbed about 1 GB every 2 s in the last 20 s before each end.
  • On this tree the precompile creates its pipelines with CreateComputePipelineState directly (shaders.rs) and doesn't take the runtime's huge-build gate (big_compile_turn, XCL_HUGE_PSO_CONCURRENCY, default 1).

Deduced, not tested on main: main's preparation workers count 3 GB of commit for each (prepare_workers, shaders.rs:2750). One driver build of a 4 MB+ compute program held well over that here, and #3067 saw single workers at 10–17 GB. With this PR more such programs pass the cap, so a 32 GB machine may need one huge build at a time, or a per-worker budget that scales with the DXIL size.

Not tested: main's worker processes, other drivers, AMD.

Results with the PR, for the record: the 1,068 compute programs of this pack that failed with "instruction after a terminator in block Block(0)" all translate directly now: 0 such failures. The remaining HLSL routes are the 471 multidimensional-group ones, by design. The scratch line from the earlier comment is in our tree as well; its test fails without it and passes with it.

AI use: Claude Code (Claude Opus 5.5) ran the precompiles, read the logs and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7244116287 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7244116287). Originally posted by [Eterst](https://github.com/Eterst) on 2026-11-28T18:52:18Z. --- A side effect to plan for when this lands: with the entry block fixed, more of a retail title's huge compute programs translate directly and come in under the 8 MiB `XCL_PIPELINE_MAX_KB` cap, so a precompile with `--pipelines` now has the driver build them. Each such build takes far more memory than a worker is budgeted. **Setup:** RTX 4070 SUPER 12 GB (driver 621.40), Ryzen 7 5700X, 32 GB RAM, Windows 10 19045, Rust 1.100.0, release. Not a clean `main`: a local test tree (`main` of 11-27 with `d9403543` ported by hand) with this PR's two commits applied by hand, and `ad19a1c1`. So the numbers are about the driver's cost, not about `main`'s precompile code. **Measured** (`xcl shaders <pack> --precompile --only cs --pipelines`, a RAM guard ending the process below 0.4 GB free): | pipelines built at once | result | |---|---| | 12 | ended by the guard at 523 s: 18.1 GB private, 0.39 GB free (1,100 of 2,689 pipelines made) | | 4 | ended by the guard after about 70 s: 15.7 GB private | | 1 | finished: 18.8 min, 2,687 made, 0 refused, 2 still over the cap | - During the first run the cache gained three compute DXIL files of 4,518,940, 4,360,108 and 4,224,036 bytes, the largest of that run. Private memory climbed about 1 GB every 2 s in the last 20 s before each end. - On this tree the precompile creates its pipelines with `CreateComputePipelineState` directly (`shaders.rs`) and doesn't take the runtime's huge-build gate (`big_compile_turn`, `XCL_HUGE_PSO_CONCURRENCY`, default 1). **Deduced, not tested on `main`:** `main`'s preparation workers count 3 GB of commit for each (`prepare_workers`, `shaders.rs:2750`). One driver build of a 4 MB+ compute program held well over that here, and #3067 saw single workers at 10–17 GB. With this PR more such programs pass the cap, so a 32 GB machine may need one huge build at a time, or a per-worker budget that scales with the DXIL size. **Not tested:** `main`'s worker processes, other drivers, AMD. **Results with the PR, for the record:** the 1,068 compute programs of this pack that failed with "instruction after a terminator in block Block(0)" all translate directly now: 0 such failures. The remaining HLSL routes are the 471 multidimensional-group ones, by design. The scratch line from the earlier comment is in our tree as well; its test fails without it and passes with it. **AI use:** Claude Code (Claude Opus 5.5) ran the precompiles, read the logs and wrote this comment.
Aniseto commented 2026-11-28 19:38:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T19:38:48Z.


Re-ran the static-sampler-from-code test at 43902aa2 after the head moved from bacb6f04 and after a NVIDIA driver update; this is a new response in the same thread, not an edit of my earlier report at bacb6f04: https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7240035285

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2140 (621.40), 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.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_static_samplers_from_constants_in_code -- --test-threads=1
1 passed; 0 failed; 0 ignored; 0 measured; 2045 filtered out      (exit 0)

The test still passes at the new head on the new driver. The PR description reports a full debug workspace run at this head on an RTX 4090 with six failures; I ran only this focused test, so I am not reporting a suite result. The new dimension here is the Blackwell card on driver 32.0.16.2140.

Not tested: the full workspace suite, a paired smoke run, a retail title, 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.

<!-- greyfinch-sync:ivall/xcl:comment:7244700491 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7244700491). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-28T19:38:48Z. --- Re-ran the static-sampler-from-code test at `43902aa2` after the head moved from `bacb6f04` and after a NVIDIA driver update; this is a new response in the same thread, not an edit of my earlier report at `bacb6f04`: https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7240035285 Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2140 (621.40), 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. ``` XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_static_samplers_from_constants_in_code -- --test-threads=1 1 passed; 0 failed; 0 ignored; 0 measured; 2045 filtered out (exit 0) ``` The test still passes at the new head on the new driver. The PR description reports a full debug workspace run at this head on an RTX 4090 with six failures; I ran only this focused test, so I am not reporting a suite result. The new dimension here is the Blackwell card on driver 32.0.16.2140. Not tested: the full workspace suite, a paired smoke run, a retail title, 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.
afpruivo commented 2026-11-28 19:40:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-28T19:40:41Z.


A clarification on my report above: the 7.5 and 9.3 ms per frame for the two CS_Gather_Classified programs were measured on nvidia-dev, and there both programs already translate through direct DXIL without this PR. The refusal ("instruction after a terminator") happens on main. So the report doesn't show a frame-time gain from this PR, and I didn't mean to suggest one.

I checked it in play: nvidia-dev 54225f58 with and without this PR's two commits, three interleaved runs each, 16 frames from 420 s. Both arms built the same DXIL for these programs (274,848 B for 95bc3980ec624295), and the direct-queue busy time per frame was the same within noise (control 144.7 / 140.3 / 141.2 ms, with the PR 141.2 / 149.8 / 139.3 ms). The coverage numbers for main stand. I'm running the same comparison on main now and will add the result here.

AI use: Claude Code (Claude Opus 5.5) ran the runs and drafted this. I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7244723345 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7244723345). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-11-28T19:40:41Z. --- **A clarification on my report above:** the 7.5 and 9.3 ms per frame for the two `CS_Gather_Classified` programs were measured on `nvidia-dev`, and there both programs already translate through direct DXIL without this PR. The refusal ("instruction after a terminator") happens on `main`. So the report doesn't show a frame-time gain from this PR, and I didn't mean to suggest one. I checked it in play: `nvidia-dev` `54225f58` with and without this PR's two commits, three interleaved runs each, 16 frames from 420 s. Both arms built the same DXIL for these programs (274,848 B for `95bc3980ec624295`), and the direct-queue busy time per frame was the same within noise (control 144.7 / 140.3 / 141.2 ms, with the PR 141.2 / 149.8 / 139.3 ms). The coverage numbers for `main` stand. I'm running the same comparison on `main` now and will add the result here. AI use: Claude Code (Claude Opus 5.5) ran the runs and drafted this. I checked it before posting.
Anon64 commented 2026-11-28 20:33:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-28T20:33:23Z.


Regression run for 43902aa2 (this head) against main b937fbab on an RTX 3060 12 GB (driver 581.80), i9-14900KF, 64 GB RAM, Windows 11 26200, release builds. A newer retail game, 300 s, XCL_PREPARE=0, XCL_ADAPTER=3060, XCL_PIPELINE_THREADS=8, same cache state.

xcl-smoke v1
commit: b937fbab2964b2c142f5d13662b91b00f99b9848
gpu: NVIDIA GeForce RTX 3060
title: retail-1
seconds: 300
exit: 0x0
frames shown: 8786 (PresentX 8786)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 37615 MB
xcl-smoke v1
commit: 43902aa2a05f56f870f6db60fb9b46e47833c0e8
gpu: NVIDIA GeForce RTX 3060
title: retail-1
seconds: 300
exit: 0x0
frames shown: 8822 (PresentX 8822)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 37535 MB

100.4 % of main's frames, 99.8 % of its peak commit, no device removal or crash.

Not tested / not covered: this title logs huge-program direct DXIL unavailable: direct DXIL builder error: instruction after a terminator in block Block(0) on this machine, but only while its shaders are translated cold during preparation; with a warm cache and XCL_PREPARE=0 neither run hit that path (0 such lines in both logs), so this run does not show the fix working, only that nothing regressed. Not run: the whole suite, AMD, a cold-cache preparation.

AI use: Claude Code (Claude Opus 5.5) built both commits, ran the smoke runs and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7245372085 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7245372085). Originally posted by [Anon64](https://github.com/Anon64) on 2026-11-28T20:33:23Z. --- Regression run for `43902aa2` (this head) against `main` `b937fbab` on an RTX 3060 12 GB (driver 581.80), i9-14900KF, 64 GB RAM, Windows 11 26200, release builds. A newer retail game, 300 s, `XCL_PREPARE=0`, `XCL_ADAPTER=3060`, `XCL_PIPELINE_THREADS=8`, same cache state. ``` xcl-smoke v1 commit: b937fbab2964b2c142f5d13662b91b00f99b9848 gpu: NVIDIA GeForce RTX 3060 title: retail-1 seconds: 300 exit: 0x0 frames shown: 8786 (PresentX 8786) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 37615 MB ``` ``` xcl-smoke v1 commit: 43902aa2a05f56f870f6db60fb9b46e47833c0e8 gpu: NVIDIA GeForce RTX 3060 title: retail-1 seconds: 300 exit: 0x0 frames shown: 8822 (PresentX 8822) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 37535 MB ``` 100.4 % of `main`'s frames, 99.8 % of its peak commit, no device removal or crash. **Not tested / not covered:** this title logs `huge-program direct DXIL unavailable: direct DXIL builder error: instruction after a terminator in block Block(0)` on this machine, but only while its shaders are translated cold during preparation; with a warm cache and `XCL_PREPARE=0` neither run hit that path (0 such lines in both logs), so this run does not show the fix working, only that nothing regressed. Not run: the whole suite, AMD, a cold-cache preparation. **AI use:** Claude Code (Claude Opus 5.5) built both commits, ran the smoke runs and wrote this report.
afpruivo commented 2026-11-28 20:59:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-11-28T20:59:21Z.


Update to my note above: I stopped the main comparison before it finished, so I have no frame-time result for this PR on main. With ±3–6 ms of run-to-run noise per frame on this title, three runs a side wouldn't separate a difference of this size. The test and coverage results in my report stand.

AI use: Claude Code (Claude Opus 5.5) drafted this. I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7245690408 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7245690408). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-11-28T20:59:21Z. --- Update to my note above: I stopped the `main` comparison before it finished, so I have no frame-time result for this PR on `main`. With ±3–6 ms of run-to-run noise per frame on this title, three runs a side wouldn't separate a difference of this size. The test and coverage results in my report stand. AI use: Claude Code (Claude Opus 5.5) drafted this. I checked it before posting.
bmjask commented 2026-11-28 22:04:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-28T22:04:21Z.

Review: COMMENTED


Critical-review result: I found no concrete defect. Initializing the allocation slot in its defining block preserves dominance, and inserting sampler handles before the entry terminator while restoring builder state matches the surrounding IR construction pattern. The DispatchX regression exercises the motivating path.

Please retain the change as a focused correctness repair and keep the exact-head PR validation attached to this commit.

Reviewed at 43902aa2a0 with Codex (GPT-5).

<!-- greyfinch-sync:ivall/xcl:review:6100275397 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#pullrequestreview-6100275397). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-28T22:04:21Z. **Review:** COMMENTED --- Critical-review result: I found no concrete defect. Initializing the allocation slot in its defining block preserves dominance, and inserting sampler handles before the entry terminator while restoring builder state matches the surrounding IR construction pattern. The DispatchX regression exercises the motivating path. Please retain the change as a focused correctness repair and keep the exact-head PR validation attached to this commit. Reviewed at 43902aa2a05f56f870f6db60fb9b46e47833c0e8 with Codex (GPT-5).
Kalmarv commented 2026-11-29 04:36:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-29T04:36:42Z.


merge-check
base: fa204595a4
head: 43902aa2a0
merge: clean (trial merge bfac2ad8, local)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> 2609 passed, 0 failed, 49 ignored; SKIPPED: 26, the usual set (21 no wave64 on this 32-lane GPU, 3 per-lane forms refused, 2 no heap windows). Both of the PR's tests ran (not skipped) and passed: gpu::dxil::kernel::gpu_compact_slots_use_the_dispatch_prologues_exec_mask and the new DispatchX part of gpu::recomp::tests::gpu_static_samplers_from_constants_in_code.
review: none blocking; whole diff read (kernel.rs, lower.rs, lower_image.rs, recomp/tests.rs, +75). (1) Init now stores a slot's initial value in the block that defines it (def_block(v), else entry): the DispatchX EXEC mask is defined at the prologue join, so the store sees the selected mask, not a stale full one. (2) A static sampler handle created on first use now goes in front of entry's terminator (set_insert_before_term(true), restored after): entry can already end in the prologue's branch, and the handle must dominate both paths. Both changes are local and keep the old placement when the value comes from entry. (3) The tests do not catch the fix on this tree and GPU. With lower.rs and lower_image.rs set back to main's (rebuilt, PR tests kept), both tests still pass, so on this base neither test program reaches the bad placement. They guard the behaviour but would not have failed before. Worth a word from the author on which main commit or program shape reproduced it.
performance: no cost by default (only where values are placed in the prologue). Title run (release build of the merge, scratch/fast-world.py fast profile, against main fa204595): exit 0, 0 crashes, 0 device removals; world entry 92.5 s against 76.8 s and 99.7 s in two main runs; peak commit 33,512 MB against 33,027 and 31,295 MB (101.5 % of the higher); 86 WARN lines against 86. This run presented world frames (1.5 fps, 3 frame dumps) while both main runs showed 0 fps in their window.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, release build for the title run, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: build, suite, revert probe, title run and full-diff review; this report.

<!-- greyfinch-sync:ivall/xcl:comment:7250756506 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7250756506). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-29T04:36:42Z. --- merge-check base: fa204595a488c60c6c5f905244f0172072c9c2a9 head: 43902aa2a05f56f870f6db60fb9b46e47833c0e8 merge: clean (trial merge bfac2ad8, local) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> 2609 passed, 0 failed, 49 ignored; SKIPPED: 26, the usual set (21 no wave64 on this 32-lane GPU, 3 per-lane forms refused, 2 no heap windows). Both of the PR's tests ran (not skipped) and passed: `gpu::dxil::kernel::gpu_compact_slots_use_the_dispatch_prologues_exec_mask` and the new DispatchX part of `gpu::recomp::tests::gpu_static_samplers_from_constants_in_code`. review: none blocking; whole diff read (`kernel.rs`, `lower.rs`, `lower_image.rs`, `recomp/tests.rs`, +75). (1) `Init` now stores a slot's initial value in the block that defines it (`def_block(v)`, else entry): the DispatchX EXEC mask is defined at the prologue join, so the store sees the selected mask, not a stale full one. (2) A static sampler handle created on first use now goes in front of entry's terminator (`set_insert_before_term(true)`, restored after): entry can already end in the prologue's branch, and the handle must dominate both paths. Both changes are local and keep the old placement when the value comes from entry. (3) The tests do not catch the fix on this tree and GPU. With `lower.rs` and `lower_image.rs` set back to main's (rebuilt, PR tests kept), both tests still pass, so on this base neither test program reaches the bad placement. They guard the behaviour but would not have failed before. Worth a word from the author on which main commit or program shape reproduced it. performance: no cost by default (only where values are placed in the prologue). Title run (release build of the merge, scratch/fast-world.py fast profile, against main fa204595): exit 0, 0 crashes, 0 device removals; world entry 92.5 s against 76.8 s and 99.7 s in two main runs; peak commit 33,512 MB against 33,027 and 31,295 MB (101.5 % of the higher); 86 WARN lines against 86. This run presented world frames (1.5 fps, 3 frame dumps) while both main runs showed 0 fps in their window. verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, release build for the title run, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: build, suite, revert probe, title run and full-diff review; this report.
KaniaKrzysztof commented 2026-11-29 08:15:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KaniaKrzysztof on 2026-11-29T08:15:38Z.


Thanks for the merge check @Kalmarv

The original reproduction was on main e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd, using the (95cc13288a27a96e) compute shader.

I rebased the PR while investigating the full workspace test failures, but those turned out to be related to my local environment.

<!-- greyfinch-sync:ivall/xcl:comment:7252988938 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7252988938). Originally posted by [KaniaKrzysztof](https://github.com/KaniaKrzysztof) on 2026-11-29T08:15:38Z. --- Thanks for the merge check @Kalmarv The original reproduction was on main `e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd`, using the (`95cc13288a27a96e`) compute shader. I rebased the PR while investigating the full workspace test failures, but those turned out to be related to my local environment.
no-juiice commented 2026-11-29 16:03:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by no-juiice on 2026-11-29T16:03:39Z.


merge-check claim
head: 43902aa2a0

<!-- greyfinch-sync:ivall/xcl:comment:7258584480 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7258584480). Originally posted by [no-juiice](https://github.com/no-juiice) on 2026-11-29T16:03:39Z. --- merge-check claim head: 43902aa2a05f56f870f6db60fb9b46e47833c0e8
no-juiice commented 2026-11-29 21:54:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by no-juiice on 2026-11-29T21:54:17Z.


merge-check
base: bc2cbb72af
head: 43902aa2a0
merge: clean (4 files, +75; git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609.5) -> 2725 passed, 0 failed, 49 ignored (41 binaries; the lib binary runs 2615 tests, base 2614); SKIPPED: 28 notices (22 "no wave64", 3 per-lane form refused for wave32 f16/f32 cases, 2 "no heap windows", 1 "no D3D12 debug layer"); failing: none in that run, but see review 1
review:

  1. Intermittent crash of the lib test binary: in 2 of 4 full-workspace runs of the merge result, xcl lib tests exited with 0xc0000005 (STATUS_ACCESS_VIOLATION), both times after exactly 82 finished tests and with the same four tests in flight: gpu::agility::tests::create_device_sets_dred_first, gpu::bvh::tests::scene_trace_matches_brute_force, gpu::bvh::tests::trace_matches_brute_force, gpu::dxil::compact_tests::a_large_program_that_repeats_itself_takes_the_compact_form. Not seen in 3 full-workspace runs of the base (one of them had two unrelated e2e failures, test_title_runs_and_game_folder_is_untouched and incomplete_discovered_corpus_blocks_headless_title_entry, which did not repeat), nor in 2 -p xcl --lib runs of the merge result (2586 passed, 0 failed, 29 ignored). Each of the four tests passes alone (--exact --test-threads=1) with and without this PR, and a full-workspace run with --skip gpu::agility::tests::create_device_sets_dred_first passed. This PR's new test sorts into that part of the run, so it may only change which tests run together and expose an existing race; I could not show which. Unconfirmed as this PR's; a full-workspace run on another machine would settle it.
  2. The diff itself: Init::slot now stores a slot's first value in that value's defining block, before its terminator, while the alloca stays in entry; slot runs before load emits its read, so the store precedes the first load. This relies on every first value being defined in a block that dominates the compact loop (true for entry values and for the DispatchX prologue join). lower_image.rs creates the static sampler handle before the entry terminator and restores the insertion setting, which removes the "instruction after a terminator in block Block(0)" refusal. Both new tests ran (wave32) and passed: gpu::dxil::kernel::gpu_compact_slots_use_the_dispatch_prologues_exec_mask, gpu::recomp::tests::gpu_static_samplers_from_constants_in_code. No other findings.
  3. Not covered here: wave64 hardware (this GPU is wave32 only, 22 wave64 cases skipped), AMD, and a game run of this exact merge result.
    performance: translation-time only; no per-frame cost expected. Related to the precompile-memory note above: on this 16 GB RAM machine a main db3921dc compute precompile with --pipelines and the size cap off died with "LLVM ERROR: out of memory" at 42 GB process private, building the HLSL-path DXIL (9-19 MB) of the large compute programs; main 10d27297 + #3189 + this PR (4 driver compiles at once, default 8 MiB cap) finished: 10,002 pipelines, 0 refused, 8.5 GB peak private, 66 min. Not an A/B of this PR alone. Later builds with this PR (on 765b2c5b, d8bd9a38, 24d21a41) reached the retail title's world; launch preparation had 0 failed workers.
    verdict: safe to merge
    The merge is clean, the build and the full suite pass (2725 passed, 0 failed), the diff reads correct and both new tests pass on the GPU. The intermittent lib-binary crash in review 1 is unconfirmed as this PR's: it doesn't reproduce with any of the four tests alone, and it may be an existing race this PR's added test exposes.
    hardware / tool and model: NVIDIA GeForce RTX 4060 Laptop GPU 8 GB (driver 617.42), AMD Ryzen 7 7435HS, 16 GB RAM, Windows 11 Home 26300, rustc 1.100.0, debug / Claude Code, Claude Opus 5.5 (ran the builds and tests and wrote this; checked before posting)
<!-- greyfinch-sync:ivall/xcl:comment:7263245234 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3154#issuecomment-7263245234). Originally posted by [no-juiice](https://github.com/no-juiice) on 2026-11-29T21:54:17Z. --- merge-check base: bc2cbb72af29710458e0613455de3e5828d32d8c head: 43902aa2a05f56f870f6db60fb9b46e47833c0e8 merge: clean (4 files, +75; `git diff --check` clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609.5) -> 2725 passed, 0 failed, 49 ignored (41 binaries; the lib binary runs 2615 tests, base 2614); SKIPPED: 28 notices (22 "no wave64", 3 per-lane form refused for wave32 f16/f32 cases, 2 "no heap windows", 1 "no D3D12 debug layer"); failing: none in that run, but see review 1 review: 1. Intermittent crash of the lib test binary: in 2 of 4 full-workspace runs of the merge result, `xcl` lib tests exited with 0xc0000005 (STATUS_ACCESS_VIOLATION), both times after exactly 82 finished tests and with the same four tests in flight: `gpu::agility::tests::create_device_sets_dred_first`, `gpu::bvh::tests::scene_trace_matches_brute_force`, `gpu::bvh::tests::trace_matches_brute_force`, `gpu::dxil::compact_tests::a_large_program_that_repeats_itself_takes_the_compact_form`. Not seen in 3 full-workspace runs of the base (one of them had two unrelated e2e failures, `test_title_runs_and_game_folder_is_untouched` and `incomplete_discovered_corpus_blocks_headless_title_entry`, which did not repeat), nor in 2 `-p xcl --lib` runs of the merge result (2586 passed, 0 failed, 29 ignored). Each of the four tests passes alone (`--exact --test-threads=1`) with and without this PR, and a full-workspace run with `--skip gpu::agility::tests::create_device_sets_dred_first` passed. This PR's new test sorts into that part of the run, so it may only change which tests run together and expose an existing race; I could not show which. Unconfirmed as this PR's; a full-workspace run on another machine would settle it. 2. The diff itself: `Init::slot` now stores a slot's first value in that value's defining block, before its terminator, while the alloca stays in entry; `slot` runs before `load` emits its read, so the store precedes the first load. This relies on every first value being defined in a block that dominates the compact loop (true for entry values and for the DispatchX prologue join). `lower_image.rs` creates the static sampler handle before the entry terminator and restores the insertion setting, which removes the "instruction after a terminator in block Block(0)" refusal. Both new tests ran (wave32) and passed: `gpu::dxil::kernel::gpu_compact_slots_use_the_dispatch_prologues_exec_mask`, `gpu::recomp::tests::gpu_static_samplers_from_constants_in_code`. No other findings. 3. Not covered here: wave64 hardware (this GPU is wave32 only, 22 wave64 cases skipped), AMD, and a game run of this exact merge result. performance: translation-time only; no per-frame cost expected. Related to the precompile-memory note above: on this 16 GB RAM machine a `main` `db3921dc` compute precompile with `--pipelines` and the size cap off died with "LLVM ERROR: out of memory" at 42 GB process private, building the HLSL-path DXIL (9-19 MB) of the large compute programs; `main` `10d27297` + #3189 + this PR (4 driver compiles at once, default 8 MiB cap) finished: 10,002 pipelines, 0 refused, 8.5 GB peak private, 66 min. Not an A/B of this PR alone. Later builds with this PR (on `765b2c5b`, `d8bd9a38`, `24d21a41`) reached the retail title's world; launch preparation had 0 failed workers. verdict: safe to merge The merge is clean, the build and the full suite pass (2725 passed, 0 failed), the diff reads correct and both new tests pass on the GPU. The intermittent lib-binary crash in review 1 is unconfirmed as this PR's: it doesn't reproduce with any of the four tests alone, and it may be an existing race this PR's added test exposes. hardware / tool and model: NVIDIA GeForce RTX 4060 Laptop GPU 8 GB (driver 617.42), AMD Ryzen 7 7435HS, 16 GB RAM, Windows 11 Home 26300, rustc 1.100.0, debug / Claude Code, Claude Opus 5.5 (ran the builds and tests and wrote this; checked before posting)
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!3154
No description provided.