Skip to content

tests/semantic: three image test files red on main (stale after #4473 and #6805; LLVM_MC on Windows) - #7284

Open
nonverifiedperson wants to merge 1 commit into
ItsNotRexed:mainfrom
nonverifiedperson:tests/semantic-image-red
Open

nonverifiedperson wants to merge 1 commit into
ItsNotRexed:mainfrom
nonverifiedperson:tests/semantic-image-red

Conversation

@nonverifiedperson

Copy link
Copy Markdown
Contributor

Claimed in #7231 (claim), from @dadsmallbuk1's finding there plus a third file. Depends on: none.

What and why

Three tests/semantic files fail on main (8575d36ed). The translator is right in all three; each test is stale or Windows-only broken:

File Failure on main Cause Fix
test_image_atomics_guard.py 47 subtests: OpImageTexelPointer in unguarded block #4473 (exec_static_true) folds the active-lane guard to OpBranchConditional %true when a shader never writes EXEC (every lane is active, so that's correct). The test, from #3559 and merged the same day, looks for OpLoad %bool %active The test's translate() starts with s_mov_b32 exec_lo, s12, so the guard it checks is a real %active load again
test_image_store_d16.py Unsupported not raised for a CUBE d16 image_store #6805 made CUBE image_store supported, d16 included, and test_image_cube_store_glc tests it Drop that row from the refused list; tfe/lwe stay
test_image_cube_store_glc.py FileNotFoundError with LLVM_MC=C:\...\llvm-mc.exe shlex.split (POSIX) drops the backslashes of a Windows path Use mc_command.split_command, as tests/conftest.py already does

No translator change.

Tests

  • The three files, each with spirv-as/spirv-val (Vulkan SDK 1.4.363) on PATH: OK. On main: 47 failures, 1 failure and 1 error.
  • python -I scripts/run_semantic_tests.py tests/semantic: 443 files, 5889 tests, 1 file failed, test_float_nan_fract. That one also fails on main, and Preserve signaling NaNs through minmax source modifiers #6685 fixes it. On main, 4 files fail.

Windows 10 22H2, Python 3.15, CPU only. No game files. AI-assisted (Claude Code).

🤖 Generated with Claude Code

…tRexed#4473 and ItsNotRexed#6805, LLVM_MC on Windows)

- test_image_atomics_guard: ItsNotRexed#4473 folds the active-lane guard to %true in a
  shader that never writes EXEC; write EXEC from an SGPR first so the test
  checks a real OpLoad %bool %active guard.
- test_image_store_d16: a CUBE d16 image_store is supported since ItsNotRexed#6805
  (test_image_cube_store_glc); drop it from the refused rows.
- test_image_cube_store_glc: resolve LLVM_MC with mc_command.split_command;
  shlex.split dropped a Windows path's backslashes (FileNotFoundError).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dadsmallbuk1

Copy link
Copy Markdown

Tested 6a591b7 on Windows 11 (26200), CPython 3.12.10, the setup of my #7231 finding: pass.

AI-assisted (Claude Code).

@RD37510

RD37510 commented Nov 23, 2026 •

Copy link
Copy Markdown

Independent Windows check of 6a591b7, using CPython 3.14.10, local LLVM 23.1.5 with AMDGPU support and SPIRV-Tools v2026.4:

  • test_image_atomics_guard, test_image_store_d16 and test_image_cube_store_glc: 16 tests passed, 0 failed, 0 skipped.
  • At base 8575d36, the first two files produced 47 and 1 failures respectively. The cube test passed with 2 skipped before LLVM was installed, so its base and head results are not directly comparable.
  • Full suite: python -I scripts/run_semantic_tests.py -j 4 tests/semantic: 443 files, 5,889 tests, 0 files failed, 620 seconds. The runner does not report a total number of skips.
  • These are CPU-side semantic tests; no game files or GPU execution.

AI-assisted (Codex).

@nonverifiedperson

Copy link
Copy Markdown
Contributor Author

Thanks @dadsmallbuk1 and @RD37510. About the overlap with #7292: I've left a note there. Its "only that constant" check matches OpStore %bool %active, which the translator never emits (it emits OpStore %active <value>). So as written, it accepts %true even in a shader that writes EXEC. Either way of fixing the guard test is fine with me. If #7292 goes in with that regex fixed, I'll drop the test_image_atomics_guard.py hunk here and keep the test_image_store_d16 and test_image_cube_store_glc fixes, which #7292 doesn't touch.

@harrisotiropoulos-jpg harrisotiropoulos-jpg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked: with this PR applied onto main at 48ff424, test_image_atomics_guard (3 tests), test_image_store_d16 (4) and test_image_cube_store_glc (9, 2 skipped without llvm-mc) pass. The atomics walker still catches a missing guard: an EXEC-writing shader whose guard is replaced by %true is rejected. The dropped CUBE d16 row is covered by test_image_cube_store_glc.py, which has d16 cases. mc_command.split_command exists in tools/mc_command.py. The LLVM_MC change was not exercised here, because llvm-mc is not installed on this machine.

Optional: since every case now starts with an EXEC write, nothing checks the folded path any more. Consider one case without EXEC_FROM_SGPR that asserts the module has no OpLoad %bool %active and branches on %true, so a regression in exec_static_true folding (#4473) is noticed.

Overlap: #7292 fixes the same atomics failure in a different way. This PR is the more complete fix (all three files) and keeps the walker strict.


Checked on Windows 11, Python 3.12.10; the three files have not changed on main since this PR's base, 8575d36. Review was AI-assisted.

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.

4 participants