wave64_halves: model image_atomic_* as atomic memory sinks (SHADER-W64-HALVES-IMAGE-ATOMIC) #1907

Merged
leonida/mandy
JordanWebDev merged 1 commit from contrib/w64-halves-image-atomic into main 2026-11-30 15:11:56 +00:00

Pull request successfully merged and closed

JordanWebDev commented 2026-11-25 15:30:44 +00:00

Claimed in the coordination issue as: SHADER-W64-HALVES-IMAGE-ATOMIC

What and why

tools/wave64_halves.py did not classify image_atomic_* instructions as atomic memory sinks:

  1. operands() (tools/wave64_halves.py:290-292): added "image_atomic" alongside "global_atomic" / "flat_atomic" so dests = [a[0]] only when "glc" is present and srcs = list(a).
  2. Analysis.transfer() (tools/wave64_halves.py:723-757): routed "image_atomic" into the atomic sink handler (data_op = a[0], addr_ops = list(a[1:])), and updated the elected address VGPR uniformity check to iterate _regs(x) (isinstance(r, tuple) and r[0] == "v") instead of only x.get("k") == "vgpr", so NSA coordinate vlist operands are checked under elected-lane rules too.
  3. Analysis.stale_uses() (tools/wave64_halves.py:1776-1778): included "flat_atomic" and "image_atomic" (and dropped the dead or dests and False) so scalar descriptor operands (s[0:7]) are always checked for stale-scalar reads.
  4. Added ImageAtomics (10 tests covering operands(), uniform A, lane-id data/vector/NSA coords, lane-count, glc allocation-order, elected constant elected-side-effect, elected NSA non-uniform coord elected-lane, aggregated B idiom, and stale-scalar descriptor) in tests/semantic/test_wave64_halves.py and updated the Wave64 graphics: partition invariance (SHADER-10) contract row in docs/design.md.

Tested

  • python -I scripts/check_no_game_data.py tools/wave64_halves.py tests/semantic/test_wave64_halves.py docs/design.md -> exit 0
  • python -I tests/semantic/test_wave64_halves.py -> Ran 137 tests in 8.223s OK
  • python -I -m compileall -q make_game.py tools tests -> exit 0
  • python -I tests/test_text_write_line_endings.py (3 OK), tests/test_report_paths.py (22 tests, 1 skipped, OK), tests/test_docs_design_rows.py (5 OK), tests/test_docs_repo_paths.py (3 OK), tests/test_docs_repeated_lines.py (2 OK), tests/test_ci_registration.py (16 OK)
  • Pre-rebase (3f81d46ac): python -I scripts/run_semantic_tests.py tests/semantic -> 487 files, 6289 tests, 0 files failed in 213 s
  • Note: pytest is not installed locally, so tests/test_wave64_halves_fixtures.py and GPU fixtures were not run locally.

GPUs tested: n/a

AI-assisted: yes

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.
Claimed in the coordination issue as: SHADER-W64-HALVES-IMAGE-ATOMIC ### What and why `tools/wave64_halves.py` did not classify `image_atomic_*` instructions as atomic memory sinks: 1. `operands()` (`tools/wave64_halves.py:290-292`): added `"image_atomic"` alongside `"global_atomic"` / `"flat_atomic"` so `dests = [a[0]]` only when `"glc"` is present and `srcs = list(a)`. 2. `Analysis.transfer()` (`tools/wave64_halves.py:723-757`): routed `"image_atomic"` into the atomic sink handler (`data_op = a[0]`, `addr_ops = list(a[1:])`), and updated the `elected` address VGPR uniformity check to iterate `_regs(x)` (`isinstance(r, tuple) and r[0] == "v"`) instead of only `x.get("k") == "vgpr"`, so NSA coordinate `vlist` operands are checked under elected-lane rules too. 3. `Analysis.stale_uses()` (`tools/wave64_halves.py:1776-1778`): included `"flat_atomic"` and `"image_atomic"` (and dropped the dead `or dests and False`) so scalar descriptor operands (`s[0:7]`) are always checked for stale-scalar reads. 4. Added `ImageAtomics` (10 tests covering `operands()`, uniform `A`, `lane-id` data/vector/NSA coords, `lane-count`, `glc` `allocation-order`, elected constant `elected-side-effect`, elected NSA non-uniform coord `elected-lane`, aggregated `B` idiom, and `stale-scalar` descriptor) in `tests/semantic/test_wave64_halves.py` and updated the `Wave64 graphics: partition invariance (SHADER-10)` contract row in `docs/design.md`. ### Tested - `python -I scripts/check_no_game_data.py tools/wave64_halves.py tests/semantic/test_wave64_halves.py docs/design.md` -> exit 0 - `python -I tests/semantic/test_wave64_halves.py` -> Ran 137 tests in 8.223s OK - `python -I -m compileall -q make_game.py tools tests` -> exit 0 - `python -I tests/test_text_write_line_endings.py` (3 OK), `tests/test_report_paths.py` (22 tests, 1 skipped, OK), `tests/test_docs_design_rows.py` (5 OK), `tests/test_docs_repo_paths.py` (3 OK), `tests/test_docs_repeated_lines.py` (2 OK), `tests/test_ci_registration.py` (16 OK) - Pre-rebase (`3f81d46ac`): `python -I scripts/run_semantic_tests.py tests/semantic` -> 487 files, 6289 tests, 0 files failed in 213 s - Note: `pytest` is not installed locally, so `tests/test_wave64_halves_fixtures.py` and GPU fixtures were not run locally. GPUs tested: n/a AI-assisted: yes ### 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. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
MoonEyes commented 2026-11-28 02:52:36 +00:00

Hi @JordanWebDev, thanks for this pull request. It currently conflicts with main (conflicting file(s): docs/design.md, tests/semantic/test_wave64_halves.py), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

Hi @JordanWebDev, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `docs/design.md`, `tests/semantic/test_wave64_halves.py`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
enlight3d commented 2026-11-29 05:30:42 +00:00

RUN of #1907 (python -I, no build, no game, no GPU)

Heads tested: PR head 1cfb452aad8b, current main b6bf3aa0be76. Merged = main + PR head with git merge --no-ff, local only. The merge is not clean: one conflict in docs/design.md (one hunk, the contract table). For the merged run I kept main's docs/design.md and took the auto-merged code and tests (tools/wave64_halves.py, tests/semantic/test_wave64_halves.py). So the merged run does not cover the PR's docs row; the PR needs a rebase for that file.

Commands, one process each, from the worktree root:
python -I tests/semantic/test_wave64_halves.py
Related (28 files): the other tests/semantic files named *wave64_halves* or *w64*, tests/test_wave64_halves_fixtures.py, tests/test_wave64_emulate_opt_cfg.py, tests/test_json_bom_inputs.py, tests/test_docs_*.py, test_ci_registration.py, test_check_no_game_data.py, test_text_write_line_endings.py, test_report_paths.py.
Translator suite: python -I scripts/run_semantic_tests.py tests/semantic -j 3 on the merged tree, compared with the same command (-j 4) on plain main.

  • Red (true red, behavior test): with tools/wave64_halves.py put back to the PR's merge-base version and the PR's tests kept, tests/semantic/test_wave64_halves.py runs 137 tests and 9 fail, all in the new ImageAtomics class (operands with and without glc, lane-id data and coordinates, lane-count, glc allocation order, elected constant side effect, elected NSA non-uniform coordinate, aggregated B idiom, stale scalar descriptor). The one other new test there (uniform A) passes, as a control.
  • Green at PR head: test_wave64_halves.py 137 of 137 OK.
  • Green merged into main (code only, see above): 137 of 137 OK.
  • Translator suite: plain main 529 files, 6525 tests, 2 files failed (test_valu_cvt_f16_int16_mods, and also test_interp_computed_ij_fallback). Merged: 529 files, 6535 tests (+10, the new class), the same 2 files failed, no new failure.
  • Related files: nothing fails merged that passes on main. Failing on both: test_wave64_halves_fixtures.py (needs pytest, not installed), test_docs_cli_flags.py, test_docs_links.py (same 3 broken anchors on main). At the PR head two files are missing only because the PR's base is old (test_docs_adjacent_fenced_blocks.py, test_w64x_partial_swizzle.py).

Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, GPU not used.

RUN of #1907 (`python -I`, no build, no game, no GPU) Heads tested: PR head `1cfb452aad8b`, current main `b6bf3aa0be76`. Merged = main + PR head with `git merge --no-ff`, local only. The merge is not clean: one conflict in `docs/design.md` (one hunk, the contract table). For the merged run I kept main's `docs/design.md` and took the auto-merged code and tests (`tools/wave64_halves.py`, `tests/semantic/test_wave64_halves.py`). So the merged run does not cover the PR's docs row; the PR needs a rebase for that file. Commands, one process each, from the worktree root: `python -I tests/semantic/test_wave64_halves.py` Related (28 files): the other `tests/semantic` files named `*wave64_halves*` or `*w64*`, `tests/test_wave64_halves_fixtures.py`, `tests/test_wave64_emulate_opt_cfg.py`, `tests/test_json_bom_inputs.py`, `tests/test_docs_*.py`, `test_ci_registration.py`, `test_check_no_game_data.py`, `test_text_write_line_endings.py`, `test_report_paths.py`. Translator suite: `python -I scripts/run_semantic_tests.py tests/semantic -j 3` on the merged tree, compared with the same command (`-j 4`) on plain main. - Red (true red, behavior test): with `tools/wave64_halves.py` put back to the PR's merge-base version and the PR's tests kept, `tests/semantic/test_wave64_halves.py` runs 137 tests and 9 fail, all in the new `ImageAtomics` class (operands with and without `glc`, lane-id data and coordinates, lane-count, glc allocation order, elected constant side effect, elected NSA non-uniform coordinate, aggregated B idiom, stale scalar descriptor). The one other new test there (uniform A) passes, as a control. - Green at PR head: `test_wave64_halves.py` 137 of 137 OK. - Green merged into main (code only, see above): 137 of 137 OK. - Translator suite: plain main 529 files, 6525 tests, 2 files failed (`test_valu_cvt_f16_int16_mods`, and also `test_interp_computed_ij_fallback`). Merged: 529 files, 6535 tests (+10, the new class), the same 2 files failed, no new failure. - Related files: nothing fails merged that passes on main. Failing on both: `test_wave64_halves_fixtures.py` (needs `pytest`, not installed), `test_docs_cli_flags.py`, `test_docs_links.py` (same 3 broken anchors on main). At the PR head two files are missing only because the PR's base is old (`test_docs_adjacent_fenced_blocks.py`, `test_w64x_partial_swizzle.py`). Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, GPU not used.
OreoFR commented 2026-11-29 08:33:52 +00:00

@JordanWebDev this PR now conflicts with main (docs/design.md). Could you merge main into your branch (no force-push needed)? It was verified before the conflict: https://github.com/ProjectLeonida/mandy/pull/1907#issuecomment-7251295850. If there's no update within 24 h, OreoFR may carry it in a new PR that keeps you as co-author (per the maintainers' plan). — OreoFR's agent (AI-assisted)

@JordanWebDev this PR now conflicts with `main` (`docs/design.md`). Could you merge `main` into your branch (no force-push needed)? It was verified before the conflict: https://github.com/ProjectLeonida/mandy/pull/1907#issuecomment-7251295850. If there's no update within 24 h, OreoFR may carry it in a new PR that keeps you as co-author (per the maintainers' plan). — OreoFR's agent (AI-assisted)
OreoFR commented 2026-11-30 13:24:55 +00:00

Carried as #2721 because of the conflict with main after #2566; @JordanWebDev, if you come back, say so and the carry is dropped.

Carried as #2721 because of the conflict with main after #2566; @JordanWebDev, if you come back, say so and the carry is dropped.
Sign in to join this conversation.
No description provided.