Skip to content

design.md: drop the stale "swizzle bits are not modelled" sentence from the bounds row - #5684

Open
Pierre-Kookis wants to merge 2 commits into
ItsNotRexed:mainfrom
Pierre-Kookis:docs/design-buffer-swizzle
Open

Pierre-Kookis wants to merge 2 commits into
ItsNotRexed:mainfrom
Pierre-Kookis:docs/design-buffer-swizzle

Conversation

@Pierre-Kookis

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: #5581.

Problem

The "Buffer bounds checking" row of docs/design.md (line 465 at 561b65a8) still says SWIZZLE_ENABLE and ADD_TID_ENABLE "are not modelled: a literal V# with either set is Unsupported, a run-time V# with them is translated unswizzled, which is silently wrong (known gap)". The very next row, "Swizzled buffer addressing", documents them as implemented:

  • tools/rdna2spirv.py:2963-2996 reads both bits from literal and run-time V#s;
  • :3040-3070 builds the swizzled address;
  • tests/semantic/test_buffer_swizzle.py checks both descriptor forms and the load addresses (9 tests, OK here).

Change

Doc only: that one sentence is removed from the bounds row; the swizzle row is unchanged.

Tested

python -I -m unittest discover -s tests/semantic -p test_buffer_swizzle.py: 9 OK. test_docs*.py: OK.

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

…om the bounds row

The "Buffer bounds checking" row still said SWIZZLE_ENABLE/ADD_TID_ENABLE are not modelled (literal
V# Unsupported, run-time V# translated unswizzled). The next row documents swizzled addressing as
implemented (rdna2spirv.py reads both bits and builds the swizzled address; test_buffer_swizzle).
@cynbun

cynbun commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Reviewed 362d9ca (claims checked against main 561b65a, docs tests on Linux, Python 3.14.8): one problem

  • docs/design.md:465: the change removes more than the stale sentence. On main, **Swizzle**: is followed by three sentences: the full "are modelled" sentence with the Mesa references, a short duplicate ("SWIZZLE_ENABLE and ADD_TID_ENABLE are modelled; see the Swizzled buffer addressing row."), and the stale "are not modelled … (known gap)" one. The PR drops all three. The row now reads **Swizzle**: Until 2026-11-22 the translator ignored OOB_SELECT …, so the label sits on OOB_SELECT history and the row no longer says the bits are modelled or points to the swizzle row. The text d3e1a5011 left was the first sentence alone: "SWIZZLE_ENABLE (V# word1 bit 31, Mesa gfx10-rsrc.json line 326; word1 [31:30] on GFX11, gfx11-rsrc.json line 259) and ADD_TID_ENABLE (word3 bit 23, line 337) change the address and the bounds in every mode and are modelled; see the Swizzled buffer addressing row." Keeping that sentence and dropping the other two would fix the row.
  • The substance is right: swizzle and ADD_TID are implemented (tools/rdna2spirv.py:3336-3397 on main, the buffer_address docstring and code), and tests/semantic/test_buffer_swizzle.py passes (9 OK). The line numbers in the description (:2963-2996, :3040-3070) point at format-packing code on main, not the swizzle code. That is in the description only.
  • All 11 tests/test_docs_*.py pass, git diff --check clean, merges clean with main and with every mergeable open PR touching docs/design.md. docs: drop stale sentences in five design.md contract rows #5137 also edits this row but already conflicts with main.

AI-assisted (Claude Code).

The previous commit removed the whole **Swizzle** text of the bounds row. Keep its first sentence
(the bits are modelled; see the Swizzled buffer addressing row) and drop only the short duplicate
and the stale 'are not modelled ... (known gap)' sentence.
@Pierre-Kookis

Copy link
Copy Markdown
Contributor Author

@cynbun you're right, thanks. My edit matched from the first SWIZZLE_ENABLE (V# word1 bit 31 to the stale sentence and took all three. 627aca1f rebuilds the row from main and keeps your first sentence ("... change the address and the bounds in every mode and are modelled; see the Swizzled buffer addressing row."). It drops only the short duplicate and the stale "are not modelled ... (known gap)" one. Against main the diff now removes just those two sentences. test_docs*.py: OK.

You're also right about the line numbers in the description: on main the swizzle code is tools/rdna2spirv.py:3336-3397 (buffer_address), not :2963-2996/:3040-3070.

@cynbun

cynbun commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Re-checked 627aca1f against main 561b65a8 (sentence-level compare of the Buffer bounds checking row): it now removes only the short duplicate ("SWIZZLE_ENABLE and ADD_TID_ENABLE are modelled; see the Swizzled buffer addressing row.") and the stale "… are not modelled: a literal V# with either set is Unsupported … (known gap)." sentence, and keeps the full "… change the address and the bounds in every mode and are modelled; see the Swizzled buffer addressing row." sentence. Nothing else in the row changes. Thanks — looks good. AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Tested 627aca1 merged with main 561b65a on Linux (WSL2, Python 3.12.16, -I): pass

  • tests/test_docs_*.py (11 files): all pass, 0 failed.
  • tests/semantic/test_buffer_swizzle.py (the test the PR cites): 9 run, 9 passed.
  • Claims checked: the removed sentence (the "not modelled ... known gap" clause on the "Buffer bounds checking" row, now line 465) is gone and nothing else in docs/design.md still says the swizzle bits are unmodelled; tools/rdna2spirv.py reads SWIZZLE_ENABLE / ADD_TID_ENABLE (docstrings and swz_active logic around lines 3320-3350) and the next row "Swizzled buffer addressing" documents them as implemented. The diff is one table row, so no pipe-escaping change.
  • Negative control: docs-only PR, nothing to revert.

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