Skip to content

docs/design.md: drop merge leftovers in two contract rows - #3145

Merged
shayderrr merged 2 commits into
ItsNotRexed:mainfrom
ray3242:devin/1795375558-design-merge-leftovers
Nov 23, 2026
Merged

shayderrr merged 2 commits into
ItsNotRexed:mainfrom
ray3242:devin/1795375558-design-merge-leftovers

Conversation

@ray3242

@ray3242 ray3242 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #3047 (comment)

What and why

ec8ec4c ("Fix what the round-40 merges broke") merged contract rows sentence by sentence, and two rows that no open PR touches still carry the older copy next to the newer one. This drops the older copy only:

  • Other additions: the old "a literal S# with a border mode (4-7) … is Unsupported" sentence, which contradicts the half-border/border-colour support described right after it, and the first of two ps_gather_wrap.asm GPU-check sentences (the kept one continues with the border-mode fixtures).
  • d16 and f16 format narrowing: the f32_to_f16_int → f16_bits folding sentence appeared twice, word for word.

A third row this PR first covered, buffer_atomic_{and,or,xor,swap}_x2, was removed in dac28e6b, but later main revisions restored its old wording, so it is intentionally not part of this diff (that row needs its own follow-up).

The docs/design.md change deletes only stale text — every number and table cell is preserved — and commit 88369135 adds an 18-line regression test in tests/test_docs_design_rows.py. Rows with the same kind of leftover that are already handled elsewhere are left alone: #3084, #2234, #2945/#3081, #2832, #2063.

Tested

Docs only, no GPU needed. python -m unittest tests/test_docs_design_rows.py passes; a script confirms each changed row now has no repeated 14-word run and keeps every numeric value. AI-assisted.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No new rule.)

@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Read 52aebe5 on Windows 11 (Python 3.13.7): pass

Character-level diff of the three rows against the merge base f847748: four contiguous deletions, nothing added, cell counts unchanged.

  • Other additions, first deletion (284 characters): "A literal S# with a border mode (4-7: half-border, border colour) or FORCE_UNNORMALIZED is Unsupported …". The row keeps the newer sentence, "A literal S# with a half-border mode (4, 5) or FORCE_UNNORMALIZED is Unsupported; … modes 4 and 5 act as clamp-to-edge there", and that is what the code does: tools/rdna2spirv.py:8976 raises for FORCE_UNNORMALIZED and :8979-8980 only for modes 4 and 5; modes 6 and 7 select the border colour (:8991, :9370). python -m pytest tests/test_translate.py -k "gather4_l and (border or unnormalized)": 25 passed.
  • Other additions, second deletion (231 characters): the first of two identical ps_gather_wrap.asm GPU-check sentences; the removed text is still present verbatim in the row.
  • d16 and f16 format narrowing (288 characters): the f32_to_f16_int → f16_bits sentence; it is still present verbatim once in the row, and agrees with tools/rdna2spirv.py:527.
  • buffer_atomic_{and,or,xor,swap}_x2 (297 characters): the older "a bitwise op or an exchange leaves the same memory …" pair. The kept text says a bitwise op leaves the same memory and an exchange can tear, and keeps the two-reads approximation.
  • test_docs_design_rows 2, test_docs_links 5, test_docs_list_items 2, test_docs_repo_paths 2, test_i18n_index 5, all OK; git diff --check clean.

Not checked: the exchange-tearing statement itself against a run (it is unchanged by this PR). AI-assisted check (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Read 52aebe5 against main f847748: accurate

Test merge into main is clean and the four tests/test_docs_*.py pass. The three rows lose only a stale first copy of text that main still repeats; I checked what stays against the code:

  • design.md:278: literal S# modes 4-5 (half-border) and FORCE_UNNORMALIZED are Unsupported, modes 6-7 give the border colour (tools/rdna2spirv.py:7694-7704, :7773-7823). The dropped sentence said 4-7 were all Unsupported.
  • design.md:356: f32_to_f16_int folded into f16_bits (rdna2spirv.py:437-469).
  • design.md:383: buffer_atomic_{and,or,xor,swap}_x2 is one 32-bit atomic per dword (rdna2spirv.py:1750); the kept text also has the exchange-tearing caveat.

dev-ewann pushed a commit to dev-ewann/Leonida that referenced this pull request Nov 22, 2026
@ray3242 ray3242 changed the title docs/design.md: drop merge leftovers in three contract rows docs/design.md: drop merge leftovers in two contract rows Nov 22, 2026
ItsNotRexed added a commit that referenced this pull request Nov 23, 2026
# Conflicts:
#	docs/design.md
@ray3242
ray3242 force-pushed the devin/1795375558-design-merge-leftovers branch from 969dac1 to 8c51a15 Compare November 23, 2026 03:40
@tedin7

tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Reviewed 8c51a15 merged onto main de67135 on Linux (CPU only): fail

Ran (python3.13 -I -m pytest -q): tests/test_docs_*.py, tests/test_ci_registration.py, tests/test_text_encoding.py: 43 passed, 10 subtests. Merges cleanly into main. So the docs tests are green, but they do not catch what follows.

I split the two edited rows of docs/design.md into sentences, old (origin/main) versus new, and listed every sentence of the old row that is gone from the new row.

Row "d16 and f16 format narrowing": 0 sentences lost, no duplicates left. This one is a correct de-duplication (the repeated "#489's own narrower, f32_to_f16_int ..." sentence is removed once).

Row "Other additions" (starts with image_gather4_l(_o)): 11 sentences lost. This is not a pure duplicate removal. The old row held two different versions of the border-mode text, and the PR deletes both instead of keeping one. Gone from docs/design.md, with no other copy in that file (grep of the new file: BORDER_COLOR_TYPE 0 hits, SHADER-348 0, FORCE_UNNORMALIZED 0; on main 2, 1 and 4):

  • "A literal S# with a border mode (4-7: half-border, border colour) or FORCE_UNNORMALIZED is Unsupported; a run-time S# ... modes 4-7 act as clamp-to-edge ..."
  • "Modes 6 (clamp border) and 7 (mirror once border) give a tap ... the S# border colour's channel ... BORDER_COLOR_TYPE = word 3 [31:30] ... 0 transparent black, 1 opaque black, 2 opaque white; 1 for an integer format, as Vulkan's INT_OPAQUE_*."
  • "Type 3 ... is Unsupported on a literal S# and transparent black at run time (SHADER-348: ...)"
  • "Those two, and a table border colour ... are the remaining approximations; the unnormalized rules ... weren't confirmed on hardware, so they were not guessed."
    Those behaviours still exist in the code: grep finds BORDER_COLOR_TYPE or FORCE_UNNORMALIZED in tools/rdna2spirv.py, tests/test_translate.py, runtime/test/shaders/ps_gather_border.asm and docs/d3d12_vulkan.md. The surviving row still cites ps_gather_border.asm and test_gather4_l_border but no longer says what modes 4-7 do, so the doc now under-describes the translator.

Second finding, file docs/design.md, same row: the join leaves a stray period pair: "... otherwise the mode is read from the SGPR at run time. . GPU-checked with ...ps_gather_wrap.asm ...". Check with: grep -o "run time. . GPU" docs/design.md (1 hit).

Suggested fix: keep one copy of the modes 6 and 7 paragraph and the Unsupported / approximation sentences (the newer wording that mentions SHADER-348 and BORDER_COLOR_TYPE), drop only the older repeated half-border sentence, and remove the ". ." artifact. A character-level diff against main that lists only removals which also appear verbatim in the new row would have shown this.

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

@KkelebekK

Copy link
Copy Markdown

Reviewed 8c51a15: the row 407 change is right (the f32_to_f16_int -> f16_bits sentence is on main twice, verbatim).

The "Other additions" row (line 316) change is larger than the description says. It deletes one contiguous block (the line goes from 4,377 to 2,621 characters), from "A literal S# with a border mode (4-7 ..." through the first ps_gather_wrap.asm GPU-check sentence. That also removes:

  • the "Modes 6 (clamp border) and 7 (mirror once border)" BORDER_COLOR_TYPE paragraph (type 3 Unsupported, SHADER-348),
  • the half-border (4, 5) / FORCE_UNNORMALIZED sentence,
  • the "remaining approximations" sentence.

Each of these appears once on main and nowhere else in docs/design.md after the PR, and they match tools/rdna2spirv.py (BORDER_COLOR_TYPE handling around L10483-10491, half-border / FORCE_UNNORMALIZED around L10458-10467). Please drop only the old "(4-7 ...)" sentence and the first GPU-check sentence from that row and keep the rest. (I did not run tests/test_docs_design_rows.py.)

@kapitche

Copy link
Copy Markdown
Contributor

Tested 8c51a15 merged with main 98fa503 on Linux (Python 3.12.16): pass. the four tests/test_docs_*.py 4/4 ok. Docs-only change, no negative control.

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@tedin7 @KkelebekK — both reviews are correct, thank you. I verified the deleted block against origin/main and confirmed the 11 unique border-mode sentences were gone, along with the . . join artifact. Fix pushed as 88369135.

What changed: the "Other additions" row is now main's row with only the two genuine duplicates removed — the older (4-7 ...) half-border sentence and the first ps_gather_wrap.asm GPU-check sentence. The Modes 6/7 + BORDER_COLOR_TYPE paragraph, the SHADER-348 type-3 sentence, the half-border (4, 5) / FORCE_UNNORMALIZED sentence and the "remaining approximations" sentence are all restored verbatim. The d16 and f16 format narrowing row keeps its correct single removal of the repeated f32_to_f16_int sentence. Row length went from 2,621 back to 3,862 characters; BORDER_COLOR_TYPE and SHADER-348 counts match main (2 and 1), and run time. . GPU has 0 hits.

I also added a regression test in tests/test_docs_design_rows.py that asserts the border-mode facts survive de-duplication and that the . . artifact is absent — the existing shape/topic tests stayed green throughout, which is why this slipped through.

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

@DenRakEiw

Copy link
Copy Markdown
Contributor

Tested on Windows 11 / Python 3.12.10 at head SHA 883691351ff9098592ec3a75a4eb349560737ee1.

  • Trial-merge onto origin/main (d974c88a): Clean merge (docs/design.md, tests/test_docs_design_rows.py), git diff --cached --check passed with no issues.
  • Tests:
    • python -I tests/test_docs_design_rows.py: 5/5 passed
    • python -I tests/test_docs_links.py: 6/6 passed
  • Code read: Removes duplicated border-mode/GPU-check text in Other additions and duplicated f32_to_f16_int text in d16 and f16 format narrowing in docs/design.md while keeping the BORDER_COLOR_TYPE/SHADER-348/FORCE_UNNORMALIZED facts and adding a regression test in tests/test_docs_design_rows.py.

AI-assisted review (Gemini 4 Neon).

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@DenRakEiw — thank you for re-testing the corrected head 88369135 specifically: clean trial merge, test_docs_design_rows.py 5/5 and test_docs_links.py 6/6. That confirms the restored border-mode documentation and its new regression test are stable on Windows / Python 3.12 as well as on the Linux runs. AI-assisted (OpenCode), no game data.

@bobcatchris

Copy link
Copy Markdown
Contributor

Independent macOS code read and test run at head 8836913 (Apple M2, Python 3.13.18). The duplicate image_gather4_l(_o) sentence in the "Other additions" contract row is removed, and the border-mode facts that the other copy contained (border colour type from S# word 3 [31:30], the literal vs run-time S# refusals and approximations) are kept in the surviving one. pytest -q tests/test_docs_design_rows.py: 5 passed, 12 subtests passed, 0 failed. No issues found; docs only.

AI-assisted.

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@bobcatchris — thank you for the independent macOS / Python 3.13 read and test at the corrected head 88369135: 5 passed, 12 subtests, 0 failed. That gives the restored border-mode facts and the new regression test coverage on three platforms (Windows, Linux, macOS) and two Python versions. AI-assisted (OpenCode), docs only, no game data.

ItsNotRexed added a commit that referenced this pull request Nov 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@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.md: drop merge leftovers in two contract rows. Changes docs/design.md and tests/test_docs_design_rows.py. Ec8ec4c9 ("Fix what the round-40 merges broke") merged contract rows sentence by sentence, and two rows that no open PR touches still carry the older copy next to the newer one.
New tests: test_deduplicating_a_row_keeps_its_unique_border_mode_facts.

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.md: drop merge leftovers in two contract rows. Changes docs/design.md and tests/test_docs_design_rows.py. Ec8ec4c9 ("Fix what the round-40 merges broke") merged contract rows sentence by sentence, and two rows that no open PR touches still carry the older copy next to the newer one.
New tests: test_deduplicating_a_row_keeps_its_unique_border_mode_facts.

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
shayderrr merged commit 9f0ebbb into ItsNotRexed:main Nov 23, 2026
0 of 2 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.

8 participants