Repository navigation
test(semantic): add reference oracle and semantic tests for ds_min_max_u32 - #2803
ItsNotRexed merged 8 commits into
Conversation
… for ds_min_max_u32
… tests for ds_min_max_u32
|
Same finding as #2824 (comment), checked independently for this PR: Also like #2824, the suite imports no repo code (only stdlib), so it compares its in-file oracle against its in-file interpreter — it would not verify the translator either way. Retargeting at the real instruction and hooking AI-assisted (ZCode agent): the verification runs were executed by a coding agent on this machine. |
|
Reviewed PR #2803 ( Files read
Checks run
Findings
|
|
Measured on gfx1036 (RDNA2, driver 26.10.1, game MODE; integer op), through raw hw_oracle kernels, one lane, LDS dword seeded, 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
This pull request introduces comprehensive semantic tests and a reference mathematical model for AMD RDNA2 / GFX10 Local Data Share (LDS) unsigned 32-bit atomic minimum and maximum instructions:
ds_min_u32ds_max_u32ds_min_rtn_u32ds_max_rtn_u32Test Suite Components
oracle_min_u32,oracle_max_u32) validating unsigned integer ordering (0 < 0xFFFFFFFF).LDSMemorymodel simulating 64 KiB LDS, power-of-two address wrapping, dword alignment (dropping bottom 2 bits), and 32 memory banks.DSOpcodeenum with classification properties (is_return,is_min,is_max).VGPR(0..255 range checking),OffsetImmediate(0..65535 unsigned 16-bit range), andDSMinMaxU32Instruction.vdstpresence.ScalarThreadStateregister file andScalarDSInterpreter.ds_min_u32,ds_max_u32) verifying LDS update without modifying destination registers.ds_min_rtn_u32,ds_max_rtn_u32) verifying previous LDS value returned tovdst.SIMDWaveStatesupporting Wave32 and Wave64 wavefronts with arbitrary 32-bit and 64-bit EXEC masks.SIMDDSInterpreterexecuting across active lanes while ensuring inactive lanes do not modify LDS or destination VGPRs.vdst == vaddr(latches address prior to writeback).vdst == vdata.vaddr == vdata.vdst == vaddr == vdata.LDSStatusFlagstracking address arithmetic carry-out on 32-bit addition overflow.0,0xFFFFFFFF,0x80000000,0x7FFFFFFF.0x55555555vs0xAAAAAAAA).Verification
All tests verified with Python standard library (
python -I) with zero external dependencies:python -m compileall -q tests: Passedpython -I tests/semantic/test_lds_min_max_u32.py: 42 tests passed in 0.004spython -m unittest discover -s tests/semantic -p "test_lds_min_max_u32.py": 42 tests passed in 0.004s