Recompiler: the FSSM header's wave32 flag decides a program's wave size #573
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!573
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/573/head"
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 01:56 UTC · original
throny:recompiler-wave-size-from-header→main· +112 −6 · 5 files · 1 commits · merged 2026-11-25 18:24 UTCA wave32 console program that never writes EXEC was translated as wave64.
detect_wave64tells the wave size from the code (32-bit EXEC writes and no 64-bit ones mean wave32, anything else wave64), and such a program has nothing in its code to tell. Its cross-lane reads (v_readfirstlane,v_readlane, permutes) then span 64 threads instead of 32.The FSSM header says which it is: bit 5 of the flags word at +0xD4.
fssm_wave64takes wave32 from the header and leaves everything else todetect_wave64, so only those programs change. No issue covers this; I found none fordetect_wave64or the wave size. #517 is adjacent (how wave64 VS / PS are classified for 32-lane GPUs) and touches other functions; the two do not conflict.Measured on a retail shader pack (
XCL_SAMPLE_RPF, 26 698 programs, with a temporary test that is not part of the PR; counts only):maintranslates them as wave64. 27 of them have cross-lane instructions (v_readfirstlane,v_readlane, permutes, LDS);cs_6_6); their HLSL differs from the wave64 translation in all 54 withsplit_wave64(the form 32-lane GPUs get).Where the flag is: the Leonida project's docs (GPL-3.0, no code taken) name this header bit; the numbers above are my own count on the pack with XCL's parser.
What is in it
crates/xcl/src/gpu/xbox.rs:Fssm::wave32(version 0x101, the flags word, an unused 0xDEADBEEF field says nothing), the header comment, and the testwave_size_comes_from_the_header_flag.crates/xcl/src/gpu/recomp/mod.rs:fssm_wave64.crates/xcl/tests/gpu_compute_e2e.rs:console_compute_without_an_exec_write_has_the_wave_size_of_its_header, a compute program through the PSO hook on the GPU: 64 threads storev_readfirstlaneof their thread id. With the flag, threads 32..63 read thread 32; without it they read thread 0.console_cs_flagssets the flags word in the test container.crates/xcl/src/gpu/recomp/pso.rs:console_translationandconsole_meshuse it, and so do the direct DXIL paths from #1426 (direct_compute,direct_graphicsand the direct branch ofconsole_mesh), so both backends give an FSSM program the same wave size.crates/xcl/src/shaders.rs: thexcl shaderscompile run that mirrorspso, and its--directpass, use it.xcl shadersstatistics (shaders.rsaddhas only the code).docs/specs/2026-11-20-xcl-design.mdline 340 ("Wave64/wave32 is detected from the code (detect_wave64)") is no longer the whole rule.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=4onb8b4135(rebased onmainbdda528): 1 129 passed, 0 failed, 46 ignored, first run. Earlier heads: 995 / 0 / 45 onaefabd8, 860 / 0 / 42 on500fd5a, 715 / 0 / 41 on09b1fb0.SKIPPEDon this adapter (24 lines): the wave64 GPU tests (no wave64, including the per-lanelower_dxilones and two of its forms the per-lane path refuses),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).fssm_wave64returningdetect_wave64(code)alone,wave_size_comes_from_the_header_flagfails (left: (true, true),right: (true, false); run onde5b510), and the GPU test fails atflags 0x20, thread 32(left: (0, 32),right: (32, 32); run on the rebased tree).Regression run
scripts/smoke.ps1, the newer retail title, release builds of both commits, warm shader cache,mainfirst.main:
PR:
Not tested
XCL_DIRECT_DXIL=1on a title (the suite ran, the title run used the default HLSL path).AI use
c160d86,80f4819andbdda528(conflicts inpso.rs), the direct-path changes, the reruns above and these updates. The user asked for the comparison with their earlier Leonida work and approved opening the PR.🤖 Generated with Claude Code
@CryingLaughing on GitHub · 2026-11-24 02:05 UTC · original
I checked the GPU behavior called out under Not tested on exact head
de5b51027922d550a16a875677b4387ac0cb0467. Two synthetic FSSM containers carried identical 64-thread compute code with no EXEC writes. The containers differed only in the FSSM wave32 flag. Each invocation stored itsV_READFIRSTLANE_B32result in its own output slot through the real XCL PSO path.0x00, code-only detection selects split wave64000x20, header selects wave32032Tested
XCL_ADAPTER=4080,XCL_REQUIRE_GPU=1, allXCL_SAMPLE_*variables unset. D3D12 reported 32 hardware lanes.crates/xcl/tests/gpu_compute_e2e.rs,cargo test -p xcl --test gpu_compute_e2e --locked -j 4 fssm_wave32_flag_controls_compute_cross_lane_reads -- --show-output --test-threads=1passed 1/1. Both PSOs registered as translated, all 128 output words matched, and the canaries before and after each output were intact.cargo test -p xcl --lib --locked -j 4 wave_size_comes_from_the_header_flag -- --show-outputpassed 1/1.cargo build --workspace --locked -j 4passed.cargo test --workspace --locked -j 4 -- --test-threads=4 --show-outputreported 681 passed, 0 failed, 41 ignored, including opt-in game-data tests that returned early and four explicit skips.SKIPPEDfor native wave64:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware.SKIPPEDfor D3D12 debug-layer availability:test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_state.Not tested
AI use
@MesshM on GitHub · 2026-11-24 02:06 UTC · original
Test run and review of
de5b51027922d550a16a875677b4387ac0cb0467on AMD RDNA4 (native wave64). The branch is based on508a0c7, so I merged it onto currentmain9ce2070locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debug.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4) on the merge: 685 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 645 passed, 0 failed, 21 ignoredSKIPPED;wave_size_comes_from_the_header_flagpassesFssm::wave32changed to returnfalse(not committed), the test fails (left: (false, true),right: (true, false)), so it does pin the header flagReview
parseuses forversion(+4) and the code offset/size (+0xC0/+0xC8), and only for version 0x101 and not 0xDEADBEEF.fssm_wave64:console_translation(VS/PS/CS),console_mesh, and the pack precompile inshaders.rs. The remainingdetect_wave64call inconsole_translationis the FSPX (driver container) branch, which has no FSSM header, so that one is right as it is.pso::translated) stores the XCL binary's hash in each file, so a new build misses, and the DXC cache is keyed by the HLSL.Fssmat hand:xcl shaders --recomp's statistics (shaders.rs,self.rc.add(...)→detect_wave64inadd, which also countswave32) and the per-shader dump ingpu/shader.rs(recompile). Their wave32 counts and dumped HLSL will differ from what the runtime now translates for the 54 programs. Not a blocker; passing the FSSM (or the flag) there would keep the tools in step, in this PR or a follow-up.Not tested: no retail title or regression run (I have no unpacked game), so the 54 programs' behaviour was not seen here; no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; each point was checked against the code.
@ghost on GitHub · 2026-11-24 02:06 UTC · original
Wave64 hardware run, since Not tested lists it:
de5b510merged ontomain9ce2070(clean merge): pass. AMD Radeon RX 9060 XT (RDNA4, native 64-lane waves), driver 32.0.32029.2010; Ryzen 7 5800X3D; Windows 11 Pro 26200; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug..\scripts\test.ps1: 685 passed, 0 failed, 41 ignored; noSKIPPEDGPU tests (the wave64 GPU tests run on this adapter).cargo test -p xcl --lib wave_size_comes_from:wave_size_comes_from_the_header_flagpasses.AI use
@WebIdentity1 on GitHub · 2026-11-24 02:06 UTC · original
Complementing the RTX 4080 report above with native AMD wave64, an Ampere run,
V_READLANE_B32as well asV_READFIRSTLANE_B32, and an old-selection negative control onde5b51027922d550a16a875677b4387ac0cb0467, with the synthetic fixture below appended togpu/recomp/tests.rs.The fixture takes the real
console_to_dxil_inpath, then dispatches one 64-thread group. The program never writes EXEC. Each thread storesV_READFIRSTLANE_B32(v0)andV_READLANE_B32(v0, 31), where v0 is the group thread ID. Expected wave32 results are(0,31)for threads 0–31 and(32,63)for threads 32–63; wave64 expects(0,31)throughout.Tested
cargo test --locked -p xcl --lib gpu_fssm_wave32_flag_scopes_cross_lane_reads -- --nocapture --test-threads=1, separately withXCL_ADAPTER=NVIDIA GeForce RTX 3090/XCL_REQUIRE_GPU=mesh, andXCL_ADAPTER=AMD Radeon(TM) Graphics/XCL_REQUIRE_GPU=wave64; forced split variable unset.pso.rsrestored from parent508a0c7Both old-selection runs produce 64 mismatches out of 128 readbacks with flags
0x20; the upper 32 threads read the first wave's values. Both PR runs produce zero. The flags=0 wave64 control produces zero mismatches in all four runs (split wave64 on NVIDIA, native wave64 on AMD).cargo build --locked --workspace: passed. Four-thread workspace attempt (cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output) was incomplete, stopped by a 180 s bound. The new fixture passed, butgpu_uma_import_check_at_init,large_heaps_get_shared_pages_as_used,slots_copy_and_releaseandcopy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enumstalled. Log retained; no completed counts claimed. This resembles the existing #343/#344 interference reports, but I did not establish the cause here.cargo test --locked --workspace --no-fail-fast -- --test-threads=1 --show-output): 681 passed / 1 failed / 41 ignored. Sole failure:gpu_clamp_and_omod_per_instruction, also seen on parent508a0c7here. Four explicit skips:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no native wave64);test_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state(no debug layer). Sample inputs unset; system XGameRuntime comparison unavailable. Early-return skips remain included in Rust's pass counts. Full-suite recompiler tests selected NVIDIA; some default-device fixtures used AMD. This is not a passing four-thread suite claim.Not tested
Retail shaders/titles, VS/PS/mesh execution or older FSSM versions. This proves the GPU consequence for the chosen synthetic header; it does not independently establish the bit's format meaning or verify the 54 retail programs in the description. No change to your runtime code is proposed here.
AI use
Codex (GPT-6) wrote the fixture, ran native Windows tests and prepared the report.
Synthetic fixture, using existing test helpers (38 lines)
@MichaelL401 on GitHub · 2026-11-24 03:43 UTC · original
Test report on NVIDIA (wave32-only), commit de5b51027922d550a16a875677b4387ac0cb0467
Tested
.\scripts\test.ps1(cargo test --workspace -- --test-threads=4): 681 passed, 0 failed, 41 ignoredgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware– the same two as on main on this cardgpu_split_wave64_*,gpu_wave64_ps_*,gpu_wave64_vs_*,console_wave64_compute_through_the_pso_hook_dispatch_and_read_back) passNot tested
XCL_SAMPLE_*set: game-data tests passed without running anything.AI use
@raylitebull on GitHub · 2026-11-24 10:40 UTC · original
Code/CI review only (not independently runtime-tested by me): clean merge and
PR descriptiongreen (just awaiting CI workflow approval). Uses the FSSM header'swave32flag to determine program wave size with compute e2e test coverage. Recommend approving CI and merging, @ivall.@throny on GitHub · 2026-11-24 18:44 UTC · original
Rebased onto
mainc160d86(now500fd5a): #1426 conflicted inconsole_mesh. Besides resolving that, the direct DXIL paths #1426 added (direct_compute,direct_graphics, the direct branch ofconsole_mesh) now take the wave size fromfssm_wave64too, so both backends agree on an FSSM program. Suite 860 / 0 / 42 and a new smoke pair are in the description; the earlier AMD confirmations were on09b1fb0.AI use: Claude Code (Claude Opus 5.5).
@nnonno91 on GitHub · 2026-11-24 18:51 UTC · original
Independent AMD test of both compute backends at
500fd5aa026203a017b7efe60d716fa2bdc1399c.Tested
XCL_ADAPTER='AMD Radeon'; the probe required native wave64 and the real D3D12 backend.cargo build --workspace --lockedpassed.cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 860 passed, 0 failed, 42 ignored, with one GPU skip included in the pass count (heap_window_out_of_memory_falls_back_to_the_switch_form, heap windows off). Both new in-tree tests and the bundled title test passed.cargo test --locked -p xcl --test fssm_wave_probe -- --exact fssm_wave_size_through_both_compilers --nocapture --test-threads=1ran a temporary adaptation of the in-tree PSO-hook test. I ran it in separate processes withXCL_DIRECT_DXIL=0and=1at the PR head and basec160d86ef2efe3a07e4dfb473e4fa72eafb413c0, withXCL_TRANSLATED_CACHE=0,XCL_PSO_DISK_CACHE=0, and separate DXIL caches. Each of the four runs passed, with 0 ignored and 0 skips.The two synthetic containers held identical compute code with no EXEC writes and varied only the FSSM wave32 flag. All 64 output records per container were checked through the real D3D12 pipeline. Threads 0–31 returned first-lane ID
0in every run.The compiler counters confirmed 2 direct compute translations and 0 HLSL fallbacks in each direct run. The GPU readback also checked each output's own thread ID.
Not tested
Retail shaders or titles, graphics and mesh paths, other adapters, or performance.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the temporary probe, ran the checks, and drafted the report.
@JJAutoCompare on GitHub · 2026-11-25 05:42 UTC · original
PR #573 — Intel Arc A770 compatibility
Tested
b8b4135b7261c9b50cff1abf92a3b03cc2e8e6d2. PR #573 remained open at that SHA before and after the run, with no prior Intel Arc result in the PR discussion.32.0.101.9175, AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation 25H2 x64 build26200.9974, Rust and Cargo1.100.0(x86_64-pc-windows-msvc), DXC and DXIL1.9.2609.5, unoptimized test profile.cargo test --locked -p xcl --test gpu_compute_e2e --no-runexited0outside the Arc mutex.Invoke-ArcTest.ps1withXCL_ADAPTER=A770and pinnedXCL_DXC_DIR, ran the prebuiltgpu_compute_e2ebinary in separate processes for each backend withconsole_compute_without_an_exec_write_has_the_wave_size_of_its_header --exact --nocapture --test-threads=1:XCL_DIRECT_DXIL=0)XCL_DIRECT_DXIL=1)(first-lane value, thread ID)pairs through the real D3D12.X compute pipeline: FSSM flags0x00returned0for all 64 threads under split wave64; flags0x20returned0for threads 0–31 and32for threads 32–63 under wave32. Both Direct DXIL shaders ran with zero HLSL fallbacks.Not tested
Native wave64, other adapters, graphics stages, other FSSM versions, release builds, the full workspace suite, and retail or main-vs-PR smoke runs.
AI use
T3 Code / Codex (
gpt-6.2-sol) ran the fixture, verified the logs, and wrote this report. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts againstdirect-0.stdout.loganddirect-1.stdout.logand published.@raylitebull on GitHub · 2026-11-25 10:46 UTC · original
b8b4135isMERGEABLE/CLEANwith green CI.Needs an exact-head AMD GPU verification pass on
b8b4135(previous AMD runs were on pre-rebase commits) before merge.@DavidM1911 on GitHub · 2026-11-25 13:18 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!
@thiagocalile on GitHub · 2026-11-25 16:45 UTC · original
Independent test report for head
b8b4135b7261c9b50cff1abf92a3b03cc2e8e6d2on 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 -- wave --test-threads=4: 53 passed, 0 failed, 3 ignored (0skipped).Regression run (
scripts/smoke.ps1 -Seconds 60, release builds,XCL_ADAPTER=radeon)main(06c9f55):PR
#573(b8b4135):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.
@oni-swr on GitHub · 2026-11-25 18:05 UTC · original
AMD RX 7800 XT run of
b8b4135b7261c9b50cff1abf92a3b03cc2e8e6d2(PR head, as-is).Tested
cargo test --workspace --no-fail-fast -- --test-threads=4: lib 1078 passed, 1 failed, 26 ignored; every other test binary passed, includinggpu_compute_e2e. The newgpu::xbox::tests::wave_size_comes_from_the_header_flagandconsole_compute_without_an_exec_write_has_the_wave_size_of_its_headerpassed.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1fails (seed 722:res[30] = 0x1, CPU 0x7fffffff); it fails the same way onmainin my run, so it is not caused by this PR.main(origin/main68a284a596bd558b6bd9db6eedda6d6aa178c360) in the same setup: 1218 passed, 2 failed (the fuzz test andlower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier).Not tested
scripts/smoke.ps1regression run on a real title, so the runtime-change requirement is not met by this report.AI use