TEST-722-PSB-OPLOAD: move PSB OpLoad out of OpAccessChain and tighten ps_w64 checks #910

Merged
leonida/mandy
markankamaransheogarat-sys merged 1 commit from ubiq/test-722-psb-load into main 2026-11-28 11:52:04 +00:00

Pull request successfully merged and closed

markankamaransheogarat-sys commented 2026-11-24 15:09:38 +00:00

Summary

  • Move the unreachable if p[0] == "psb": load branch out of OpAccessChain into OpLoad in tests/semantic/spirv_wave_interp.py, fixing PhysicalStorageBuffer loads.
  • Tighten ps_w64 wave64/wave32 checks and add regression tests for PSB OpLoad in tests/semantic/test_spirv_wave_interp.py and tests/semantic/test_wave64_halves.py.

Verification

  • python3 -I tests/semantic/test_spirv_wave_interp.py: 20/20 passed.
  • python3 -I tests/semantic/test_wave64_halves.py: 126/126 passed.

AI-assisted: yes (synthetic tests only, no game files).

### Summary - Move the unreachable `if p[0] == "psb":` load branch out of `OpAccessChain` into `OpLoad` in `tests/semantic/spirv_wave_interp.py`, fixing PhysicalStorageBuffer loads. - Tighten `ps_w64` wave64/wave32 checks and add regression tests for PSB `OpLoad` in `tests/semantic/test_spirv_wave_interp.py` and `tests/semantic/test_wave64_halves.py`. ### Verification - `python3 -I tests/semantic/test_spirv_wave_interp.py`: 20/20 passed. - `python3 -I tests/semantic/test_wave64_halves.py`: 126/126 passed. AI-assisted: yes (synthetic tests only, no game files).
qhukz13 reviewed 2026-11-24 15:39:18 +00:00
qhukz13 left a comment
No description provided.
Checked 1d5b44581 (Linux, CPU only, no game files). Merges cleanly with current `main`. - The fix is right: in `OpAccessChain` the `psb` branch sat after the access-chain-into-psb case, which already returns, so it never ran; in `OpLoad` it now does. - `test_physical_storage_buffer_load_and_store_readback` catches it: with `main`'s `spirv_wave_interp.py` it errors (`IndexError`), with this one it passes. - `test_wave64_halves.py` passes with and without the interpreter change, so its part is a separate tightening. The new heap checks follow the fixture's own header (`ps_w64_b_ballot_atomic.asm`: the wanted pixels are `x % 4 == 1`, each stores `y * 64 + x + 1` in a slot of its own), which is stricter than the old "16 distinct slots" and also catches a write past the last slot. The tier C change now checks wave32 against the reference on every fixed channel instead of only `w32 != w64`. - `tests/semantic/test_spirv_wave_interp.py` 20 OK, `tests/semantic/test_wave64_halves.py` 126 OK. LGTM.
sodove commented 2026-11-28 10:46:04 +00:00

#910 | head 0e9abdc7d4122adcd49200b416cf1b191eadc19a | python3 -m unittest discover -s tests/semantic -p test_spirv_wave_interp.py -v, python3 -m unittest discover -s tests/semantic -p test_wave64_halves.py -v | red: 147 run, 1 error | green: 148 passed | Red → green

I left the wave interpreter on main for the baseline and copied only the two test files. The physical-storage-buffer readback case raised IndexError there. Both files passed on the merged interpreter.

Captured 212 distinct complete SPIR-V module(s) emitted while rerunning test_wave64_halves.py on the merged tree. All assembled and passed spirv-val for Vulkan 1.2 with --allow-offset-texture-operand.

Test file Main + PR tests PR + main
tests/semantic/test_spirv_wave_interp.py 20 run, 1 error 20 passed
tests/semantic/test_wave64_halves.py 127 passed 128 passed

Base 3bd936ecd98995bca3e1da83d5e28d2343001aef was merged into the recorded PR head for the second run. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Counts include unittest subtest events where applicable. AI-assisted with OpenAI Codex. Batch claim.

#910 | head `0e9abdc7d4122adcd49200b416cf1b191eadc19a` | `python3 -m unittest discover -s tests/semantic -p test_spirv_wave_interp.py -v`, `python3 -m unittest discover -s tests/semantic -p test_wave64_halves.py -v` | red: 147 run, 1 error | green: 148 passed | **Red → green** I left the wave interpreter on main for the baseline and copied only the two test files. The physical-storage-buffer readback case raised IndexError there. Both files passed on the merged interpreter. Captured 212 distinct complete SPIR-V module(s) emitted while rerunning test_wave64_halves.py on the merged tree. All assembled and passed spirv-val for Vulkan 1.2 with --allow-offset-texture-operand. | Test file | Main + PR tests | PR + main | |---|---|---| | `tests/semantic/test_spirv_wave_interp.py` | 20 run, 1 error | 20 passed | | `tests/semantic/test_wave64_halves.py` | 127 passed | 128 passed | Base `3bd936ecd98995bca3e1da83d5e28d2343001aef` was merged into the recorded PR head for the second run. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Counts include unittest subtest events where applicable. AI-assisted with OpenAI Codex. [Batch claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7237873883).
DadaCap commented 2026-11-28 11:52:06 +00:00

Merged, thank you @markankamaransheogarat-sys! This translator PR (TEST-722-PSB-OPLOAD: move PSB OpLoad out of OpAccessChain and tighten ps_w64 checks) passed its own tests with main merged in during sodove's verification of this batch, so it went in with the batch.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

Merged, thank you @markankamaransheogarat-sys! This translator PR (TEST-722-PSB-OPLOAD: move PSB OpLoad out of OpAccessChain and tighten ps_w64 checks) passed its own tests with main merged in during sodove's verification of this batch, so it went in with the batch. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.
Sign in to join this conversation.
No description provided.