Recompiler: XCL_COMPACT_NEST=auto nests programs of 512 cases or more #2018
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2018
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2018"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Pipodi on GitHub · 2026-11-25 00:54 UTC · original
Pipodi:nest-auto→main· +2547 −55 · 8 files · 8 commits · openStacked on #1692 (
2046259, on #144880fac65and #13165328b15); only the top commit (908c454) belongs here.XCL_COMPACT_NEST=<P>nests every compact program or none. This addsXCL_COMPACT_NEST=auto: groups of 32 cases for a program of 512 cases (distinct block texts) or more, and the flat switch below. The case count is known only once the blocks are emitted, socompact_atresolves the setting there. Unset,0and a size behave as in #1692. Turningautoon by default is a separate PR. Part of #1269.The measurements behind the numbers (#1269 result), RTX 4090, release, cold driver (new exe path and fresh
XCL_DXIL_CACHEper run):512 is below the smallest program measured (698 cases); nothing under it was timed.
From testers, on the same three programs:
autothere.What is in it
crates/xcl/src/gpu/recomp/compact.rs:enum Nest { Flat, Groups(usize), Auto };parse_nestacceptsauto(trimmed, any case);NEST_MIN_CASES(512) andAUTO_GROUP(32);resolve_nest, called incompact_atonce the cases are counted;compact_withstill takes a group size, so its callers are unchanged.crates/xcl/src/gpu/recomp/pso.rs: the translated-shader cache names anautoentry_c_na(the group size follows from the program, which the hash identifies)._cand_c_n<P>are unchanged.compact::tests::auto_nest_starts_at_the_case_threshold:resolve_nestat 511/512, andcompact_atwith the threshold at the program's case count (nested in groups of 32) and one above it (byte-identical to the flat text);autoandAUTO;_c_na.Tested
rustc 1.100.0.908c454(onmainafc5ee8through the stack), debug:cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4gave 1299 passed, 0 failed, 46 ignored, in 23 result blocks. Its patch is the same as at5040ea1and480143a; only the base moved.825aa91/480143a(not rerun):cargo test -p xcl --lib compact -- --test-threads=4withXCL_COMPACT_NESTunset,=32and=auto: 34 passed, 0 failed each. The cache tests (shader_cache_tests): 16 passed. On480143a,compact::tests: 6 passed.lower_dxilper-lane f16/f32 cases (refused by the per-lane form, as onmain); 3 cases that need the D3D12 debug layer / SDK layers, which this machine does not have;heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Autoresolved to 0 and its tag set to_c,auto_nest_starts_at_the_case_thresholdandtranslated_compact_and_normal_forms_are_kept_apartfail.Regression run
The retail title, 60 s,
XCL_PRESS_AT=16:A(the title takes A at its title screen 16 s in and loads for the rest of the run), no other variables (the default shader cache, warm from earlier runs). Both runs on this machine, with nothing else running.main06c9f55:This PR, head
908c454:The PR's run got 105.9 % of
main's frames and 101.5 % of its peak commit.Not tested
autoin a title run: the smoke runs have it unset, so they check only that the change breaks nothing.autoitself on AMD or RADV: the testers' numbers above are with a fixed P.AI use
95e8abcand2046259, and wrote this description. A second Opus 5.5 agent reviewed the diff.🤖 Generated with Claude Code
@nnonno91 on GitHub · 2026-11-25 01:09 UTC · original
Tested
Independent
XCL_COMPACT_NEST=autoGPU check on exact head480143a6583b2f4ca418898cd7ba224d62b83f51. Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62, native wave64), and GeForce RTX 5090 (32.0.16.1742, split wave64). Rust 1.100.0 x64 MSVC and DXC/DXIL 1.8.2502.11. Unoptimized dev/test profiles with debug info off.cargo build --workspace --lockedpassed.cargo test --locked -p xcl --lib <filter> -- --test-threads=1 --nocapture, on AMD with the setting unset:gpu::recomp::compact::tests6 passed,shader_cache_tests16 passed, andgpu::recomp::tests_compact::gpu_compact_nested_dispatch1 passed (also used--exactfor this last test). Zero failed, ignored, or skipped in each run.cargo test --locked -p xcl --test compact_auto_gpu_probe -- --exact auto_compact_at_actual_case_boundary --test-threads=1 --nocapturepassed on both GPUs withXCL_COMPACT_NEST=0,auto, and32in separate processes (1 passed, 0 failed, 0 ignored, 0 skipped per run). The temporary probe built two synthetic RDNA2 programs with exactly 511 and 512 distinct cases. Each nonterminal block adds a distinct literal to v0 and branches to the next block. It used the public compact translator, DXC, the DXIL validator, and D3D12 readback.At 511 cases,
autoproduced byte-identical HLSL to the flat0control. At 512, it produced 16 groups of 32 and byte-identical HLSL to the fixed32control. All 64 lanes matched an independent CPU sum for both programs in every mode on both GPUs. For each program and GPU, the full result buffer and memory were byte-identical across the three modes.For this particular 512-case program, grouped DXIL was larger than the flat control (36,392 to 41,284 bytes on AMD and 37,512 to 42,424 on NVIDIA).
Not tested
Controlled cold-driver compile times, GPU execution performance, real titles, RADV, and the full workspace test suite. The two programs are synthetic and exercise correctness at the cutoff.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) prepared and ran the temporary probe, checked the outputs, and drafted this report.
@raylitebull on GitHub · 2026-11-25 02:06 UTC · original
Independent AMD RDNA2 + NVIDIA RTX 5090 checks on \480143a\ look great. Currently \CONFLICTING\ and Draft — once the base stack (#1316\ / #1448\ / #1692) is rebased onto \main, please rebase #2018\ and mark Ready for review so \Build and test\ CI can run.
@DavidM1911 on GitHub · 2026-11-25 04:01 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@Pipodi on GitHub · 2026-11-25 04:05 UTC · original
@DavidM1911, thanks for checking. Yes, the conflict is expected. This PR is stacked on #1316 (
964f5ed), and #1316 conflicts with currentmain. #1448, #1692 and #2025 above it are drafts for the same reason. I'll rebase the whole stack as soon as #1316 is rebased, then post the new heads.If you'd like to test before then, build the branch as it is (on
main266b845). In that case please name the head commit you tested in the report.AI use: Claude Code with Claude Opus 5.5.
@itsSio on GitHub · 2026-11-25 09:51 UTC · original · edited 2026-11-25 10:24 UTC
Tested
Independent check requested in #1269 at clean head
5040ea1ef4807af4732dcbfaed1789226c39c4e0. Windows 11 Pro 26200 on both systems; x64 MSVC, unoptimized dev/test with debug info disabled.cargo build --workspace --lockedpassed on both.cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocapture:32.0.16.108832.0.16.1088Both ran and passed
auto_nest_starts_at_the_case_thresholdandtranslated_compact_and_normal_forms_are_kept_apart. Runtime skips on both: 21 native-wave64 cases, three per-lane f16/f32 refusals, one unavailable driver-cache control, and one unavailable heap-windows case. The RTX 2080 SUPER also had two missing D3D12 debug-layer skips.cargo test -p xcl --lib --locked gpu::recomp::tests_compact -- --test-threads=1 --nocapture: 25 / 0 / 0, no runtime skips on the Radeon RDNA2 iGPU (32.0.21043.5001, Ryzen 7 system), and 25 / 0 / 0, one native-wave64 skip on the RTX 2080 SUPER. These runs leftXCL_COMPACT_NESTunset; the threshold unit test exercisesautoexplicitly.The RTX 2080 SUPER failed
placed_title_textures_share_vram_and_preserve_pixels(cubemap VA reuse assertion),transitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory(bothPoisonError). The same three failures were visible before an earlier run timed out and also on the separate #1338 checkout. That is not a matched-parent comparison, so I am not classifying them as regressions or declaring this suite green. The RTX 5080 workspace and Radeon filter initially aborted with0xc0000005in DXC 1.6.2112.16; selecting DXC 1.9.2609.5 viaXCL_DXC_DIRresolved both aborts on the same checkout.Exact-parent follow-up: The original trio matches the symptoms tracked in #718. On each system above, I ran
cargo test -p xcl --lib --locked -- --test-threads=4 --nocapturein four separate processes ordered parent (95e8abcfd8eb2da975255e5ea2c85ed2d812f37f), head (5040ea1ef4807af4732dcbfaed1789226c39c4e0), head, parent. Same adapter, DXC and build settings per system; 25 runtime skips per library run.The three original D3D12 failures did not recur on either revision in this sample. The one distinct failure was
atomic_writes_preserve_xcltmp_blobs_and_skip_leftover_temps, on the second RTX 2080 SUPER head run. This is an observation, not an attribution to this PR. The original red workspace result is unchanged.Not tested
Retail smoke, full AMD workspace, opt-in
autoon a retail program, performance, or a repeated matched full-workspace comparison.AI use
Ran via Samaritan:
openai/gpt-6.2-sol): planned and ran these checks, diagnosed the toolchain issue, verified the saved test logs and wrote this report.@DavidM1911 on GitHub · 2026-11-26 00:49 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.