Repository navigation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 117d2fd03b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
117d2fd to
5baadbc
Compare
…b32/s_nand_b32 lane-mask lowering, document scope
e73b1f0 to
2ebf8dd
Compare
|
Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is. We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here. AI-assisted; commands listed were executed locally. |
|
The You wrote that you will reopen this once the Windows queue is clear. Since #2459 merged in between, the branch now overlaps it. If you would rather not rebase, I can port the AI-assisted. |
|
Changing my timeline above: I am taking the AI-assisted. |
|
I see you reopened this at 23:00 UTC, so I am handing the AI-assisted. |
…ith WARP readback test Merge origin/main (which took the SGPR-destination forms in the sibling change) and keep only the exec_lo destination, ported from Leyukaka's snor-exec-lo commit 482bade. Adds a D3D12 UAV readback check for NOR and NAND. Co-authored-by: Leyukaka <45659323+Leyukaka@users.noreply.github.com>
|
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
|
@MasterDomino ready for review/merge: head @Leyukaka thank you for the Verification (Win2025, head AI-assisted; commands listed were executed locally. |
|
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
|
|
@MasterDomino: #2030 is ready for review/merge. What changed: merged current main into the branch (one conflict in Verification:
AI-assisted; commands listed were executed locally. |
R0Y00
left a comment
There was a problem hiding this comment.
The four-bit-pair fixtures passed on WARP and RTX, but the new EXEC_LO form is accepted by the mesh-stage lowering too. The slot 57 profile is known wave64. A probe with kind=ms and two marked mask sources emits exec = (~(s1 | s2)) & 1 for s_nor_b32 exec_lo, s1, s2 and likewise for NAND, so upper lanes are changed even though the instruction only writes EXEC_LO. Please require a proven wave32 mask for the new EXEC_LO forms, or explicitly preserve lanes 32–63 in wave64. Add a case with an active upper lane and an inactive low lane result so the current lowering fails. The existing SCC-read refusals should remain.
MasterDomino
left a comment
There was a problem hiding this comment.
Reviewed 9d9dbe91. I agree with @R0Y00's open change request.
The exec_lo destination is accepted for every stage kind. A unit probe with kind='ms' (slot 57 mesh is wave64) and two marked mask sources emits exec = (~(s1 | s2)) & 1; for s_nor_b32 exec_lo, s1, s2, and NAND does the same. That write also changes lanes 32–63 of a wave64 wave.
- What to change: accept the
exec_lodestination only for a proven wave32 stage: pixel, or compute with at most 32 threads per group, as the b32 waterfall close already requires (gfx2hlsl.py:~2606). - Test: add the upper-lane case R0Y00 asked for.
- Related: existing
s_and_b32/s_or_b32/s_mov_b32writes intoexec_loshow the same behaviour in that probe. That can be a separate issue.
The branch also conflicts with main since #2580, in tools/startup/gfx2hlsl.py, where main's mark_heap_index call follows set_s. Keeping that call and dropping the moved lane_complement block should resolve it. Please also refresh the PR description: it still says a vcc_lo destination is accepted and that SCC uses the per-lane projection, and the code now refuses both.
Otherwise the lane semantics look right:
- NOR/NAND bit i depends only on bit i of each source.
- Compare masks are zero in inactive lanes, and VGPR writes are guarded after the
execwrite, so a reactivated lane computes the hardware bit. - SCC isn't emitted, and a later read of it is refused.
No cache revision bump is needed: 60 of 72 probe programs translate identically on main and on this head, and the 12 that differ were refused on main.
Runs: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818.
- Targeted:
ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)'4/4, including dispatch on WARP and hardware. - Neighbours:
ctest -R startup_gfx2hlsl252/253. The failure,startup_gfx2hlsl_fma_mix_dispatch_hardware, also fails onmainon this GPU (#2746). - Mutants: five one-line mutants are each caught by
startup_gfx2hlsl_sop2_complement: XNOR intoexec_lo, avcc_lodestination intoexec_lo, mixed sources intoexec_lo, SCC emitted, andscc_effectdropped. The news_nor_nandcheck itself catches none of them; it covers only accepted forms and the readback.
AI-assisted; commands listed were executed locally.
… proven wave32 stage Merge main (keep mark_heap_index and the salu_align4 write); refuse the exec_lo destination in mesh, vertex and wave64 compute stages; add stage cases to the s_nor_nand check and a pixel-stage default to the shared probe.
…reads The wave size of a pixel or vertex stage is unknown to the translator, so only compute with at most 32 threads per group is proven wave32.
|
@MasterDomino @R0Y00 thanks, both points are addressed at
Linux, from the worktree at this head: The Win2025 receipt (named tests) follows in an edit to this comment. AI-assisted; commands listed were executed locally. |
|
Win2025 receipt at
@MasterDomino @R0Y00 ready for another look. AI-assisted; commands listed were executed locally. |
MasterDomino
left a comment
There was a problem hiding this comment.
Approving ef54c20a. My change request at 9d9dbe91 is addressed.
exec_lodestination. NOR/NAND intoexec_lois now accepted only for compute groups of at most 32 threads (wave32_stage), where lanes 32..63 hold no thread. Pixel, vertex, mesh and larger compute groups refuse it.- Mutant: with the gate forced on (
wave32_stage = True or ...),startup_gfx2hlsl_s_nor_nand_check.pyfails on the newstage_checks(): the ps, cs (64, 1, 1) and cs (8, 8, 1) cases are no longer refused. - Pixel: keeping it refused without a wave-size proof is the right call.
- Mutant: with the gate forced on (
- Conflict and description: resolved and refreshed. The branch merges cleanly onto current
main, and CI is green at the head.
No cache revision bump is needed: main refuses these exec_lo forms, and this head only adds translations for compute groups of at most 32 threads.
Commands, on Windows 11 build 26300, at ef54c20a: python -B tests/startup_gfx2hlsl_{s_nor_nand,sop2_complement,compute,mask_overwrite}_check.py, all exit 0.
@R0Y00, the head now enforces the wave32 requirement from your change request. If you agree, please clear it and I'll merge (or merge it yourself).
AI-assisted; commands listed were executed locally.
|
@R0Y00 the change request of 2026-11-26 05:50Z (on 9d9dbe9:
Please re-review this head, or dismiss the old change request if you agree it is resolved. AI-assisted; commands listed were executed locally. |
|
@tedin7, The merge also still needs @R0Y00 to re-review or dismiss his change request at AI-assisted. |
|
Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it. |
Part of #1723
What this unblocks: Run 20 census #9 (64/61 pairs).
Source: AMD RDNA 2 instruction set architecture guide, the SOP2 instructions
s_nor_b32ands_nand_b32(bitwise on the 32-bit scalar operands) and the EXEC / wave32 description (a write toexec_loin wave64 leaves the high half unchanged).gfx2hlslrefuseds_nor_b32ands_nand_b32whenever an operand or the destination was a lane mask. They now lower on a mask when every source is a lane mask: bit i of~(a op b)depends only on bit i of each source, so the lane's own bit is exact. The destination may be an SGPR (any stage) orexec_lo(only for compute with at most 32 threads per group, the one wave32 proof available; pixel, vertex, mesh and larger compute groups keep refusing it, because a write toexec_loleaves lanes 32..63 of a wave64 wave unchanged).s_xnor_b32, avcc_loor high-half destination, mixed mask and word sources, ands_pack_hh_b32_b16on a lane mask stay refused.SCC is not emitted for these forms: translate() refuses a program that can read it.
Changes:
tools/startup/gfx2hlsl.py: lane-complement lowering ofs_nor_b32/s_nand_b32on masks, with the wave32 gate for theexec_lodestination.tests/startup_gfx2hlsl_s_nor_nand_check.py(new, registered inCMakeLists.txt, with_dispatch_warp/_dispatch_hardwareD3D12 UAV readback variants): per-bit CPU reference, GPU readback, andstage_checks()for the stage gate.tests/startup_gfx2hlsl_sop2_complement_check.py: refusal checks narrowed to the forms that stay refused; the shared probe is a 32-thread compute stage.docs/experiments.md: the accepted forms and the stage rule.Verification (head
ef54c20a638f7d0ff72dc3747c6a82158273207a):python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py,..._sop2_complement_check.py,..._waitcnt_depctr_check.pyok. Without the stage gate,s_nor_nand_checkfails on the wave64 cases.startup_gfx2hlsl_sop2_complement,startup_gfx2hlsl_s_nor_nand,startup_gfx2hlsl_s_nor_nand_dispatch_warp,startup_gfx2hlsl_s_nor_nand_dispatch_hardware). Thewarp-named test ran on the GPU there, not on WARP.AI-assisted; commands listed were executed locally.