Shaders: xcl shaders statistics and the dump take the wave size from the header #880
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!880
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-880"
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?
@throny on GitHub · 2026-11-24 07:23 UTC · original
throny:shaders-stats-wave-size-from-header→main· +131 −10 · 6 files · 2 commits · openStacked on #573; only the top commit (
6576d75) belongs here.xcl shaders --recompand the per-shader dump (XCL_DUMP_SHADERS) told a program's wave size from its code alone (detect_wave64). After #573 the pipelines take wave32 from the FSSM header's flag, so a wave32 program without an EXEC write was still counted and translated as wave64 by these two tools. Both now usefssm_wave64, so the statistics describe what the pipelines build. MesshM suggested it in the review of #573. No issue covers it; no other open PR touches these call sites.What is in it
crates/xcl/src/shaders.rs:RecompAgg::addgets the wave size from its caller, which has the FSSM (recomp::fssm_wave64(f, code)); the testrecompiler_statistics_count_wave32_by_the_header_flag.crates/xcl/src/gpu/shader.rs: the dump'srecompileusesfssm_wave64.Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); tests in debug, title runs in release.cargo build --workspace && cargo test --workspace -- --test-threads=4on6576d75(on #573b8b4135,mainbdda528): 1 130 passed, 0 failed, 46 ignored, first run (one more than #573 on the samemain: this PR's test).XCL_SAMPLE_*unset.SKIPPEDon this adapter: the wave64 GPU tests (no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(the driver cache cannot be disabled without Developer Mode).xcl shaders <pack> --recompon a retail shader pack (26 698 programs; counts only):main1ec4c98reports wave32 2 608, this PR 2 662 – the 54 compute programs #573 describes. Both translate 26 698 of 26 698 with 0 errors; the VS / PS wave size line is the same in both (wave32 1 127, wave64 13 210).detect_wave64(code)again, the new test fails (left: (1, 0),right: (1, 1)).Regression run
scripts/smoke.ps1, a retail title, release builds, warm shader cache,mainfirst. The change is not reached by a title run (it is inxcl shadersand the dump).main:
PR:
Not tested
XCL_DUMP_SHADERS): no test covers it; the change there is the same one-line call.AI use
🤖 Generated with Claude Code
@ettehn on GitHub · 2026-11-24 07:33 UTC · original
Independently verified the shader dump on Windows x64 at 051b86e7982008778c1b78885f83ca2262f4e09f. With XCL_DUMP_SHADERS=1, I passed two synthetic CS containers through shader::capture. Both used the same three RDNA2 instructions with no EXEC write. I checked the captured binaries against the inputs and read the generated fssm0.p0.hlsl files. Header flags 0x20 produced [WaveSize(32)] and 0x00 produced [WaveSize(64)].
As a negative control, restoring only the previous detect_wave64(code) call made the same test fail: the 0x20 case emitted [WaveSize(64)]. This exercises HLSL export; I did not compile or dispatch the dumped shaders.
OpenAI Codex (GPT-6.2 Astra) assisted with verification.
@4usphs on GitHub · 2026-11-24 07:35 UTC · original
Test run on AMD RDNA4 (native wave64), since the PR's own run is on a wave32-only adapter where the wave64 tests are skipped.
Tested: the PR head
051b86e(stack: #573's09b1fb0+ this commit, basemainbeaa245, so this is the same code as the merge). RX 9070 XT (RDNA4), driver 32.0.32029.2010, Ryzen 7 9800X3D, Windows 11 Pro 26200, Rust 1.100.0, debug.cargo build --workspace && cargo test --workspace -- --test-threads=4: 716 passed, 0 failed, 41 ignored, 0SKIPPED(lib: 674 / 0 / 21). The two tests skipped on the RTX 4080 (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware) run and pass here.console_compute_without_an_exec_write_has_the_wave_size_of_its_headerruns here (backend 'real' – AMD Radeon RX 9070 XT, not skipped) and passes, also withXCL_TRANSLATED_CACHE=0.shaders.rscaller passingdetect_wave64(code)again,recompiler_statistics_count_wave32_by_the_header_flagfails (left: (1, 0),right: (1, 1)), as in the description.console_translationinpso.rspassingdetect_wave64(code)again andXCL_TRANSLATED_CACHE=0, the e2e test fails 2 of 2 runs:flags 0x20, thread 32,left: (0, 32),right: (32, 32). So thread 32 reads thread 0, as in one 64-lane wave.A note for anyone repeating that last control: without
XCL_TRANSLATED_CACHE=0the test still passes, becausepso.rsis not in the translator source hash (build.rs) and the translation from the earlier run is reused. That is not a problem for the PR itself: it also changesmod.rs,xbox.rsandshader.rs, which are in the hash.Not tested: smoke or a retail title,
xcl shaders --recomporXCL_DUMP_SHADERSon a real shader pack (noXCL_SAMPLE_*set), a release build.AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests and the controls on my PC and wrote this comment. I have not reviewed the code.
@SlopTart on GitHub · 2026-11-24 09:33 UTC · original
Linux / AMD RDNA3 datapoint.
Merged state: head
051b86eonto main077ce40, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 712 passed, 7 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows. wave-size-from-header statistics green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@JJAutoCompare on GitHub · 2026-11-25 05:50 UTC · original
Empirical test report (
6576d75b)PR #880 head tested at
6576d75b66735120b4d459c046318a52b6ba807fin a clean detached checkout.Hardware / environment
rustc 1.100.0 (0ef1bc386 2026-11-09), hostx86_64-pc-windows-msvc.dxc.exe --versionreported DXC 1.9.2609.5 (01b62ad47).XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1. Both commands ran outsideInvoke-ArcTest.ps1with no Arc GPU mutex held.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test executables.cargo test -p xcl --lib header_flag -- --nocaptureexited 0 with 2 passed, 0 failed, 0 ignored, 0SKIPPEDlines, and 1,104 filtered out. Counts came from the captured output.Observed behavior
0xDEADBEEFfield fall back to instruction-based detection. Both tests use synthetic data and execute on the CPU.Not tested
The full GPU workspace suite and game smoke runs were omitted. The focused tests exercise the parser and statistics code in-process. The standalone CLI and runtime shader dump were not exercised.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr880-focused.logand published.@thehollowedone on GitHub · 2026-11-25 09:29 UTC · original
Independent Windows run on 6576d75, including its stacked b8b4135. RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, DXC 1.8.2502.11.
The clean
cargo build --workspace --offline --locked -j 4passed.cargo test --workspace --offline --locked --no-fail-fast -j 4 -- --nocapture --test-threads=4finished with 1130 passed, 0 failed, 46 ignored. Cargo’s pass count includes 25 runtime skips (20 no native wave64, three unsupported per-lane forms, one unavailable driver-cache control, one no heap windows). The stock header, statistics and compute-dispatch tests passed.For a separate synthetic CLI check, LLVM 23.1.6
llvm-mcassembled one 36-bytegfx1030program containingv_readfirstlane_b32and no EXEC write. Two containers differed only in FSSM bit 5.xcl shaders <fixture> --recomp --compile 1 --jsoncounted wave32 as 1 with the bit set and 0 with it clear. Each dump had the matchingWaveSizeattribute, compiled with DXC, and passed DXIL validation. Dispatching the wave32 dump on the RTX 3080 Ti returned the expected first lane and thread ID for all 64 threads. The wave64 dump was validated without dispatch. Reverting only the CLI’s wave selection to code-only detection made the tagged case count zero wave32 programs and fail the assertion. The focused filter waslocal_llvm_rdna2_cli_dump_respects_wave_header_and_runs.Synthetic CLI and D3D12 coverage. No retail data or native AMD hardware run. AI use: Codex (GPT-6, exact variant unspecified) prepared the fixture, ran the tests and drafted this report.
@DavidM1911 on GitHub · 2026-11-25 09:52 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@raylitebull on GitHub · 2026-11-25 10:46 UTC · original
6576d75isMERGEABLE/CLEANwith green CI.Needs an exact-head AMD verification pass on
6576d75(previous AMD runs were on pre-rebase commits) before merge.@4usphs on GitHub · 2026-11-25 11:25 UTC · original
@raylitebull exact-head AMD run on
6576d75, as asked. Two AMD adapters with native 64-lane waves, so the wave64 tests skipped on NVIDIA run here.Tested:
6576d75as it is (on #573'sb8b4135, parentbdda528), clean checkout, debug,XCL_TRANSLATED_CACHE=0. Ryzen 7 9800X3D, Windows 11 Pro 26200, Rust 1.100.0, DXC 1.9.2602.17. Adapter picked withXCL_ADAPTER:gfx1036), driver 32.0.21045.29003cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:no wave64skips on either.SKIPPEDon both: the per-lane-form subcases oflower_dxil::tests::f16_programs_on_the_gpu/f32_programs_on_the_gpu(refused),pso_measurement_compiles_an_exact_synthetic_record(driver cache),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599; iGPUfuzz_validate_and_gpu_1seed 540.cargo test -p xcl --lib gpu::dxil::fuzz_testson the parentbdda528fails the same way on each adapter (same seeds, same values).XCL_REQUIRE_GPU=wave64, 3 / 3 passes on each adapter: #573'sconsole_compute_without_an_exec_write_has_the_wave_size_of_its_header(runs, not skipped),recompiler_statistics_count_wave32_by_the_header_flag,wave_size_comes_from_the_header_flag.console_translationinpso.rspassingdetect_wave64(code)again, the e2e test fails 2 / 2 runs:flags 0x20, thread 32,left: (0, 32),right: (32, 32). Reverted after.Not tested: smoke or a retail title,
xcl shaders --recomp/XCL_DUMP_SHADERSon a real shader pack,XCL_DIRECT_DXIL=1(thedirect_compute/direct_graphicscall sites), release build.My earlier run on
051b86e(RX 9070 XT) is in #880.AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests and the control on my PC and wrote this comment. I have not reviewed the code.
@thiagocalile on GitHub · 2026-11-25 16:45 UTC · original
Independent test report for head
6576d75b66735120b4d459c046318a52b6ba807fon an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).Tested
32.0.21045.29003,XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- shaders --test-threads=4: 15 passed, 0 failed, 0 ignored (1SKIPPED:pso_measurement_compiles_an_exact_synthetic_record, Windows Developer Mode not enabled).Regression run (
scripts/smoke.ps1 -Seconds 60, release builds,XCL_ADAPTER=radeon)main(06c9f55):PR
#880(6576d75):Not tested: full workspace test suite on this head, NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window.
AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.