Repository navigation
Conversation
…pact The direct translator picks the compact form (each distinct block lowered once, run from a table) only for size: from 10,000 instructions or 2,000 blocks, and only when most of the program repeats. Below that a big program gets the plain form, whose register allocation in the driver can be the program's cost. The title's shadow-mask program (cs d9fac2f1d8f646fd, ~6,000 instructions, a light loop around nearly all of it; 20-139 ms a frame in the open world) compiles on RDNA4 (RGA, amdxc64 gfx1201, the run's heap windows) to 256 VGPRs and 18 KB of scratch a lane, ~18,000 scratch loads and stores; its compact form to 215 VGPRs, 75 SGPRs and no scratch, 32,146 instead of 58,333 instructions. XCL_DIRECT_COMPACT_MIN=<n>: a compute program of at least n reachable instructions takes the compact form whenever its table fits, however little of it repeats (compact::sized_plan); otherwise the automatic choice as before. Unset by default; the caches key the value. Measured on the GPU (RX 9070 XT, Adrenalin as installed, RDNA4 wave32; the program patched past its early exits with a light mask of all ones, zero memory, 40x40 groups of 4x8, one 32-light word; ms a dispatch): plain 95.6 (8,192-dword LDS) / 80.0 (declared LDS), compact 24.7 / 4.0. Port onto main: the conflicts were only the caches identities and the test plumbing next to amd-dev-only switches (declared LDS, coherent per access, one-wave group IDs); only the XCL_DIRECT_COMPACT_MIN parts are taken. (cherry picked from commit 41dc012) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Foniass
force-pushed
the
dxil-compact-min
branch
from
November 30, 2026 23:07
6e40d14 to
f9935af
Compare
This was referenced Dec 1, 2026
|
merge-check
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of raylitebull's amd-dev commit
41dc012e. The direct translator picks the compact form only for size: from 10,000 instructions or 2,000 blocks, and only when most of the program repeats. On a big program below that, the driver's register allocation of the plain form can be the program's cost. amd-dev's case is the retail title's shadow-mask program (d9fac2f1d8f646fd, ~6,000 instructions, 20–139 ms a frame in the open world):XCL_DIRECT_COMPACT_MIN=<n>: a compute program of at least n reachable instructions takes the compact form whenever its table fits (compact::sized_plan), however little of it repeats. Otherwise the automatic choice applies as before. Unset by default, so nothing changes unless it is set. The caches key the value.amd-dev's measurement (RX 9070 XT, the program patched past its early exits, ms per dispatch): plain 95.6, compact 24.7.
What is in it
crates/xcl/src/gpu/dxil/compact.rs:compact_min,sized_plancrates/xcl/src/gpu/dxil/kernel.rs: the switch in the plan choice for compute programs, the test plumbingcrates/xcl/src/gpu/recomp/pso.rs: the value in both direct cache identities, testa_compact_size_is_another_direct_outputcrates/xcl/src/gpu/dxil/compact_tests.rs: the commit's tests of the size choice and a GPU run against the plain formXCL_DIRECT_COMPACT_MINparts are taken.Tested
cargo test -p xcl --lib -- gpu::dxil::compact_tests shader_cache_tests(5070 Ti): 47 passed, 0 failedgpu::dxil::compact_testson the iGPU: 15 passed, 1 failed. The failure is main's literal-table bug on AMD, fixed by Recompiler: compact literal indices are read from one table word on AMD #3473. The new tests pass there.cargo test --workspace --no-fail-fast -- --test-threads=4on f9935af, rebased on main 86e86fc (5070 Ti): 2892 passed, 0 failed, 51 ignored. SKIPPED: 28 notices, almost allno wave64(the others: no D3D12 debug layer, heap windows off, driver cache needs Developer Mode). The narrower runs listed here are from before the rebase.Regression run
main:
this PR:
Not tested
AI use
41dc012e.🤖 Generated with Claude Code