Recompiler: preserve split dispatch for auto-compact compute #2810

Closed
github-bot wants to merge 1 commit from github-bot/gh-2810 into main AGit
Owner

@⁠CryingLaughing on GitHub · 2026-11-26 14:07 UTC · original
CryingLaughing:perf/preserve-ordinary-compute-chain → main · +165 −32 · 3 files · 1 commits · closed without merging

Part of #2745.

Automatic compact lowering can select a small whole compute shader and lose a split dispatch plan available in ordinary lowering. The opt-in XCL_DIRECT_PREFER_SPLIT=1 keeps the compact whole as a fallback and retains compatible ordinary pieces for eligible direct wave32 dispatches.

What is in it

  • Preserves the ordinary pieces only when automatic compact lowering selected the whole, splitting is enabled, and the ordered static samplers match. The preference has its own translated shader cache identity.
  • Covers fallback and splitting decisions, sampler order, and disk-cache separation. The option defaults off.

Tested

  • Head fe87896d84ad581ac8a25b275d0889eaf938f2b0, parent b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. RTX 4080 driver 621.01, i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC and DXC 1.8.2502.11.

  • cargo build --workspace --locked -j 4 and cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output. 1,437 passed, 0 failed, 47 ignored across 37 harnesses. This includes 29 explicit capability skips in the pass count.

  • A bounded native test overlay passed 1/0/0 with zero capability skips. Both the five-piece dispatch and the compact whole fallback matched all 784 UAV words. The pieces created zero whole PSOs. The fallback created one.

  • A separate CPU fixture passed 5/0/0 through the normal compute entry point. Automatic lowering kept the same 4,524-byte compact whole with preference off or on. With preference on, it also kept the same 24 pieces and 384-dword stride as forced ordinary lowering. Setting the split limit to zero disabled the chain.

  • Independent RTX 5070 Ti Laptop verification by ettehn used the exact head with a test-only auto-plan injection and a low split limit. The retained 49-piece chain and compact whole matched all 784 UAV words in each of four cases. The compact whole stayed byte-identical to preference off. Independent GPU check

Regression run

Independent retail smoke by Anon64 compared release builds of main and this exact head on an RTX 3060 12 GB (driver 581.80), Core i9-14900KF, and Windows 11 build 26200. The 60-second runs used the same title. The head retained 102.9% of the baseline frames and used 101.7% of its peak commit, with zero crashes or device removals. The run did not establish whether the title reached the changed code.

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1461 (PresentX 1462)
presents per 2 s (last 3): 10 1 1
device removals: 0
crashes: 0
peak commit: 23855 MB

PR:

xcl-smoke v1
commit: fe87896d84ad581ac8a25b275d0889eaf938f2b0
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1504 (PresentX 1504)
presents per 2 s (last 3): 30 7 2
device removals: 0
crashes: 0
peak commit: 24260 MB

Not tested

  • Retail use of the split-preference path, native execution of the 24-piece shader, and GPU compilation times for large programs.
**@⁠CryingLaughing** on GitHub · 2026-11-26 14:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/2810) `CryingLaughing:perf/preserve-ordinary-compute-chain` → `main` · +165 −32 · 3 files · 1 commits · closed without merging Part of #2745. Automatic compact lowering can select a small whole compute shader and lose a split dispatch plan available in ordinary lowering. The opt-in `XCL_DIRECT_PREFER_SPLIT=1` keeps the compact whole as a fallback and retains compatible ordinary pieces for eligible direct wave32 dispatches. **What is in it** - Preserves the ordinary pieces only when automatic compact lowering selected the whole, splitting is enabled, and the ordered static samplers match. The preference has its own translated shader cache identity. - Covers fallback and splitting decisions, sampler order, and disk-cache separation. The option defaults off. **Tested** - Head `fe87896d84ad581ac8a25b275d0889eaf938f2b0`, parent `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. RTX 4080 driver 621.01, i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC and DXC 1.8.2502.11. - `cargo build --workspace --locked -j 4` and `cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output`. **1,437 passed, 0 failed, 47 ignored** across 37 harnesses. This includes 29 explicit capability skips in the pass count. - A bounded native test overlay passed **1/0/0** with zero capability skips. Both the five-piece dispatch and the compact whole fallback matched all **784 UAV words**. The pieces created zero whole PSOs. The fallback created one. - A separate CPU fixture passed **5/0/0** through the normal compute entry point. Automatic lowering kept the same **4,524-byte** compact whole with preference off or on. With preference on, it also kept the same 24 pieces and 384-dword stride as forced ordinary lowering. Setting the split limit to zero disabled the chain. - Independent RTX 5070 Ti Laptop verification by ettehn used the exact head with a test-only auto-plan injection and a low split limit. The retained 49-piece chain and compact whole matched all 784 UAV words in each of four cases. The compact whole stayed byte-identical to preference off. [Independent GPU check](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2810) **Regression run** [Independent retail smoke by Anon64](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2810) compared release builds of main and this exact head on an RTX 3060 12 GB (driver 581.80), Core i9-14900KF, and Windows 11 build 26200. The 60-second runs used the same title. The head retained 102.9% of the baseline frames and used 101.7% of its peak commit, with zero crashes or device removals. The run did not establish whether the title reached the changed code. main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1461 (PresentX 1462) presents per 2 s (last 3): 10 1 1 device removals: 0 crashes: 0 peak commit: 23855 MB ``` PR: ``` xcl-smoke v1 commit: fe87896d84ad581ac8a25b275d0889eaf938f2b0 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1504 (PresentX 1504) presents per 2 s (last 3): 30 7 2 device removals: 0 crashes: 0 peak commit: 24260 MB ``` **Not tested** - Retail use of the split-preference path, native execution of the 24-piece shader, and GPU compilation times for large programs.
Allow an explicit opt-in to retain ordinary wave32 pieces alongside the compact whole fallback. Require the same ordered static samplers and isolate cached output by the selected preference.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:11:15 +00:00
Author
Owner

@⁠Anon64 on GitHub · 2026-11-26 14:44 UTC · original

Regression run of fe87896 on a newer retail title: no device removal, no crash, frames and commit within the limits.

Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main b49be18 (this PR's base) and of this PR's exact head, scripts/smoke.ps1 -Game <title> for 60 s with XCL_NETWORK=0 and A pressed every 4 s from 20 s. Main ran before and after a batch of 11 PRs and peaked at 23,855 and 23,844 MB, so the baseline held steady over the batch.

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1461 (PresentX 1462)
presents per 2 s (last 3): 10 1 1
device removals: 0
crashes: 0
peak commit: 23855 MB

this PR:

xcl-smoke v1
commit: fe87896d84ad581ac8a25b275d0889eaf938f2b0
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1504 (PresentX 1504)
presents per 2 s (last 3): 30 7 2
device removals: 0
crashes: 0
peak commit: 24260 MB

102 % of main's frames, 101 % of its peak commit. One run each.

Not tested: the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD.

AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.

**@⁠Anon64** on GitHub · 2026-11-26 14:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2810#issuecomment-7195249111) **Regression run of `fe87896` on a newer retail title: no device removal, no crash, frames and commit within the limits.** **Setup:** RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main `b49be18` (this PR's base) and of this PR's exact head, `scripts/smoke.ps1 -Game <title>` for 60 s with `XCL_NETWORK=0` and A pressed every 4 s from 20 s. Main ran before and after a batch of 11 PRs and peaked at 23,855 and 23,844 MB, so the baseline held steady over the batch. main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1461 (PresentX 1462) presents per 2 s (last 3): 10 1 1 device removals: 0 crashes: 0 peak commit: 23855 MB ``` this PR: ``` xcl-smoke v1 commit: fe87896d84ad581ac8a25b275d0889eaf938f2b0 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1504 (PresentX 1504) presents per 2 s (last 3): 30 7 2 device removals: 0 crashes: 0 peak commit: 24260 MB ``` 102 % of main's frames, 101 % of its peak commit. One run each. **Not tested:** the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD. AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.
Author
Owner

@⁠ettehn on GitHub · 2026-11-26 14:45 UTC · original

Focused GPU correctness check on fe87896d84ad581ac8a25b275d0889eaf938f2b0, complementary to the smoke run above. Windows 11 x64 build 26200, RTX 5070 Ti Laptop (621.24), Rust 1.97.1 MSVC, DXC 1.8.2502.11.

I extended the committed automatic_compact_can_keep_an_ordinary_compute_chain fixture locally to execute both forms. It uses the fixture’s injected auto-plan callback and a deliberately low split limit (12), yielding 49 retained pieces (1,024 scratch dwords/group). The compact whole stayed byte-identical to the preference-off form. On the GPU, the compact whole and the retained chain each matched all 784 UAV words in four cases: skip the first, middle, or last store region, or skip none. This includes untouched guard words.

cargo test --locked --offline -p xcl --lib -j 2 automatic_compact_can_keep_an_ordinary_compute_chain -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, no capability skips with XCL_ADAPTER=NVIDIA and XCL_REQUIRE_GPU=wave64. This exercises a synthetic wave32 shader. The production auto-selection threshold, GPU compile timings, and a retail title were outside this check. OpenAI Codex (6.2sol) assisted with verification.

**@⁠ettehn** on GitHub · 2026-11-26 14:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2810#issuecomment-7195282416) Focused GPU correctness check on `fe87896d84ad581ac8a25b275d0889eaf938f2b0`, complementary to the smoke run above. Windows 11 x64 build 26200, RTX 5070 Ti Laptop (621.24), Rust 1.97.1 MSVC, DXC 1.8.2502.11. I extended the committed `automatic_compact_can_keep_an_ordinary_compute_chain` fixture locally to execute both forms. It uses the fixture’s injected auto-plan callback and a deliberately low split limit (12), yielding **49 retained pieces** (1,024 scratch dwords/group). The compact whole stayed byte-identical to the preference-off form. On the GPU, the compact whole and the retained chain each matched all **784 UAV words** in four cases: skip the first, middle, or last store region, or skip none. This includes untouched guard words. `cargo test --locked --offline -p xcl --lib -j 2 automatic_compact_can_keep_an_ordinary_compute_chain -- --test-threads=1 --nocapture`: 1 passed, 0 failed, 0 ignored, no capability skips with `XCL_ADAPTER=NVIDIA` and `XCL_REQUIRE_GPU=wave64`. This exercises a synthetic wave32 shader. The production auto-selection threshold, GPU compile timings, and a retail title were outside this check. OpenAI Codex (6.2sol) assisted with verification.
github-bot closed this pull request 2026-11-27 01:17:42 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.