Repository navigation
Conversation
detect_wave64 tells the wave size from the code: 32-bit EXEC writes and no 64-bit ones mean wave32, anything else wave64. A wave32 program that never writes EXEC has nothing in its code to tell, so it was translated as wave64: its cross-lane reads (v_readfirstlane, v_readlane, permutes) then span 64 threads instead of 32. The FSSM header has the answer: bit 5 of the flags word at +0xD4. Measured on a retail shader pack (26 698 programs): the bit is set for all 2 608 programs the code shows to be wave32 and clear for all 24 036 the code takes for wave64, except 54 compute programs with the bit set and no EXEC write in their code. 27 of those 54 have cross-lane instructions (v_readfirstlane, v_readlane, permutes, LDS). As wave32 all 54 translate completely and compile with DXC. fssm_wave64 takes wave32 from the header and leaves everything else to detect_wave64, so only those programs change. An unused field (0xDEADBEEF) and other FSSM versions say nothing. A compute program through the PSO hook (gpu_compute_e2e) shows the effect: 64 threads store v_readfirstlane of their thread id; with the flag threads 32..63 read thread 32, without it they read thread 0. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…the header `xcl shaders --recomp` counted and translated a program as wave32 or wave64 from its code alone (detect_wave64), and so did the per-shader HLSL dump (`XCL_DUMP_SHADERS`). A wave32 program without an EXEC write was counted and translated as wave64 there, while the pipelines translate it as wave32 by the FSSM header's flag (fssm_wave64). Both now use fssm_wave64, so the statistics describe what the pipelines build. Suggested in the review of the header-flag change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#880 was closed or merged. |
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.
Stacked on xcl-dev#573; only the top commit (
051b86e) 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 xcl-dev#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 xcl-dev#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=4on051b86e: 716 passed, 0 failed, 41 ignored (lib: 674 / 0 / 21), first run.XCL_SAMPLE_*unset.SKIPPEDon this adapter:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).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 Recompiler: the FSSM header's wave32 flag decides a program's wave size xcl-dev/xcl#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. The PR ran twice (the block is the second run; the first: 1632 frames, exit 0x0, 0 removals, 0 crashes), thenmain. 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
Mirror of xcl-dev#880 (auto-synced, do not edit).