Repository navigation
startup: accept single-wave TG_SIZE_EN wave-ID masking in compute - #2432
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
tedin7
left a comment
There was a problem hiding this comment.
Review of head 1fbdd4fd (comment only, no merge action).
What I checked
- Diff read against origin/main:
gfx2hlsl.pyentry placement of TG_SIZE (user + len(groups)), the<= 32threads guard, the narrows_and_b32 R, TG, 0xfc0fold, and the refusal of every other read of an untouched TG register. Logic is sound and additive. - The test file covers placement, both operand orders,
R == TG, overwrite recovery, the> 32refusal and a WARP dispatch with CPU reference. The two control cases (dropped-base,swapped-mask) are wired into CTest for warp and hardware. The sibling refusal fixture instartup_gfx2hlsl_compute_check.pywas updated correctly. - No other open or merged PR covers TG_SIZE_EN (searched PRs: #1608, #2182 and #2223 are the compute base only).
- The author's WARP results in the PR body are stated for head
1fbdd4fd, the same SHA I reviewed. I did not run Windows tests myself. Hardware dispatch was not run by the author either, as they say. - The branch is 23 commits behind main. I did not update it, so the author's results stay valid for this SHA.
Commands run locally (Linux)
python3 -B tests/startup_compute_tg_size_check.py: passpython3 -B tests/startup_gfx2hlsl_compute_check.py: passpython3 tests/docs_links_check.py: passpython3 tests/bidi_controls_check.py: passgit diff --check origin/main...HEAD: clean- Mutation 1:
tg_size_sgproffset by +1. The test fails (exit 1). - Mutation 2: mask
0xfc0changed to0x3f. The test fails (exit 1). - Both mutations reverted.
No blocking findings.
AI-assisted; commands listed were executed locally.
# Conflicts: # CMakeLists.txt # docs/experiments.md # tools/startup/gfx2hlsl.py
1fbdd4f to
8d58e78
Compare
Main now carries R0Y00#2459, R0Y00#2461, R0Y00#2466, R0Y00#2483, R0Y00#2428 and others in their final form; the conflicts take main's versions. Kept from this branch: R0Y00#2460's generalized unjoined(), R0Y00#2432's scalar(mods), the s_setreg MODE check, the cube image kind, the v_cvt_f64_f32 inline check. Upstream chose R0Y00#2428 for v_{add,sub,subrev}_co_ci_u32, so the local co_ci handlers are renamed unbound_* and their two checks unregistered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review of head
A smaller fix than changing AI-assisted. |
|
Pushed c8348bc: a merge of main into this branch (no force, no rebase) so the PR is mergeable again. No code changes from me. Two conflicts, both kept on both sides:
Commands executed locally:
AI-assisted; commands listed were executed locally. |
Implements the unclaimed
TG_SIZE_ENitem from #2274 Part A intools/startup/gfx2hlsl.py.What changed
tools/startup/gfx2hlsl.py:ComputePipeline.__init__acceptsCOMPUTE_PGM_RSRC2.TG_SIZE_EN(bit 10) whenx * y * z <= 32(one wave per workgroup), decoding the base registers viaentry_registers(rsrc2 & ~(1 << 10))and placingtg_size_sgpr = user + len(groups). Groups> 32threads withTG_SIZE_ENremain refused.Stage.setup_compute_entrytagsself.sym[tg_size_sgpr] = ('tg_size',).Stage.scalaraccepts only unmodifieds_and_b32 R, TG, 0xfc0(either operand order,Ra plain SGPR<= 105, includingR == TG), emittingR = 0u; scc = false;and trackingRas('const', 0)sov_mbcnt_lo_u32_b32acceptsRas a known zero base.Stage.SandStage.scalarrefuse every other read of an untouched('tg_size',)register by name (other masks, moves, arithmetic, vector instructions, or directv_mbcnt_lo); overwritingTGrestores ordinary scalar behavior.tools/compute_store_aot.pycontinues to refuseTG_SIZE_EN.tests/startup_compute_tg_size_check.py,CMakeLists.txt,docs/experiments.md, andtests/startup_gfx2hlsl_compute_check.py(updated theTG_SIZE_ENrefusal fixture group size from(1, 1, 1)to(8, 4, 2)).Measured checks (
1fbdd4fdonorigin/mainb442b57f)tests/startup_compute_tg_size_check.py(pure Python): PASS (SGPR placement,s_and_b32 0xfc0,v_mbcnt_lobase,>32-thread & disallowed-read refusals, overwrite recovery,execz/ join behavior).tests/startup_compute_tg_size_check.py dispatch <dxc> <offscreen_check> warp(Microsoft Basic Render Driver1414:008c,10.0.26100.9818, DXCcs_6_0): PASS (two4x2x2groups,320words compared,0mismatches).tests/startup_compute_tg_size_check.py control {dropped-base,swapped-mask} <dxc> <offscreen_check> warp: PASS (dropped-baserejected at word 5,swapped-maskrejected at word 8).startup_gfx2hlsl_*,startup_compute_*,compute_entry_layout_check.py,startup_translator_check.py,docs_links_check.py,bidi_controls_check.py): 74 passed, 0 failed (2 CLI-binary compute checks skipped standalone).tools/startup/gfx2hlsl.py(offsettingtg_size_sgpr, dropping<= 32check, accepting0x3f, droppingStage.Srefusal): all 4 caught (exit 1).Not established
hardwaredispatch was not run here (WARP only).Refs #2274. AI-assisted (Gemini).