Repository navigation
docs, tests: probe and close row 403 (v_cmp(x) 16-bit op_sel, constants, sdst inactive lanes) (TEST-284) - #3231
Conversation
…ts, sdst inactive lanes) Natively probe and verify 16-bit vector compares (v_cmp and v_cmpx for f16, u16, i16) across wave32 and wave64 on AMD RDNA2 silicon (gfx1036, AMD Ryzen 7000 iGPU, driver 26.11.2): - v_cmp sets 0 for inactive lanes in sdst (s4 in wave32, s[4:5] in wave64). - v_cmpx kills inactive/failing lanes in EXEC across wave32 and wave64. - Inline float constants (1.0, -2.0, 0.5, 4.0): op_sel=0 reads f16 in low half; op_sel=1 reads +0.0. - Inline integer constants (1, -1): op_sel=0 reads low half; op_sel=1 reads high half (0 for 1, 0xFFFF for -1). - 32-bit literals: op_sel=0 reads [15:0]; op_sel=1 reads [31:16], including signed negative high halves in i16. - SGPR high halves as src0 and src1 with modifiers (neg, abs). - f16 ordered vs unordered relations on qNaN/sNaN. Probed with 0 divergences via tools/probe_gfx1036_vcmp16.py. Expanded tests/semantic/test_vcmp16_opsel.py with full coverage and spirv-val compliance. Closed row 403 in docs/design.md (TEST-284).
|
Reproduced on Linux, Python 3.12, with spirv-as off PATH: AI-assisted (Devin); Linux, no GPU. |
Summary
Closes row 403 in
docs/design.md(TEST-284 from coordination issue #3047 / #2891).Natively probes and verifies 16-bit vector compares (
v_cmpandv_cmpxforf16,u16,i16) across both wave32 and wave64 on AMD RDNA2 silicon (gfx1036, AMD Ryzen 7000 iGPU, driver 26.11.2) with 0 divergences against the translator and CPU interpreter:v_cmpinactive-lane handling: sets bit 0 insdst(s4in wave32,s[4:5]in wave64) for lanes inactive inEXEC.v_cmpxEXEC update: kills inactive/failing lanes inEXECacross both wave32 and wave64.1.0,-2.0,0.5,4.0, etc.):op_sel=0reads the f16 bit pattern in the low half;op_sel=1reads+0.0.1,-1):op_sel=0reads the low half;op_sel=1reads the high half (0for1,0xFFFFfor-1).op_sel=0reads[15:0];op_sel=1reads[31:16](including signed negative high halves ini16).src0andsrc1withop_sel:[1, 0]andop_sel:[0, 1], includingnegandabsmodifiers.o,u,eq,neq,lt,gt) onqNaNandsNaNwith modifier interactions.Testing & Validation
tools/probe_gfx1036_vcmp16.py.tests/semantic/test_vcmp16_opsel.py.spirv-val --target-env vulkan1.2across generated shaders.python -m compileall -q make_game.py tools tests scriptscompletely clean.AI-assisted: Yes (Gemini 4 Neon xhigh / subagent swarm worker 4).
Tested on: AMD Radeon(TM) Graphics (gfx1036 / deviceID 0x164e, driver 26.11.2, Windows 11).