Repository navigation
Conversation
|
Tested I ran all 73 cases from AI-assisted |
|
Independent fragment-stage check of |
Kam471
left a comment
There was a problem hiding this comment.
Verified on the PR head: python -I tests/semantic/test_alu_div_fixup_f32.py -v -> 4/4 OK (73 rows), full semantic 4,141 OK. The table is hardware-derived (gfx1036, driver 32.0.21042.62; 73 curated + 256 seeded cases, wave32/64) and its non-ISA quirks contradict the repo's older IEEE oracle, so it is not implementation-mirrored. Mutation checks are non-vacuous: NaN-priority swap -> 2 failures, 0xFFC00000->0x7FC00000 -> 9, 151->150 -> 2. A 6,000-case independent differential against the documented 8-rule oracle gave 0 mismatches.
One blocker before merge: tests/semantic/test_valu_div_fixup.py on main is titled "Exact AMD RDNA2 fixup truth table" and asserts the opposite on four points (S2-NaN precedence 0x7FC00007 vs measured 0x7FC00022; 0/0 0x7FC00000 vs 0xFFC00000; subnormal S1 passing S0 vs 0x7F800000; sNaN quieted vs unchanged). This PR doesn't touch it, so CI would stay green while the repo holds two contradictory specs. Please update that oracle or scope it explicitly to IEEE=1/denorm32=3 and cite the measured table here.
|
Tested You noted no Vulkan SDK was available, so the translated modules had not been validated or executed here. The block now has both: the PR's own shader path passes CPU suites, reproduced. GPU check, hand-written and not pushed. One synthetic compute shader,
= wave32 and wave64 agree, as you claimed. The same module with the subgroup pinned to 32: Identical words. So the priority order, the canonical What I did not cover. Eight of your 73 rows, chosen one per rule for groups 1-8. I did not execute the VOP3 AI-assisted (Capy, DeepSeek V4.1 Flash). Synthetic shaders only, no game data, nothing pushed. |
|
Tested at the head on Windows 11 / Python 3.13.0: the new file 4/4 (73 measured rows), The test is genuine: it writes each row's Three documentation contradictions to settle (none block the code):
Rebase (14 commits behind, no conflicts today), and consider a GPU fixture - there is no Approve. AI-assisted review, no game files, no GPU. |
|
Thanks for the review @Kam471, and thank you @KiryaAfimin, @Marukooh, and @whoalin1 for the independent RTX 4070 / RTX 5070 Ti / Addressed in
Re-verified locally:
Ready for re-review! (AI-assisted.) |
e54c1a0 to
09d37db
Compare
# Conflicts: # docs/design.md
# Conflicts: # docs/design.md
Implements RDNA2
v_div_fixup_f32(v_div_fixup_f32_e64) intools/rdna2spirv.py, verified natively against RDNA2 silicon (gfx1036, wave32 and wave64).Claimed in #2716 (comment).
Measured RDNA2 (
gfx1036) semanticsMeasured natively on AMD Radeon(TM) Graphics (
gfx1036, not the console'sgfx1013), Windows AMD driver32.0.21042.62, viatools/hw_oraclein both wave32 and wave64 (identical on every case) under the game's inferred MODE (IEEE=0,denorm32=0,DX10_CLAMP=1):abs,neg): Applied bitwise (& 0x7FFFFFFF,^ 0x80000000) toS0/S1/S2before classification, including on quiet and signalling NaN payloads.denorm32=0): SubnormalS1/S2flush to signed zero (exp == 0), whileS0subnormals are preserved.S0quotient,S1denominator,S2numerator):NaN(S2)→S2(unchanged underIEEE=0, beatsNaN(S1)even whenS1is sNaN)NaN(S1)→S1(unchanged underIEEE=0)(zero(S1) && zero(S2)) || (inf(S1) && inf(S2))→0xFFC00000(canonical-qNaN)zero(S2) || inf(S1)→copysign(0.0, sign(S1) ^ sign(S2))zero(S1) || inf(S2)→copysign(inf, sign(S1) ^ sign(S2))exp(S2) - exp(S1) <= -151→copysign(0.0, sign(S1) ^ sign(S2))(pure biased-exponent difference; beatsNaN(S0)andinf(S0); no overflow cutoff)NaN(S0)→copysign(inf, sign(S1) ^ sign(S2))copysign(S0, sign(S1) ^ sign(S2))%uintops (zero float ops, zeroFloat64). Whenmul:2/mul:4/div:2/clampare present,omodapplies beforeclamp, andclampmaps NaN to+0.0(DX10_CLAMP=1) beforeGLSL.std.450 FClampto[0, 1].Changes
tools/rdna2spirv.py: Addv_div_fixup_f32lowering inGen._insn.tests/semantic/test_alu_div_fixup_f32.py: Add semantic regression tests pinning all 73 nativegfx1036-measured rows (wave32 & wave64), operand forms (SGPR, inline floats, VOP3 constant modifiers, hex literal NaN,_e64,nulldst), inactive-lane EXEC masking, SPIR-V structural invariants, andUnsupportedon invalid modifiers.docs/design.md: Appendv_div_fixup_f32row to the translator contract table.Testing
AMD Radeon(TM) Graphics (gfx1036), Windows driver32.0.21042.62):abs/neg/omod/clamprows: wave32 == wave64, 73/73 bit-exact betweenrdna2spirv.py+spirv_mini_interpand livegfx1036.rdna2spirv.py+spirv_mini_interpand livegfx1036.python -I tests/semantic/test_alu_div_fixup_f32.py -v: 4/4 tests OK (73 hardware-measured subtests).python -m unittest discover -s tests/semantic: 4,141 tests ran, 0 failures (3 skipped).python -m compileall -q make_game.py tools tests: OK.python -I tests/semantic/regen_fixtures.py --check: OK.test_docs_links.py,test_docs_list_items.py,test_docs_repo_paths.py,test_tool_startup.py,test_tool_stdout_encoding.py,test_text_write_line_endings.py,test_shader_checks.py(69/69),test_shader_meta.py(15/15),test_isa_coverage.py(13 ran, 3 skipped): all OK.spirv-as/spirv-val/ Vulkan SDK are not installed on this machine, so SPIR-V was validated throughspirv_mini_interpand structural assertions rather thanspirv-val.AI-assisted contribution.