Recompiler: enable scalar reload CSE for direct DXIL vertex and pixel shaders #2436

Open
emusynths wants to merge 1 commit from upstream-pr/2446 into main
emusynths commented 2026-11-25 19:18:20 +00:00 (Migrated from github.com)

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


Enable scalar reload CSE (reload::analyze) for direct-DXIL vertex and pixel shaders (Entry::Vertex, Entry::Pixel). Previously follow_loads was restricted to Entry::Kernel | Entry::Compute(_) because two-phase Entry::Geometry enters its GS blocks via edges outside the CFG; vertex and pixel shaders use the exact same single-entry Cfg::build as compute, so repeated s_load_dword* descriptor reloads can safely reuse their first values and avoid redundant memory-window switches.

Part of #2088.

What is in it

  • crates/xcl/src/gpu/dxil/kernel.rs: include Entry::Vertex(_) | Entry::Pixel(_) in follow_loads so reload::analyze(&cfg) runs for direct-DXIL VS and PS.
  • crates/xcl/src/gpu/dxil/reload.rs: add graphics_stages_emit_a_repeated_load_once verifying DXIL validation, repeated s_load_dwordx4 elimination, and store-invalidation across 4 memory windows for both translate_vertex and translate_pixel.
  • Added an execution parity test that overwrites the scalar destination, reloads it in each graphics stage, then checks the rasterized pixels against HLSL and the expected positions and colors.

Tested

  • Hardware: NVIDIA GeForce RTX 5090 32 GB (driver 621.01, wave32-only), AMD Ryzen 9 5950X, 64 GB RAM, Windows 11 26300, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, debug tests / release benchmarks and smoke runs.

  • Clean head 3a71471c80. cargo build --workspace succeeded. cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output reported 1361 passed, 4 failed, 46 ignored and 25 SKIPPED notices (1 heap windows unavailable, 21 no wave64, 3 unsupported per-lane translation). The four NVIDIA compute fuzz failures match #1905.

  • Both gpu_graphics_scalar_reloads_match_hlsl and graphics_stages_emit_a_repeated_load_once passed on the RTX 5090.

  • Cold RTX 5090 pixel-shader CreateGraphicsPipelineState benchmark (XCL_DIRECT_DXIL=all, XCL_TRANSLATED_CACHE=0, --windows 4 --repeat 3, ShaderCacheControl(IMPLICIT_DRIVER_MANAGED | IMPLICIT_D3D_CACHE_FOR_DRIVER, DISABLE), distinct exe basenames per build, measured with #2438's --measure-pso on 2898511 vs 926428e):

Record hash Base DXIL PR DXIL Base median PR median Delta
c7f0a851a539391c 706,072 B 696,280 B (−9.8 KB) 10.948 s 8.856 s −19.1%
1f0e250e6f22b059 725,608 B 721,928 B (−3.7 KB) 10.211 s 10.851 s +6.3%
3552327805b442b7 620,804 B 613,984 B (−6.8 KB) 9.021 s 8.466 s −6.2%
7221675a6826d876 692,424 B 687,840 B (−4.6 KB) 10.471 s 9.657 s −7.8%
34253cc8188405fd 639,392 B 631,176 B (−8.2 KB) 8.597 s 8.822 s +2.6%
Sum (5 PS) 3,384 KB 3,351 KB (−33 KB) 49.248 s 46.652 s −5.3%

Regression run
60 seconds per build, XCL_NETWORK=0, XCL_PRESS_AT=18:A,30:A,44:A,52:A and XCL_FRAME_DUMP=300.
XCL_DIRECT_DXIL=all on both builds.

main

xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 5090
title: a155fb60
seconds: 60
exit: 0x0
frames shown: 1420 (PresentX 1420)
presents per 2 s (last 3): 39 21 0
device removals: 0
crashes: 0
peak commit: 22144 MB

PR head

xcl-smoke v1
commit: 3a71471c80b842d8e6f2bffd74556947fc11921b
gpu: NVIDIA GeForce RTX 5090
title: a155fb60
seconds: 60
exit: 0x0
frames shown: 1342 (PresentX 1342)
presents per 2 s (last 3): 47 27 0
device removals: 0
crashes: 0
peak commit: 21714 MB

Not tested
AMD, Intel, native wave64 and shader execution-time benchmarks on this revision.

AI use

  • Antigravity (Gemini 4 Neon): inspected the codebase, implemented the change and unit test, ran the test suite, cold --measure-pso benchmarks, and smoke runs, and drafted this PR description.
  • Codex (GPT-6) prepared the initial review follow-up. Codex (gpt-6.2-astra) completed the update and ran the reported workspace and post-push smoke checks.
<!-- greyfinch-sync:ivall/xcl:issue:5497624211 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446). Originally posted by [emusynths](https://github.com/emusynths) on 2026-11-25T19:18:20Z. --- Enable scalar reload CSE (`reload::analyze`) for direct-DXIL vertex and pixel shaders (`Entry::Vertex`, `Entry::Pixel`). Previously `follow_loads` was restricted to `Entry::Kernel | Entry::Compute(_)` because two-phase `Entry::Geometry` enters its GS blocks via edges outside the CFG; vertex and pixel shaders use the exact same single-entry `Cfg::build` as compute, so repeated `s_load_dword*` descriptor reloads can safely reuse their first values and avoid redundant memory-window switches. Part of #2088. **What is in it** - `crates/xcl/src/gpu/dxil/kernel.rs`: include `Entry::Vertex(_) | Entry::Pixel(_)` in `follow_loads` so `reload::analyze(&cfg)` runs for direct-DXIL VS and PS. - `crates/xcl/src/gpu/dxil/reload.rs`: add `graphics_stages_emit_a_repeated_load_once` verifying DXIL validation, repeated `s_load_dwordx4` elimination, and store-invalidation across 4 memory windows for both `translate_vertex` and `translate_pixel`. - Added an execution parity test that overwrites the scalar destination, reloads it in each graphics stage, then checks the rasterized pixels against HLSL and the expected positions and colors. **Tested** - Hardware: NVIDIA GeForce RTX 5090 32 GB (driver 621.01, wave32-only), AMD Ryzen 9 5950X, 64 GB RAM, Windows 11 26300, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC 1.9.2609.5, debug tests / release benchmarks and smoke runs. - Clean head 3a71471c80b842d8e6f2bffd74556947fc11921b. cargo build --workspace succeeded. cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output reported 1361 passed, 4 failed, 46 ignored and 25 SKIPPED notices (1 heap windows unavailable, 21 no wave64, 3 unsupported per-lane translation). The four NVIDIA compute fuzz failures match #1905. - Both gpu_graphics_scalar_reloads_match_hlsl and graphics_stages_emit_a_repeated_load_once passed on the RTX 5090. - Cold RTX 5090 pixel-shader `CreateGraphicsPipelineState` benchmark (`XCL_DIRECT_DXIL=all`, `XCL_TRANSLATED_CACHE=0`, `--windows 4 --repeat 3`, `ShaderCacheControl(IMPLICIT_DRIVER_MANAGED | IMPLICIT_D3D_CACHE_FOR_DRIVER, DISABLE)`, distinct exe basenames per build, measured with #2438's `--measure-pso` on `2898511` vs `926428e`): | Record hash | Base DXIL | PR DXIL | Base median | PR median | Delta | |---|---:|---:|---:|---:|---:| | `c7f0a851a539391c` | 706,072 B | 696,280 B (−9.8 KB) | 10.948 s | 8.856 s | −19.1% | | `1f0e250e6f22b059` | 725,608 B | 721,928 B (−3.7 KB) | 10.211 s | 10.851 s | +6.3% | | `3552327805b442b7` | 620,804 B | 613,984 B (−6.8 KB) | 9.021 s | 8.466 s | −6.2% | | `7221675a6826d876` | 692,424 B | 687,840 B (−4.6 KB) | 10.471 s | 9.657 s | −7.8% | | `34253cc8188405fd` | 639,392 B | 631,176 B (−8.2 KB) | 8.597 s | 8.822 s | +2.6% | | **Sum (5 PS)** | **3,384 KB** | **3,351 KB (−33 KB)** | **49.248 s** | **46.652 s** | **−5.3%** | **Regression run** 60 seconds per build, XCL_NETWORK=0, XCL_PRESS_AT=18:A,30:A,44:A,52:A and XCL_FRAME_DUMP=300. XCL_DIRECT_DXIL=all on both builds. main ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 5090 title: a155fb60 seconds: 60 exit: 0x0 frames shown: 1420 (PresentX 1420) presents per 2 s (last 3): 39 21 0 device removals: 0 crashes: 0 peak commit: 22144 MB ``` PR head ``` xcl-smoke v1 commit: 3a71471c80b842d8e6f2bffd74556947fc11921b gpu: NVIDIA GeForce RTX 5090 title: a155fb60 seconds: 60 exit: 0x0 frames shown: 1342 (PresentX 1342) presents per 2 s (last 3): 47 27 0 device removals: 0 crashes: 0 peak commit: 21714 MB ``` **Not tested** AMD, Intel, native wave64 and shader execution-time benchmarks on this revision. **AI use** - Antigravity (Gemini 4 Neon): inspected the codebase, implemented the change and unit test, ran the test suite, cold `--measure-pso` benchmarks, and smoke runs, and drafted this PR description. - Codex (GPT-6) prepared the initial review follow-up. Codex (gpt-6.2-astra) completed the update and ran the reported workspace and post-push smoke checks.
DarkPanda69 commented 2026-11-25 20:08:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T19:31:43Z.


Update for head 3a71471: paired rerun on main e1d84b7 with the same command and cards. On both cards the only result changes against main are graphics_stages_emit_a_repeated_load_once and the new draw test gpu_graphics_scalar_reloads_match_hlsl, both ok, with no new skips. The draw test takes wave64 = !runner::graphics_wave32(), which is false on both cards: the RX 9070 XT also runs 32-lane waves. So it ran the wave32 VS / PS form on both, not native wave64. RX 9070 XT: 700 passed, 2 failed (the #2115 fuzz seeds), 6 SKIPPED. RTX 3060: 702 passed, 0 failed, 24 SKIPPED.

AMD native wave64 run (listed as untested), plus an RTX 3060, paired against main with the direct translator on for the whole GPU suite.

Head 926428e applied on main 23865ea, debug, Windows 11 Pro 26200, XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4, on main and on this PR for each card:

main this PR
RX 9070 XT (RDNA4, 32.0.32029.2010, native wave64) 692 passed, 2 failed, 6 SKIPPED 693 passed, 2 failed, 6 SKIPPED
RTX 3060 (32.0.16.1088, wave32) 694 passed, 0 failed, 24 SKIPPED 695 passed, 0 failed, 24 SKIPPED

Per-test comparison: on both cards the only difference is the new graphics_stages_emit_a_repeated_load_once (ok). No existing test changes result or skip state. The 2 RX 9070 XT failures are the AMD fuzz seeds tracked in #2115, the same on main.

Not tested: a title with XCL_DIRECT_DXIL=all, GPU time of the translated pixel shaders.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7172421733 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7172421733). Originally posted by [DarkPanda69](https://github.com/DarkPanda69) on 2026-11-25T19:31:43Z. --- **Update for head `3a71471`:** paired rerun on `main` `e1d84b7` with the same command and cards. On both cards the only result changes against `main` are `graphics_stages_emit_a_repeated_load_once` and the new draw test `gpu_graphics_scalar_reloads_match_hlsl`, both ok, with no new skips. The draw test takes `wave64 = !runner::graphics_wave32()`, which is false on both cards: the RX 9070 XT also runs 32-lane waves. So it ran the wave32 VS / PS form on both, not native wave64. RX 9070 XT: 700 passed, 2 failed (the #2115 fuzz seeds), 6 SKIPPED. RTX 3060: 702 passed, 0 failed, 24 SKIPPED. AMD native wave64 run (listed as untested), plus an RTX 3060, paired against `main` with the direct translator on for the whole GPU suite. Head `926428e` applied on `main` `23865ea`, debug, Windows 11 Pro 26200, `XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4`, on `main` and on this PR for each card: | | `main` | this PR | |---|---|---| | RX 9070 XT (RDNA4, 32.0.32029.2010, native wave64) | 692 passed, 2 failed, 6 SKIPPED | 693 passed, 2 failed, 6 SKIPPED | | RTX 3060 (32.0.16.1088, wave32) | 694 passed, 0 failed, 24 SKIPPED | 695 passed, 0 failed, 24 SKIPPED | Per-test comparison: on both cards the only difference is the new `graphics_stages_emit_a_repeated_load_once` (ok). No existing test changes result or skip state. The 2 RX 9070 XT failures are the AMD fuzz seeds tracked in #2115, the same on `main`. Not tested: a title with `XCL_DIRECT_DXIL=all`, GPU time of the translated pixel shaders. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
emirduran707 commented 2026-11-25 20:08:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T19:41:14Z.


Independent AMD RDNA4 (native wave64) test report on exact head 926428e48c2e4944f714ac96a5efc6c61f13705b (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1362 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All gpu::dxil::reload::tests and native wave64 GPU tests ran and passed.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 926428e48c2e4944f714ac96a5efc6c61f13705b
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15773 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7172634069 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7172634069). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T19:41:14Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `926428e48c2e4944f714ac96a5efc6c61f13705b` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1362 passed, 2 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All `gpu::dxil::reload::tests` and native wave64 GPU tests ran and passed. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 926428e48c2e4944f714ac96a5efc6c61f13705b gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15773 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
emusynths commented 2026-11-25 20:08:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emusynths on 2026-11-25T19:59:24Z.


Additional in-title check covering the XCL_DIRECT_DXIL=all path on exact head 926428e48c2e4944f714ac96a5efc6c61f13705b (RTX 5090 32 GB, driver 621.01, Ryzen 9 5950X, 64 GB RAM, Windows 11 26300, release build, XCL_DIRECT_DXIL=all):

xcl-smoke v1
commit: 926428e48c2e4944f714ac96a5efc6c61f13705b
gpu: NVIDIA GeForce RTX 5090
title: a155fb60
seconds: 60
exit: 0x0
frames shown: 1557 (PresentX 1558)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17260 MB

AI use: Antigravity (Gemini 4 Neon) ran the smoke check and posted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7173031544 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7173031544). Originally posted by [emusynths](https://github.com/emusynths) on 2026-11-25T19:59:24Z. --- Additional in-title check covering the `XCL_DIRECT_DXIL=all` path on exact head `926428e48c2e4944f714ac96a5efc6c61f13705b` (RTX 5090 32 GB, driver 621.01, Ryzen 9 5950X, 64 GB RAM, Windows 11 26300, release build, `XCL_DIRECT_DXIL=all`): ``` xcl-smoke v1 commit: 926428e48c2e4944f714ac96a5efc6c61f13705b gpu: NVIDIA GeForce RTX 5090 title: a155fb60 seconds: 60 exit: 0x0 frames shown: 1557 (PresentX 1558) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17260 MB ``` *AI use: Antigravity (Gemini 4 Neon) ran the smoke check and posted this comment.*
bmjask commented 2026-11-25 20:56:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:56:34Z.

Review: COMMENTED


No concrete source-level defect found. Enabling reload analysis for VS/PS retains the existing safety exclusions and CFG availability handling; title smoke/AMD/RTX evidence is encouraging. Nonblocking gap: tests count rawBufferLoad elimination but do not execute a Direct-DXIL VS/PS fixture whose output depends on reused scalar data. Add graphics execution parity coverage and provide current CI confirmation.

<!-- greyfinch-sync:ivall/xcl:review:6064873450 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#pullrequestreview-6064873450). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T20:56:34Z. **Review:** COMMENTED --- No concrete source-level defect found. Enabling reload analysis for VS/PS retains the existing safety exclusions and CFG availability handling; title smoke/AMD/RTX evidence is encouraging. Nonblocking gap: tests count rawBufferLoad elimination but do not execute a Direct-DXIL VS/PS fixture whose output depends on reused scalar data. Add graphics execution parity coverage and provide current CI confirmation.
DavidM1911 commented 2026-11-25 21:05:16 +00:00 (Migrated from github.com)

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


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:7173742500 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7173742500). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T20:29:15Z. --- 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!
emusynths commented 2026-11-25 22:06:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emusynths on 2026-11-25T21:40:16Z.


@bmjask, please take another look at 3a71471. The new graphics execution test checks that a reused scalar load produces the expected vertex positions and pixel colors on the RTX 5090, and matches the HLSL output. The original load-elimination test also passed. The description includes the full-suite results and the post-push offline smoke pair.

<!-- greyfinch-sync:ivall/xcl:comment:7175387023 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7175387023). Originally posted by [emusynths](https://github.com/emusynths) on 2026-11-25T21:40:16Z. --- @bmjask, please take another look at 3a71471. The new graphics execution test checks that a reused scalar load produces the expected vertex positions and pixel colors on the RTX 5090, and matches the HLSL output. The original load-elimination test also passed. The description includes the full-suite results and the post-push offline smoke pair.
thehollowedone commented 2026-11-26 02:08:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T01:31:15Z.


Independent RTX 3080 Ti check of #2446 head 3a71471. Windows 11 build 26300, Ryzen 7 9800X3D, NVIDIA driver 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11; debug tests, synthetic inputs only.

Tested

  • On the exact clean PR head, cargo test --offline --locked -p xcl --lib gpu_graphics_scalar_reloads_match_hlsl -- --nocapture --test-threads=1 passed 1/0/0 without a skip. Its GPU draw readback matched the HLSL path and the expected pixel positions and colors. graphics_stages_emit_a_repeated_load_once also passed 1/0/0; it validates the emitted VS/PS DXIL and checks repeated loads and store invalidation across four windows.
  • cargo build --offline --locked --workspace passed. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 reported 1,365 passed, 0 failed, 46 ignored, with 25 SKIPPED notices.
  • I then merged that head without committing into current main b49be18; there was no conflict. On that integration, the same workspace build passed, the GPU draw test passed 1/0/0 without a skip, and the full suite reported 1,437 passed, 0 failed, 47 ignored, with 25 SKIPPED notices. The Invalid bitcode signature log line belongs to a passing malformed-container test.

Not tested

  • Retail title execution, cold driver PSO compilation, shader execution-time performance, AMD/Intel GPUs and native wave64. The integration was local and uncommitted.

AI use

  • Codex (GPT-6.2 Sol) ran the checks, verified the logs and drafted this report. AI-assisted.
<!-- greyfinch-sync:ivall/xcl:comment:7179853173 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7179853173). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-26T01:31:15Z. --- Independent RTX 3080 Ti check of [#2446 head `3a71471`](https://github.com/xcl-dev/xcl/commit/3a71471c80b842d8e6f2bffd74556947fc11921b). Windows 11 build 26300, Ryzen 7 9800X3D, NVIDIA driver 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11; debug tests, synthetic inputs only. **Tested** - On the exact clean PR head, `cargo test --offline --locked -p xcl --lib gpu_graphics_scalar_reloads_match_hlsl -- --nocapture --test-threads=1` passed 1/0/0 without a skip. Its GPU draw readback matched the HLSL path and the expected pixel positions and colors. `graphics_stages_emit_a_repeated_load_once` also passed 1/0/0; it validates the emitted VS/PS DXIL and checks repeated loads and store invalidation across four windows. - `cargo build --offline --locked --workspace` passed. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4` reported **1,365 passed, 0 failed, 46 ignored**, with 25 `SKIPPED` notices. - I then merged that head without committing into [current main `b49be18`](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7); there was no conflict. On that integration, the same workspace build passed, the GPU draw test passed 1/0/0 without a skip, and the full suite reported **1,437 passed, 0 failed, 47 ignored**, with 25 `SKIPPED` notices. The `Invalid bitcode signature` log line belongs to a passing malformed-container test. **Not tested** - Retail title execution, cold driver PSO compilation, shader execution-time performance, AMD/Intel GPUs and native wave64. The integration was local and uncommitted. **AI use** - Codex (GPT-6.2 Sol) ran the checks, verified the logs and drafted this report. AI-assisted.
DavidM1911 commented 2026-11-26 02:08:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:50:06Z.


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:7180184110 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7180184110). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T01:50:06Z. --- 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
oni-swr commented 2026-11-26 07:03:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-26T07:01:52Z.


Independent native Windows RX 7800 XT verification at 3a71471c80b842d8e6f2bffd74556947fc11921b against its exact parent, 2898511af1c038a2ef809719e9b6f89e5675c422.

Environment: RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 Pro 26200.9974, Rust 1.100.0 MSVC, DXC 1.8.2502.11. The head passed cargo build --workspace --locked -j 4.

cargo test --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --show-output:

Revision Passed Failed Ignored SKIPPED notices
Head 1,364 1 46 7
Exact parent 1,362 1 46 7

Both runs reproduced the same seed-722 failure in fuzz_validate_and_gpu_1 (#2115). The skips also matched: six unsupported per-lane cases and one unavailable heap-window case.

The synthetic gpu_graphics_scalar_reloads_match_hlsl fixture ran without a skip and matched HLSL and expected positions and colors with the wave32 form. The synthetic graphics_stages_emit_a_repeated_load_once test also ran and passed, covering repeated-load elimination and store invalidation in both stages. No retail smoke run.

AI use: Codex (gpt-6.2-sol) ran and compared the tests and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7185023479 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7185023479). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-26T07:01:52Z. --- Independent native Windows RX 7800 XT verification at `3a71471c80b842d8e6f2bffd74556947fc11921b` against its exact parent, `2898511af1c038a2ef809719e9b6f89e5675c422`. Environment: RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 Pro 26200.9974, Rust 1.100.0 MSVC, DXC 1.8.2502.11. The head passed `cargo build --workspace --locked -j 4`. `cargo test --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --show-output`: | Revision | Passed | Failed | Ignored | SKIPPED notices | | --- | ---: | ---: | ---: | ---: | | Head | 1,364 | 1 | 46 | 7 | | Exact parent | 1,362 | 1 | 46 | 7 | Both runs reproduced the same seed-722 failure in `fuzz_validate_and_gpu_1` (#2115). The skips also matched: six unsupported per-lane cases and one unavailable heap-window case. The synthetic `gpu_graphics_scalar_reloads_match_hlsl` fixture ran without a skip and matched HLSL and expected positions and colors with the wave32 form. The synthetic `graphics_stages_emit_a_repeated_load_once` test also ran and passed, covering repeated-load elimination and store invalidation in both stages. No retail smoke run. AI use: Codex (gpt-6.2-sol) ran and compared the tests and drafted this report.
luckyteagirl commented 2026-11-26 07:40:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:40:17Z.

Review: COMMENTED


This enables reload::analyze for VS/PS (kernel.rs:206,334) while the current base's reload::changes still misses VOPC SDWA SD=1 writes to SDST and some cache barriers. Open #2479 has a failing-first fixture for those invalidations. For a graphics program that loads through s[4:5], overwrites s4 with such an SDWA compare, then repeats the load, this PR can reuse the value from the old address instead of emitting the second load. The existing VS/PS tests cover repeated loads and an ordinary store, not this address-register write.

Could #2446 depend on #2479's invalidation fix before merge and include a VS or PS variant of its fixture? This is a source-derived cross-PR dependency at exact #2446 head 3a71471c80b842d8e6f2bffd74556947fc11921b; #2479's live head is d423c902918bcac16c8e8fe6192e85e2003c16b0. I have not run a graphics GPU reproduction. AI-assisted review with Codex.

<!-- greyfinch-sync:ivall/xcl:review:6070172614 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#pullrequestreview-6070172614). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T07:40:17Z. **Review:** COMMENTED --- This enables `reload::analyze` for VS/PS (`kernel.rs:206,334`) while the current base's `reload::changes` still misses `VOPC` SDWA `SD=1` writes to `SDST` and some cache barriers. Open #2479 has a failing-first fixture for those invalidations. For a graphics program that loads through `s[4:5]`, overwrites `s4` with such an SDWA compare, then repeats the load, this PR can reuse the value from the old address instead of emitting the second load. The existing VS/PS tests cover repeated loads and an ordinary store, not this address-register write. Could #2446 depend on #2479's invalidation fix before merge and include a VS or PS variant of its fixture? This is a source-derived cross-PR dependency at exact #2446 head `3a71471c80b842d8e6f2bffd74556947fc11921b`; #2479's live head is `d423c902918bcac16c8e8fe6192e85e2003c16b0`. I have not run a graphics GPU reproduction. AI-assisted review with Codex.
thehollowedone commented 2026-11-27 20:40:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T20:40:17Z.


merge-check

base: 6089122a
head: 3a71471c
merge: clean trial merge into that main.
build: cargo build --workspace passed.
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 reported 1,466 passed, 1 failed, 47 ignored, with 25 GPU skip notices. Both new graphics tests passed on the RTX 3080 Ti. The sole failure was console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (DXIL not compiled), also reproduced on untouched main in this base check.
review: not yet. Enabling reload reuse for vertex and pixel shaders exposes a missed scalar destination in an SDWA VOPC compare. vopc_dst reads SD=1 and SDST from the extension word and writes that SGPR pair; reload::changes checks destination fields only in the base ENC_VOPC encoding. In S_LOAD_DWORD ... SOFFSET=s8; V_CMP_EQ_U32 SD=1,SDST=8; S_LOAD_DWORD ... SOFFSET=s8, the second load can use the old offset after the compare writes s8. A local regression failed on the unchanged merge ([(0,false),(2,true)] versus expected [(0,false),(2,false)]) and passed after the candidate invalidation below. This is an existing analyzer gap that the PR would extend to graphics stages.
performance: no timing measurement on this machine; no performance verdict.
verdict: not yet; account for the extension destination and keep a regression before enabling graphics reuse.

Candidate fix and regression (local, uncommitted)
diff --git a/crates/xcl/src/gpu/dxil/reload.rs b/crates/xcl/src/gpu/dxil/reload.rs
index 96dfc2cd..1edd7b79 100644
--- a/crates/xcl/src/gpu/dxil/reload.rs
+++ b/crates/xcl/src/gpu/dxil/reload.rs
@@ -124,6 +124,17 @@ fn changes(d: &Decoded) -> (u128, bool) {
             }
         }
     }
+    if d.enc.name == "ENC_VOPC" && d.variant == rdna2::Variant::Sdwa {
+        let Some(ext) = rdna2::encoding("VOPC_VOP_SDWA_SDST_ENC") else {
+            return (u128::MAX, false);
+        };
+        if rdna2::field_value(ext, &d.words, "SD") == Some(1) {
+            let dst = rdna2::field_value(ext, &d.words, "SDST").unwrap_or(106);
+            if dst < 125 {
+                regs |= pair(dst, 2);
+            }
+        }
+    }
     let writes = name.contains("_STORE") || name.contains("_ATOMIC");
     let memory = match d.enc.name {
         "ENC_MUBUF" | "ENC_MTBUF" | "ENC_FLAT" | "ENC_FLAT_GLBL" | "ENC_FLAT_SCRATCH" | "ENC_MIMG" => writes,
@@ -312,6 +323,13 @@ mod tests {
         }
     }
 
+    #[test]
+    fn sdwa_compare_destination_invalidates_load_offset() {
+        let load: I = ("S_LOAD_DWORD", "ENC_SMEM", &[("SDATA", 12), ("SBASE", 2), ("OFFSET", 0), ("SOFFSET", 8)]);
+        let cmp: I = ("V_CMP_EQ_U32", "VOPC_VOP_SDWA_SDST_ENC", &[("SRC0", 0xF9), ("VSRC0", 0), ("VSRC1", 1), ("SRC0_SEL", 6), ("SRC1_SEL", 6), ("SD", 1), ("SDST", 8)]);
+        assert_eq!(loads(&[load, cmp, load, END]), [(0, false), (2, false)]);
+    }
+
     #[test]
     fn loads_that_cannot_be_followed_are_left_alone() {
         // a coherent load, and one that overwrites its own base

cargo test -p xcl --lib sdwa_compare_destination_invalidates_load_offset -- --nocapture: 0 passed / 1 failed before; 1 passed / 0 failed with the candidate. The candidate was not run through the full suite or a graphics readback.

Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), rustc 1.99.1 MSVC, DXC 1.8.2502.11. AI use: Codex (GPT-6.2 Sol) ran the merge, build, tests, and candidate fix; Codex (GPT-6.2 Astra) independently traced the missing destination.

<!-- greyfinch-sync:ivall/xcl:comment:7227728525 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7227728525). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-27T20:40:17Z. --- merge-check base: [6089122a](https://github.com/xcl-dev/xcl/commit/6089122a1c96dff16e93b6fdf04c8ed20cfb6102) head: [3a71471c](https://github.com/xcl-dev/xcl/commit/3a71471c80b842d8e6f2bffd74556947fc11921b) merge: clean trial merge into that `main`. build: `cargo build --workspace` passed. tests: `cargo test --workspace --no-fail-fast -- --test-threads=4` reported 1,466 passed, 1 failed, 47 ignored, with 25 GPU skip notices. Both new graphics tests passed on the RTX 3080 Ti. The sole failure was `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (`DXIL not compiled`), also reproduced on untouched `main` in [this base check](https://github.com/xcl-dev/xcl/pull/671#issuecomment-7223888221). review: **not yet.** Enabling reload reuse for vertex and pixel shaders exposes a missed scalar destination in an SDWA VOPC compare. `vopc_dst` reads `SD=1` and `SDST` from the extension word and writes that SGPR pair; `reload::changes` checks destination fields only in the base `ENC_VOPC` encoding. In `S_LOAD_DWORD ... SOFFSET=s8; V_CMP_EQ_U32 SD=1,SDST=8; S_LOAD_DWORD ... SOFFSET=s8`, the second load can use the old offset after the compare writes `s8`. A local regression failed on the unchanged merge (`[(0,false),(2,true)]` versus expected `[(0,false),(2,false)]`) and passed after the candidate invalidation below. This is an existing analyzer gap that the PR would extend to graphics stages. performance: no timing measurement on this machine; no performance verdict. verdict: **not yet**; account for the extension destination and keep a regression before enabling graphics reuse. <details><summary>Candidate fix and regression (local, uncommitted)</summary> ```diff diff --git a/crates/xcl/src/gpu/dxil/reload.rs b/crates/xcl/src/gpu/dxil/reload.rs index 96dfc2cd..1edd7b79 100644 --- a/crates/xcl/src/gpu/dxil/reload.rs +++ b/crates/xcl/src/gpu/dxil/reload.rs @@ -124,6 +124,17 @@ fn changes(d: &Decoded) -> (u128, bool) { } } } + if d.enc.name == "ENC_VOPC" && d.variant == rdna2::Variant::Sdwa { + let Some(ext) = rdna2::encoding("VOPC_VOP_SDWA_SDST_ENC") else { + return (u128::MAX, false); + }; + if rdna2::field_value(ext, &d.words, "SD") == Some(1) { + let dst = rdna2::field_value(ext, &d.words, "SDST").unwrap_or(106); + if dst < 125 { + regs |= pair(dst, 2); + } + } + } let writes = name.contains("_STORE") || name.contains("_ATOMIC"); let memory = match d.enc.name { "ENC_MUBUF" | "ENC_MTBUF" | "ENC_FLAT" | "ENC_FLAT_GLBL" | "ENC_FLAT_SCRATCH" | "ENC_MIMG" => writes, @@ -312,6 +323,13 @@ mod tests { } } + #[test] + fn sdwa_compare_destination_invalidates_load_offset() { + let load: I = ("S_LOAD_DWORD", "ENC_SMEM", &[("SDATA", 12), ("SBASE", 2), ("OFFSET", 0), ("SOFFSET", 8)]); + let cmp: I = ("V_CMP_EQ_U32", "VOPC_VOP_SDWA_SDST_ENC", &[("SRC0", 0xF9), ("VSRC0", 0), ("VSRC1", 1), ("SRC0_SEL", 6), ("SRC1_SEL", 6), ("SD", 1), ("SDST", 8)]); + assert_eq!(loads(&[load, cmp, load, END]), [(0, false), (2, false)]); + } + #[test] fn loads_that_cannot_be_followed_are_left_alone() { // a coherent load, and one that overwrites its own base ``` `cargo test -p xcl --lib sdwa_compare_destination_invalidates_load_offset -- --nocapture`: 0 passed / 1 failed before; 1 passed / 0 failed with the candidate. The candidate was not run through the full suite or a graphics readback. </details> Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), rustc 1.99.1 MSVC, DXC 1.8.2502.11. AI use: Codex (GPT-6.2 Sol) ran the merge, build, tests, and candidate fix; Codex (GPT-6.2 Astra) independently traced the missing destination.
throny commented 2026-11-27 20:52:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T20:52:42Z.


merge-check claim
head: 3a71471c80

<!-- greyfinch-sync:ivall/xcl:comment:7227924599 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7227924599). Originally posted by [throny](https://github.com/throny) on 2026-11-27T20:52:42Z. --- merge-check claim head: 3a71471c80b842d8e6f2bffd74556947fc11921b
throny commented 2026-11-27 21:10:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T21:10:40Z.


merge-check
base: 6089122a
head: 3a71471c80
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1467 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored
review: no defect in the change itself. Open from the thread: the reload analysis it now also applies to vertex and pixel programs can miss a class of compare writes, which #2479 (still open) fixes; enabling it for more stages widens that existing gap (the field decoding behind it was not verified here). The instruction-count test fails without the change; the GPU draw test is a parity check.
performance: only with XCL_DIRECT_DXIL=all; only the direct-DXIL cache is re-keyed (reasoned).
verdict: not yet: merge after #2479, or show that the gap cannot matter for these stages.
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:7228205976 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7228205976). Originally posted by [throny](https://github.com/throny) on 2026-11-27T21:10:40Z. --- merge-check base: 6089122a head: 3a71471c80b842d8e6f2bffd74556947fc11921b merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1467 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored review: no defect in the change itself. Open from the thread: the reload analysis it now also applies to vertex and pixel programs can miss a class of compare writes, which #2479 (still open) fixes; enabling it for more stages widens that existing gap (the field decoding behind it was not verified here). The instruction-count test fails without the change; the GPU draw test is a parity check. performance: only with XCL_DIRECT_DXIL=all; only the direct-DXIL cache is re-keyed (reasoned). verdict: not yet: merge after #2479, or show that the gap cannot matter for these stages. 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).
Foniass commented 2026-12-01 08:07:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:07:03Z.


Triage (#1607) – head 3a71471

Not on main: kernel.rs on main still sets follow_loads for Entry::Kernel | Entry::Compute(_) only. No other open PR makes this change as its own; an older version of this commit (ba41b03) is carried in the base of several unrelated fork-based PRs (e.g. #2589, #2604, #2605). #2567 shares scalar-load bodies in compute shaders, a different change.
The comment that only geometry enters by edges the CFG does not hold looks right for the plain form: VS/PS indirect branches other than the self-s_swappc_b64 are refused, and the compact form (plan) still does not use reloads. No problems found in the diff. The branch conflicts with main (kernel.rs has moved) and needs a rebase.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304895488 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2446#issuecomment-7304895488). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:07:03Z. --- **Triage (#1607)** – head 3a71471 Not on main: `kernel.rs` on main still sets `follow_loads` for `Entry::Kernel | Entry::Compute(_)` only. No other open PR makes this change as its own; an older version of this commit (ba41b03) is carried in the base of several unrelated fork-based PRs (e.g. #2589, #2604, #2605). #2567 shares scalar-load bodies in compute shaders, a different change. The comment that only geometry enters by edges the CFG does not hold looks right for the plain form: VS/PS indirect branches other than the self-`s_swappc_b64` are refused, and the compact form (`plan`) still does not use `reloads`. No problems found in the diff. The branch conflicts with main (`kernel.rs` has moved) and needs a rebase. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2446:upstream-pr/2446'
git switch 'upstream-pr/2446'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2446'
git switch 'upstream-pr/2446'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2446'
git switch 'upstream-pr/2446'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2446'
git switch 'main'
git merge --squash 'upstream-pr/2446'
git switch 'main'
git merge --ff-only 'upstream-pr/2446'
git switch 'main'
git merge 'upstream-pr/2446'
git push origin 'main'
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!2436
No description provided.