Recompiler: direct DXIL reads heap memory windows without a branch #2417

Closed
Kalmarv wants to merge 1 commit from upstream-pr/2427 into main
Kalmarv commented 2026-11-25 18:37:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-25T18:37:30Z.


Part of #2088.

With heap memory windows (XCL_HEAP_WINDOWS=1), every read in a direct-DXIL compute program is a branch on w < windows (and the lane guard) around the heap lookup, with a phi per value where the paths join. NVIDIA's compile time follows the block count, not the byte count, and the reads in a large compute program make thousands of blocks.

This PR adds a one-path form behind XCL_HEAP_FLAT=1. It applies only with heap windows on:

  • The read: each lane reads from window w's heap view. It uses window 0 instead when w is outside the windows or the lane is inactive, and those lanes then take 0. The guarded form and the switch over root UAVs give the same results.
  • Credit: the one-path idea (a clamped index instead of a branch) is the one @brothernog brings to the HLSL heap form in #1695. Reading through a select instead of a branch is the same direction as @coolpersonnn's #2368 for root UAVs. This PR applies it to the direct translator's heap form.
  • Cache keys: the new HEAP_FLAT flag is in the windows count, so the caches keep the forms apart.
  • Scope: compute programs only (kernel and CS entries, kernel::reads_heap_flat). Vertex, pixel, mesh and GS programs keep the guarded form, and the HLSL path is unchanged. Before, mesh and GS programs read flat too (@pvfreis's review). Only reads change: raw, SMEM, unaligned, format and BVH node loads (all the with_mem_i32s callers). Stores and atomics keep their branch.

Result, on native Windows and NVIDIA: this form builds these five large programs 34–64 % faster than the guarded heap form. Its native code is 2.4 % smaller than the guarded form's in total (1.5–4.8 % per program).

The table was measured on 0f045140, this PR before its rebase onto 6d12f58a. Its switch column is the form from before #2368; main now reads compute memory through #2368's select instead.

Cold pipeline builds on an RTX 5070 Ti (NVIDIA 610.74), shader cache disabled (ShaderCacheControl), 4 windows, split wave64:

  • Programs: five large compute programs from title: ea3b5e4d.
  • One job: all three forms come from the same translator build: the switch over root UAVs (before #2368), the guarded heap form, and this PR's flat heap form.
  • Order: each program is built in the order switch, guarded, flat, flat, guarded, switch.
  • Cells: both runs, then their mean, in seconds.
program switch (before #2368) heap, guarded heap, flat (this PR) native code: switch / guarded / flat
RT resolve A 36.4 / 29.7 → 33.1 29.4 / 12.6 → 21.0 12.0 / 12.4 → 12.2 1242 / 955 / 941 KB
RT resolve B 31.5 / 31.6 → 31.5 14.2 / 14.2 → 14.2 8.9 / 8.5 → 8.7 1365 / 1051 / 1027 KB
local lights 6.4 / 6.3 → 6.3 2.9 / 2.8 → 2.9 1.9 / 1.9 → 1.9 460 / 374 / 356 KB
cascade shadows A 51.5 / 53.8 → 52.7 101.1 / 82.8 → 92.0 29.0 / 37.8 → 33.4 2408 / 2153 / 2092 KB
cascade shadows B 13.8 / 11.5 → 12.7 14.3 / 14.2 → 14.2 8.2 / 8.2 → 8.2 1252 / 1138 / 1117 KB
  • Against the guarded form: flat builds 34–64 % faster on all five programs. On RT resolve A, the guarded form took 29.4 s once and 12.6 s once.
  • Against the switch from before #2368: flat builds 1.5–3.6 times as fast. Against main's form (#2368) see the next table.
  • Only large programs: these five are all the compile-time evidence I have. Whether the gain holds for smaller programs is not measured.
  • On another card: @Raghav314 timed the heap form with and without its guard in one process on an RTX 4090 (#2088). The two programs took 20.0 vs 18.8 s and 7.1 vs 5.2 s, a much smaller gain than here. The difference is not explained. Their card, driver and translator revision differ from this run.
  • Under Wine and vkd3d-proton: @Royalflamejlh's times (#2428, comment 7179985117) did not separate from the spread between runs, except for the two largest programs. That run compares this form, as #2428's default, with main's root UAVs.
  • Native code: the driver's compiled code (GetCachedBlob) is 2.4 % smaller than the guarded form's here (1.5–4.8 % per program), and 0.974 times its size over 60 records on @pvfreis's RTX 3060, where 12 of the 60 are larger. Against root UAVs, the gap is larger; #2428, which turns this form on by default, has those numbers.
  • The cascade shadows programs: they are wave64 groups of several waves. Most of their remaining time is the split form's exchange between the two halves, which this PR does not touch.

Against main's form (#2368), measured on this PR rebased onto 6d12f58a (its compute translation is this head's) in one timing job, same card, driver and settings as above. Each program is built in the order switch (before #2368), #2368's select, guarded, flat, then the reverse. The switch column comes from the earlier export, so it is not from the 6d12f58a build.

program switch (before #2368) #2368's select (main) heap, guarded heap, flat (this PR) native code: switch / #2368 / guarded / flat
RT resolve A 30.2 / 30.7 → 30.4 14.3 / 14.1 → 14.2 11.9 / 11.6 → 11.7 7.7 / 7.6 → 7.6 1243 / 1119 / 956 / 941 KB
RT resolve B 31.4 / 36.2 → 33.8 15.5 / 17.2 → 16.4 14.2 / 14.8 → 14.5 8.5 / 8.5 → 8.5 1365 / 1226 / 1047 / 1030 KB
local lights 6.3 / 6.3 → 6.3 3.4 / 3.4 → 3.4 2.9 / 2.8 → 2.9 1.8 / 1.8 → 1.8 460 / 460 / 373 / 353 KB
cascade shadows A 43.4 / 45.1 → 44.3 40.1 / 40.2 → 40.1 68.8 / 67.2 → 68.0 26.5 / 27.5 → 27.0 2408 / 2293 / 2149 / 2094 KB
cascade shadows B 11.6 / 11.3 → 11.4 10.4 / 10.8 → 10.6 14.9 / 15.0 → 14.9 8.4 / 8.2 → 8.3 1252 / 1216 / 1138 / 1117 KB
  • Against #2368's select: flat builds 22–48 % faster on all five programs (geomean 7.67 vs 12.72 s, a ratio of 0.603). Its native code is 0.877 times the size in total (0.77–0.92 per program).
  • Against the guarded form in this job: 0.557 by geomean (13.76 s guarded).
  • Same limits as above: five large compute programs, one card, native Windows.

What is in it

  • gpu/dxil/lower_mem.rs: the one-path read in with_mem_i32s.
  • gpu/dxil/kernel.rs, gpu/dxil/lower.rs: heap_flat in Lw. kernel::reads_heap_flat sets it for kernel and CS entries with HEAP_FLAT and heap windows. Test: only_compute_programs_read_heap_windows_flat.
  • gpu/recomp/mod.rs, gpu/recomp/pso.rs: the HEAP_FLAT flag and XCL_HEAP_FLAT=1. The HLSL path strips the flag the way it strips HEAP_WINDOWS. pso::windows_for gives the windows of n for this run; mem_windows takes it.
  • shaders.rs: xcl shaders (--precompile, --export-hlsl, --measure-pso) takes its windows from pso::windows_for too, instead of its own copy of the rule, which had no HEAP_FLAT. With XCL_HEAP_FLAT=1, the precompile made the guarded form's entries, not the ones the runtime looks up (found by @bielfreedom). Test: precompile_windows_are_the_runtimes runs with XCL_HEAP_WINDOWS=1 and XCL_HEAP_FLAT=1 or 0 in a new process and compares the windows with the runtime's. It fails with the old copy (260 against 772).
  • gpu/recomp/tests.rs: gpu_heap_flat_reads_match_the_switch_form.
    • It runs one program in all three forms (switch, guarded heap, flat heap) over a 4-window arena and compares SGPRs and VGPRs.
    • The program has SMEM loads into window 2 and outside the UMA, an s_buffer_load_dwordx4 from window 3, a buffer_load from window 1, and per-lane global_loads spread over all four windows.
    • Every eighth lane reads outside the UMA, lanes 0–32 are inactive (v_cmpx), and there is a SADDR global_load_dwordx2.

Tested

  • Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, rustc 1.99.0, DXC 1.9.2609, debug.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on this head, c8c2b7a6 (on main 6d12f58a): 1426 passed, 0 failed, 46 ignored.
    • 25 SKIPPED notices: 21 for no wave64, 3 for wave32 per-lane forms refused by the #1426 list (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), and 1 for no heap windows (the switch-form fallback test, since heap windows are opt-in here).
    • gpu_heap_flat_reads_match_the_switch_form, only_compute_programs_read_heap_windows_flat and precompile_windows_are_the_runtimes pass.
  • Title run with the form on, this head, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1, 60 s, release, one run beside other jobs on the same machine. There was no device removal and no crash. It showed 1474 frames and was still presenting at the end (52, 38 and 50 frames per 2 s), with a peak commit of 17993 MB. Its log shows the memory windows coming from the shared descriptor heap. There is no main run of the same length to compare with.

Tested by others

  • @pvfreis (#2428, comment 7177531683): RTX 3060, NVIDIA 617.14, on #2428's ab2855f, which contains this PR.

    • Native code over 60 records: guarded heap 42.19 MB, flat heap 41.11 MB, a ratio of 0.974 (0.901–1.039 per record). 12 of the 60 are larger with this form.
    • Repeat builds had the same sizes but different contents for 18 and 8 of the 60.
    • No build times.
  • @Eterst (#2496, comment 7176075746): RTX 4070 SUPER 12 GB, NVIDIA 616.92, Windows 10 19045, release.

    • Build: 6d12f58 with #2496 78bba5c and this PR's d356a74.
    • Settings: XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1, split off, a full precompile with the same switches, then a title run with XCL_WINDOW_NO_CARRY=1 XCL_HEAP_FLAT=1.
    • Before (main 06055a7): four runs lost the device (0x887a0005) at 261–303 s.
    • With both PRs: one run, no device removal up to 395 s. Their RAM guard stopped it at 418 s.
    • Precompiled compute driver code: 2,227 programs and 905 MB before, 2,565 programs and 757 MB after.
    • Caveats:
      • This PR and #2496 are not separated, and it is one run.
      • The two rows have different program sets and different bases.
      • There is no counter of the code bound at the removal point.
  • @bielfreedom (comment 7180279957): RX 9070 XT 16 GB (RDNA4), AMD driver 32.0.32029.2010, Ryzen 7 7700, 32 GB, Windows 11, release.

    • Build: this PR (f8b3191) on main 08db802. It had their one-line fix of the precompile windows, now in this PR, and a local patch that logs each program's DXIL size and CreateComputePipelineState time.
    • Settings: xcl shaders --precompile --only cs --pipelines with XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_DISK_CACHE=0, one driver thread, every build cold. The flat and guarded arms come from one binary.
    • DXIL, all 2,689 compute programs: 728.9 MB guarded, 702.1 MB flat (−3.7 %); 2,639 programs changed.
    • AMD driver time, 26 large programs, two interleaved rounds: 73.5 s guarded, 65.2 s flat on average (−11 %). Peak memory was 1.62 / 1.63 GB guarded and 1.24 / 1.36 GB flat, and no pipeline failed. On d356a74 the sizes were the same and the gain was 10.5 %.
    • Not measured there: GPU output and a title run.
    • On this head, c8c2b7a, with no local change (comment 7181043742), merged onto main b49be18 with only their timing patch:
      • XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1 xcl shaders --precompile now makes the flat form. Its DXIL is 728.9 → 702.1 MB (−3.7 %, 2,639 changed), the same bytes, program for program, as their run with the hand-added fix.
      • Driver, the same 26 large programs, two interleaved rounds: flag off, 66 pipelines, 91.6 / 100.2 s, peak 1.62 GB; flag on, 65 pipelines, 85.8 / 86.9 s, peak 1.34 / 1.27 GB. No failures, mean −10 %. Both arms were slower than in their first run because the machine was busier.
  • @veyn-sudo (#2403, comments 7189887455 and 7191174254): RTX 2070 SUPER 8 GB, NVIDIA 617.14, release. This PR's c8c2b7a6 merged with #2576 and #2567 on their tree (main b49be183 and other open PRs). Offline only: GetCachedBlob summed over the 926 compute records their runs used, with the switches added one at a time in this order (cumulative):

    • #2576 alone: driver code 328.3 → 308.1 MB (−6.2 %).
    • Adding #2567's outlining (XCL_DXIL_OUTLINE=1): 256.6 MB (−21.8 %).
    • Adding this PR (XCL_HEAP_FLAT=1): 256.6 → 253.6 MB, −1.2 % of driver code on top of the outlined build, and −0.8 % of DXIL (179.4 → 178.0 MB).
    • Their title runs had this PR's form off (only #2576 and #2567 active), so they say nothing about this PR.

Regression run

  • Setup: scripts/smoke.ps1 through our run script, 120 s, release builds, XCL_DIRECT_DXIL=1, in one queue job: main b49be18, then this head. Both sides use the same data root and XCL cache, warmed by earlier runs, and start from the same learned coherent-window state.
  • Beside it: it ran beside a CPU-bound precompile on the same machine (an offline xcl shaders --precompile count, through both sides), and another agent's GPU test suite ran beside the main side only (about 60 of its 120 s).
  • Result: no device removal and no crash. This PR showed 87.6 % of main's frames (1522 against 1738) and 101.7 % of its peak commit (28999 against 28514 MB). The run uses this PR's defaults, where the flat form is off.

main b49be18:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1738 (PresentX 1738)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 28514 MB

This PR (c8c2b7a6):

xcl-smoke v1
commit: c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1522 (PresentX 1522)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 28999 MB

Not tested

  • A title run with the form on that is longer than 60 s, or compared with main over the same time.
  • Compile time for programs other than the five large ones, and on other cards natively.
  • Intel and Linux. AMD: only @bielfreedom's precompile timing, no title run.
  • Graphics stages: they keep the guarded form. #2368 measured a select-flattened form as slower for NVIDIA pixel shaders, so extending this form to them needs its own timing.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, the test and this description, made the measurements and ran the tests.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5497033832 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-25T18:37:30Z. --- Part of #2088. With heap memory windows (`XCL_HEAP_WINDOWS=1`), every read in a direct-DXIL compute program is a branch on `w < windows` (and the lane guard) around the heap lookup, with a phi per value where the paths join. NVIDIA's compile time follows the block count, not the byte count, and the reads in a large compute program make thousands of blocks. This PR adds a one-path form behind `XCL_HEAP_FLAT=1`. It applies only with heap windows on: - **The read:** each lane reads from window `w`'s heap view. It uses window 0 instead when `w` is outside the windows or the lane is inactive, and those lanes then take 0. The guarded form and the switch over root UAVs give the same results. - **Credit:** the one-path idea (a clamped index instead of a branch) is the one @brothernog brings to the HLSL heap form in #1695. Reading through a select instead of a branch is the same direction as @coolpersonnn's #2368 for root UAVs. This PR applies it to the direct translator's heap form. - **Cache keys:** the new `HEAP_FLAT` flag is in the windows count, so the caches keep the forms apart. - **Scope:** compute programs only (kernel and CS entries, `kernel::reads_heap_flat`). Vertex, pixel, mesh and GS programs keep the guarded form, and the HLSL path is unchanged. Before, mesh and GS programs read flat too (@pvfreis's review). Only reads change: raw, SMEM, unaligned, format and BVH node loads (all the `with_mem_i32s` callers). Stores and atomics keep their branch. **Result**, on native Windows and NVIDIA: this form builds these five large programs 34–64 % faster than the guarded heap form. Its native code is 2.4 % smaller than the guarded form's in total (1.5–4.8 % per program). The table was measured on 0f045140, this PR before its rebase onto 6d12f58a. Its switch column is the form from before #2368; `main` now reads compute memory through #2368's select instead. Cold pipeline builds on an RTX 5070 Ti (NVIDIA 610.74), shader cache disabled (`ShaderCacheControl`), 4 windows, split wave64: - **Programs:** five large compute programs from title: ea3b5e4d. - **One job:** all three forms come from the same translator build: the switch over root UAVs (before #2368), the guarded heap form, and this PR's flat heap form. - **Order:** each program is built in the order switch, guarded, flat, flat, guarded, switch. - **Cells:** both runs, then their mean, in seconds. | program | switch (before #2368) | heap, guarded | heap, flat (this PR) | native code: switch / guarded / flat | |---|---|---|---|---| | RT resolve A | 36.4 / 29.7 → 33.1 | 29.4 / 12.6 → 21.0 | **12.0 / 12.4 → 12.2** | 1242 / 955 / 941 KB | | RT resolve B | 31.5 / 31.6 → 31.5 | 14.2 / 14.2 → 14.2 | **8.9 / 8.5 → 8.7** | 1365 / 1051 / 1027 KB | | local lights | 6.4 / 6.3 → 6.3 | 2.9 / 2.8 → 2.9 | **1.9 / 1.9 → 1.9** | 460 / 374 / 356 KB | | cascade shadows A | 51.5 / 53.8 → 52.7 | 101.1 / 82.8 → 92.0 | **29.0 / 37.8 → 33.4** | 2408 / 2153 / 2092 KB | | cascade shadows B | 13.8 / 11.5 → 12.7 | 14.3 / 14.2 → 14.2 | **8.2 / 8.2 → 8.2** | 1252 / 1138 / 1117 KB | - **Against the guarded form:** flat builds 34–64 % faster on all five programs. On RT resolve A, the guarded form took 29.4 s once and 12.6 s once. - **Against the switch from before #2368:** flat builds 1.5–3.6 times as fast. Against `main`'s form (#2368) see the next table. - **Only large programs:** these five are all the compile-time evidence I have. Whether the gain holds for smaller programs is not measured. - **On another card:** @Raghav314 timed the heap form with and without its guard in one process on an RTX 4090 (#2088). The two programs took 20.0 vs 18.8 s and 7.1 vs 5.2 s, a much smaller gain than here. The difference is not explained. Their card, driver and translator revision differ from this run. - **Under Wine and vkd3d-proton:** @Royalflamejlh's times (#2428, comment 7179985117) did not separate from the spread between runs, except for the two largest programs. That run compares this form, as #2428's default, with `main`'s root UAVs. - **Native code:** the driver's compiled code (`GetCachedBlob`) is 2.4 % smaller than the guarded form's here (1.5–4.8 % per program), and 0.974 times its size over 60 records on @pvfreis's RTX 3060, where 12 of the 60 are larger. Against root UAVs, the gap is larger; #2428, which turns this form on by default, has those numbers. - **The cascade shadows programs:** they are wave64 groups of several waves. Most of their remaining time is the split form's exchange between the two halves, which this PR does not touch. **Against `main`'s form (#2368)**, measured on this PR rebased onto 6d12f58a (its compute translation is this head's) in one timing job, same card, driver and settings as above. Each program is built in the order switch (before #2368), #2368's select, guarded, flat, then the reverse. The switch column comes from the earlier export, so it is not from the 6d12f58a build. | program | switch (before #2368) | #2368's select (`main`) | heap, guarded | heap, flat (this PR) | native code: switch / #2368 / guarded / flat | |---|---|---|---|---|---| | RT resolve A | 30.2 / 30.7 → 30.4 | 14.3 / 14.1 → 14.2 | 11.9 / 11.6 → 11.7 | **7.7 / 7.6 → 7.6** | 1243 / 1119 / 956 / 941 KB | | RT resolve B | 31.4 / 36.2 → 33.8 | 15.5 / 17.2 → 16.4 | 14.2 / 14.8 → 14.5 | **8.5 / 8.5 → 8.5** | 1365 / 1226 / 1047 / 1030 KB | | local lights | 6.3 / 6.3 → 6.3 | 3.4 / 3.4 → 3.4 | 2.9 / 2.8 → 2.9 | **1.8 / 1.8 → 1.8** | 460 / 460 / 373 / 353 KB | | cascade shadows A | 43.4 / 45.1 → 44.3 | 40.1 / 40.2 → 40.1 | 68.8 / 67.2 → 68.0 | **26.5 / 27.5 → 27.0** | 2408 / 2293 / 2149 / 2094 KB | | cascade shadows B | 11.6 / 11.3 → 11.4 | 10.4 / 10.8 → 10.6 | 14.9 / 15.0 → 14.9 | **8.4 / 8.2 → 8.3** | 1252 / 1216 / 1138 / 1117 KB | - **Against #2368's select:** flat builds 22–48 % faster on all five programs (geomean 7.67 vs 12.72 s, a ratio of 0.603). Its native code is 0.877 times the size in total (0.77–0.92 per program). - **Against the guarded form in this job:** 0.557 by geomean (13.76 s guarded). - **Same limits as above:** five large compute programs, one card, native Windows. **What is in it** - `gpu/dxil/lower_mem.rs`: the one-path read in `with_mem_i32s`. - `gpu/dxil/kernel.rs`, `gpu/dxil/lower.rs`: `heap_flat` in `Lw`. `kernel::reads_heap_flat` sets it for kernel and CS entries with `HEAP_FLAT` and heap windows. Test: `only_compute_programs_read_heap_windows_flat`. - `gpu/recomp/mod.rs`, `gpu/recomp/pso.rs`: the `HEAP_FLAT` flag and `XCL_HEAP_FLAT=1`. The HLSL path strips the flag the way it strips `HEAP_WINDOWS`. `pso::windows_for` gives the windows of `n` for this run; `mem_windows` takes it. - `shaders.rs`: `xcl shaders` (`--precompile`, `--export-hlsl`, `--measure-pso`) takes its windows from `pso::windows_for` too, instead of its own copy of the rule, which had no `HEAP_FLAT`. With `XCL_HEAP_FLAT=1`, the precompile made the guarded form's entries, not the ones the runtime looks up (found by @bielfreedom). Test: `precompile_windows_are_the_runtimes` runs with `XCL_HEAP_WINDOWS=1` and `XCL_HEAP_FLAT=1` or `0` in a new process and compares the windows with the runtime's. It fails with the old copy (260 against 772). - `gpu/recomp/tests.rs`: `gpu_heap_flat_reads_match_the_switch_form`. - It runs one program in all three forms (switch, guarded heap, flat heap) over a 4-window arena and compares SGPRs and VGPRs. - The program has SMEM loads into window 2 and outside the UMA, an `s_buffer_load_dwordx4` from window 3, a `buffer_load` from window 1, and per-lane `global_load`s spread over all four windows. - Every eighth lane reads outside the UMA, lanes 0–32 are inactive (`v_cmpx`), and there is a SADDR `global_load_dwordx2`. **Tested** - Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, rustc 1.99.0, DXC 1.9.2609, debug. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on this head, c8c2b7a6 (on `main` 6d12f58a): 1426 passed, 0 failed, 46 ignored. - 25 SKIPPED notices: 21 for no wave64, 3 for wave32 per-lane forms refused by the #1426 list (`V_MUL_F16`, `V_PK_MUL_F16`, `V_CVT_F16_F32`), and 1 for no heap windows (the switch-form fallback test, since heap windows are opt-in here). - `gpu_heap_flat_reads_match_the_switch_form`, `only_compute_programs_read_heap_windows_flat` and `precompile_windows_are_the_runtimes` pass. - Title run with the form on, this head, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1`, 60 s, release, one run beside other jobs on the same machine. There was no device removal and no crash. It showed 1474 frames and was still presenting at the end (52, 38 and 50 frames per 2 s), with a peak commit of 17993 MB. Its log shows the memory windows coming from the shared descriptor heap. There is no `main` run of the same length to compare with. **Tested by others** - **@pvfreis** (#2428, comment 7177531683): RTX 3060, NVIDIA 617.14, on #2428's ab2855f, which contains this PR. - Native code over 60 records: guarded heap 42.19 MB, flat heap 41.11 MB, a ratio of 0.974 (0.901–1.039 per record). 12 of the 60 are larger with this form. - Repeat builds had the same sizes but different contents for 18 and 8 of the 60. - No build times. - **@Eterst** (#2496, comment 7176075746): RTX 4070 SUPER 12 GB, NVIDIA 616.92, Windows 10 19045, release. - **Build:** 6d12f58 with #2496 78bba5c and this PR's d356a74. - **Settings:** `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1`, split off, a full precompile with the same switches, then a title run with `XCL_WINDOW_NO_CARRY=1 XCL_HEAP_FLAT=1`. - **Before** (`main` 06055a7): four runs lost the device (`0x887a0005`) at 261–303 s. - **With both PRs:** one run, no device removal up to 395 s. Their RAM guard stopped it at 418 s. - **Precompiled compute driver code:** 2,227 programs and 905 MB before, 2,565 programs and 757 MB after. - **Caveats:** - This PR and #2496 are not separated, and it is one run. - The two rows have different program sets and different bases. - There is no counter of the code bound at the removal point. - **@bielfreedom** (comment 7180279957): RX 9070 XT 16 GB (RDNA4), AMD driver 32.0.32029.2010, Ryzen 7 7700, 32 GB, Windows 11, release. - **Build:** this PR (f8b3191) on `main` 08db802. It had their one-line fix of the precompile windows, now in this PR, and a local patch that logs each program's DXIL size and `CreateComputePipelineState` time. - **Settings:** `xcl shaders --precompile --only cs --pipelines` with `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_DISK_CACHE=0`, one driver thread, every build cold. The flat and guarded arms come from one binary. - **DXIL, all 2,689 compute programs:** 728.9 MB guarded, 702.1 MB flat (−3.7 %); 2,639 programs changed. - **AMD driver time, 26 large programs, two interleaved rounds:** 73.5 s guarded, 65.2 s flat on average (−11 %). Peak memory was 1.62 / 1.63 GB guarded and 1.24 / 1.36 GB flat, and no pipeline failed. On d356a74 the sizes were the same and the gain was 10.5 %. - Not measured there: GPU output and a title run. - **On this head, c8c2b7a, with no local change** (comment 7181043742), merged onto `main` b49be18 with only their timing patch: - `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1 xcl shaders --precompile` now makes the flat form. Its DXIL is 728.9 → 702.1 MB (−3.7 %, 2,639 changed), the same bytes, program for program, as their run with the hand-added fix. - Driver, the same 26 large programs, two interleaved rounds: flag off, 66 pipelines, 91.6 / 100.2 s, peak 1.62 GB; flag on, 65 pipelines, 85.8 / 86.9 s, peak 1.34 / 1.27 GB. No failures, mean −10 %. Both arms were slower than in their first run because the machine was busier. - **@veyn-sudo** (#2403, comments 7189887455 and 7191174254): RTX 2070 SUPER 8 GB, NVIDIA 617.14, release. This PR's c8c2b7a6 merged with #2576 and #2567 on their tree (`main` b49be183 and other open PRs). Offline only: `GetCachedBlob` summed over the 926 compute records their runs used, with the switches added one at a time in this order (cumulative): - #2576 alone: driver code 328.3 → 308.1 MB (−6.2 %). - Adding #2567's outlining (`XCL_DXIL_OUTLINE=1`): 256.6 MB (−21.8 %). - **Adding this PR (`XCL_HEAP_FLAT=1`): 256.6 → 253.6 MB, −1.2 % of driver code on top of the outlined build, and −0.8 % of DXIL (179.4 → 178.0 MB).** - Their title runs had this PR's form off (only #2576 and #2567 active), so they say nothing about this PR. **Regression run** - **Setup:** `scripts/smoke.ps1` through our run script, 120 s, release builds, `XCL_DIRECT_DXIL=1`, in one queue job: `main` b49be18, then this head. Both sides use the same data root and XCL cache, warmed by earlier runs, and start from the same learned coherent-window state. - **Beside it:** it ran beside a CPU-bound precompile on the same machine (an offline `xcl shaders --precompile` count, through both sides), and another agent's GPU test suite ran beside the `main` side only (about 60 of its 120 s). - **Result:** no device removal and no crash. This PR showed 87.6 % of `main`'s frames (1522 against 1738) and 101.7 % of its peak commit (28999 against 28514 MB). The run uses this PR's defaults, where the flat form is off. `main` b49be18: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 120 exit: 0x0 frames shown: 1738 (PresentX 1738) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 28514 MB ``` This PR (c8c2b7a6): ``` xcl-smoke v1 commit: c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 120 exit: 0x0 frames shown: 1522 (PresentX 1522) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 28999 MB ``` **Not tested** - A title run with the form on that is longer than 60 s, or compared with `main` over the same time. - Compile time for programs other than the five large ones, and on other cards natively. - Intel and Linux. AMD: only @bielfreedom's precompile timing, no title run. - Graphics stages: they keep the guarded form. #2368 measured a select-flattened form as slower for NVIDIA pixel shaders, so extending this form to them needs its own timing. **AI use** - Claude Code (Claude Opus 5.5) wrote the change, the test and this description, made the measurements and ran the tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
alexmircea1299 commented 2026-11-25 19:09:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by alexmircea1299 on 2026-11-25T18:49:15Z.


Tested commit 717fec5 on Windows:

Environment

  • OS: Windows 11 (Build 26100)
  • CPU: AMD Ryzen 5 9600X 6-Core Processor
  • RAM: 32 GB
  • GPU: NVIDIA GeForce RTX 5070 (12 GB VRAM, driver 621.40, wave32)
  • DXC: 1.8.2502.11 (Windows SDK 10.0.26100.0)

Results

  • Library test suite (cargo test -p xcl --lib -- --skip fuzz_validate_and_gpu): 1216 passed, 1 failed, 26 ignored, 4 filtered out (14.73s).
  • New XCL_HEAP_FLAT / XCL_HEAP_WINDOWS GPU tests: Passed cleanly on native wave32 NVIDIA hardware.
  • Unrelated / pre-existing failures on main:
    • gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (assertion left == right failed: group barriers in the program: left: 3, right: 1).
    • gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (filtered out; known RTX 5000 driver E_OUTOFMEMORY 0x8007000E on non-constant groupshared atomic subtract tracked in #1905 / #1919).
<!-- greyfinch-sync:ivall/xcl:comment:7171444750 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7171444750). Originally posted by [alexmircea1299](https://github.com/alexmircea1299) on 2026-11-25T18:49:15Z. --- Tested commit `717fec5` on Windows: ### Environment * **OS:** Windows 11 (Build 26100) * **CPU:** AMD Ryzen 5 9600X 6-Core Processor * **RAM:** 32 GB * **GPU:** NVIDIA GeForce RTX 5070 (12 GB VRAM, driver `621.40`, `wave32`) * **DXC:** `1.8.2502.11` (Windows SDK `10.0.26100.0`) ### Results * **Library test suite (`cargo test -p xcl --lib -- --skip fuzz_validate_and_gpu`):** **1216 passed, 1 failed, 26 ignored, 4 filtered out** (`14.73s`). * **New `XCL_HEAP_FLAT` / `XCL_HEAP_WINDOWS` GPU tests:** Passed cleanly on native `wave32` NVIDIA hardware. * **Unrelated / pre-existing failures on `main`:** * `gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (`assertion left == right failed: group barriers in the program: left: 3, right: 1`). * `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (filtered out; known RTX 5000 driver `E_OUTOFMEMORY` `0x8007000E` on non-constant `groupshared` atomic subtract tracked in #1905 / #1919).
SlopTart commented 2026-11-25 20:08:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T19:18:47Z.


Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite, cold cache: 161 passed / 4 failed. Three are the known baseline trio on this lane; the fourth is the new gpu_promoted_uav_clear_values_pass_create_committed_resource failure that current main carries (reported here), not caused by this PR. Everything else is green.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7172123370 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7172123370). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T19:18:47Z. --- **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). `gpu_` suite, cold cache: 161 passed / 4 failed. Three are the known baseline trio on this lane; the fourth is the new `gpu_promoted_uav_clear_values_pass_create_committed_resource` failure that current main carries ([reported here](https://github.com/xcl-dev/xcl/pull/2280#issuecomment-7172066690)), not caused by this PR. Everything else is green. **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
DavidM1911 commented 2026-11-25 20:08:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:04:32Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7173154823 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7173154823). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T20:04:32Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
bmjask commented 2026-11-25 21:03:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:03:22Z.

Review: COMMENTED


No concrete source-level defect found. Flat path clamping/select behavior, cache identity, and GPU parity coverage look sound. This draft is not merge-ready: merge state is unstable, required main/head regression pair is pending, and there is no XCL_HEAP_FLAT title run or AMD/Intel validation. The documented precompiled-cache misses are acceptable only while opt-in measurement remains the scope; rebase and provide current evidence before merge.

<!-- greyfinch-sync:ivall/xcl:review:6064948413 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#pullrequestreview-6064948413). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T21:03:22Z. **Review:** COMMENTED --- No concrete source-level defect found. Flat path clamping/select behavior, cache identity, and GPU parity coverage look sound. This draft is not merge-ready: merge state is unstable, required main/head regression pair is pending, and there is no XCL_HEAP_FLAT title run or AMD/Intel validation. The documented precompiled-cache misses are acceptable only while opt-in measurement remains the scope; rebase and provide current evidence before merge.
pvfreis commented 2026-11-25 23:09:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-25T22:24:05Z.


By reading only, at d356a74 and #2428 ab2855f:

  1. Baseline. The table (last edited 18:40 UTC, on 68a284a) predates #2368 (merged 19:59, now in both heads' base). #2368 replaced the switch on compute raw loads with selects and reports builds up to 3.5 times as fast for that form. So the switch column, and #2428's 1.1–3.8 times (body and heap_windows comment) and 11–25 %, are not against the form #2428's default replaces now. Rerunning the five programs on the current base would settle it.
  2. Scope. "Mesh and GS programs … are unchanged" does not hold: heap_flat is off only for Entry::Vertex | Entry::Pixel, so with XCL_HEAP_WINDOWS=1 and direct DXIL the mesh and GS compute passes read flat too (by default after #2428). The new test runs a kernel program only.

AI use: Claude Code (Claude Opus 5.5) found this; a second Claude Opus 5.5 re-derived it; Claude Fable 5.2 reviewed the text; checked by a person before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7176315721 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7176315721). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-25T22:24:05Z. --- By reading only, at `d356a74` and #2428 `ab2855f`: 1. **Baseline.** The table (last edited 18:40 UTC, on `68a284a`) predates #2368 (merged 19:59, now in both heads' base). #2368 replaced the switch on compute raw loads with selects and reports builds up to 3.5 times as fast for that form. So the switch column, and #2428's 1.1–3.8 times (body and `heap_windows` comment) and 11–25 %, are not against the form #2428's default replaces now. Rerunning the five programs on the current base would settle it. 2. **Scope.** "Mesh and GS programs … are unchanged" does not hold: `heap_flat` is off only for `Entry::Vertex | Entry::Pixel`, so with `XCL_HEAP_WINDOWS=1` and direct DXIL the mesh and GS compute passes read flat too (by default after #2428). The new test runs a kernel program only. **AI use:** Claude Code (Claude Opus 5.5) found this; a second Claude Opus 5.5 re-derived it; Claude Fable 5.2 reviewed the text; checked by a person before posting.
bielfreedom commented 2026-11-26 02:08:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bielfreedom on 2026-11-26T01:55:11Z.


AMD Windows driver timing for #2427: on an RX 9070 XT with heap windows, XCL_HEAP_FLAT=1 makes AMD's CreateComputePipelineState about 11 % faster over 26 large retail compute programs and lowers peak memory. One catch first: xcl shaders --precompile never sets HEAP_FLAT, so offline the switch does nothing.

The offline tool: pso::mem_windows adds HEAP_FLAT, but shaders.rs's runtime_windows builds its own count (windows | HEAP_WINDOWS). With this PR as is, XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1 xcl shaders --precompile gives the same bytes as without the switch for all 2,689 programs. So with the switch on, what the offline precompile caches would not be what the runtime looks for. For the numbers below I added | if recomp::pso::heap_flat() { recomp::HEAP_FLAT } else { 0 } to runtime_windows locally.

Setup

  • GPU: RX 9070 XT 16 GB (RDNA4, native wave64), AMD driver 32.0.32029.2010.
  • CPU and memory: Ryzen 7 7700 (16 threads), 32 GB RAM, Windows 11, release.
  • Build: this PR merged onto main 08db802, plus the one-line hookup above and a local timing patch that writes each program's DXIL size and each CreateComputePipelineState time to a file. Measured at d356a74 and again at the current head f8b3191; the numbers below are from f8b3191 (d356a74 gave the same sizes and a 10.5 % driver gain). One binary for both arms; only the switch differs.
  • Offline: xcl shaders <retail shaders.rpf> --precompile --only cs --pipelines with XCL_DIRECT_DXIL=1, XCL_HEAP_WINDOWS=1, XCL_PSO_DISK_CACHE=0, one driver thread, a fresh translation cache and a fresh executable name for every run (the AMD driver keys its own cache on the exe name, so every build is cold).

DXIL size, all 2,689 compute programs, heap windows (translation only)

switch off XCL_HEAP_FLAT=1
total direct DXIL 728.9 MB (same bytes as main) 702.1 MB (−3.7 %)
programs changed 2,639

Driver time, 26 large programs, 2 interleaved rounds (off, on, then on, off)

arm pipelines (incl. split pieces) driver time r1 / r2 peak memory r1 / r2
off 66 73.1 / 73.9 s 1.62 / 1.63 GB
XCL_HEAP_FLAT=1 65 64.8 / 65.5 s 1.24 / 1.36 GB

Mean 73.5 → 65.2 s (−11 %), and no pipeline failed. The gain is much larger than the 3.7 % size cut, which fits the description: AMD also seems to pay for the blocks, not the bytes. Largest programs:

program DXIL off → on driver ms off driver ms on
620491641aa9bad6 317 → 307 KB 11,277 / 11,625 9,215 / 9,277
6d1e4583f8129771 558 → 545 KB 6,698 / 6,823 6,044 / 6,348
7c08ec6429245b8e 478 → 467 KB 5,694 / 5,729 4,898 / 4,926
6f3a2502a8d6b129 322 → 316 KB 3,449 / 3,456 2,670 / 2,712
83a3df882bebfdab 260 → 255 KB 2,419 / 2,451 1,903 / 1,963

Not measured: 95cc13288a27a96e (ActivateRays, 17.6 GB with heap windows on #2375), 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.

<!-- greyfinch-sync:ivall/xcl:comment:7180279957 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7180279957). Originally posted by [bielfreedom](https://github.com/bielfreedom) on 2026-11-26T01:55:11Z. --- **AMD Windows driver timing for #2427: on an RX 9070 XT with heap windows, `XCL_HEAP_FLAT=1` makes AMD's `CreateComputePipelineState` about 11 % faster over 26 large retail compute programs and lowers peak memory. One catch first: `xcl shaders --precompile` never sets `HEAP_FLAT`, so offline the switch does nothing.** **The offline tool:** `pso::mem_windows` adds `HEAP_FLAT`, but `shaders.rs`'s `runtime_windows` builds its own count (`windows | HEAP_WINDOWS`). With this PR as is, `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1 xcl shaders --precompile` gives the same bytes as without the switch for all 2,689 programs. So with the switch on, what the offline precompile caches would not be what the runtime looks for. For the numbers below I added `| if recomp::pso::heap_flat() { recomp::HEAP_FLAT } else { 0 }` to `runtime_windows` locally. **Setup** - GPU: RX 9070 XT 16 GB (RDNA4, native wave64), AMD driver 32.0.32029.2010. - CPU and memory: Ryzen 7 7700 (16 threads), 32 GB RAM, Windows 11, release. - Build: this PR merged onto `main` `08db802`, plus the one-line hookup above and a local timing patch that writes each program's DXIL size and each `CreateComputePipelineState` time to a file. Measured at `d356a74` and again at the current head `f8b3191`; the numbers below are from `f8b3191` (`d356a74` gave the same sizes and a 10.5 % driver gain). One binary for both arms; only the switch differs. - Offline: `xcl shaders <retail shaders.rpf> --precompile --only cs --pipelines` with `XCL_DIRECT_DXIL=1`, `XCL_HEAP_WINDOWS=1`, `XCL_PSO_DISK_CACHE=0`, one driver thread, a fresh translation cache and a fresh executable name for every run (the AMD driver keys its own cache on the exe name, so every build is cold). **DXIL size, all 2,689 compute programs, heap windows (translation only)** | | switch off | `XCL_HEAP_FLAT=1` | |---|---:|---:| | total direct DXIL | 728.9 MB (same bytes as `main`) | 702.1 MB (−3.7 %) | | programs changed | | 2,639 | **Driver time, 26 large programs, 2 interleaved rounds (off, on, then on, off)** | arm | pipelines (incl. split pieces) | driver time r1 / r2 | peak memory r1 / r2 | |---|---:|---:|---:| | off | 66 | 73.1 / 73.9 s | 1.62 / 1.63 GB | | `XCL_HEAP_FLAT=1` | 65 | 64.8 / 65.5 s | 1.24 / 1.36 GB | Mean 73.5 → 65.2 s (−11 %), and no pipeline failed. The gain is much larger than the 3.7 % size cut, which fits the description: AMD also seems to pay for the blocks, not the bytes. Largest programs: | program | DXIL off → on | driver ms off | driver ms on | |---|---:|---:|---:| | `620491641aa9bad6` | 317 → 307 KB | 11,277 / 11,625 | 9,215 / 9,277 | | `6d1e4583f8129771` | 558 → 545 KB | 6,698 / 6,823 | 6,044 / 6,348 | | `7c08ec6429245b8e` | 478 → 467 KB | 5,694 / 5,729 | 4,898 / 4,926 | | `6f3a2502a8d6b129` | 322 → 316 KB | 3,449 / 3,456 | 2,670 / 2,712 | | `83a3df882bebfdab` | 260 → 255 KB | 2,419 / 2,451 | 1,903 / 1,963 | **Not measured:** `95cc13288a27a96e` (ActivateRays, 17.6 GB with heap windows on #2375), 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.
Kalmarv commented 2026-11-26 02:08:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T01:55:36Z.


@bmjask thanks for the review.

Rebased. This PR is now c8c2b7a6, on main 6d12f58a, so #2368 is in its base. The suite on that head: 1426 passed, 0 failed, 46 ignored.

The table. It was measured before the rebase, and its switch column is the form from before #2368. The body now says so and states the claim against the guarded heap form, which this opt-in flag replaces. Against that form, the flat form built the five large programs 34–64 % faster, and its native code was 2.4 % smaller in total. On @pvfreis's RTX 3060 it was 0.974 times the guarded form's size over 60 records, with 12 of them larger. Those five programs are all the compile-time evidence there is, and the body says the gain is shown only for them. A same-job rerun on the new base, with #2368's form as a fourth column, is queued.

Scope. Flat reads are now for compute programs only (kernel and CS entries, kernel::reads_heap_flat). Mesh and GS passes read flat before with XCL_HEAP_WINDOWS=1; now they keep the guarded form. only_compute_programs_read_heap_windows_flat covers it (@pvfreis's point).

Regression pair (in the body), on c8c2b7a6 against main b49be18, 120 s, XCL_DIRECT_DXIL=1: no removal or crash, 87.6 % of main's frames (1522 against 1738) and 101.7 % of its peak commit.

XCL_HEAP_FLAT title run: this head with XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1, 60 s, one run. There was no device removal and no crash, 1474 frames, still presenting at the end, and a peak commit of 17993 MB. @Eterst ran a title with this PR and #2496 together on an RTX 4070 SUPER (#2496, comment 7176075746): no device removal up to 395 s, where main 06055a7 lost the device at 261–303 s in four runs. That run is not separated from #2496, and it is one run.

AMD / Intel. I have neither. @bielfreedom timed the form on an RX 9070 XT (comment 7180279957), and found and confirmed a precompile-key fix (comment 7181043742): xcl shaders --precompile now keys this form as the runtime does.

AI use: Claude Code (Claude Opus 5.5) made the changes and measurements and wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7180287094 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7180287094). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-26T01:55:36Z. --- @bmjask thanks for the review. **Rebased.** This PR is now c8c2b7a6, on `main` 6d12f58a, so #2368 is in its base. The suite on that head: 1426 passed, 0 failed, 46 ignored. **The table.** It was measured before the rebase, and its switch column is the form from before #2368. The body now says so and states the claim against the guarded heap form, which this opt-in flag replaces. Against that form, the flat form built the five large programs 34–64 % faster, and its native code was 2.4 % smaller in total. On @pvfreis's RTX 3060 it was 0.974 times the guarded form's size over 60 records, with 12 of them larger. Those five programs are all the compile-time evidence there is, and the body says the gain is shown only for them. A same-job rerun on the new base, with #2368's form as a fourth column, is queued. **Scope.** Flat reads are now for compute programs only (kernel and CS entries, `kernel::reads_heap_flat`). Mesh and GS passes read flat before with `XCL_HEAP_WINDOWS=1`; now they keep the guarded form. `only_compute_programs_read_heap_windows_flat` covers it (@pvfreis's point). **Regression pair** (in the body), on c8c2b7a6 against `main` b49be18, 120 s, `XCL_DIRECT_DXIL=1`: no removal or crash, 87.6 % of `main`'s frames (1522 against 1738) and 101.7 % of its peak commit. **`XCL_HEAP_FLAT` title run:** this head with `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1`, 60 s, one run. There was no device removal and no crash, 1474 frames, still presenting at the end, and a peak commit of 17993 MB. @Eterst ran a title with this PR and #2496 together on an RTX 4070 SUPER (#2496, comment 7176075746): no device removal up to 395 s, where `main` 06055a7 lost the device at 261–303 s in four runs. That run is not separated from #2496, and it is one run. **AMD / Intel.** I have neither. @bielfreedom timed the form on an RX 9070 XT (comment 7180279957), and found and confirmed a precompile-key fix (comment 7181043742): `xcl shaders --precompile` now keys this form as the runtime does. AI use: Claude Code (Claude Opus 5.5) made the changes and measurements and wrote this reply.
Kalmarv commented 2026-11-26 02:08:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T01:55:38Z.


@pvfreis thank you for both: the reading on #2427 and the RTX 3060 run on #2428.

1. Baseline. You're right: the table predated #2368. A same-job rerun of the five programs on main 6d12f58a is queued: RTX 5070 Ti (610.74), cold, A B B A, in four forms (the old switch, #2368's select form, the guarded heap form and the flat heap form). Until it lands, the bodies state each claim against the form it was measured against:

  • #2427 (flat, opt-in) replaces the guarded heap form. On native size that is a small gain: your 0.974 on Ampere (12 of 60 records larger), and 2.4 % in total over the five programs here. That is not the 11–25 % the body quoted against the old switch. Build time against guarded: 34–64 % faster on the five, measured before the rebase.
  • #2428 (flat heap windows by default on NVIDIA compute) replaces #2368's root-UAV form. Its native size claim is now your 0.803 on Ampere (0.465–0.922 per record). Its build-time claim is limited to what was measured: five large programs on native Windows, against the switch from before #2368. The 1.1–3.8 times is gone from the body and from the heap_windows comment.

2. Scope. Also right: with XCL_HEAP_WINDOWS=1, the mesh and GS compute passes read flat too, and that form was never timed or GPU-tested. I narrowed the code rather than the claim. Flat reads are now for kernel and CS entries only (kernel::reads_heap_flat), and mesh, GS, VS and PS keep the guarded form. A test, only_compute_programs_read_heap_windows_flat, covers it. It is in #2427's commit, now f8b31918.

Your other results. Your suite (1429 passed, 1 failed, 46 ignored; only e2e presents fails, and it fails on main too) and the native sizes are in the bodies under Tested by others, with a link to your comment. On the repeat check: I haven't looked into why blob contents differ between runs either. The sizes were equal 60/60, and the size claims use only sizes.

AI use: Claude Code (Claude Opus 5.5) made the changes and the measurements and wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7180287583 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7180287583). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-26T01:55:38Z. --- @pvfreis thank you for both: the reading on #2427 and the RTX 3060 run on #2428. **1. Baseline.** You're right: the table predated #2368. A same-job rerun of the five programs on `main` 6d12f58a is queued: RTX 5070 Ti (610.74), cold, A B B A, in four forms (the old switch, #2368's select form, the guarded heap form and the flat heap form). Until it lands, the bodies state each claim against the form it was measured against: - **#2427** (flat, opt-in) replaces the guarded heap form. On native size that is a small gain: your 0.974 on Ampere (12 of 60 records larger), and 2.4 % in total over the five programs here. That is not the 11–25 % the body quoted against the old switch. Build time against guarded: 34–64 % faster on the five, measured before the rebase. - **#2428** (flat heap windows by default on NVIDIA compute) replaces #2368's root-UAV form. Its native size claim is now your 0.803 on Ampere (0.465–0.922 per record). Its build-time claim is limited to what was measured: five large programs on native Windows, against the switch from before #2368. The 1.1–3.8 times is gone from the body and from the `heap_windows` comment. **2. Scope.** Also right: with `XCL_HEAP_WINDOWS=1`, the mesh and GS compute passes read flat too, and that form was never timed or GPU-tested. I narrowed the code rather than the claim. Flat reads are now for kernel and CS entries only (`kernel::reads_heap_flat`), and mesh, GS, VS and PS keep the guarded form. A test, `only_compute_programs_read_heap_windows_flat`, covers it. It is in #2427's commit, now f8b31918. **Your other results.** Your suite (1429 passed, 1 failed, 46 ignored; only e2e `presents` fails, and it fails on `main` too) and the native sizes are in the bodies under Tested by others, with a link to your comment. On the repeat check: I haven't looked into why blob contents differ between runs either. The sizes were equal 60/60, and the size claims use only sizes. AI use: Claude Code (Claude Opus 5.5) made the changes and the measurements and wrote this reply.
Kalmarv commented 2026-11-26 03:06:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T02:20:28Z.


@bielfreedom thank you, that is a real bug, and the AMD timing is very useful.

The fix, in this PR's commit, now c8c2b7a6:

  • xcl shaders (--precompile, --export-hlsl, --measure-pso) no longer has its own copy of the window rule. It takes its windows from pso::windows_for, the same function pso::mem_windows uses at run time. With XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1, the precompile now makes the entries the runtime looks up.
  • The precompile's printed window count also leaves out the new flag.
  • A test, shaders::tests::precompile_windows_are_the_runtimes, runs with XCL_HEAP_WINDOWS=1 and XCL_HEAP_FLAT=1 or 0 in a new process, since both switches are read once. It checks that the precompile's windows are the runtime's. With the old copy it fails: 260 (no HEAP_FLAT) against 772.
  • #2428 had its own version of this, which already carried HEAP_FLAT. It is rebased onto the fix and keeps one shared function (pso::compute_windows) for the precompile and the runtime. The same test runs there.

This corrects what I wrote to @bmjask above: precompiled entries for this form are found with the flag on.

Your setup and numbers are in the description under Tested by others, credited to you: 3.7 % less DXIL over 2,689 programs, and 11 % less AMD CreateComputePipelineState time over 26 large programs, with lower peak memory and no failures.

AI use: Claude Code (Claude Opus 5.5) made the fix and the test and wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7180709208 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7180709208). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-26T02:20:28Z. --- @bielfreedom thank you, that is a real bug, and the AMD timing is very useful. **The fix**, in this PR's commit, now c8c2b7a6: - `xcl shaders` (`--precompile`, `--export-hlsl`, `--measure-pso`) no longer has its own copy of the window rule. It takes its windows from `pso::windows_for`, the same function `pso::mem_windows` uses at run time. With `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1`, the precompile now makes the entries the runtime looks up. - The precompile's printed window count also leaves out the new flag. - A test, `shaders::tests::precompile_windows_are_the_runtimes`, runs with `XCL_HEAP_WINDOWS=1` and `XCL_HEAP_FLAT=1` or `0` in a new process, since both switches are read once. It checks that the precompile's windows are the runtime's. With the old copy it fails: 260 (no `HEAP_FLAT`) against 772. - #2428 had its own version of this, which already carried `HEAP_FLAT`. It is rebased onto the fix and keeps one shared function (`pso::compute_windows`) for the precompile and the runtime. The same test runs there. This corrects what I wrote to @bmjask above: precompiled entries for this form are found with the flag on. Your setup and numbers are in the description under **Tested by others**, credited to you: 3.7 % less DXIL over 2,689 programs, and 11 % less AMD `CreateComputePipelineState` time over 26 large programs, with lower peak memory and no failures. AI use: Claude Code (Claude Opus 5.5) made the fix and the test and wrote this reply.
DavidM1911 commented 2026-11-26 03:06:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T02:22:10Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7180738939 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7180738939). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T02:22:10Z. --- 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
bielfreedom commented 2026-11-26 03:06:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bielfreedom on 2026-11-26T02:42:15Z.


@Kalmarv confirmed on the RX 9070 XT: at c8c2b7a, with no local change, XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1 xcl shaders --precompile now makes the flat form.

  • DXIL, all 2,689 compute programs: 728.9 → 702.1 MB (−3.7 %, 2,639 changed). These are the same bytes, program for program, as my earlier run with the hand-added hookup.
  • Driver, the same 26 large programs, 2 interleaved rounds (off, on, then on, off):
    • Flag off: 66 pipelines, 91.6 / 100.2 s, peak 1.62 GB.
    • Flag on: 65 pipelines, 85.8 / 86.9 s, peak 1.34 / 1.27 GB.
    • No failures. Mean −10 %, in line with the −11 % before.
    • Both arms are slower than last night because the machine was busier; the comparison inside the run is what counts.
  • Setup is as in my comment above. This PR is merged onto main b49be18. Only my timing patch is added: it writes each CreateComputePipelineState time to a file.

AI use: Claude Code (Claude Opus 5.5) built the binary, ran the measurements and wrote this; I posted it.

<!-- greyfinch-sync:ivall/xcl:comment:7181043742 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7181043742). Originally posted by [bielfreedom](https://github.com/bielfreedom) on 2026-11-26T02:42:15Z. --- @Kalmarv confirmed on the RX 9070 XT: at `c8c2b7a`, with no local change, `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1 xcl shaders --precompile` now makes the flat form. - **DXIL, all 2,689 compute programs:** 728.9 → 702.1 MB (−3.7 %, 2,639 changed). These are the same bytes, program for program, as my earlier run with the hand-added hookup. - **Driver, the same 26 large programs, 2 interleaved rounds (off, on, then on, off):** - Flag off: 66 pipelines, 91.6 / 100.2 s, peak 1.62 GB. - Flag on: 65 pipelines, 85.8 / 86.9 s, peak 1.34 / 1.27 GB. - No failures. Mean −10 %, in line with the −11 % before. - Both arms are slower than last night because the machine was busier; the comparison inside the run is what counts. - **Setup** is as in my comment above. This PR is merged onto `main` `b49be18`. Only my timing patch is added: it writes each `CreateComputePipelineState` time to a file. **AI use:** Claude Code (Claude Opus 5.5) built the binary, ran the measurements and wrote this; I posted it.
pvfreis commented 2026-11-26 03:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-26T03:01:39Z.


Follow-up, by reading only, not run, at c8c2b7a6 and #2428 970823e4. Both points are addressed.

  1. Baseline: the 1.1–3.8 times and 11–25 % are gone from both bodies, both commit messages and the heap_windows comment. Each remaining build-time figure names the form it was measured against (the guarded heap form, or the switch from before #2368). Still open, as both bodies say: build time against #2368's form.
  2. Scope: fixed. heap_flat is set in one place (kernel.rs:537), from reads_heap_flat, which is true only for kernel and CS entries, and with_mem_i32s is its only reader. Mesh and GS passes are translated as Entry::Mesh / Entry::Geometry, so they keep the guarded form with XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1. In #2428 they take heap windows only with XCL_HEAP_WINDOWS=1 (pso::mem_windows).

AI use: Claude Code (Claude Opus 5.5) checked this; Claude Fable 5.2 reviewed it; checked by a person before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7181329429 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7181329429). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-26T03:01:39Z. --- Follow-up, by reading only, not run, at `c8c2b7a6` and #2428 `970823e4`. Both points are addressed. 1. **Baseline:** the 1.1–3.8 times and 11–25 % are gone from both bodies, both commit messages and the `heap_windows` comment. Each remaining build-time figure names the form it was measured against (the guarded heap form, or the switch from before #2368). Still open, as both bodies say: build time against #2368's form. 2. **Scope:** fixed. `heap_flat` is set in one place (`kernel.rs:537`), from `reads_heap_flat`, which is true only for kernel and CS entries, and `with_mem_i32s` is its only reader. Mesh and GS passes are translated as `Entry::Mesh` / `Entry::Geometry`, so they keep the guarded form with `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1`. In #2428 they take heap windows only with `XCL_HEAP_WINDOWS=1` (`pso::mem_windows`). **AI use:** Claude Code (Claude Opus 5.5) checked this; Claude Fable 5.2 reviewed it; checked by a person before posting.
Kalmarv commented 2026-11-26 03:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T03:02:48Z.


@pvfreis thank you for reading both heads again.

On point 2: the scope is stated under Scope in this PR's description (compute programs only, kernel::reads_heap_flat), and only_compute_programs_read_heap_windows_flat tests it. #2428's description says so under How it decides: graphics, mesh and GS take heap windows only with XCL_HEAP_WINDOWS=1, through pso::mem_windows. On the open item, build time against #2368's form, the same-job rerun of the five programs is still queued.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7181346818 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7181346818). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-26T03:02:48Z. --- @pvfreis thank you for reading both heads again. On point 2: the scope is stated under **Scope** in this PR's description (compute programs only, `kernel::reads_heap_flat`), and `only_compute_programs_read_heap_windows_flat` tests it. #2428's description says so under **How it decides**: graphics, mesh and GS take heap windows only with `XCL_HEAP_WINDOWS=1`, through `pso::mem_windows`. On the open item, build time against #2368's form, the same-job rerun of the five programs is still queued. AI use: Claude Code (Claude Opus 5.5) wrote this reply.
upipibi commented 2026-11-26 20:31:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T20:31:14Z.


8 GB NVIDIA run on the current head c8c2b7a6 (base main 6d12f58a, merge-base 6d12f58a): RTX 3070 8 GB (Ampere, wave32, driver 616.56), Windows 11 26100, rustc 1.100.0, debug. Ryzen 9 5950X, 32 GB RAM.

  • XCL_HEAP_FLAT=1 (XCL_HEAP_WINDOWS unset), 3 of 3 runs: gpu_heap_flat_reads_match_the_switch_form and only_compute_programs_read_heap_windows_flat passed, none skipped.
  • XCL_HEAP_FLAT=1 cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4: 1292 passed, 0 failed, 26 ignored, 9 filtered out. 25 SKIPPED: 21 no wave64, 3 wave32 per-lane f16 forms, 1 needs Developer Mode to disable the driver cache.
  • 0 DXGI_ERROR_DEVICE_REMOVED, 0 nvlddmkm resets.

Tests only: no title run, no compile timing (driver cache cannot be disabled here).
AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).

<!-- greyfinch-sync:ivall/xcl:comment:7202779375 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7202779375). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T20:31:14Z. --- 8 GB NVIDIA run on the current head `c8c2b7a6` (base `main` 6d12f58a, merge-base 6d12f58a): RTX 3070 8 GB (Ampere, wave32, driver 616.56), Windows 11 26100, rustc 1.100.0, debug. Ryzen 9 5950X, 32 GB RAM. - `XCL_HEAP_FLAT=1` (XCL_HEAP_WINDOWS unset), 3 of 3 runs: `gpu_heap_flat_reads_match_the_switch_form` and `only_compute_programs_read_heap_windows_flat` passed, none skipped. - `XCL_HEAP_FLAT=1 cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4`: 1292 passed, 0 failed, 26 ignored, 9 filtered out. 25 SKIPPED: 21 no wave64, 3 wave32 per-lane f16 forms, 1 needs Developer Mode to disable the driver cache. - 0 DXGI_ERROR_DEVICE_REMOVED, 0 nvlddmkm resets. Tests only: no title run, no compile timing (driver cache cannot be disabled here). AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
itsd-effex commented 2026-11-27 00:21:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by itsd-effex on 2026-11-27T00:21:27Z.


Interaction with #2555 (startup preparation, now on main): prepare_for_launch builds its window flags by hand,

let mut windows = crate::gpu::uma::configured_runtime_windows() as u32;
if windows > 1 && recomp::pso::heap_windows() { windows |= recomp::HEAP_WINDOWS; }

so with this PR and XCL_HEAP_FLAT=1 it translates every compute program without HEAP_FLAT, while the runtime asks for the program with it (pso::windows_for). Each prepared compute program is then a translation the title never uses, and the driver compiles it cold at every launch until the caches hold both forms.

Measured on Linux (Wine + vkd3d-proton, NVIDIA, wave32), this PR on a branch merged with main 8b957bec, a retail title (title.exe), caches filled beforehand by xcl pipelines with the same settings:

preparation translation keys compute pipelines in preparation NVIDIA shader cache
as merged …_Compute_0_260_1 (precompile and runtime: …_772_1) ~2.5 per second, cold compiles +309 MB
with the fix below …_Compute_0_772_1 9,300 in about 30 s unchanged (all hits)

Fix: take the runtime's helper, as xcl shaders --precompile already does (runtime_windows):

fn launch_windows() -> u32 {
    runtime_windows(crate::gpu::uma::configured_runtime_windows() as u32)
}

with a test that runs itself in a child process with XCL_HEAP_WINDOWS=1 and XCL_HEAP_FLAT=1 / 0 (the switches are read once), mirroring precompile_windows_are_the_runtimes. Happy to push it as a commit for this PR if that helps; on main without this PR the flags agree, so the fix only matters once both are in.

AI use

  • Claude Code (Claude Opus 5.5) found the mismatch from the cache keys, wrote the fix and test, and drafted this comment; the numbers are from our own runs.
<!-- greyfinch-sync:ivall/xcl:comment:7206392339 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7206392339). Originally posted by [itsd-effex](https://github.com/itsd-effex) on 2026-11-27T00:21:27Z. --- **Interaction with #2555 (startup preparation, now on main):** `prepare_for_launch` builds its window flags by hand, ```rust let mut windows = crate::gpu::uma::configured_runtime_windows() as u32; if windows > 1 && recomp::pso::heap_windows() { windows |= recomp::HEAP_WINDOWS; } ``` so with this PR and `XCL_HEAP_FLAT=1` it translates every compute program without `HEAP_FLAT`, while the runtime asks for the program with it (`pso::windows_for`). Each prepared compute program is then a translation the title never uses, and the driver compiles it cold at every launch until the caches hold both forms. Measured on Linux (Wine + vkd3d-proton, NVIDIA, wave32), this PR on a branch merged with main `8b957bec`, a retail title (title.exe), caches filled beforehand by `xcl pipelines` with the same settings: | | preparation translation keys | compute pipelines in preparation | NVIDIA shader cache | |---|---|---|---| | as merged | `…_Compute_0_260_1` (precompile and runtime: `…_772_1`) | ~2.5 per second, cold compiles | +309 MB | | with the fix below | `…_Compute_0_772_1` | 9,300 in about 30 s | unchanged (all hits) | Fix: take the runtime's helper, as `xcl shaders --precompile` already does (`runtime_windows`): ```rust fn launch_windows() -> u32 { runtime_windows(crate::gpu::uma::configured_runtime_windows() as u32) } ``` with a test that runs itself in a child process with `XCL_HEAP_WINDOWS=1` and `XCL_HEAP_FLAT=1` / `0` (the switches are read once), mirroring `precompile_windows_are_the_runtimes`. Happy to push it as a commit for this PR if that helps; on main without this PR the flags agree, so the fix only matters once both are in. **AI use** - Claude Code (Claude Opus 5.5) found the mismatch from the cache keys, wrote the fix and test, and drafted this comment; the numbers are from our own runs.
JJAutoCompare commented 2026-11-27 00:38:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:38:45Z.


Tested: Clean c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7, Windows 11 build 26200.9974, Ryzen 7 3800X, Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC, DXC/DXIL 1.9.2602.17, debug. cargo test -j 2 -p xcl --lib --no-run; eight exact compiler/layout tests passed. Across ten Arc fixture invocations, libtest reported 9 passed and 1 failed, with one of the nine passes being the native-wave64 capability skip. The four-window direct DXIL fixture matched flat heap, guarded heap, and root UAV readbacks for all 64 logical lanes. The HLSL heap variant of gpu_heap_windows_divergent_lanes_match_switch_form produced 43 window-0 atomic increments, expected 22. It failed the same way on the exact parent 6d12f58a229bc73889878a448c64dc3af25eeba0; the assertion stops before that fixture's Direct DXIL cases.

Not tested: 8- and 16-window GPU execution, workspace suite, release, retail smoke and performance.

AI use: T3 Code / Codex (gpt-6.2-sol) ran and reran the fixtures and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7206632626 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7206632626). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-27T00:38:45Z. --- **Tested:** Clean `c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7`, Windows 11 build 26200.9974, Ryzen 7 3800X, Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC, DXC/DXIL 1.9.2602.17, debug. `cargo test -j 2 -p xcl --lib --no-run`; eight exact compiler/layout tests passed. Across ten Arc fixture invocations, libtest reported 9 passed and 1 failed, with one of the nine passes being the native-wave64 capability skip. The four-window direct DXIL fixture matched flat heap, guarded heap, and root UAV readbacks for all 64 logical lanes. The HLSL heap variant of `gpu_heap_windows_divergent_lanes_match_switch_form` produced 43 window-0 atomic increments, expected 22. It failed the same way on the exact parent `6d12f58a229bc73889878a448c64dc3af25eeba0`; the assertion stops before that fixture's Direct DXIL cases. **Not tested:** 8- and 16-window GPU execution, workspace suite, release, retail smoke and performance. **AI use:** T3 Code / Codex (`gpt-6.2-sol`) ran and reran the fixtures and wrote this report.
Decodere commented 2026-11-27 03:58:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T03:58:31Z.


Independent desktop NVIDIA verification of PR #2427 at head c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7 (1 commit; exact parent & merge-base: 6d12f58a229bc73889878a448c64dc3af25eeba0, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (c8c2b7a6)

Command Result
cargo test --release -p xcl --lib only_compute_programs_read_heap_windows_flat -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.00s × 3, 0 skipped)
cargo test --release -p xcl --lib gpu_heap_flat_reads_match_the_switch_form -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.27s, 0.19s, 0.19s, 0 skipped; live RTX 4060 execution)
cargo test --release -p xcl --lib precompile_windows_are_the_runtimes -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.02s × 3, 0 skipped)
cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4 (3 consecutive runs) 184 passed; 0 failed; 3 ignored; 1140 filtered out × 3 (3.81s, 3.61s, 4.02s; 1 self-skipped: dispatch_chain_native_wave64_builds_whole — no wave64 on Wave32-only Ada; 183 executed)
cargo test --release -p xcl --lib shaders:: (3 consecutive runs) 11 passed; 0 failed; 0 ignored; 1316 filtered out × 3 (0.19s, 0.19s, 0.18s; 1 self-skipped: pso_measurement_compiles_an_exact_synthetic_record — Windows Developer Mode off; 10 executed)
cargo build --release -p xcl Clean build (1m 10s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):

xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14004 MB

PR #2427 (c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7, default flags):

xcl-smoke v1
commit: c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1583 (PresentX 1583)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14024 MB

Runtime log observations (xcl.log)

  • 9223 log lines, 0 [ERROR] / device-removal / panic lines (dxil_cache: 460 hits, 0 misses, 0 compilation failures; 228 background pipelines, 0 failures).
  • Final draw/memory telemetry in log: 19435 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14023 MB committed by the process; video memory 6114 MB local, 4683 MB non-local.

Limits of coverage

  • Compute-only HEAP_FLAT gating, xcl shaders precompile/runtime window-flag parity, and on-GPU HEAP_FLAT vs. guarded switch-form equivalence were directly exercised on the RTX 4060 via all 3 new tests (3/3 each, 0 skipped).
  • The 60 s retail smoke ran with default flags (without XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1), confirming default-path non-regression (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR); NVIDIA driver compile-time reduction on large retail compute shaders under XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1 was not separately benchmarked here.
  • Two pre-existing tests self-skipped for host capabilities: gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole (no wave64 on Wave32-only Ada) and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode off).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7209417818 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7209417818). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T03:58:31Z. --- Independent desktop NVIDIA verification of **PR #2427** at head `c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7` (`1` commit; exact parent & merge-base: `6d12f58a229bc73889878a448c64dc3af25eeba0`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`c8c2b7a6`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib only_compute_programs_read_heap_windows_flat -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1326 filtered out` × 3 (`0.00s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib gpu_heap_flat_reads_match_the_switch_form -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1326 filtered out` × 3 (`0.27s`, `0.19s`, `0.19s`, `0` skipped; live RTX 4060 execution) | | `cargo test --release -p xcl --lib precompile_windows_are_the_runtimes -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1326 filtered out` × 3 (`0.02s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4` (3 consecutive runs) | `184 passed; 0 failed; 3 ignored; 1140 filtered out` × 3 (`3.81s`, `3.61s`, `4.02s`; `1` self-skipped: `dispatch_chain_native_wave64_builds_whole` — `no wave64` on Wave32-only Ada; `183` executed) | | `cargo test --release -p xcl --lib shaders::` (3 consecutive runs) | `11 passed; 0 failed; 0 ignored; 1316 filtered out` × 3 (`0.19s`, `0.19s`, `0.18s`; `1` self-skipped: `pso_measurement_compiles_an_exact_synthetic_record` — Windows Developer Mode off; `10` executed) | | `cargo build --release -p xcl` | Clean build (`1m 10s`, exit `0`, `0` new warnings) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`6d12f58a229bc73889878a448c64dc3af25eeba0`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1606 (PresentX 1606) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14004 MB ``` PR #2427 (`c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7`, default flags): ``` xcl-smoke v1 commit: c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1583 (PresentX 1583) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14024 MB ``` ### Runtime log observations (`xcl.log`) - `9223` log lines, `0` `[ERROR]` / device-removal / panic lines (`dxil_cache`: `460` hits, `0` misses, `0` compilation failures; `228` background pipelines, `0` failures). - Final draw/memory telemetry in log: `19435 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `14023 MB committed by the process; video memory 6114 MB local, 4683 MB non-local`. ### Limits of coverage - Compute-only `HEAP_FLAT` gating, `xcl shaders` precompile/runtime window-flag parity, and on-GPU `HEAP_FLAT` vs. guarded switch-form equivalence were directly exercised on the RTX 4060 via all 3 new tests (`3/3` each, `0` skipped). - The 60 s retail smoke ran with default flags (without `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1`), confirming default-path non-regression (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR); NVIDIA driver compile-time reduction on large retail compute shaders under `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1` was not separately benchmarked here. - Two pre-existing tests self-skipped for host capabilities: `gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole` (`no wave64` on Wave32-only Ada) and `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` (Windows Developer Mode off). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
futurepro62 commented 2026-11-27 06:14:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-27T06:14:05Z.


NVIDIA and AMD full-suite run, to go with the reports above by Decodere, JJAutoCompare, upipibi, since none of them covers AMD. Tested exact head c8c2b7a6 (on its base 6d12f58).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1414 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, dispatch_chain_native_wave64_builds_whole, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: only_compute_programs_read_heap_windows_flat, gpu_heap_flat_reads_match_the_switch_form, precompile_windows_are_the_runtimes.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1425 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main c2ee10e4 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7211339896 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7211339896). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-27T06:14:05Z. --- NVIDIA and AMD full-suite run, to go with the reports above by Decodere, JJAutoCompare, upipibi, since none of them covers AMD. Tested exact head `c8c2b7a6` (on its base `6d12f58`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1414 passed, 0 failed, 44 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `dispatch_chain_native_wave64_builds_whole`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `only_compute_programs_read_heap_windows_flat`, `gpu_heap_flat_reads_match_the_switch_form`, `precompile_windows_are_the_runtimes`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1425 passed, 0 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `c2ee10e4` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
throny commented 2026-11-27 22:28:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T22:28:33Z.


merge-check claim
head: c8c2b7a6b1

<!-- greyfinch-sync:ivall/xcl:comment:7229358454 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7229358454). Originally posted by [throny](https://github.com/throny) on 2026-11-27T22:28:33Z. --- merge-check claim head: c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7
throny commented 2026-11-27 23:13:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:13:00Z.


merge-check
base: 2c717a04
head: c8c2b7a6b1
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1469 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored
review: one gap, not a correctness risk: shaders::prepare_for_launch on main (shaders.rs:1817) still has its own rule for the window flags (it adds HEAP_WINDOWS, never HEAP_FLAT) and the PR does not touch it, so with XCL_HEAP_FLAT=1 the launcher prepares entries in the guarded form that the runtime never looks up; pso::windows_for there is a one-line fix (the same point was fixed for 'xcl shaders' in this PR). Bounds: a lane outside the windows, or not under the guard, reads window 0's raw view at its own offset; that view is bounds-checked by D3D12, so a read past it returns 0, and a select sets the value to 0 anyway; it cannot read outside the buffer, and the results match the guarded form. The new GPU test covers out-of-window and inactive lanes.
performance: off by default (needs XCL_HEAP_FLAT=1 and XCL_HEAP_WINDOWS=1), default cache keys unchanged; it does change translator sources, so every tester re-translates once. When on, every lane runs every read (more memory traffic, no branches); not measured here.
verdict: safe to merge (with the launcher line as a follow-up, or in this PR if the author prefers)
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).

<!-- greyfinch-sync:ivall/xcl:comment:7229964989 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7229964989). Originally posted by [throny](https://github.com/throny) on 2026-11-27T23:13:00Z. --- merge-check base: 2c717a04 head: c8c2b7a6b19d86aa3774dc62dfc2bb13b6aafac7 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1469 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored review: one gap, not a correctness risk: shaders::prepare_for_launch on main (shaders.rs:1817) still has its own rule for the window flags (it adds HEAP_WINDOWS, never HEAP_FLAT) and the PR does not touch it, so with XCL_HEAP_FLAT=1 the launcher prepares entries in the guarded form that the runtime never looks up; pso::windows_for there is a one-line fix (the same point was fixed for 'xcl shaders' in this PR). Bounds: a lane outside the windows, or not under the guard, reads window 0's raw view at its own offset; that view is bounds-checked by D3D12, so a read past it returns 0, and a select sets the value to 0 anyway; it cannot read outside the buffer, and the results match the guarded form. The new GPU test covers out-of-window and inactive lanes. performance: off by default (needs XCL_HEAP_FLAT=1 and XCL_HEAP_WINDOWS=1), default cache keys unchanged; it does change translator sources, so every tester re-translates once. When on, every lane runs every read (more memory traffic, no branches); not measured here. verdict: safe to merge (with the launcher line as a follow-up, or in this PR if the author prefers) 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).
bmjask commented 2026-11-29 14:50:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T14:50:19Z.


Current-main audit (2026-11-29): already implemented; please close this PR.

Current main contains 2f523330ae160ccca151bd6e0417a4bafbfd0d43 (Recompiler: flatten direct-DXIL compute heap reads), explicitly adapted from #2427. XCL_HEAP_FLAT, the compute-only branchless heap-read path, cache identity handling, offline/runtime window agreement, and tests are present.

No remaining code from this old conflicted head should be merged. Enabling the already-carried opt-in form intentionally creates distinct DXIL/PSO cache entries; leaving it unset preserves the guarded form's entries.

Review assisted by Codex; exact model name was not exposed in this session.

<!-- greyfinch-sync:ivall/xcl:comment:7257615505 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7257615505). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-29T14:50:19Z. --- **Current-main audit (2026-11-29): already implemented; please close this PR.** Current `main` contains `2f523330ae160ccca151bd6e0417a4bafbfd0d43` (`Recompiler: flatten direct-DXIL compute heap reads`), explicitly adapted from #2427. `XCL_HEAP_FLAT`, the compute-only branchless heap-read path, cache identity handling, offline/runtime window agreement, and tests are present. No remaining code from this old conflicted head should be merged. Enabling the already-carried opt-in form intentionally creates distinct DXIL/PSO cache entries; leaving it unset preserves the guarded form's entries. Review assisted by Codex; exact model name was not exposed in this session.
Foniass commented 2026-12-01 06:10:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:10:37Z.


Review (head c8c2b7a6, diff read, not a merge-check; it conflicts with main, so not built or run):

  • Superseded by main. 2f523330 ("Recompiler: flatten direct-DXIL compute heap reads", merged with #2959) says it's adapted from this PR, and main now has the flat read in with_mem_i32s (lower_mem.rs ~408), reads_heap_flat and its test (kernel.rs ~169), HEAP_FLAT / XCL_HEAP_FLAT (recomp/mod.rs ~97, pso.rs ~198) and the precompile-windows test (shaders.rs ~4983). Main went further: e8f7164b keeps HEAP_FLAT out of graphics cache keys, 3e2a48ec adds a flat vs guarded vs root-UAV GPU test with this PR's cases, and b5973e3e / 644b5188 extend the flat form.

Fine: the design and measurements here are what main's version is built on. Recommendation: close as superseded by 2f523330 (and #2428 should drop it as its base commit).

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7302574475 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7302574475). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:10:37Z. --- Review (head c8c2b7a6, diff read, not a merge-check; it conflicts with main, so not built or run): - **Superseded by main.** 2f523330 ("Recompiler: flatten direct-DXIL compute heap reads", merged with #2959) says it's adapted from this PR, and main now has the flat read in `with_mem_i32s` (`lower_mem.rs` ~408), `reads_heap_flat` and its test (`kernel.rs` ~169), `HEAP_FLAT` / `XCL_HEAP_FLAT` (`recomp/mod.rs` ~97, `pso.rs` ~198) and the precompile-windows test (`shaders.rs` ~4983). Main went further: e8f7164b keeps `HEAP_FLAT` out of graphics cache keys, 3e2a48ec adds a flat vs guarded vs root-UAV GPU test with this PR's cases, and b5973e3e / 644b5188 extend the flat form. Fine: the design and measurements here are what main's version is built on. Recommendation: close as superseded by 2f523330 (and #2428 should drop it as its base commit). AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
throny commented 2026-12-01 12:52:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:52:53Z.


Closing as superseded: this change is already on main (2f523330). main 2f523330 'flatten direct-DXIL compute heap reads' is adapted from this PR: reads_heap_flat in dxil/kernel.rs, HEAP_FLAT 0x200 flag, same test only_compute_programs_read_heap_windows_flat

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311782676 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2427#issuecomment-7311782676). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:52:53Z. --- Closing as superseded: this change is already on `main` (2f523330). main 2f523330 'flatten direct-DXIL compute heap reads' is adapted from this PR: reads_heap_flat in dxil/kernel.rs, HEAP_FLAT 0x200 flag, same test only_compute_programs_read_heap_windows_flat Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

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!2417
No description provided.