Skip to content

test: cover supported d16 cube image stores - #7194

Open
lucas-tafuri wants to merge 2 commits into
ItsNotRexed:mainfrom
lucas-tafuri:test/d16-cube-image-store
Open

lucas-tafuri wants to merge 2 commits into
ItsNotRexed:mainfrom
lucas-tafuri:test/d16-cube-image-store

Conversation

@lucas-tafuri

Copy link
Copy Markdown
Contributor

Claim: #7049 (comment)

Since #6805, cube image stores translate using 2D array storage views. Move the d16 cube case into the existing positive matrix, where it must emit OpImageWrite. Keep negative dimension coverage with a 2D MSAA case and retain both modifier checks. The translator is unchanged.

Windows / Python 3.12, upstream snapshot 8575d36e: the original d16 suite failed on the stale cube assertion. After the test change, 4 d16 tests and 7 related cube tests passed. Two related tests skipped because LLVM/SPIR-V tools were unavailable. Local runs used no GPU or game files.

AI-assisted (OpenAI Codex).

@neoisg8

neoisg8 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Independent Review of PR #7194

Verdict: LGTM / Approve.

Environment

  • Windows 11 x64, CPython 3.14.3.
  • CPU only; zero game data or GPU hardware needed.
  • Evaluated PR commit 53a572676 rebased cleanly on current main (8575d36ed).

Negative Control Reproduction on main

On current upstream main (8575d36ed), running:

python -m unittest discover -s tests/semantic -p test_image_store_d16.py

Fails with:

FAIL: test_unsupported_dims_and_modifiers_still_refused (test_image_store_d16.ImageStoreD16Tests.test_unsupported_dims_and_modifiers_still_refused) (bad='image_store v[4:5], v[2:4], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm d16')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests\semantic\test_image_store_d16.py", line 344, in test_unsupported_dims_and_modifiers_still_refused
    with self.assertRaises(rdna2spirv.Unsupported):
AssertionError: Unsupported not raised

Cause: Commit 896b56c6a (#6805) implemented cube storage image stores mapped to 6-layer 2D array views (view_dim = "dim:SQ_RSRC_IMG_2D_ARRAY" if dim == "dim:SQ_RSRC_IMG_CUBE" else dim at tools/rdna2spirv.py:12816). As a result, image_store ... SQ_RSRC_IMG_CUBE unorm d16 translates successfully and no longer raises Unsupported.

Verification with PR #7194 Applied

  • With PR test: cover supported d16 cube image stores #7194 moving CUBE into the positive matrix and checking SQ_RSRC_IMG_2D_MSAA in the negative refusal matrix:
    python -m unittest discover -s tests/semantic -p test_image_store_d16.py
    Ran 4 tests in 0.243s - OK
  • All cube-related semantic tests:
    python -m unittest discover -s tests/semantic -p "*cube*"
    Ran 21 tests in 2.494s - OK (skipped=2 GPU fixtures)
  • git diff origin/main cleanly touches only 2 additions and 1 deletion in tests/semantic/test_image_store_d16.py.
  • No game data, clean-room test adjustment only.

AI-assisted.

@illusionart453-max

Copy link
Copy Markdown

Native Windows/Python 3.15 check of published head 53a5726: test_image_store_d16.py runs 4 tests and errors in the new positive cube case with rdna2spirv.Unsupported: image_store CUBE d16. The published head appears based before the cube-store implementation, so the positive test needs its prerequisite/current main to pass. I will check the test patch against current main separately. #7284 also changes this test file. Synthetic CPU inputs only. AI-assisted (Codex).

@illusionart453-max

Copy link
Copy Markdown

Follow-up: the two intended test edits applied to main 8575d36 pass all 4 test_image_store_d16 methods on Windows/Python 3.15. git apply rejected the stale context around the case list, so I manually added the CUBE positive row and replaced only the CUBE negative row with 2D_MSAA in a fresh isolated main checkout. Published 53a5726 errors on CUBE d16; main plus these edits passes. This supports rebasing/integrating the prerequisite, and #7284 overlaps the same file. Synthetic CPU verification; no GPU/game files. AI-assisted (Codex).

Sync the cube image-store test branch with main
@lucas-tafuri

Copy link
Copy Markdown
Contributor Author

Thanks for catching the stale base. I merged upstream-synced main (8575d36e, which includes #6805) into the PR branch. The published head is now 7147f5b, and the upstream PR still changes only test_image_store_d16.py. For local validation I reconstructed that tree from the pinned main snapshot and verified the test file matches the published head. Windows / Python 3.12: 4 d16 tests and 7 related cube tests passed, with 2 tool-dependent skips. I’m aware #7284 overlaps this coverage. AI-assisted (OpenAI Codex).

@boesbo

boesbo commented Nov 23, 2026

Copy link
Copy Markdown

Independent integration check on macOS arm64, CPython 3.13.18. I applied the test-only diffs from #7194 (7147f5b) and #7212 (9395858) together to upstream 48ff424. The unmodified base reproduced 48 subtest failures across these two files. With the two patches applied, the full semantic runner reported 444 files, 5,902 tests, zero failed files. Both runs used the same environment.

I also ran the two changed test modules separately with spirv-as and spirv-val from SPIRV-Tools v2026.4 on PATH so their optional assembly and validation paths actually ran. All seven tests passed. The full-suite figure above is for the standard-library run. Synthetic inputs and CPU only. AI-assisted with Codex.

@Daazd

Daazd commented Nov 23, 2026

Copy link
Copy Markdown

Independent check (Linux, Python 3.12.3, Node 24.13, CPU only, no game files): head 7147f5bd6 merged onto main 6a4299563: merges clean.

  • python3 -m unittest discover -s tests/semantic -p test_image_store_d16.py: Ran 4 tests in 0.284s OK (exit 0)

Fixes test_image_store_d16 (red on main: cube d16 stores became legal in #6805). #7284 fixes the same test; both pass.

AI-assisted (Claude Code).

@NiHuShu

NiHuShu commented Nov 23, 2026

Copy link
Copy Markdown

Compared the four open edits to test_image_store_d16.py on a common translator, upstream dde82f27e994337094afc476ded0b1426f6e87e2. I took just that test file from each head into a separate worktree. I ran python -I tests/semantic/test_image_store_d16.py -v with the real translator, then with two independent local changes restricted to CUBE+d16: reject the store as unsupported, or silently omit the write.

Test file revision Stock translator Reject store Omit write
Upstream 1 failure / 4 4 pass 1 failure / 4
This PR, 7147f5bd60018a833c98b19db8c486c719d091a6 4 pass 1 error 1 failure
#7284, 6a591b77f405da26a07f8cbc087a633034aedc21 4 pass 4 pass 4 pass
#7608, b4a9b5a4c3c7031f9c952f150a1febb68331f152 5 pass 1 error 1 failure
#7916, 6d17ae34c4f33356c4147414a617d8b19b7f4311 4 pass 4 pass 4 pass

All four clear the stale expectation. This PR and #7608 also catch both regressions in this file. The separate upstream test_image_cube_store_glc.py already catches both: 9/9 clean, 8 errors on refusal and 5 failures on omission (python -I -m unittest discover -s tests/semantic -p test_image_cube_store_glc.py -v). Zero skips throughout. This comparison covers d16 cube stores only.

CachyOS x86-64, CPython 3.14.10, SPIRV-Tools 2026.4. CPU only; GPU not used. Synthetic inputs, AI-assisted.

@kappalegoat

Copy link
Copy Markdown

Tested 7147f5b applied on main dde82f2, Windows 11, Python 3.13, Vulkan SDK 1.4.363 (spirv-val on PATH): test_image_store_d16 goes from 4 tests / 1 failure (the stale CUBE refusal) on main to 4/4 OK with this PR, including the new CUBE d16 validate case. Overlaps #7608 and #7284 on this file. AI-assisted (Claude).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants