docs/design.md: one copy of each rule in the Global atomics row (OLD-9923) #665

Merged
LouisRiverstone merged 2 commits from upstream-pr/665 into main 2026-12-01 15:13:57 +00:00
LouisRiverstone commented 2026-11-24 11:18:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by LouisRiverstone on 2026-11-24T11:18:49Z.


Claimed in the coordination issue as: OLD-9923 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129925439)

Replaces the carried-over draft #191. I'm the original author of old upstream PR 9923.

What and why

The Global atomics row in docs/design.md had been stitched together twice, the second time after old PR 3084, so some rules appeared twice in it. This keeps one copy of each. It also takes fcmpswap out of that row's Still Unsupported list, because it has its own row (pointed out by WALID1618Y on the old PR). The matching comment in tools/rdna2spirv.py now names inc/dec next to the other _x2 forms. The row also gains one pointer sentence: natural alignment (an unaligned dword, or an unaligned 8-byte _x2 element, leaves memory alone and an active glc lane gets 0) is in "Atomic natural alignment" below, which says the same, as does the global_atomic docstring. No behaviour change.

The old branch's final diff, applied on current main (21625bca8) as one commit. It applied cleanly.

Tested

  • python -m compileall -q tools: OK (only a comment changed in tools/rdna2spirv.py).
  • python -I scripts/run_semantic_tests.py tests/semantic: 465 files, 6108 tests, 0 files failed (Linux, Python 3.14.4).

GPUs tested: n/a

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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. (n/a: documentation only)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5471134991 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/665). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-11-24T11:18:49Z. --- Claimed in the coordination issue as: OLD-9923 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129925439) Replaces the carried-over draft #191. I'm the original author of old upstream PR 9923. ### What and why The Global atomics row in `docs/design.md` had been stitched together twice, the second time after old PR 3084, so some rules appeared twice in it. This keeps one copy of each. It also takes `fcmpswap` out of that row's Still Unsupported list, because it has its own row (pointed out by WALID1618Y on the old PR). The matching comment in `tools/rdna2spirv.py` now names inc/dec next to the other `_x2` forms. The row also gains one pointer sentence: natural alignment (an unaligned dword, or an unaligned 8-byte `_x2` element, leaves memory alone and an active `glc` lane gets 0) is in "Atomic natural alignment" below, which says the same, as does the `global_atomic` docstring. No behaviour change. The old branch's final diff, applied on current `main` (21625bca8) as one commit. It applied cleanly. ### Tested - `python -m compileall -q tools`: OK (only a comment changed in `tools/rdna2spirv.py`). - `python -I scripts/run_semantic_tests.py tests/semantic`: 465 files, 6108 tests, 0 files failed (Linux, Python 3.14.4). GPUs tested: n/a AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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. (n/a: documentation only)
MoonEyes commented 2026-11-24 13:56:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-24T13:56:52Z.


Checked the Global atomics row (docs/design.md:289) fact by fact against origin/main. Every rule of the old cell is now there exactly once (Until 2026-11-22, CPU-checked by, the glc/vdst rule, the cmpswap pair, **Approximation:**, Still Unsupported, spirv-val and Not GPU-verified each went from 2 or 3 copies to 1). The copies kept are the most complete ones: all three test files, and the exchange-tearing approximation. The broken dec formula on main (... ? DATA : M + 1, cut off mid-expression) is now whole and reads M - 1. The only changes in meaning remove stale or contradictory claims (inc/dec and the float atomics listed as unsupported; "a bitwise op or an exchange leaves the same memory"), and the global_atomic docstring agrees with both. fcmpswap has its own row (line 417). The confirmation methods are unchanged (CPU tests, spirv-val, not GPU-verified).

One note: the PR also adds a pointer sentence to the "Atomic natural alignment" row. It is accurate (row 515 and the code docstring say the same), but the description does not mention it.

The table still has two columns on lines 288 to 290. tests/test_docs_design_rows.py, test_docs_repeated_lines.py, test_docs_table_rows.py and test_docs_table_ids.py pass on the PR head.

AI-assisted review (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7133581436 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/665#issuecomment-7133581436). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-24T13:56:52Z. --- Checked the Global atomics row (docs/design.md:289) fact by fact against `origin/main`. Every rule of the old cell is now there exactly once (`Until 2026-11-22`, `CPU-checked by`, the `glc`/`vdst` rule, the `cmpswap` pair, `**Approximation:**`, `Still Unsupported`, `spirv-val` and `Not GPU-verified` each went from 2 or 3 copies to 1). The copies kept are the most complete ones: all three test files, and the exchange-tearing approximation. The broken `dec` formula on main (`... ? DATA : M + 1`, cut off mid-expression) is now whole and reads `M - 1`. The only changes in meaning remove stale or contradictory claims (`inc`/`dec` and the float atomics listed as unsupported; "a bitwise op or an exchange leaves the same memory"), and the `global_atomic` docstring agrees with both. `fcmpswap` has its own row (line 417). The confirmation methods are unchanged (CPU tests, `spirv-val`, not GPU-verified). One note: the PR also adds a pointer sentence to the "Atomic natural alignment" row. It is accurate (row 515 and the code docstring say the same), but the description does not mention it. The table still has two columns on lines 288 to 290. `tests/test_docs_design_rows.py`, `test_docs_repeated_lines.py`, `test_docs_table_rows.py` and `test_docs_table_ids.py` pass on the PR head. AI-assisted review (Claude Code).
tiguan26 commented 2026-11-25 19:37:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T19:37:05Z.

Review: APPROVED


Approving. It changes docs only: the docstring and the design row. Merged into current main (9f9a7c5) with no conflicts, and the full translator suite gives 491 files / 6,312 tests with only test_int32_to_f64 failing, as on main here.

The new wording matches the code. atomic_inc_dec_cas exists on main and is the path inc/dec take, and the _x2 inc/dec forms are correctly listed with the other unsupported 64-bit forms.

AI-assisted (Claude).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6063834652 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/665#pullrequestreview-6063834652). Originally posted by [tiguan26](https://github.com/tiguan26) on 2026-11-25T19:37:05Z. **Review:** APPROVED --- Approving. It changes docs only: the docstring and the design row. Merged into current main (9f9a7c5) with no conflicts, and the full translator suite gives 491 files / 6,312 tests with only `test_int32_to_f64` failing, as on main here. The new wording matches the code. `atomic_inc_dec_cas` exists on main and is the path inc/dec take, and the `_x2` inc/dec forms are correctly listed with the other unsupported 64-bit forms. AI-assisted (Claude).
kawaii-shakal commented 2026-11-27 19:14:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-27T19:14:25Z.


Checked against main 43a9d562: merges cleanly (also with #1450 and #1224). The Global atomics row keeps every rule; what goes are older copies a later sentence extends (for example the two CPU-checked by test_global_atomics.py sentences, of which the fuller one stays). The docstring change in Gen.global_atomic matches the code (atomic_inc_dec_cas, global_atomic_float and float_cmpswap_loop exist in main). Doc tests pass with the three merged.

AI-assisted (Claude Code); I ran the checks and read the diff.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226328918 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/665#issuecomment-7226328918). Originally posted by [kawaii-shakal](https://github.com/kawaii-shakal) on 2026-11-27T19:14:25Z. --- Checked against main 43a9d562: merges cleanly (also with #1450 and #1224). The Global atomics row keeps every rule; what goes are older copies a later sentence extends (for example the two `CPU-checked by test_global_atomics.py` sentences, of which the fuller one stays). The docstring change in `Gen.global_atomic` matches the code (`atomic_inc_dec_cas`, `global_atomic_float` and `float_cmpswap_loop` exist in main). Doc tests pass with the three merged. AI-assisted (Claude Code); I ran the checks and read the diff. --- _Generated by [Claude Code](https://claude.ai/code)_
zmasi commented 2026-11-29 00:22:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T00:22:27Z.


Native Windows 11 Verification (83f589e6fc) — PASS

Diff-audited docs/design.md (+1/-1) and tools/rdna2spirv.py (+4/-3) and verified Red -> Green merged onto origin/main (48bae6cad) on Windows 11 (10.0.26200, Python 3.12.10 with -I).

Results

  • Deduplication & Docstring Alignment:
    • Eliminates the mid-sentence merge-paste corruption (dec gives (M == 0 With glc...) in the Global atomics contract row of docs/design.md while preserving all inc/dec, fmin/fmax, _x2, and natural-alignment rules.
    • Updates Gen.global_atomic's docstring in tools/rdna2spirv.py so inc/dec (atomic_inc_dec_cas) and fmin/fmax (global_atomic_float) are no longer listed as Unsupported.
  • Semantic, Documentation & Policy Suites (PR #665 merged onto origin/main):
    • python -I tests/semantic/test_global_atomics.py: Ran 12 tests in 3.754s — OK
    • python -I tests/semantic/test_atomic_inc_dec.py: Ran 11 tests in 5.046s — OK
    • python -I tests/semantic/test_global_atomics_x2.py: Ran 4 tests in 1.086s — OK
    • tests/test_docs_design_rows.py (5/5), tests/test_docs_table_rows.py (2/2), tests/test_docs_repo_paths.py (5/5), tests/test_docs_list_items.py (3/3), tests/test_docs_repeated_lines.py (3/3), tests/test_docs_encoding.py (1/1), tests/test_text_write_line_endings.py (3/3), and scripts/check_no_game_data.py: OK.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248067556 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/665#issuecomment-7248067556). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T00:22:27Z. --- ### Native Windows 11 Verification (`83f589e6fc`) — PASS Diff-audited `docs/design.md` (`+1/-1`) and `tools/rdna2spirv.py` (`+4/-3`) and verified Red -> Green merged onto `origin/main` (`48bae6cad`) on Windows 11 (`10.0.26200`, Python `3.12.10` with `-I`). #### Results - **Deduplication & Docstring Alignment**: - Eliminates the mid-sentence merge-paste corruption (`dec gives (M == 0 With glc...`) in the `Global atomics` contract row of `docs/design.md` while preserving all `inc`/`dec`, `fmin`/`fmax`, `_x2`, and natural-alignment rules. - Updates `Gen.global_atomic`'s docstring in `tools/rdna2spirv.py` so `inc`/`dec` (`atomic_inc_dec_cas`) and `fmin`/`fmax` (`global_atomic_float`) are no longer listed as `Unsupported`. - **Semantic, Documentation & Policy Suites (`PR #665` merged onto `origin/main`)**: - `python -I tests/semantic/test_global_atomics.py`: **`Ran 12 tests in 3.754s — OK`** - `python -I tests/semantic/test_atomic_inc_dec.py`: **`Ran 11 tests in 5.046s — OK`** - `python -I tests/semantic/test_global_atomics_x2.py`: **`Ran 4 tests in 1.086s — OK`** - `tests/test_docs_design_rows.py` (`5/5`), `tests/test_docs_table_rows.py` (`2/2`), `tests/test_docs_repo_paths.py` (`5/5`), `tests/test_docs_list_items.py` (`3/3`), `tests/test_docs_repeated_lines.py` (`3/3`), `tests/test_docs_encoding.py` (`1/1`), `tests/test_text_write_line_endings.py` (`3/3`), and `scripts/check_no_game_data.py`: **`OK`**. AI-assisted.
TheGeogeo commented 2026-11-29 01:13:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T01:13:16Z.


Checked 83f589e6f merged (no commit) with main 87a39df94: Python 3.12.4, Windows 11 10.0.26300, CPU only. check_no_game_data.py is clean.

  • Docs only in effect: the tools/rdna2spirv.py change is a docstring, with no code change. The tests around the translator give the same result on main and on the merge.
  • Cost note: tools/rdna2spirv.py is one of make_game.py's translation sources. Even a docstring edit there changes the translator digest, so every port build translates all shaders again once after this lands.

No blocker from my side.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248640523 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/665#issuecomment-7248640523). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T01:13:16Z. --- Checked `83f589e6f` merged (no commit) with `main` `87a39df94`: Python 3.12.4, Windows 11 10.0.26300, CPU only. `check_no_game_data.py` is clean. - Docs only in effect: the `tools/rdna2spirv.py` change is a docstring, with no code change. The tests around the translator give the same result on `main` and on the merge. - Cost note: `tools/rdna2spirv.py` is one of `make_game.py`'s translation sources. Even a docstring edit there changes the translator digest, so every port build translates all shaders again once after this lands. No blocker from my side. AI-assisted (Claude Code).
aslan2142 commented 2026-12-01 10:54:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T10:54:41Z.

Review: APPROVED


Reviewed docs/design.md and the docstring in tools/rdna2spirv.py: cleanly removes the duplicated/corrupted text in the Global atomics row (dec gives (M == 0 With glc...), aligns the Gen.global_atomic docstring with the code, merges cleanly onto main, and passes clean-room checks.

Not merging immediately because editing tools/rdna2spirv.py triggered the full Runtime/CI suite on an older base where unrelated jobs failed (windows, linux-gpu-tools, translator-tests, stdlib-tests-linux, check cancelled). Ready to merge once CI is re-run green on current main.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6129831006 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/665#pullrequestreview-6129831006). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T10:54:41Z. **Review:** APPROVED --- Reviewed `docs/design.md` and the docstring in `tools/rdna2spirv.py`: cleanly removes the duplicated/corrupted text in the `Global atomics` row (`dec gives (M == 0 With glc...`), aligns the `Gen.global_atomic` docstring with the code, merges cleanly onto `main`, and passes clean-room checks. Not merging immediately because editing `tools/rdna2spirv.py` triggered the full Runtime/CI suite on an older base where unrelated jobs failed (`windows`, `linux-gpu-tools`, `translator-tests`, `stdlib-tests-linux`, `check` cancelled). Ready to merge once CI is re-run green on current `main`. *(AI-assisted review.)*
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!665
No description provided.