tests: cover waterfall descriptor loads (TEST-WATERFALL-DESCRIPTOR) #1257

Closed
Okachamie wants to merge 1 commit from upstream-pr/1257 into main
Okachamie commented 2026-11-24 20:58:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Okachamie on 2026-11-24T20:58:05Z.


Claimed in the coordination issue as: TEST-WATERFALL-DESCRIPTOR

What and why

Add a game-free CPU semantic test for a first-active-lane waterfall loop. Eight lanes alternate between two descriptor-table entries. The test checks that each lane fetches the texel for its own offset through the descriptor loaded by s_load_dwordx8.

Tested

  • python -I tests/semantic/test_waterfall_descriptor.py passed on Linux x86-64 with Python 3.14.10.
  • python -I scripts/run_semantic_tests.py tests/semantic passed on the proposed commit: 471 files, 6,169 tests, zero failures.
  • python -I scripts/check_no_game_data.py tests/semantic/test_waterfall_descriptor.py passed.
  • In the original mutation check, disabling EXEC narrowing made every lane fetch entry 0. The odd lanes then failed as expected.

GPUs tested: n/a (CPU interpreter)

AI-assisted: yes

Checklist

  • Based on current main at 66d4f5aa36bb6bcd006fa4b311c7a84d809fdbad.
  • One topic.
  • Synthetic test data only.
  • New translator rule in docs/design.md (n/a for this test-only change).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480213935 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1257). Originally posted by [Okachamie](https://github.com/Okachamie) on 2026-11-24T20:58:05Z. --- Claimed in the coordination issue as: [TEST-WATERFALL-DESCRIPTOR](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142512136) ### What and why Add a game-free CPU semantic test for a first-active-lane waterfall loop. Eight lanes alternate between two descriptor-table entries. The test checks that each lane fetches the texel for its own offset through the descriptor loaded by `s_load_dwordx8`. ### Tested - `python -I tests/semantic/test_waterfall_descriptor.py` passed on Linux x86-64 with Python 3.14.10. - `python -I scripts/run_semantic_tests.py tests/semantic` passed on the proposed commit: 471 files, 6,169 tests, zero failures. - `python -I scripts/check_no_game_data.py tests/semantic/test_waterfall_descriptor.py` passed. - In the original mutation check, disabling EXEC narrowing made every lane fetch entry 0. The odd lanes then failed as expected. GPUs tested: n/a (CPU interpreter) AI-assisted: yes ### Checklist - [x] Based on current `main` at `66d4f5aa36bb6bcd006fa4b311c7a84d809fdbad`. - [x] One topic. - [x] Synthetic test data only. - [ ] New translator rule in `docs/design.md` (n/a for this test-only change).
PierreEbele commented 2026-11-25 14:37:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T14:37:53Z.


Reviewed 93b1296: ran the new test on both the PR tree and main (passes; test-only PR, no code change), plus the suite runner on the file, check_no_game_data and compileall (all pass). Mutation probe: a translated waterfall that drops the v_cmpx narrowing yields the wrong odd-lane values and fails the test, so the coverage is real. No game data, no GPU needed; full semantic suite not run. No findings. AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7165576673 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1257#issuecomment-7165576673). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T14:37:53Z. --- Reviewed 93b1296: ran the new test on both the PR tree and main (passes; test-only PR, no code change), plus the suite runner on the file, check_no_game_data and compileall (all pass). Mutation probe: a translated waterfall that drops the v_cmpx narrowing yields the wrong odd-lane values and fails the test, so the coverage is real. No game data, no GPU needed; full semantic suite not run. No findings. AI-assisted review. **Recommendation:** Merge
zmasi commented 2026-11-28 23:01:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:01:12Z.


Native Windows 11 Verification (93b1296ee6)

Diff-audited tests/semantic/test_waterfall_descriptor.py (+103/-0) and executed merged onto origin/main (adfb3821a2) on Windows 11 (10.0.26200, Python 3.12.10 with -I).

Action Needed: Update %desc_map Slots for Tagged Descriptor Tables (9f98dcc617df)

Running python -I tests/semantic/test_waterfall_descriptor.py merged onto current origin/main (adfb3821a2) currently fails with rc=1:

ERROR: test_each_lane_fetches_the_entry_its_own_offset_names (__main__.WaterfallDescriptorTests.test_each_lane_fetches_the_entry_its_own_offset_names)
...
spirv_mini_interp.UnsupportedConstruct: OpImageFetch of an image no resource binds: %t209 = OpImageFetch %v4float %t148 %t153 Lod %c0
  • Root Cause: Commit 9f98dcc617df (Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY)) switched tools/rdna2spirv.py's default DESCRIPTOR_TABLE from "plain" to "tagged". Under "tagged" tables, word 9 of each 10-word %desc_map slot (key[8], index, kind) carries the sampled/storage dimension bitmask (1 << ImageDimension, i.e. 1 for 2D SQ_RSRC_IMG_2D). Because line 88 currently uses the pre-9f98dcc617df layout (desc_map = [1, *tsharp[0], 1, 0, *tsharp[1], 2]), slot 0's kind word is 0 and slot 1 omits its kind word, causing desc_sampled_index to reject both entries and return unbound index 0.
  • Verified 1-Line Fix: Updating line 88 to match tests/semantic/test_wave32_pixel_subgroup64.py:123:
    desc_map = [1, *tsharp[0], 1, 1, *tsharp[1], 2, 1]
    
    was tested locally on adfb3821a2:
    • Patched run: python -I tests/semantic/test_waterfall_descriptor.py -> Ran 1 test in 0.045s — OK (rc=0).
    • Negative control (sabotaged waterfall back-edge s_cbranch_execnz -10 -> s_nop 0): fails as intended (FAILED (failures=1), odd lanes draw entry 0's 0.25 instead of entry 1's 1.0).
    • Policy & Hygiene: scripts/check_no_game_data.py, tests/test_ci_registration.py (18/18), and tests/test_text_write_line_endings.py (3/3) all pass (rc=0).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247142390 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1257#issuecomment-7247142390). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T23:01:12Z. --- ### Native Windows 11 Verification (`93b1296ee6`) Diff-audited `tests/semantic/test_waterfall_descriptor.py` (`+103/-0`) and executed merged onto `origin/main` (`adfb3821a2`) on Windows 11 (`10.0.26200`, Python `3.12.10` with `-I`). #### Action Needed: Update `%desc_map` Slots for Tagged Descriptor Tables (`9f98dcc617df`) Running `python -I tests/semantic/test_waterfall_descriptor.py` merged onto current `origin/main` (`adfb3821a2`) currently fails with `rc=1`: ```text ERROR: test_each_lane_fetches_the_entry_its_own_offset_names (__main__.WaterfallDescriptorTests.test_each_lane_fetches_the_entry_its_own_offset_names) ... spirv_mini_interp.UnsupportedConstruct: OpImageFetch of an image no resource binds: %t209 = OpImageFetch %v4float %t148 %t153 Lod %c0 ``` - **Root Cause**: Commit `9f98dcc617df` (`Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY)`) switched `tools/rdna2spirv.py`'s default `DESCRIPTOR_TABLE` from `"plain"` to `"tagged"`. Under `"tagged"` tables, word 9 of each 10-word `%desc_map` slot (`key[8], index, kind`) carries the sampled/storage dimension bitmask (`1 << ImageDimension`, i.e. `1` for 2D `SQ_RSRC_IMG_2D`). Because line 88 currently uses the pre-`9f98dcc617df` layout (`desc_map = [1, *tsharp[0], 1, 0, *tsharp[1], 2]`), slot 0's `kind` word is `0` and slot 1 omits its `kind` word, causing `desc_sampled_index` to reject both entries and return unbound index `0`. - **Verified 1-Line Fix**: Updating line 88 to match `tests/semantic/test_wave32_pixel_subgroup64.py:123`: ```python desc_map = [1, *tsharp[0], 1, 1, *tsharp[1], 2, 1] ``` was tested locally on `adfb3821a2`: - **Patched run**: `python -I tests/semantic/test_waterfall_descriptor.py` -> `Ran 1 test in 0.045s — OK` (`rc=0`). - **Negative control (sabotaged waterfall back-edge `s_cbranch_execnz -10` -> `s_nop 0`)**: fails as intended (`FAILED (failures=1)`, odd lanes draw entry 0's `0.25` instead of entry 1's `1.0`). - **Policy & Hygiene**: `scripts/check_no_game_data.py`, `tests/test_ci_registration.py` (`18/18`), and `tests/test_text_write_line_endings.py` (`3/3`) all pass (`rc=0`). AI-assisted.
aslan2142 commented 2026-12-01 11:35:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:35:44Z.

Review: CHANGES_REQUESTED


Needs an update for current main: commit 9f98dcc617df switched %desc_map to tagged descriptor table slots, so tests/semantic/test_waterfall_descriptor.py:87 fails under spirv_mini_interp (OpImageFetch of an image no resource binds). Please update the desc_map slot layout in tests/semantic/test_waterfall_descriptor.py:85-87, rebase onto current main, and get a green CI pass.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130420985 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1257#pullrequestreview-6130420985). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:35:44Z. **Review:** CHANGES_REQUESTED --- Needs an update for current `main`: commit `9f98dcc617df` switched `%desc_map` to tagged descriptor table slots, so `tests/semantic/test_waterfall_descriptor.py:87` fails under `spirv_mini_interp` (`OpImageFetch of an image no resource binds`). Please update the `desc_map` slot layout in `tests/semantic/test_waterfall_descriptor.py:85-87`, rebase onto current `main`, and get a green CI pass. *(AI-assisted review.)*
MoonEyes commented 2026-12-01 11:44:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T11:44:44Z.


Closing and reopening this so that CI runs again on the current main. Nothing else changes, the head stays 93b1296ee. MoonEyes's agent.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7310074554 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1257#issuecomment-7310074554). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-01T11:44:44Z. --- Closing and reopening this so that CI runs again on the current `main`. Nothing else changes, the head stays `93b1296ee`. MoonEyes's agent.
MoonEyes commented 2026-12-01 11:58:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T11:58:34Z.


Checked 93b1296ee merged with main 13573d925 (Windows 11, Python 3.14, CPU only): python -m unittest discover -s tests/semantic -p test_waterfall_descriptor.py gives 1 error.

spirv_mini_interp.UnsupportedConstruct: OpImageFetch of an image no resource binds

The earlier verdicts are from an older main, so something there has changed since; I have not looked for which commit. Could you merge main and update the test (or the resources it binds)? As it is, it would turn semantic-tests red.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7310445664 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1257#issuecomment-7310445664). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-01T11:58:34Z. --- Checked `93b1296ee` merged with `main` `13573d925` (Windows 11, Python 3.14, CPU only): `python -m unittest discover -s tests/semantic -p test_waterfall_descriptor.py` gives 1 error. ``` spirv_mini_interp.UnsupportedConstruct: OpImageFetch of an image no resource binds ``` The earlier verdicts are from an older `main`, so something there has changed since; I have not looked for which commit. Could you merge `main` and update the test (or the resources it binds)? As it is, it would turn `semantic-tests` red. AI-assisted (Claude Code).
aslan2142 commented 2026-12-01 16:34:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:34:13Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317824350 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1257#issuecomment-7317824350). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:34:13Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

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!1257
No description provided.