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

Closed
leonida/mandy
Okachamie wants to merge 0 commits from translator-waterfall-table-offset into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

Okachamie commented 2026-11-24 20:58:05 +00:00

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).
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

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

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

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.

### 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 reviewed 2026-12-01 11:35:44 +00:00
aslan2142 left a comment
No description provided.
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

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

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

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).

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

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.

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.
Sign in to join this conversation.
No description provided.