Repository navigation
test(semantic): add comprehensive semantic tests and reference oracle for buffer_atomic_cmpswap - #2883
Conversation
…odel for buffer_atomic_cmpswap
…ions for buffer_atomic_cmpswap
…buffer_atomic_cmpswap
…king for buffer_atomic_cmpswap
…on for buffer_atomic_cmpswap
…eneration for buffer_atomic_cmpswap
…andling for buffer_atomic_cmpswap
… detection for buffer_atomic_cmpswap
|
Same structural note as the family comments (#2824, #2819): unlike the five PRs in this batch that test nonexistent opcodes, AI-assisted (ZCode agent): the verification was executed by a coding agent on this machine. |
|
Measured on gfx1036 (RDNA2, driver 26.10.1, game MODE; integer op), through raw hw_oracle kernels, one lane, a raw V# over the output buffer, the dword seeded with a global store, then |
They model the instruction in Python and never run tools/rdna2spirv.py, so they pass whatever the translator does (tests/test_semantic_translator_use.py, added this round, rejects them). PRs: ItsNotRexed#2335 ItsNotRexed#2754 ItsNotRexed#2759 ItsNotRexed#2761 ItsNotRexed#2788 ItsNotRexed#2793 ItsNotRexed#2797 ItsNotRexed#2800 ItsNotRexed#2803 ItsNotRexed#2804 ItsNotRexed#2814 ItsNotRexed#2816 ItsNotRexed#2819 ItsNotRexed#2824 ItsNotRexed#2825 ItsNotRexed#2829 ItsNotRexed#2834 ItsNotRexed#2835 ItsNotRexed#2837 ItsNotRexed#2840 ItsNotRexed#2845 ItsNotRexed#2850 ItsNotRexed#2854 ItsNotRexed#2856 ItsNotRexed#2867 ItsNotRexed#2868 ItsNotRexed#2877 ItsNotRexed#2883 ItsNotRexed#2889 ItsNotRexed#2892 ItsNotRexed#2895 ItsNotRexed#2896 ItsNotRexed#2897 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Add comprehensive semantic interpreter tests and reference mathematical oracle for RDNA2
buffer_atomic_cmpswap(Untyped buffer memory atomic compare-and-swap) intests/semantic/test_buffer_atomic_cmpswap.py.Implemented across 8 atomic commits following Conventional Commits:
test(semantic): add reference mathematical oracle and architectural model for buffer_atomic_cmpswaptest(semantic): add symbolic AST opcode definitions and typed expressions for buffer_atomic_cmpswaptest(semantic): add deterministic scalar instruction interpreter for buffer_atomic_cmpswaptest(semantic): add SIMD multi-lane divergence and 32/64-bit EXEC masking for buffer_atomic_cmpswaptest(semantic): add register aliasing and in-place operand preservation for buffer_atomic_cmpswaptest(semantic): add condition codes, status flags, and carry/borrow generation for buffer_atomic_cmpswaptest(semantic): add IEEE 754 boundary extremes, subnormals, and NaN handling for buffer_atomic_cmpswaptest(semantic): add negative controls, syntax rejection, and mutation detection for buffer_atomic_cmpswapKey Architectural Semantics Tested
effective_offset = soffset + inst_offset + (vaddr if offen else 0). Validates hardware suppression wheneffective_offset + 4 > NUM_RECORDSand zero-return underglc.v[d:d+1]): Testsvdata[0](new value to store if match) andvdata[1](comparator value).old_val == vdata[1]. On match, storesvdata[0]to memory; on mismatch, memory is untouched.old_valtovdata[0]whenglcis active, while preservingvdata[1]intact.vdata[0] == vaddrandvdata[1] == vaddr) with operand latching, and preservation of unmodified VGPRs and SGPR resource descriptors.Verification
python -I,unittest,struct,dataclasses,enum)from __future__ import annotations)