Skip to content

docs: pin the v_fmamk_f16 and v_fmaak_f16 row to measured gfx1100 - #4141

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
bobcatchris:docs/fmamk-f16-hw
Nov 23, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
bobcatchris:docs/fmamk-f16-hw

Conversation

@bobcatchris

Copy link
Copy Markdown
Contributor

Row v_fmamk_f16, v_fmaak_f16 was CPU-checked against v_fma_f16 with K in a VGPR but not GPU-verified.

Measured natively on an RX 7900 XTX (gfx1100, driver 26.10.1) through tools/hw_oracle, 17 cases, one kernel each: the destination starts as 0xbeef0000 so the kept high half is visible, and the expected word is one exact-rational binary16 multiply-add rounded once to nearest even, computed in the probe from the documented rule rather than read from the translator.

  • The documented shape holds: fmamk = S0 * K + S1 and fmaak = S0 * S1 + K in the printed operand order, one rounding only (the exact 3.0029296875 of (1+2^-10)*3 lands on the tie's even 0x4202 in a single step), overflow to +inf at 65504*2, and the result replaces the low half while the high half keeps 0xbeef. 13/13 such cases matched.
  • Denormals are kept by f16 VALU (0x0001*1 + 0x0001 gives 0x0002), unlike the LDS float adder measured in docs: pin the LDS ds_add_f32 rows to measured gfx1100 flush-to-zero #4137, which flushes them — both rows now say so.
  • Special values (measured, no prior rule): an sNaN is quieted with its payload kept (0x7c01 → 0x7e01), a qNaN passes through, and inf + -inf gives the negative default 0xfe00.

Docs-only: one row of docs/design.md (1 insertion, 1 deletion). tests/test_docs_design_rows.py, test_docs_links.py, test_docs_list_items.py, test_docs_repo_paths.py: 12 passed. No game data, synthetic operands only. AI-assisted.

The row was CPU-checked only. 17 cases on gfx1100 confirm the print order, one rounding to f16 and the kept high
half, and add that f16 VALU keeps denormals (the LDS float adder flushes them), quiet the sNaN with its payload
and give the negative default NaN for inf + -inf.
@tupacfan04

Copy link
Copy Markdown
Contributor

Tested at the head on Windows 11 / Python 3.13.0: 25 docs tests with 6 subtests, the cited test_valu_fmamk_fmaak_f16.py 4 passed / 601 subtests, git diff --check clean, textual merges clean with #4137/#4147.

Hold this until #4137 lands, or drop the cross-reference: docs/design.md:260 asserts "unlike the LDS float adder" (which flushes denormals), while the same tree's ds_add_f32 row at :342 still says the LDS denormal/NaN treatment is "Not measured". The two rows contradict each other until #4137 merges.

Approve in that order. AI-assisted review, docs only.

@sds-228 sds-228 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review of f325308: no issues found. The unsupported/unverified note is consistently replaced by a native-measurement summary.

AI-assisted (OpenCode).

@kapitche

Copy link
Copy Markdown
Contributor

Tested f325308 merged with main 3faac55 on Linux (WSL2), Python 3.12.16: pass.
Docs-only change, so no PR tests; ran tests/test_docs_*.py (10 files, all OK) on the merged tree. Negative control not applicable (no code or tests in the diff). Also ran tests/semantic/test_valu_fmamk_fmaak_f16.py (4 OK), the test the row cites.
The 17 hw_oracle gfx1100 cases are not reproducible here and were taken as stated; the row replaces "Not GPU-verified" and keeps the rest.

@ItsNotRexed
ItsNotRexed merged commit 24847e6 into ItsNotRexed:main Nov 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants