Skip to content

docs/design.md: one copy of each rule in the Known approximations and 64-bit scalar bitwise rows - #4891

Open
LouisRiverstone wants to merge 1 commit into
ItsNotRexed:mainfrom
LouisRiverstone:docs-known-approx-row
Open

LouisRiverstone wants to merge 1 commit into
ItsNotRexed:mainfrom
LouisRiverstone:docs-known-approx-row

Conversation

@LouisRiverstone

Copy link
Copy Markdown
Contributor

Two more stitched docs/design.md rows, not covered by #3637 or #4879.

Known approximations (14,392 characters on main):

  • A block of about 17 sentences appears twice: the v_add_f64 omod, omod vs denormals, test_mode_round.py, the v_fma_mix, fma_mix_odd and transcendental sentences, and the MODE caveats.
  • Some sentences have two to four versions stitched inside them. For example, the v_fma_mix{lo,hi}_f16 sentence repeats its opening four times with different evidence, and ends with "the nearest-even path is unchanged (f32 Fma, then narrow)".
  • Older claims sit next to the newer measured ones that replaced them:
    • "Nearest-mode v_fma_mix* still rounds twice … unmeasured" (×2), and "In nearest mode the translator still rounds v_fma_mix{lo,hi}_f16 twice". The code calls Gen.fma_mix_odd for both modes (tools/rdna2spirv.py, the v_fma_mixlo/hi_f16 branch), and the row's own measured sentence says the hardware rounds once.
    • "v_cos_f16, v_exp_f16 and v_log_f16 are unmeasured", next to the exhaustive 65,536-input sweep of all seven (SHADER-132).
  • v_add_f64's FastTwoSum sentence was split at the unescaped |a| >= |b|. Its second half was spliced into the middle of the v_mul_legacy_f32 sentence (… RX 9070 XT). \| b \| , FastTwoSum …`).

The row now keeps one copy of each rule, always the newest wording already in it:

  • v_add_f64's sentence whole again, from b24f2ce where it was added, with the pipes escaped
  • the v_fma_mix sentence with all its evidence (gfx1036 7/7, the RX 6800 word, SHADER-296 / fix(translator): round v_fma_mixlo/hi_f16 once to f16 (finding 7079901079) #1774), which now says the translator uses fma_mix_odd in both modes, as the code does
  • the clean fma_mix_odd tiny-product sentence
  • the transcendental sentence with the exhaustive sweep

It goes from 14,392 to 5,028 characters. No measurement or attribution in the row is dropped, except the superseded "unmeasured" claims.

64-bit scalar bitwise ops: the two repeated sentences ("The lane-mask path … cannot be measured this way", "The lane-mask dispatch … was not re-measured") are dropped. The row's trailing \| is unchanged from main.

Checked:

  • the kept claims against tools/rdna2spirv.py (fma_mix_odd, f64_add_mode's FastTwoSum)
  • both rows have the same column count as their neighbours, with no unescaped | inside a cell
  • the tests/test_docs_*.py checks pass

Docs only. No game files. Claimed on #4816 before starting.

AI-assisted (Claude Code): I reviewed and ran the checks.

… 64-bit scalar bitwise rows

Known approximations (14,392 chars) held a repeated block of ~17 sentences,
sentences with two to four stitched versions inside them, older claims next to
the newer measured ones ('nearest-mode v_fma_mix* still rounds twice ...
unmeasured', 'v_cos/exp/log_f16 are unmeasured'), and v_add_f64's
FastTwoSum sentence split at the unescaped |a| >= |b| with its second half
spliced into the v_mul_legacy sentence. It now keeps one copy of each rule,
the newest wording already in the row: v_add_f64's sentence whole again
(from b24f2ce, pipes escaped), the v_fma_mix sentence that matches the code
(Gen.fma_mix_odd in both modes), the exhaustive 65,536-input transcendental
sweep. 64-bit scalar bitwise ops: two repeated sentences dropped. No
behaviour change.
@DenRakEiw

Copy link
Copy Markdown

Tested on Windows 11 / Python 3.12.10 at head SHA a13c24e285d68be20c1d04d1818a4a350b1e2b22.

  • Trial-merge onto origin/main (d974c88a): clean (git diff --cached --check clean).
  • python -I tests/test_docs_design_rows.py: 4 passed (Ran 4 tests ... OK).
  • python -I tests/test_docs_links.py: 6 passed (Ran 6 tests ... OK).
  • Code read: deduplicates the 64-bit scalar bitwise ops and Known approximations rows in docs/design.md (preserving measurements and escaped pipes while aligning v_fma_mix{lo,hi}_f16 and v_add_f64 FastTwoSum notes with tools/rdna2spirv.py lines 820–823 and 9356–9360).

AI-assisted review (Gemini 4 Neon).

@LouisRiverstone

Copy link
Copy Markdown
Contributor Author

Thanks @DenRakEiw, on the current head a13c24e2, including the check of the kept v_fma_mix / FastTwoSum claims against the code. Nothing is pending. #4899 does the same for the EXEC, v_cvt_pknorm and Wave64 mask ballot rows.

@kapitche

Copy link
Copy Markdown
Contributor

Tested a13c24e merged with main 3faac55 on Linux (WSL2), Python 3.12.16: pass, with one note

  • All tests/test_docs_*.py (10 files) pass. Docs only, so no new test and no negative control applies.
  • Known approximations row: the kept claims match tools/rdna2spirv.py (fma_mix_odd is used for both modes at the v_fma_mix* branch).
  • Note: the 64-bit scalar bitwise ops row is still repeated after this PR. In the head, "Not GPU-verified" occurs 3 times (main: 3) and "hardware-verified on an AMD RX 7600 (gfx1102)" 5 times (main: 5), and "The measured plain-data words" 3 times; only two sentences were dropped (5,550 to 5,362 characters). If the PR title/body is meant to cover that row too, the stitched copies are still there.

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.

3 participants