Repository navigation
Conversation
Independent Review of PR #7378Verdict: LGTM / Approve. Environment
Negative Control Reproduction on
|
|
Code read + run of 51f1761 on Windows 11, Python 3.11.9: LGTM.
AI-assisted (Claude Code). |
devnull34
left a comment
There was a problem hiding this comment.
Verified: passes all 57 tests in tests/semantic/test_interp_int_divmod.py and tests/semantic/test_interp.py. Models OpUDiv, OpUMod, OpSDiv, and OpSRem accurately including 32/64-bit signed truncation semantics and clean UNDEF handling on zero-division/INT_MIN overflow.
|
Tested 51f1761 on Windows 11 (26200.9974), Python 3.12.0: pass.
Synthetic SPIR-V only; no game data. AI-assisted. |
Claimed in the coordination issue as: #7231 (comment) (new TEST item, ID pending assignment)
What and why
tools/rdna2spirv.pyemitsOpUModfor every--wave64-emulate3-slot exchange ring buffer (%x_it % 3),OpUDivfor scratch-swizzle chunking, andOpSRemfor texture-wrap modulo, buttests/semantic/spirv_mini_interp.pyrejected all of them withUnsupportedConstruct— blockingrun_workgroup()from executing translated--wave64-emulateloop shaders.tests/semantic/spirv_mini_interp.py: ImplementOpUDiv,OpUMod,OpSDiv, andOpSRem(32-bit and 64-bit) and add them to_PURE:OpUDiv/OpUMod: unsigned division and modulo overwmask(a[0]), returningUNDEFon divisor0.OpSDiv/OpSRem: signed truncating-toward-zero division and remainder whose sign matches operand 1 (SPIR-V spec, e.g.OpSRem(-1, 4) == -1), returningUNDEFon divisor0or signedINT_MIN / -1overflow.tests/semantic/test_interp.py: ReplaceOpUDivwith an unmodelled SPIR-V opcode (OpOuterProduct) intest_unsupported_constructs_are_rejected.tests/semantic/test_interp_int_divmod.py: Add stdlib-only self-tests covering 32/64-bitOpUDiv/OpUMod/OpSDiv/OpSRem, all sign combinations,UNDEFhandling and_PUREpropagation, and an end-to-end synthetic--wave64-emulatedivergent loop compute shader verified to emitOpUModand execute accurately across all 64 lanes inrun_workgroup().Does not touch
tools/rdna2spirv.pyor overlap #4768 / #7200.Tested
Linux (Ubuntu 24.04), Python 3.12.16, CPU only (no GPU, synthetic inputs only, no game data):
python3 -I tests/semantic/test_interp_int_divmod.pyfails on every test (UnsupportedConstruct: OpUDiv/OpSRem/OpUMod).python3 -I tests/semantic/test_interp_int_divmod.py -v— 5 tests OK.python3 -m unittest discover -s tests/semantic -p "test_interp*.py"— 206 tests OK.python3 -I tests/semantic/test_wave64_scmp_masks.py— 15 tests OK.python3 -I tests/test_ci_registration.py— 14 tests OK.python3 -m compileall -q tests/semantic/spirv_mini_interp.py tests/semantic/test_interp.py tests/semantic/test_interp_int_divmod.py— clean.git diff --check— clean.AI-assisted: yes (Antigravity)
Checklist
docs/design.md, with how it was confirmed. (N/A — test interpreter only; no translator rule added.)