Recompiler: compact form also for branch-heavy programs of 2000+ blocks #3263

Merged
Foniass merged 3 commits from upstream-pr/3263 into main 2026-11-29 22:50:32 +00:00
Foniass commented 2026-11-29 02:18:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-11-29T02:18:27Z.


Note: the suite and smoke results below replace an earlier set that, by a test-setup mistake (shared cargo target directory), came from another PR's build. These were run with a forced rebuild of this head.

Stacked on #3261 (which is stacked on #3250); only the top commit (e618b742) belongs here.

amd-dev's 9887b414 (Saksukella): compact::large() asked only for 20,000+ reachable non-terminator instructions, so branch-heavy unrolled compute programs just under that (e.g. 56c0cd3b82a00c6e, about 32k blocks) stayed in the plain form and produced 2.6 MiB of DXIL. The NVIDIA / AMD driver then committed tens of GB to compile it. The threshold becomes 10,000 instructions or 2,000 reachable blocks; automatic_plan still asks for the repetition and the table limit before it takes the form.

What is in it

  • crates/xcl/src/gpu/dxil/compact.rs: LARGE_INSTS = 10_000, LARGE_BLOCKS = 2_000 in large()
  • crates/xcl/src/gpu/dxil/compact_tests.rs: a_large_program_that_repeats_itself_takes_the_compact_form checks 2500 / 500 copies (compact) and 400 (plain)

Tested

  • RTX 5070 Ti (driver 32.0.16.2114), AMD Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), debug tests, release smoke
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on e618b742: 2609 passed, 4 failed, 49 ignored. The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3: E_OUTOFMEMORY from CreateComputePipelineState at seeds 70 / 545 / 1019 / 1507, the same as on main on this machine; they pass on Kalmarv's RTX 5070 Ti, so they come from this machine's driver / setup, not the code. SKIPPED GPU tests: 30, almost all no wave64.
  • Retail title: 60 s smoke run below. The PR's run used -StartupTimeoutSeconds 3600 for the cold pipeline rebuild new DXIL needs.

Regression run

main:

xcl-smoke v1
commit: b10cc4c6766adc947c2054ada4a2af98be15108d
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1565 (PresentX 1565)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16026 MB

this PR:

xcl-smoke v1
commit: e618b7420706d8239c4462dba2cdbc0b49484731
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1584 (PresentX 1584)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 15805 MB

Not tested

  • AMD GPUs; whether the image looks the same; titles other than this one
  • which programs of a title change with the lower threshold, and whether the driver builds them all (the check that caught a refused pipeline in #3261)

AI use

  • Claude Code with Claude Opus 5.5: ported the commit to main, resolved conflicts (noted in the commit message), ran the tests and the smoke run above and wrote this description.
  • Original commit: amd-dev 9887b414 (Saksukella, cherry-picked there from 53995420); the subject is reworded to the repo's style.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5546753021 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3263). Originally posted by [Foniass](https://github.com/Foniass) on 2026-11-29T02:18:27Z. --- **Note:** the suite and smoke results below replace an earlier set that, by a test-setup mistake (shared cargo target directory), came from another PR's build. These were run with a forced rebuild of this head. Stacked on #3261 (which is stacked on #3250); only the top commit (`e618b742`) belongs here. amd-dev's `9887b414` (Saksukella): `compact::large()` asked only for 20,000+ reachable non-terminator instructions, so branch-heavy unrolled compute programs just under that (e.g. `56c0cd3b82a00c6e`, about 32k blocks) stayed in the plain form and produced 2.6 MiB of DXIL. The NVIDIA / AMD driver then committed tens of GB to compile it. The threshold becomes 10,000 instructions **or** 2,000 reachable blocks; `automatic_plan` still asks for the repetition and the table limit before it takes the form. **What is in it** - `crates/xcl/src/gpu/dxil/compact.rs`: `LARGE_INSTS = 10_000`, `LARGE_BLOCKS = 2_000` in `large()` - `crates/xcl/src/gpu/dxil/compact_tests.rs`: `a_large_program_that_repeats_itself_takes_the_compact_form` checks 2500 / 500 copies (compact) and 400 (plain) **Tested** - RTX 5070 Ti (driver 32.0.16.2114), AMD Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), debug tests, release smoke - `cargo test --workspace --no-fail-fast -- --test-threads=4` on e618b742: 2609 passed, 4 failed, 49 ignored. The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3`: `E_OUTOFMEMORY` from `CreateComputePipelineState` at seeds 70 / 545 / 1019 / 1507, the same as on main on this machine; they pass on Kalmarv's RTX 5070 Ti, so they come from this machine's driver / setup, not the code. SKIPPED GPU tests: 30, almost all `no wave64`. - Retail title: 60 s smoke run below. The PR's run used `-StartupTimeoutSeconds 3600` for the cold pipeline rebuild new DXIL needs. **Regression run** main: ``` xcl-smoke v1 commit: b10cc4c6766adc947c2054ada4a2af98be15108d gpu: NVIDIA GeForce RTX 5070 Ti title: 3cb1d8e0 seconds: 60 exit: 0x0 frames shown: 1565 (PresentX 1565) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16026 MB ``` this PR: ``` xcl-smoke v1 commit: e618b7420706d8239c4462dba2cdbc0b49484731 gpu: NVIDIA GeForce RTX 5070 Ti title: 3cb1d8e0 seconds: 60 exit: 0x0 frames shown: 1584 (PresentX 1584) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 15805 MB ``` **Not tested** - AMD GPUs; whether the image looks the same; titles other than this one - which programs of a title change with the lower threshold, and whether the driver builds them all (the check that caught a refused pipeline in #3261) **AI use** - Claude Code with Claude Opus 5.5: ported the commit to main, resolved conflicts (noted in the commit message), ran the tests and the smoke run above and wrote this description. - Original commit: amd-dev `9887b414` (Saksukella, cherry-picked there from `53995420`); the subject is reworded to the repo's style. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Kalmarv commented 2026-11-29 03:23:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-29T03:23:04Z.


merge-check
base: fa204595a4
head: e618b74207
merge: clean onto main and with the 7-PR stack.
build: cargo build --workspace -> ok; cargo build --release -p xcl -> ok.
tests: tested in the clean 7-PR stack (#3250+#3261+#3263+#3264+#3265+#3266+#3268) on main fa204595: cargo test --workspace --no-fail-fast -- --test-threads=4 (DXC 1.9.2609.5; -p xcl --lib rerun skipping the 2 known main #3187 uma_driver mixed-window tests a_refused_gpu_upload_segment_becomes_custom and mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment) -> 2620 passed, 0 failed, 49 ignored (2481 lib + 139 integration, 25 SKIPPED notices; all 4 fuzz_validate_and_gpu_0..3 passed); failing: none. 150 s xcl-smoke (ea3b5e4d, XCL_PREPARE=0, RTX 5070 Ti) on the combined 8-PR stack: exit: 0x0, 2096 frames shown, 0 device removals, 0 crashes, 0 display System events, 32049 MB peak commit.
review: none (whole diff read: lowers LARGE_INSTS to 10_000 and adds LARGE_BLOCKS = 2_000 in compact::large(), still gated by automatic_plan deduplication; compact_tests.rs updated to check 2500/500/400 copies).
performance: positive: avoids multi-MiB plain-form DXIL and driver memory spikes on branch-heavy 2000+ block shaders; no regression in 150 s smoke.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (wave32 only), Windows 11, DXC 1.9.2609.5 via XCL_DXC_DIR; Antigravity (Gemini 3.5 Pro) ran the merges, builds, workspace test suites, 150 s title smokes, diff reviews, and drafted this check.

<!-- greyfinch-sync:ivall/xcl:comment:7250014658 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3263#issuecomment-7250014658). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-29T03:23:04Z. --- merge-check base: fa204595a488c60c6c5f905244f0172072c9c2a9 head: e618b7420706d8239c4462dba2cdbc0b49484731 merge: clean onto main and with the 7-PR stack. build: cargo build --workspace -> ok; cargo build --release -p xcl -> ok. tests: tested in the clean 7-PR stack (#3250+#3261+#3263+#3264+#3265+#3266+#3268) on main `fa204595`: `cargo test --workspace --no-fail-fast -- --test-threads=4` (DXC 1.9.2609.5; `-p xcl --lib` rerun skipping the 2 known `main` #3187 `uma_driver` mixed-window tests `a_refused_gpu_upload_segment_becomes_custom` and `mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment`) -> 2620 passed, 0 failed, 49 ignored (2481 lib + 139 integration, 25 SKIPPED notices; all 4 `fuzz_validate_and_gpu_0..3` passed); failing: none. 150 s `xcl-smoke` (`ea3b5e4d`, `XCL_PREPARE=0`, RTX 5070 Ti) on the combined 8-PR stack: `exit: 0x0`, `2096` frames shown, `0` device removals, `0` crashes, `0` display System events, `32049 MB` peak commit. review: none (whole diff read: lowers `LARGE_INSTS` to 10_000 and adds `LARGE_BLOCKS = 2_000` in `compact::large()`, still gated by `automatic_plan` deduplication; `compact_tests.rs` updated to check 2500/500/400 copies). performance: positive: avoids multi-MiB plain-form DXIL and driver memory spikes on branch-heavy 2000+ block shaders; no regression in 150 s smoke. verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (wave32 only), Windows 11, DXC 1.9.2609.5 via XCL_DXC_DIR; Antigravity (Gemini 3.5 Pro) ran the merges, builds, workspace test suites, 150 s title smokes, diff reviews, and drafted this check.
KOLESNiii commented 2026-11-29 19:32:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T19:32:41Z.


Test report: cold driver compile time with this stack on an RTX 2070 SUPER (Turing, 8 GB). One run per record, so read it as a direction.

I merged both of Foniass's stacks onto main 0fe06eb0 (this PR's #3250 → #3261 → #3263 and #3266 → #3268 → #3269; they merge without conflicts) and compared that build with main. The numbers are for both stacks together: I did not measure them separately.

Setup

  • RTX 2070 SUPER 8 GB (driver 621.40, 32-lane waves), Ryzen 5 3600XT, Windows 11 26300, release builds, Rust 1.100.1 (merged head 477e2b69).
  • xcl shaders <retail game's shaders.rpf> --measure-pso <record> --repeat 1: the driver's shader caches are turned off (ShaderCacheControl, Developer Mode), so every build is cold. One compile at a time, through a local exclusive queue.

Results (DXIL bytes, cold CreateComputePipelineState s)

record main both stacks both stacks + XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1
95cc13288a27a96e 1,221,312 B, 34.1 s 252,036 B, 6.6 s 228,824 B, 5.6 s
2e1d03fbed9d95eb 1,387,508 B, 33.9 s 948,960 B, 33.1 s 730,648 B, 21.1 s
958400d2caf07244 618,416 B, 14.5 s 260,476 B, 7.2 s 252,436 B, 7.9 s
56c0cd3b82a00c6e 682,480 B, 18.1 s 298,888 B, 10.0 s 286,604 B, 10.2 s
1d4ecf4cb407d4fe 506,032 B, 8.8 s 346,680 B, 8.6 s 278,744 B, 5.0 s
total 109.5 s 65.5 s (−40 %) 49.8 s (−55 %)
  • The biggest gain is on 95cc…, the program #3261 names: 4.8× less DXIL and 5.1× faster to build cold here. 958400d2… and 56c0cd3b…: about half. The plain-form programs (2e1d…, 1d4e…) shrink 27–32 % but build barely faster; heap windows help those instead, so the two are complementary.
  • Every build succeeded on this 8 GB card (no E_OUTOFMEMORY).

Not tested: the stacks separately; the suite and a title run of the merged build (only pipeline builds); whether the image is the same; AMD.

AI use: Claude Code (Claude Opus 5.5) merged and built the stacks, ran the queued job and wrote this report.

Context: why DXIL size matters for cold compilation. On this title, compute programs whose whole DXIL is 512 KiB or larger are 27 % of the 2,730 compute programs but about 95 % of a cold full preparation's compute driver work (driver time weighted as size^1.6, fitted to 1,340 cold compiles on this card). So size reductions count almost only on those programs. Breakdown by size band: https://github.com/xcl-dev/xcl/issues/2088#issuecomment-7262349510

<!-- greyfinch-sync:ivall/xcl:comment:7261363344 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3263#issuecomment-7261363344). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T19:32:41Z. --- **Test report: cold driver compile time with this stack on an RTX 2070 SUPER (Turing, 8 GB).** One run per record, so read it as a direction. I merged both of Foniass's stacks onto `main` 0fe06eb0 (this PR's #3250 → #3261 → #3263 and #3266 → #3268 → #3269; they merge without conflicts) and compared that build with `main`. The numbers are for **both stacks together**: I did not measure them separately. **Setup** - RTX 2070 SUPER 8 GB (driver 621.40, 32-lane waves), Ryzen 5 3600XT, Windows 11 26300, release builds, Rust 1.100.1 (merged head 477e2b69). - `xcl shaders <retail game's shaders.rpf> --measure-pso <record> --repeat 1`: the driver's shader caches are turned off (`ShaderCacheControl`, Developer Mode), so every build is cold. One compile at a time, through a local exclusive queue. **Results** (DXIL bytes, cold `CreateComputePipelineState` s) | record | `main` | both stacks | both stacks + `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1` | |---|---|---|---| | `95cc13288a27a96e` | 1,221,312 B, 34.1 s | 252,036 B, 6.6 s | 228,824 B, 5.6 s | | `2e1d03fbed9d95eb` | 1,387,508 B, 33.9 s | 948,960 B, 33.1 s | 730,648 B, 21.1 s | | `958400d2caf07244` | 618,416 B, 14.5 s | 260,476 B, 7.2 s | 252,436 B, 7.9 s | | `56c0cd3b82a00c6e` | 682,480 B, 18.1 s | 298,888 B, 10.0 s | 286,604 B, 10.2 s | | `1d4ecf4cb407d4fe` | 506,032 B, 8.8 s | 346,680 B, 8.6 s | 278,744 B, 5.0 s | | **total** | **109.5 s** | **65.5 s (−40 %)** | **49.8 s (−55 %)** | - The biggest gain is on `95cc…`, the program #3261 names: 4.8× less DXIL and 5.1× faster to build cold here. `958400d2…` and `56c0cd3b…`: about half. The plain-form programs (`2e1d…`, `1d4e…`) shrink 27–32 % but build barely faster; heap windows help those instead, so the two are complementary. - Every build succeeded on this 8 GB card (no `E_OUTOFMEMORY`). **Not tested:** the stacks separately; the suite and a title run of the merged build (only pipeline builds); whether the image is the same; AMD. AI use: Claude Code (Claude Opus 5.5) merged and built the stacks, ran the queued job and wrote this report. **Context: why DXIL size matters for cold compilation.** On this title, compute programs whose whole DXIL is 512 KiB or larger are 27 % of the 2,730 compute programs but about 95 % of a cold full preparation's compute driver work (driver time weighted as size^1.6, fitted to 1,340 cold compiles on this card). So size reductions count almost only on those programs. Breakdown by size band: https://github.com/xcl-dev/xcl/issues/2088#issuecomment-7262349510
KOLESNiii commented 2026-11-29 19:37:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T19:37:19Z.


merge-check claim
head: e618b74207

<!-- greyfinch-sync:ivall/xcl:comment:7261424357 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3263#issuecomment-7261424357). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T19:37:19Z. --- merge-check claim head: e618b7420706d8239c4462dba2cdbc0b49484731
KOLESNiii commented 2026-11-29 19:56:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T19:56:04Z.


merge-check
base: 0fe06eb0f0
head: e618b74207
merge: clean. The merge carries the whole stack: e13ccd7f (#3250), 16f2f5c1 (#3261) and e618b742 (this PR's own commit); everything below is about that whole merge.
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2743 passed, 0 failed, 49 ignored, 28 SKIPPED: 22 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 2 no heap windows (one of them the opt-in XCL_HEAP_WINDOWS=1 test), 1 no GPU_UPLOAD heaps; failing: none. The base 0fe06eb0, run alone on this PC with the same command and its own target dir: 2737 passed, 0 failed, 49 ignored, the same 28 SKIPPED. The PR's changed test a_large_program_that_repeats_itself_takes_the_compact_form passed. All 4 fuzz_validate_and_gpu_0..3 passed here (8 GB card). Each suite ran alone in the queue.
review: 4 minor findings, no major or critical one.

  • [minor] crates/xcl/src/gpu/dxil/compact.rs:227,265: MAX_TABLE_WORDS goes from 12,288 to 32,768 on every GPU, and with LARGE_INSTS 10,000 / LARGE_BLOCKS 2,000 more programs reach automatic_plan (kernel.rs:410) -> on AMD, programs that are plain on main become larger compact pipelines, untested there. Evidence: e964ad22 saw an RX 9070 XT reach 24 GB building the compact form of a 9,219-word program (neither form built); 3cde0cc3 since allows 12,288 words on every GPU; nothing gates the new limit by vendor, and no test covers a table above 12,288 words (compact_tests.rs:274 asserts p.words() <= 12288). Not a confirmed regression; the maintainer's RDNA4 run is what would show it.
  • [minor] compact.rs:241-249: Plan::words(), which the cap is checked against, leaves out the new xcl_pc, xcl_lit_idx and xcl_lit_pool tables (compact.rs:786, :810) -> a program can take the compact form with more table words than MAX_TABLE_WORDS.
  • [minor] compact_tests.rs: the S_GETPC_B64 block-PC parameterization, the far-jump veneer strip and dead SGPR / SCC store removal on a compute entry have no test (every compact GPU test uses Entry::Kernel, where all SGPRs are live at the end) -> new logic ships untested. Read the code; found no defect in them.
  • [minor] compact.rs:321, :343: the comments say repeated heavy memory ops are split out at >= 4 occurrences; the code does it at >= 2 (compact.rs:359).
    Checked without a finding: the DEFINE_ABBREV encoding and abbreviation ids (function block width 4, 12 abbreviations; constants block width 3, 3), field widths, and abbreviated record layouts against the unabbreviated ones; CST_CODE_DATA never empty; micro-block splitting keeps instruction order; literal parameterization only for a block with one literal-bearing instruction; SGPR / SCC use-def sets against the operand table, with VCC, EXEC and M0 never elided; veneer strip relies on resolve_far_jumps' exact register match.
    performance: measured on this PC in the earlier test report on this PR ( cold CreateComputePipelineState with the driver's caches off, one run per record): main 0fe06eb0 with this stack and the #3266 -> #3269 stack merged together (not this stack alone) took 65.5 s against main's 109.5 s over 5 large compute programs, with 2.3-4.8x less DXIL on the three compact-form ones. Not measured here: frame time, and the extra per-iteration table loads in the compact loop head. Every direct-DXIL translation changes, so such programs are translated and built again once.
    verdict: safe to merge
    hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 90e952bb98be58f5d9387dbd13789634dbf77d41 (local, not pushed). Not tested: AMD, native wave64. Claude Code: Claude Opus 5.5 (coordination, draft), Claude Opus 5.5 (full-diff review), Claude Opus 5.5 (recompiler review).
<!-- greyfinch-sync:ivall/xcl:comment:7261674407 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3263#issuecomment-7261674407). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T19:56:04Z. --- merge-check base: 0fe06eb0f05459007ebfffc67bb9983acb3a832d head: e618b7420706d8239c4462dba2cdbc0b49484731 merge: clean. The merge carries the whole stack: e13ccd7f (#3250), 16f2f5c1 (#3261) and e618b742 (this PR's own commit); everything below is about that whole merge. build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2743 passed, 0 failed, 49 ignored, 28 SKIPPED: 22 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 2 no heap windows (one of them the opt-in XCL_HEAP_WINDOWS=1 test), 1 no GPU_UPLOAD heaps; failing: none. The base 0fe06eb0, run alone on this PC with the same command and its own target dir: 2737 passed, 0 failed, 49 ignored, the same 28 SKIPPED. The PR's changed test a_large_program_that_repeats_itself_takes_the_compact_form passed. All 4 fuzz_validate_and_gpu_0..3 passed here (8 GB card). Each suite ran alone in the queue. review: 4 minor findings, no major or critical one. - [minor] crates/xcl/src/gpu/dxil/compact.rs:227,265: MAX_TABLE_WORDS goes from 12,288 to 32,768 on every GPU, and with LARGE_INSTS 10,000 / LARGE_BLOCKS 2,000 more programs reach automatic_plan (kernel.rs:410) -> on AMD, programs that are plain on main become larger compact pipelines, untested there. Evidence: e964ad22 saw an RX 9070 XT reach 24 GB building the compact form of a 9,219-word program (neither form built); 3cde0cc3 since allows 12,288 words on every GPU; nothing gates the new limit by vendor, and no test covers a table above 12,288 words (compact_tests.rs:274 asserts `p.words() <= 12288`). Not a confirmed regression; the maintainer's RDNA4 run is what would show it. - [minor] compact.rs:241-249: Plan::words(), which the cap is checked against, leaves out the new xcl_pc, xcl_lit_idx and xcl_lit_pool tables (compact.rs:786, :810) -> a program can take the compact form with more table words than MAX_TABLE_WORDS. - [minor] compact_tests.rs: the S_GETPC_B64 block-PC parameterization, the far-jump veneer strip and dead SGPR / SCC store removal on a compute entry have no test (every compact GPU test uses Entry::Kernel, where all SGPRs are live at the end) -> new logic ships untested. Read the code; found no defect in them. - [minor] compact.rs:321, :343: the comments say repeated heavy memory ops are split out at `>= 4` occurrences; the code does it at `>= 2` (compact.rs:359). Checked without a finding: the DEFINE_ABBREV encoding and abbreviation ids (function block width 4, 12 abbreviations; constants block width 3, 3), field widths, and abbreviated record layouts against the unabbreviated ones; CST_CODE_DATA never empty; micro-block splitting keeps instruction order; literal parameterization only for a block with one literal-bearing instruction; SGPR / SCC use-def sets against the operand table, with VCC, EXEC and M0 never elided; veneer strip relies on resolve_far_jumps' exact register match. performance: measured on this PC in the earlier test report on this PR ( cold CreateComputePipelineState with the driver's caches off, one run per record): main 0fe06eb0 with this stack and the #3266 -> #3269 stack merged together (not this stack alone) took 65.5 s against main's 109.5 s over 5 large compute programs, with 2.3-4.8x less DXIL on the three compact-form ones. Not measured here: frame time, and the extra per-iteration table loads in the compact loop head. Every direct-DXIL translation changes, so such programs are translated and built again once. verdict: safe to merge hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 90e952bb98be58f5d9387dbd13789634dbf77d41 (local, not pushed). Not tested: AMD, native wave64. Claude Code: Claude Opus 5.5 (coordination, draft), Claude Opus 5.5 (full-diff review), Claude Opus 5.5 (recompiler review).
KOLESNiii commented 2026-11-29 21:42:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T21:42:53Z.


Test report: full startup shader preparation, cold cache, with #3442 + the #3263 stack + the #3269 stack together

One run of a build that combines these three PRs. It shows what they do together; it does not say how much each one contributes.

Build: a96b183c, local merge of 4465c886 (main 3b6a91ed + #3318 #3321 #3323 #3325 #3328 #3330 #3332 #3336 #3364 #3377 + #3241 + #3242) with:

cargo build --release -p xcl. Also set: XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1 (stands in for #2428, which does not merge onto this set).

This PR in the build: the whole stack, #3250 e13ccd7f, #3261 16f2f5c1, #3263 e618b742 (the current head).

Run: retail game, XCL_PREPARE_ALL=1 (all 26,503 records), XCL_RUN_SECONDS=180 (ends 180 s after the title starts), XCL_ACTIVITY=1. Cold XCL cache: XCL_DXIL_CACHE pointed at a new, empty folder, so no translation, DXC output or driver blob was reused.

Compared with: the same retail game and settings on 4465c886 alone (the base above, without the three PRs and without the heap switches), run earlier today with a warm cache: it started with 48,305 translations, 44,556 DXIL files and 13,051 driver blobs, and reused about half of its driver blobs.

base 4465c886, warm cache + #3442 + #3263 stack + #3269 stack, cold cache
translation + DXC (26,503 records) 1,353 s 1,619 s
driver compute pipelines 10,868 s 3,413 s
graphics pipelines 374 in ~80 s 391 in 100 s
title first presents 12,326 s (3 h 25 min) 5,141 s (1 h 26 min)
driver blobs made 12,304 new (25,355 in cache) 3,277
failed / fallback pipelines, crash 0 / 0 / none 0 / 0 / none
frames in the 180 s of play 5,104 3,818
  • Preparation finished 2.4× sooner even though the base was given the warm cache. Nearly all of the saving is in the driver's compute pipelines (3.2× shorter), the long tail where the very large compute programs are compiled.
  • The run made far fewer distinct driver pipelines (3,277 blobs against 25,355), which fits shorter, more compact programs reaching the driver.
  • Frames in play were 25 % lower (3,818 against 5,104). One 180 s run per side, with different builds, the heap switches on and the game possibly at a different point, so this is not a measured regression, but it needs a matched check (smoke on main and on this PR's head) before anyone reads the preparation result as free.

Not tested / limits

  • Each PR on its own; the share of #3442 against the two stacks is unknown.
  • The commits tested are not all current heads: #3263's head is the one tested; #3442 (now 30122062) and #3269 (now e01151a2, with #3268 now 64f666c0) have changed since, so this report is for the commits listed above.
  • NVIDIA's own shader cache was left on for the cold run (the base run had it on too).
  • One run per side; RTX 2070 SUPER only (wave32). Not tested on AMD.

Hardware: NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40), AMD Ryzen 5 3600XT, 32 GB, Windows 11 Home build 26300, rustc 1.100.1.

Tool and model: Claude Code (Claude Opus 5.5): two sessions on this machine ran the queued runs; this one extracted the numbers from their logs and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7263092285 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3263#issuecomment-7263092285). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T21:42:53Z. --- **Test report: full startup shader preparation, cold cache, with #3442 + the #3263 stack + the #3269 stack together** One run of a build that combines these three PRs. It shows what they do **together**; it does not say how much each one contributes. **Build:** `a96b183c`, local merge of 4465c886 (main 3b6a91ed + #3318 #3321 #3323 #3325 #3328 #3330 #3332 #3336 #3364 #3377 + #3241 + #3242) with: - #3442 as `4511c6e5`; - #3263 stack (#3250 `e13ccd7f`, #3261 `16f2f5c1`, #3263 `e618b742`); - #3269 stack (#3266 `a343eafc`, #3268 `527a8b26`, #3269 `4a8217a7`). `cargo build --release -p xcl`. Also set: `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1` (stands in for #2428, which does not merge onto this set). **This PR in the build:** the whole stack, #3250 `e13ccd7f`, #3261 `16f2f5c1`, #3263 `e618b742` (the current head). **Run:** retail game, `XCL_PREPARE_ALL=1` (all 26,503 records), `XCL_RUN_SECONDS=180` (ends 180 s after the title starts), `XCL_ACTIVITY=1`. **Cold XCL cache:** `XCL_DXIL_CACHE` pointed at a new, empty folder, so no translation, DXC output or driver blob was reused. **Compared with:** the same retail game and settings on 4465c886 alone (the base above, without the three PRs and without the heap switches), run earlier today with a **warm** cache: it started with 48,305 translations, 44,556 DXIL files and 13,051 driver blobs, and reused about half of its driver blobs. | | base 4465c886, warm cache | + #3442 + #3263 stack + #3269 stack, **cold** cache | |---|---|---| | translation + DXC (26,503 records) | 1,353 s | 1,619 s | | driver compute pipelines | 10,868 s | **3,413 s** | | graphics pipelines | 374 in ~80 s | 391 in 100 s | | title first presents | 12,326 s (3 h 25 min) | **5,141 s (1 h 26 min)** | | driver blobs made | 12,304 new (25,355 in cache) | 3,277 | | failed / fallback pipelines, crash | 0 / 0 / none | 0 / 0 / none | | frames in the 180 s of play | 5,104 | 3,818 | - Preparation finished **2.4× sooner even though the base was given the warm cache.** Nearly all of the saving is in the driver's compute pipelines (3.2× shorter), the long tail where the very large compute programs are compiled. - The run made far fewer distinct driver pipelines (3,277 blobs against 25,355), which fits shorter, more compact programs reaching the driver. - **Frames in play were 25 % lower** (3,818 against 5,104). One 180 s run per side, with different builds, the heap switches on and the game possibly at a different point, so this is not a measured regression, but it needs a matched check (smoke on main and on this PR's head) before anyone reads the preparation result as free. **Not tested / limits** - Each PR on its own; the share of #3442 against the two stacks is unknown. - The commits tested are not all current heads: #3263's head is the one tested; #3442 (now `30122062`) and #3269 (now `e01151a2`, with #3268 now `64f666c0`) have changed since, so this report is for the commits listed above. - NVIDIA's own shader cache was left on for the cold run (the base run had it on too). - One run per side; RTX 2070 SUPER only (wave32). Not tested on AMD. **Hardware:** NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40), AMD Ryzen 5 3600XT, 32 GB, Windows 11 Home build 26300, rustc 1.100.1. **Tool and model:** Claude Code (Claude Opus 5.5): two sessions on this machine ran the queued runs; this one extracted the numbers from their logs and wrote this report.
KOLESNiii commented 2026-11-29 22:39:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T22:39:23Z.

Review: COMMENTED


Static review of e618b742 for the stack in the #3041 comparison.

The threshold change itself looks consistent with the tested intent. It makes more wave32 shaders eligible for compaction and therefore exposes an inherited correctness issue I found in #3261. The compact liveness pass can drop a live high SGPR store across a SAVEEXEC_B64 instruction because wave32 lowering writes only the low destination. This is new review evidence for the stack carried by this PR.

Review assisted by Codex (GPT-6, exact variant unavailable). No new build or GPU run for this review.

<!-- greyfinch-sync:ivall/xcl:review:6105175151 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3263#pullrequestreview-6105175151). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T22:39:23Z. **Review:** COMMENTED --- Static review of `e618b742` for the stack in the [#3041 comparison](https://github.com/xcl-dev/xcl/issues/3041#issuecomment-7263214809). The threshold change itself looks consistent with the tested intent. It makes more wave32 shaders eligible for compaction and therefore exposes an inherited correctness issue I found in [#3261](https://github.com/xcl-dev/xcl/pull/3261). The compact liveness pass can drop a live high SGPR store across a `SAVEEXEC_B64` instruction because wave32 lowering writes only the low destination. This is new review evidence for the stack carried by this PR. Review assisted by Codex (GPT-6, exact variant unavailable). No new build or GPU run for this review.
Foniass commented 2026-11-29 23:25:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-11-29T23:25:55Z.


Thanks for the review. Your 4 points are now handled in follow-ups, since this was merged:

  • Plan::words() leaving out the new tables: fixed in #3475.
  • The PC parameterization, veneer strip and compute-entry liveness had no tests: #3475 adds tests, run on NVIDIA and an AMD RDNA2 iGPU.
  • The >= 4 comments: fixed in #3475.
  • MAX_TABLE_WORDS 32768 on every GPU: kept. One program in the retail title has a 16121-word plan and would fall back to the plain form at 12288. amd-dev runs 32768 by default on RDNA4. I could not measure that program's build memory on AMD; #3475 says so under Not tested.

Separately, the AMD iGPU also showed that the literal table read 0 on AMD (moombathepilot's #3261 finding). That fix is #3473.

(Claude Code, Claude Opus 5.5, for Foniass)

<!-- greyfinch-sync:ivall/xcl:comment:7264455236 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3263#issuecomment-7264455236). Originally posted by [Foniass](https://github.com/Foniass) on 2026-11-29T23:25:55Z. --- Thanks for the review. Your 4 points are now handled in follow-ups, since this was merged: - `Plan::words()` leaving out the new tables: fixed in #3475. - The PC parameterization, veneer strip and compute-entry liveness had no tests: #3475 adds tests, run on NVIDIA and an AMD RDNA2 iGPU. - The `>= 4` comments: fixed in #3475. - `MAX_TABLE_WORDS` 32768 on every GPU: kept. One program in the retail title has a 16121-word plan and would fall back to the plain form at 12288. amd-dev runs 32768 by default on RDNA4. I could not measure that program's build memory on AMD; #3475 says so under Not tested. Separately, the AMD iGPU also showed that the literal table read 0 on AMD (moombathepilot's #3261 finding). That fix is #3473. (Claude Code, Claude Opus 5.5, for Foniass)
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!3263
No description provided.