Repository navigation
Conversation
|
Overlap: #3116 (SHADER-578, @Vonsek) is also open and also implements I ran both PRs locally (Linux, CPython 3.12.16,
The two failing #3116 cases are cases where the two PRs disagree on what the hardware returns:
Both PRs say their behaviour was measured on gfx1036. I have no RDNA2 hardware, so I can't tell which is right. Running these two inputs on hardware (for example through #3182's readback) would settle it before one implementation lands. Update: I missed a hardware result posted on #3116 before this comment. A native RX 6900 XT (gfx1030) readback (comment) matches #3116 on all 16 inputs in all three forms, with IEEE off and f32 denormals flushed. That includes both inputs above. With IEEE on, the signalling NaN is quieted, as this PR does. So for gfx1030 in the game's mode, #3116's results are the measured ones. Whether gfx1036 matches is still open (follow-up). AI-assisted (Devin). |
|
Tested at the head on Windows 11 / Python 3.13.0: the new file 7/7 (44 pinned hardware cases + 24 omod/clamp cases + a 100-case seeded sweep), The rule matches the description: the literal is S2 and the gates are Minor:
Approve. AI-assisted review, no game files, no GPU. |
|
Reviewed and tested
Two small non-blocking improvements:
AI-assisted. |
|
Replying to @ray3242. There is a native RX 6900 XT readback on #3116 for the two triples in this question. The reporter ran all 16 inputs × three instruction forms on gfx1030. With IEEE off and f32 denormals flushed, all 48 matched #3116 at its tested revision. Turning IEEE on quieted the signalling NaN; the other 15 triples stayed the same. I compared current #3116 (
The gfx1030 measurement supports #3116 for these inputs in the stated mode. The remaining hardware question is whether gfx1036 gives the same four words with those mode bits. That comparison is separate from #3779’s output-modifier coverage. AI-assisted review (Codex). AI-assisted. |
|
Thanks @ray3242 for catching the overlap with #3116 (I missed it when searching open PR titles for To close @tylerstraub's open hardware question, I just measured both disputed triples natively on RDNA2
Closing #3779 in favor of @Vonsek's earlier #3116 (and #3182). Happy to open a clean follow-up PR on top of #3116 for VOP3 AI-assisted. No game files. |
Implements RDNA2
v_mullit_f32(VOP3 opcode0x150) intools/rdna2spirv.py, verified natively against RDNA2gfx1036hardware, with unit tests and contract documentation.Claimed in #3574 (comment 7085961458).
Hardware contract (measured natively on RDNA2
gfx1036)Measured on AMD Radeon Graphics (
gfx1036, Windows driver32.0.21042.62) in bothwave32andwave64under default game MODE (IEEE=0,DX10_CLAMP=1,denorm32=0) viatools/hw_oracle:abs/negapply first toS0,S1,S2, then f32 denormals flush to signed zero (flush_f32).(S2 > 0.0) && (S1 > -FLT_MAX)(OpFOrdGreaterThan). ExcludesS2 <= 0.0(including flushed denormals and NaNs) andS1 == -FLT_MAX(0xFF7FFFFF),-inf, or NaN, returning-FLT_MAX(0xFF7FFFFF) even whenS0is±0.0or NaN.mul_legacy_f32(S0, S1)returns+0.0(0x00000000) if eitherS0orS1is±0.0(or flushed denormal) — even against±inforS0 = NaN— and otherwiseflush_f32(S0 * S1)(preserving product sign on underflow, e.g.-2^-120 * 2^-120→0x80000000).mul:2,mul:4,div:2) beforeclamp: Canonicalizes±0.0→+0.0before scaling (-0.0 mul:2→+0.0), scales, and flushes post-div:2subnormals to signed zero (-FLT_MIN div:2→0x80000000,-FLT_MAX div:2→0xFEFFFFFF,-FLT_MAX mul:2→-inf).clamp): Runs afteromod; mapsNaNand<= 0(including-0.0) to+0.0, and>= 1.0to1.0.Changes
tools/rdna2spirv.py: Addv_mullit_f32lowering (pure 32-bit float/int SPIR-V, noFloat64/Int64capability).tests/semantic/test_alu_mullit_f32.py: Add 7 test methods covering pinnedgfx1036edge cases, inputabs/negordering before range/zero gates,omod(mul:2/mul:4/div:2) +clampcombinations, SGPR/inline/literal/aliasing forms, 100-case seeded sweep, single-lane & multilane compute EXEC masking, and SPIR-V assembly withoutFloat64/Int64.docs/design.md: Addv_mullit_f32row to the translator runtime contract table withgfx1036measurements.Verification
tools/hw_oracle): AMD Radeon Graphics (gfx1036), Windows driver32.0.21042.62: 1,530 cases × 2 wave sizes (wave32&wave64) = 3,060 executions,wave32 == wave64everywhere, 0 mismatches vs. translated SPIR-V (spirv_mini_interp) — 1,518 bit-exact, 12 both-NaN (S0 = NaNwithS1 > -FLT_MAXnon-zero andS2 > 0):plain-grid: 720 cases, 0 mismatchesplain-rand: 250 cases, 0 mismatchesclamp,mul:2,mul:4,div:2,mul:2 clamp,div:2 clamp,neg/abs,abs-s1-neg-s2: 70 cases each (560 cases), 0 mismatchespython -I tests/semantic/test_alu_mullit_f32.py -v— 7/7 OKpython -m unittest discover -s tests/semantic— 7,329 tests OK (skipped=4, expected failures=1)python -I tests/semantic/regen_fixtures.py --check— OKpython -I tests/test_docs_links.py— 5/5 OKpython -I tests/test_docs_repo_paths.py— 2/2 OKpython -m compileall -q make_game.py tools tests— OKpython -I make_game.py --help— OKNo game files or game data were used or included. AI-assisted (Antigravity).