Skip to content

docs: clean up the v_pack_b32_f16 source modifiers row and record its GPU-verified result - #5297

Open
gertify wants to merge 1 commit into
ItsNotRexed:mainfrom
gertify:fix-contract-v-pack-b32-f16-source-modifiers
Open

gertify wants to merge 1 commit into
ItsNotRexed:mainfrom
gertify:fix-contract-v-pack-b32-f16-source-modifiers

Conversation

@gertify

@gertify gertify commented Nov 23, 2026

Copy link
Copy Markdown

The row for v_pack_b32_f16 source modifiers in docs/design.md had several merged measurements spliced into one cell: abs and neg_abs were called hardware-verified and called never run on hardware in the same sentence, and the neg-only measurement was stated twice. This keeps one coherent version of the verified facts, drops the duplicated fragments, and removes the stray unmeasured, which made tools/progress_dashboard.py classify the row as partial. Its own rule now reads the row as GPU-verified.

It also records the translator's GPU result for the fixture the row cites. ps_f16_pack_mods (runtime/test/shaders/ps_f16_pack_mods.asm) applies neg, abs and neg_abs to both source halves with op_sel; translated by tools/rdna2spirv.py it gives 4,096/4,096 exact pixels on AMD RADV RAPHAEL_MENDOCINO (Ryzen 9 9950X3D iGPU, Mesa 26.2.6-arch3.1) and on NVIDIA GeForce RTX 5080 (driver 620.70.06), both on main with no local changes. The negative control patches the translator so neg flips bit 14 instead of the sign bit: the same fixture then mismatches all 4,096 pixels on both GPUs, so the fixture is what measures the row's rule.

No translator file changes; the row's existing raw-kernel measurements are @Sanonymous01's and are kept as they are.

AI-assisted.

@Dom-in

Dom-in commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Code read plus a GPU check on new hardware. Pass.

Read: the rewritten cell keeps every measurement the old one had (neg on gfx1036 with mode 0 and mode 1, and abs/neg_abs on gfx1035 and gfx1036). It drops the contradicting "never run on hardware" fragment, the duplicated neg sentence and the stray unmeasured. I found no fact lost.

GPU: ps_f16_pack_mods gives 4096/4096 pixels exact on main 3faac55, on an AMD Radeon RX 9070 (RDNA4), AMD driver 26.11.2, Windows 11 Pro 26300, natively and with LEONIDA_W64_EMULATE=1. That's a third vendor stack besides RADV and NVIDIA, and Windows rather than Linux.

AI-assisted (Claude Code).

@Kam471 Kam471 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.

Head 82f82b3 — docs-only; Windows 11.

  • python -I -m pytest tests/test_docs_design_rows.py tests/test_design_contract_rows.py tests/test_docs_links.py -q → 14 passed, 6 subtests passed.
  • python -I -m pytest tests/test_progress_dashboard.py -q → 26 passed.
  • progress_dashboard.classify_contract on the row: base ('not_gpu', 'partial', 'unmeasured') → this branch ('gpu', 'verified', 'GPU-verified'); the stated classification change holds.
  • LEONIDA_VK_DEVICE='RTX 5070 Ti' python -I scripts/run_gpu_tests.py --build <main-translator build> --filter ps_f16_pack_mods (this branch changes no code) → PASS ps_f16_pack_mods 4096/4096 pixels exact, 1/1; the row's added GPU result reproduces on a third GPU.
  • git diff --check clean.

No unmeasured / never run on hardware fragments remain in the row, and each measured fact appears once.

Verdict: LGTM.

@King1565

Copy link
Copy Markdown

Read 82f82b3: pass with notes

  • I ran ps_f16_pack_mods.asm on main through the translator and tests/semantic/spirv_mini_interp.py. It gives exactly the check.py:361 words.
  • Every half the fixture reads is positive (ps_f16_pack_mods.asm:6,12-13: 0x3400, 0x4200, 0x4400), so |x| = x and -|x| = -x there. With the abs AND disabled (rdna2spirv.py:6278 turned into if False and ...), the fixture still gives 0x4400b400 0xc4003400 0x4400c200 0xb400b400. The 4,096/4,096 result therefore checks neg and op_sel only, and the negative control breaks only neg.

Read:

  1. Either narrow the new sentence to "neg with op_sel", or flip the input signs: v0 = 0xc2003400, v1 = 0xb400c400 expect 0x4400b400 0x44003400 0xc400c200 0xb400b400. With abs removed, 3 of the 4 words change (I ran both through the same interpreter).
  2. Row 286 (v_pack_b32_f16 input neg) still says "abs is still refused, because its rule ... is unmeasured". That contradicts rdna2spirv.py:6278 and the row you edited. It also keeps the dashboard at partial for that row.

AI-assisted (Claude Code).


Generated by Claude Code

@x2Tweek x2Tweek 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.

AI-assisted.

Independent CPU review of PR #5297 (docs: clean up the v_pack_b32_f16 source modifiers row and record its GPU-verified result).

The diff applies cleanly to the current docs/design.md blob. The row already documents hardware verification on RDNA2 (gfx1035/gfx1036, 1,088 raw kernels, 0 mismatches, @Sanonymous01's measurement) and names the CPU checks (tests/test_values.py, tests/semantic/test_vop3_const_mods.py, tests/semantic/test_pack_b32_f16_mods.py). This change cleans up duplicated/contradictory "Not modelled: ... / Not GPU-verified" wording and adds the GPU-verified translator result via the ps_f16_pack_mods fixture (4,096/4,096 pixels exact on AMD RADV RAPHAEL_MENDOCINO / Mesa 26.2.6 and NVIDIA GeForce RTX 5080 / driver 620.70.06 — author-reported measurement; I cannot reproduce those two devices here, this machine has an RTX 5090).

Verified locally:

  • tests/semantic/test_pack_b32_f16_mods.py passes (part of 13 passed / 316 subtests).
  • ps_f16_pack_mods fixture exists and is wired in runtime/test/shaders/check.py and scripts/run_gpu_tests.py.
  • Diff base blob d32503f1a8 matches HEAD's docs/design.md, so it applies cleanly.

The remaining "Not modelled: IEEE mode 1 also quiets a signalling-NaN half ... SHADER-190" sentence is correctly retained (it is a genuine open item, not a stale marker).

Docs-only, no translator/runtime change. The cleanup is accurate.

🤖 Generated with Claude Code

@cynbun

cynbun commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Reviewed 82f82b3 (code read + history of the v_pack_b32_f16 source-modifiers row, docs/design.md:289 on main 3faac557): the cleanup itself is right and removes the merge damage (the **absand- **`… fragment came from the round-40/41/43 merge fixes ec8ec4c, 15f5b2f and daed40c; the clean, fully traceable version of the row is the one #3637 had at 51cc9e6). Two points before merge:

  1. Credit. The row ends with "the RDNA2 raw-kernel measurements above are @Sanonymous01's", but the abs measurements the row keeps come from int_hw_probe: verify packed u16/i16, min3/max3/med3_16, v_swaprel_b32 and v_pack_b32_f16 abs on RDNA2 #1969 (gfx1035, tools/int_hw_probe.py group valu_pack_b32_f16_abs) and rdna2spirv: measure v_pack_b32_f16 abs and neg+abs modifiers on RDNA2 (gfx1036) #2234 (gfx1036, 1,088 raw kernels, 0 mismatches). Citing those PRs (as 51cc9e6 did) avoids crediting the wrong run.
  2. GPU claim. As King1565 noted, ps_f16_pack_mods (runtime/test/shaders/ps_f16_pack_mods.asm, check.py:361, scripts/run_gpu_tests.py:1263) only feeds positive halves, so its 4,096/4,096 checks neg and op_sel, not abs. The row should not present that fixture as GPU verification of the abs rule; the abs evidence is the raw-kernel runs above plus tests/semantic/test_pack_b32_f16_mods.py.

Also: #5402 edits the same line, so the two will conflict; whichever lands second needs a rebase. AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Tested 82f82b3 merged with main 3ae0654 on Linux/Python 3.12.16: concern
Merge with main was clean; docs-only change, so no negative control applies.
Checked on the merged tree: the row in docs/design.md no longer contains 'unmeasured' and the cited fixture runtime/test/shaders/ps_f16_pack_mods.asm exists. Ran tests/test_docs*.py: 2 failures, the same 2 that fail on main without this PR.
Not run: the 4,096/4,096 GPU result on RADV and RTX 5080 and the translator negative control cannot be reproduced here (no GPU run); those numbers are taken from the PR text only.

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.

7 participants