Repository navigation
wave64_emulate_opt: model s_bitset0/1_b32/b64 as read-modify-write and SCC-less (SHADER-W64-EMU-BITSET-RMW) - #1906
Conversation
…d SCC-less (SHADER-W64-EMU-BITSET-RMW)
|
Hi @JordanWebDev, thanks for this pull request. It currently conflicts with AI-assisted (Claude Code, Claude Opus 5.5). |
|
RUN of #1906 ( Heads tested: PR head Commands, one process each, from the worktree root:
Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, GPU not used. |
|
GPU complement, since the run above had no GPU: the GPU shader suite with wave64 emulation on AMD RDNA4. Radeon RX 9060 XT (RDNA4, subgroup 32..64), driver 32.0.23033.1002 (Vulkan 26.3.1), Windows 10 Pro 22H2 19045.7846, MSVC 14.44, llvm-mc 21.1.8 (AMDGPU), CPython 3.14.6. Head
Not checked by a second agent or human yet. AI-assisted: yes (Claude Code). |
|
@JordanWebDev this PR now conflicts with |
Claimed in the coordination issue as: SHADER-W64-EMU-BITSET-RMW
Depends on: none (note: open PR #1735 also edits tools/wave64_emulate_opt.py in separate hunks and docs/design.md; rebase if #1735 lands first)
What and why
tools/wave64_emulate_opt.pypreviously treateds_bitset0_b32,s_bitset1_b32,s_bitset0_b64, ands_bitset1_b64as ordinary full-overwrite scalar ops that also clobberSCC. On RDNA2 (SOPK encoding),s_bitset*performs an in-place read-modify-write preserving all other bits of the target SGPR(s) and leavesSCCuntouched:"s_bitset"to_SCALAR_NO_SCC_PREFIXES(tools/wave64_emulate_opt.py:153) sowrites_scc()does not suppress liveSCCacross bitset instructions.s_bitset0_b32,s_bitset1_b32,s_bitset0_b64, ands_bitset1_b64to the_RW_SOPK_RWbranch of_get_op_meta()(tools/wave64_emulate_opt.py:252-254) so_scalar_rw()models both the read and may/must-write across the full 32-bit or 64-bit SGPR destination, keeping prior lane-local definitions live and preventing unsounds_cbranch_execzfolding.LocalExecFoldTests.test_bitset_rmw_keeps_scalar_live_out_of_lane_local_execz_foldintests/semantic/test_wave64_emulate_opt.py(covering_scalar_rw,writes_scc, SPIR-V binary assembly, and 64- and 128-thread emulated workgroup execution viaspirv_mini_interp) and updated theWave64 emulation (\--wave64-emulate`)contract row indocs/design.md`.Tested
python -I scripts/check_no_game_data.py tools/wave64_emulate_opt.py tests/semantic/test_wave64_emulate_opt.py docs/design.md-> exit 0python -I tests/semantic/test_wave64_emulate_opt.py-> Ran 34 tests in 8.295s OKpython -I tests/semantic/test_wave64_emulate_barriers.py-> Ran 13 tests in 1.430s OKpython -I tests/test_wave64_emulate_opt_cfg.py-> Ran 26 tests in 0.001s OKpython -I -m compileall -q make_game.py tools tests-> exit 0python -I make_game.py --help-> exit 0python -I tests/test_text_write_line_endings.py(3 OK),tests/test_report_paths.py(22 tests, 1 skipped, OK),tests/test_docs_design_rows.py(5 OK),tests/test_docs_repo_paths.py(3 OK),tests/test_docs_repeated_lines.py(2 OK),tests/test_ci_registration.py(16 OK)3f81d46ac):python -I scripts/run_semantic_tests.py tests/semantic-> 487 files, 6280 tests, 0 files failed in 207 sllvm-mcwith AMDGPU target andVULKAN_SDKnot installed locally);spirv_asm.assemble(..., target_env="vulkan1.2")verified valid SPIR-V binaries for all generated modules.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.