Skip to content

docs/design: remove the duplicated image-query contract row - #3637

Open
ray3242 wants to merge 1 commit into
ItsNotRexed:mainfrom
ray3242:devin/1795381635-design-leftovers-2
Open

ray3242 wants to merge 1 commit into
ItsNotRexed:mainfrom
ray3242:devin/1795381635-design-leftovers-2

Conversation

@ray3242

@ray3242 ray3242 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: #3574 (comment)

What and why

This cleanup originally covered seven contract rows on f847748c. After the coordinator's BUILD-1299 re-check, current main still had duplicated wording in one of those rows. The branch was recreated on main 561b65a8 (head 70da0ce4f) and the diff changes exactly that one docs/design.md row:

  • Image atomics, size and LOD queries: removes the spliced older image_get_resinfo sentence (depth (1)) and the older image_get_lod description, completing the newer ISA parenthetical with OpImageQuerySizeLod, OpImageQueryLevels. It keeps the TEST-184 GPU checks, the native gfx1036 / tools/image_query_probe.py SHADER-388 measurements, the clamped-LOD formula, the Unverified: list and the Gen.resinfo_words sentence verbatim.

A first version of this edit cut the row mid-sentence and lost those measurements. KkelebekK reproduced it and @ray3242 fixed it in 5e0ab71d; the regression test added to tests/test_design_contract_rows.py asserts the measured facts survive. No other row was changed by that fix.

git diff confirms one line changed in docs/design.md (one contract row) plus the new regression test. The earlier f16-rounding and buffer-bounds-cleanup rows are not part of this branch. No Depends on: #3145 and #2973 are merged and touch different files.

Tested

Docs only, no GPU used. With Python 3.12.10 on Windows 11: python -I -B tests/test_design_contract_rows.py 5/5 OK, test_docs_design_rows.py 4/4 OK, test_docs_table_rows.py 2/2 OK, git diff --check clean. Independent CPU review on Linux confirmed the row checks out. AI-assisted (OpenCode).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • No new translator rule; nothing to add to the contract table.

@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Read 51cc9e6 on Windows 11 (Python 3.13.7): pass for six rows; one leftover remains in the seventh

How I checked: old and new text of the seven rows compared sentence by sentence and token by token (every number, hex word, backticked name, #N and item ID), looking for anything that is in the old row and nowhere in the new one.

  • Packed 16-bit integer ops: the removed "a constant's high half is not measured … raises Unsupported" paragraph is superseded by text the row keeps ("A constant operand is treated as a 32-bit dword …", "Until 2026-11-22 reading the high half of a constant raised Unsupported"). One leftover is still there: the row now ends "… all eleven ops (wrap, clamp saturation on add/sub/mad, and constant op_sel/op_sel_hi) match bit-for-bit. Not GPU-verified. |". On main that mark sat between the two copies of the hardware sentence; with the second copy gone it directly follows the gfx1035/gfx1036 hardware verification it contradicts. Expected: drop the trailing "Not GPU-verified." too.
  • v_pack_b32_f16 source modifiers: nothing measured is lost: the 192-kernel neg run, the 1,088-kernel gfx1036 run, the gfx1035 int_hw_probe.py run, the 0x7c01/0xfc01/0xfe01/0x7e01/0xfe05/0x7e05 words, the IEEE-mode-1 sentence with SHADER-190 and the "Checked by" list are each present once.
  • Image atomics, size and LOD queries: the kept text (depth word 0 for a 2D image, a 2D array's layers minified, zeros past the last level, "The translator follows all three") matches Gen.resinfo_words (tools/rdna2spirv.py:9835-9842); the removed "depth (1)" and "still differs in the first three" sentences contradicted it.
  • f16 rounding and Known approximations: one v_fma_mix* statement each remains, with the 7-of-7 gfx1036 measurement, SHADER-135, finding 7079901079, the RX 6800 0x3fff/0x4000 words, SHADER-296 / fix(translator): round v_fma_mixlo/hi_f16 once to f16 (finding 7079901079) #1774 and Gen.fma_mix_odd; the transcendentals keep the RX 6700 XT run, the RX 6800 run and the 65,536-input mode_round_probe.py sweep (SHADER-132). The removed "v_cos_f16, v_exp_f16 and v_log_f16 are unmeasured" contradicted the kept "all seven".
  • 16-bit interpolation without PerVertexKHR: both "Unverified" items (fewer than 31 output locations; fewer than 124 vertex output components) are still in the row once each; the SHADER-378 sentence is whole again.
  • Buffer bounds checking: the kept "are modelled; see the Swizzled buffer addressing row" matches the code (tools/rdna2spirv.py:2613-2644 handles SWIZZLE_ENABLE and ADD_TID_ENABLE) and that row exists (docs/design.md:386).
  • python -I tests/test_docs_design_rows.py, tests/test_docs_links.py, tests/test_docs_list_items.py, tests/test_docs_repo_paths.py at the head: OK. git merge-tree with open docs/design.md: drop merge leftovers in two contract rows #3145 (same author, three other rows): clean.

Not verified: the hardware measurements the rows quote. AI-assisted check (Claude Code).

@ray3242

ray3242 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the check. I left the trailing Not GPU-verified. in the packed 16-bit integer ops row on purpose: removing that marker is part of open #1922, which strips the stale not-verified markers. Taking it out here as well would duplicate #1922 and make the two PRs conflict. Once #1922 merges, the marker is gone.

@pedro470

Copy link
Copy Markdown

Reviewed 2a7c72ff on Windows 11 with Codex assistance. All 11 documentation checks and 15 f16 interpolation tests passed. The edits preserve the measurement details across the seven rows. I also reproduced a one-row merge conflict with #1922 in “Packed 16-bit integer ops.” Whoever rebases second can keep this cleanup and drop the stale verification marker from that row.

@ray3242

ray3242 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Agreed on the #1922 overlap: it is that one row-247 line. If #1922 merges first, I'll rebase this PR on top of it, keeping its marker removal along with this cleanup. If this one merges first, #1922 only needs to keep dropping the trailing **Not GPU-verified.** when it resolves the conflict.

@thirteenhustler

Copy link
Copy Markdown

Read 11a9a77: the seven rows are cleaned up. The copies this removes are the ones that contradicted the sentence left in place.

Checked each row against main aa2988cc. The hardware sentences, hex words and item ids the description says are kept are still there. The duplicated copy is gone:

  • Image atomics, docs/design.md:357. "depth (1)" and "still differs in the first three" are gone. The kept rule (a 2D image's depth word is 0, a 2D array's layers are max(1, layers >> (BASE_LEVEL + level)), zeros past the last level) is Gen.resinfo_words at tools/rdna2spirv.py:10693-10720.
  • Buffer bounds, :413. SWIZZLE_ENABLE and ADD_TID_ENABLE are modelled at tools/rdna2spirv.py:2746-2775, which is what the row now says.
  • 16-bit interpolation, :399. The "decoded-half location is also an attribute it reads is rejected (Unsupported)" sentence is gone. assign_f16_half_locations (tools/rdna2spirv.py:113-134) keeps the canonical slots when they fit and otherwise packs into free locations in 0..29, raising only when fewer than 2 * N are free. tests/semantic/test_f16_interp_fallback.py:test_location_clash_packs_dynamically is that clash. One leftover phrase, already on main: "refusing only genuine > 30 location budget overflows". F16_HALF_TOP is 29 (:96), and raw attributes consume slots before the count reaches 30.
  • f16 rounding and Known approximations. One v_fma_mix* statement remains, with Gen.fma_mix_odd, the 7-of-7 gfx1036 run and the 65,536-input sweep. The "unmeasured" and "rounds twice until fix(translator): round v_fma_mixlo/hi_f16 once to f16 (finding 7079901079) #1774" copies are gone. The FastTwoSum words 0x7fdd9bb47daa1333 and 0xffefffffffffffff are in the row once.
  • Packed 16-bit integer ops, :263. The row ends on the hardware sentence. The trailing **Not GPU-verified.** that was still on 2a7c72ff is not on this head.
  • v_pack_b32_f16 source modifiers, :265. The 192-kernel neg run, the 1,088-kernel gfx1036 run, the gfx1035 int_hw_probe.py run, and 0x7c01 / 0xfc01 / 0xfe01 / 0x7e01 / 0xfe05 / 0x7e05 are each there once. The broken joins (| x src |, a stray **) are gone.

test_docs_design_rows.py, test_docs_links.py, test_docs_list_items.py, test_docs_repo_paths.py: OK. git diff --check clean. Merge onto aa2988cc is clean; that commit does not touch docs/design.md. The hardware runs quoted in the rows were not repeated.

@ray3242

ray3242 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @thirteenhustler. The > 30 phrase you pointed out is fixed in a3d7b78. The 16-bit interpolation row now says what assign_f16_half_locations does: it raises Unsupported only when 0..29 has fewer than 2·|F| free locations left. The four docs tests and git diff --check pass, and the PR still merges cleanly with #2973 and #3145 onto aa2988cc.

@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 a3d7b78: no issues found. The duplicated fragments are removed without leaving encoding corruption or table damage.

AI-assisted (OpenCode).

@KkelebekK

Copy link
Copy Markdown

Reviewed d3e1a50. The f16 rounding edit (three v_fma_mix* repeats, including the stale "two roundings, unmeasured / not fixed yet" one) and the Buffer bounds checking edit (the stale "not modelled" sentence plus a repeat) check out: every dropped sentence is a repeat or is contradicted by the same row, Gen.fma_mix_odd and the Swizzled buffer addressing row.

The Image atomics, size and LOD queries row is the problem. The diff removes one block of about 435 words (the row goes from 682 to 247 words), and that block includes text that appears only once on main: the image_get_lod description, the OpImageQuerySizeLod/OpImageQueryLevels mapping, the TEST-184 and SHADER-388 (tools/image_query_probe.py) measurements, the clamped-LOD formula and the "translator follows all three (Gen.resinfo_words)" sentence. TEST-184, SHADER-388, image_query_probe, cs_imgatomic3d, OpImageQueryLevels, LOD_BIAS and Gen.resinfo_words each go from 1 occurrence on main to 0 in the file. It also leaves a broken join (VGPRs 3..0; ` the clamped LOD under a linear mip filter, with an odd backtick count). Only the second (depth (1)) image_get_resinfo copy, the "still differs in the first three" sentence and the "resinfo's depth word on hardware" Unverified item look like leftovers.

Also, the diff touches 3 rows, while the description lists 7 plus follow-ups; the 16-bit interpolation and Known approximations rows still carry their leftovers on main. tests/test_docs_design_rows.py passes at the head, so it does not catch this.

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Self-review found and fixed a defect in my own earlier commit — pushed as 5e0ab71d.

The "Image atomics, size and LOD queries" row had been cut mid-sentence: the new row was 1,581 characters against 4,259 on main, with a dangling "; ` the clamped LOD under a linear mip filter" join and the entire GPU-checked / measured-RDNA2 block missing (GPU-checked (TEST-184), cs_imgatomic.asm, cs_resinfo.asm, the native gfx1036 image_query_probe results, image_get_lod's bias/clamp rules and the Unverified: list). The duplicate I meant to remove was only the older resinfo/get-lod wording; the cut removed the newer row's facts with it. The row is now 3,797 characters: the two superseded sentences are gone, the ISA parenthetical is completed (OpImageQuerySizeLod, OpImageQueryLevels), and every measured fact is restored verbatim.

I also re-audited the other two changed rows character-by-character. f16 rounding and Buffer bounds checking were correct: they drop stale/contradictory duplicates (the old two-rounding claim, and the "are not modelled" sentence that contradicts the Swizzled buffer addressing row), and I left them unchanged.

Regression test added to tests/test_design_contract_rows.py (separate from the test in #3145 to avoid a conflict between my own PRs): it asserts those measured facts survive and the join artifact is absent.

Verified (AI-assisted, OpenCode; Windows 11 Pro 26300, NVIDIA GeForce GTX 1060 6GB / driver 582.78 — GPU not used, listed for disclosure): python -I -B tests/test_design_contract_rows.py 5/5 OK, test_docs_design_rows.py 4/4 OK, test_docs_table_rows.py 2/2 OK, git diff --check clean. No game data.

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@KkelebekK — your review was exactly right, thank you. The Image-atomics row had lost TEST-184, SHADER-388, image_query_probe, cs_imgatomic3d, OpImageQueryLevels, LOD_BIAS and Gen.resinfo_words, and had the odd-backtick join you flagged. Fixed in 5e0ab71d: the row is back to 3,797 characters with every one of those facts restored verbatim; only the superseded depth (1) / old image_get_lod sentences are gone, and the ISA parenthetical is completed. I also corrected the PR description — it now says three rows, since the other four original edits had already landed on main — and added a regression test in tests/test_design_contract_rows.py. Your read of the f16 rounding and Buffer bounds checking edits matches my own character-level audit; those are unchanged. AI-assisted (OpenCode).

@kapitche

Copy link
Copy Markdown
Contributor

Tested 5e0ab71d6 merged with main 3faac557b on Linux (WSL2), Python 3.12.16: pass.

  • tests/test_design_contract_rows.py: 5 tests OK. All of tests/test_docs_*.py also OK on the merged tree (10 files).
  • Negative control: with main's docs/design.md and the PR's test, the new test fails ('depth (1) and the level count' unexpectedly found in the Image atomics row); restoring the PR file makes it pass.
  • Row sizes of the three edited rows, main -> PR: 4260 -> 3798, 3722 -> 2947, 6482 -> 6028 characters. This head is the one that restored the Image atomics row after the earlier review.

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@kapitche — thank you for the precise verification, especially the negative control: with main's docs/design.md the new test fails on 'depth (1) and the level count', and passes with the PR's file. That directly proves the regression test guards the content loss KkelebekK found. The three row sizes (4260→3798, 3722→2947, 6482→6028) also confirm the intended de-duplication with the Image atomics facts restored. Combined with the Windows/Python 3.12 runs and sds-228's code read, #3637 now has cross-platform coverage. AI-assisted (OpenCode), docs only, no game data.

@JRamos1993

Copy link
Copy Markdown
Contributor

Tested 70da0ce4 merged onto main 1cc6e3c1 on Windows 11, CPython 3.14.3, CPU only: pass.

  • python -I tests/test_design_contract_rows.py: 5 tests OK.
  • py_compile on the 1 changed Python file: OK; git diff --check: clean.

No game files. AI-assisted (Claude Code).

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@JRamos1993 — thank you for the independent CPU check at 70da0ce4 merged onto 1cc6e3c1: test_design_contract_rows.py 5/5, py_compile and git diff --check clean. That covers the one remaining row cleanup after the BUILD-1299 re-check (the PR body was corrected from three rows to one). No action needed; AI-assisted (OpenCode), docs only, no game data.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary

docs/design: remove merge leftovers in 7 more contract rows. Changes docs/design.md and tests/test_design_contract_rows.py. This cleanup originally covered seven contract rows on f847748c. Reapplied on current main, only three still need changes ΓÇö the other four were fixed by PRs that landed in the meantime.
New tests: test_deduplicating_the_image_query_row_keeps_its_measurements.

Why merge

Documentation quality: keeps the reference accurate and de-duplicated so readers and tooling rely on correct information. No runtime behavior changes, so merge risk is minimal.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary

docs/design: remove merge leftovers in 7 more contract rows. Changes docs/design.md and tests/test_design_contract_rows.py. This cleanup originally covered seven contract rows on f847748c. Reapplied on current main, only three still need changes ΓÇö the other four were fixed by PRs that landed in the meantime.
New tests: test_deduplicating_the_image_query_row_keeps_its_measurements.

Why merge

Documentation quality: keeps the reference accurate and de-duplicated so readers and tooling rely on correct information. No runtime behavior changes, so merge risk is minimal.

Verdict: Approve

@ray3242 ray3242 changed the title docs/design: remove merge leftovers in 7 more contract rows docs/design: remove the duplicated image-query contract row Nov 23, 2026
@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@shayderrr — thank you for the approval. One clarification so the record matches the diff: the current head changes one contract row in docs/design.md (plus tests/test_design_contract_rows.py), not three. The f16-rounding and buffer-bounds cleanups were part of the earlier seven-row version and are not on this branch.

Your summary quoted the old three-row description, so I corrected the PR body and title to match what is actually being merged. The code, head 70da0ce4f, and the new regression test are unchanged, so this does not affect your verdict. AI-assisted (OpenCode).

@ray3242
ray3242 force-pushed the devin/1795381635-design-leftovers-2 branch from 70da0ce to 12525a0 Compare November 23, 2026 18:19
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.

9 participants