Skip to content

check.py: a silent exit 77 is a SKIP, not ok, and no longer hides a failure - #7740

Open
fearkov wants to merge 4 commits into
ItsNotRexed:mainfrom
fearkov:fix/check-empty-skip
Open

fearkov wants to merge 4 commits into
ItsNotRexed:mainfrom
fearkov:fix/check-empty-skip

Conversation

@fearkov

@fearkov fearkov commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in #7333 as: #7333 (comment)

What and why

When vk_texture_test can't run, check.py prints ok for ps_table_fetch. It also counts the test as passed and takes one off the failure count.

table_fetch_test (runtime/test/shaders/check.py:1123) returned Skip(output.strip()). If there is no Vulkan driver, vkCreateInstance gives VK_ERROR_INCOMPATIBLE_DRIVER, and vk_texture_test exits 77 without printing anything. The result is then Skip(""), which is falsy, so main():

  • prints the row as ok;
  • computes failed as "truthy results minus every Skip", so this empty Skip takes one off the failure count. A run with one real failure next to it exits 0, and a run where everything else skipped gets failed = -1.

On main 042c5f3 the real programs show it (an empty out dir, no driver):

$ VK_DRIVER_FILES=/nonexistent/none.json python3 -I runtime/test/shaders/check.py <empty out dir> runtime/build/lx
...
ps_table_fetch       ok
...
1 of 211 pass, 9 skipped

Nothing ran there. With the branch the row is ps_table_fetch SKIP (unsupported device) and the summary is 0 of 211 pass, 9 skipped.

Even when vk_texture_test does say why it stopped, the old row printed its whole output (device: ..., the offset limits, then the reason) without any SKIP marker.

The fix:

  • table_fetch_test reports exit 77 as SKIP (<the "unsupported:" line>), or SKIP (unsupported device) when there is no such line, like the other vk_texture_test helpers do.
  • main() tells skips apart by type: an empty Skip prints SKIP (no reason given), and failed counts the truthy results that are not a Skip.

Commits:

  1. check.py: table_fetch_test reports exit 77 as SKIP (reason).
  2. check.py: main() counts a Skip result as a skip whatever its text.
  3. Tests: tests/test_shader_check_skips.py (standard library). It covers table_fetch_test with a silent 77, a 77 that names the reason and a real failure. It also runs main() with stand-in helpers and checks three things: a failure next to a silent skip still exits 1, an empty Skip from any helper prints as a skip, and the summary counts every row once.
  4. Docs: check.py's docstring says how a skipped shader is reported and what the exit status means.

Tested

Linux, Python 3.14.10 (python3 -I), NVIDIA RTX 2060 SUPER build of main 042c5f3:

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.

@SirKingg SirKingg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Independent Windows CPU-only review at 34fb524f70ab053f07e6b9fc664194f06959691e (Python 3.11.3). AI-assisted.

  • Synthetic base/head controls cover empty and multiple skips, None, real failures, exit 77 with and without a reason, all three fetch modes, command paths and exit status. The head counts each result correctly and no longer masks the failure.
  • python -I tests/test_shader_check_skips.py: 6 passed. The related GPU-runner and CI-registration suites passed (99 tests, 1 skipped).
  • tests/test_shader_checks.py has the same 15 pre-existing cwd errors on base and head. Applying #7433's two test-only changes in memory makes all 88 discovered tests pass on both; no repository files changed.
  • No real GPU, Vulkan driver, or no-driver executable path was tested. CI checks were queued at review time.

@kamilolejnik

Copy link
Copy Markdown

Tested 34fb524 on Intel Iris Xe Graphics (TGL GT2), Mesa ANV 26.3.1, Vulkan 1.4.363, Linux 6.12 (Arch container), llvm-mc 23.1.5, CPython 3.14: pass. build.py <out> then check.py <out> <programs>, programs built once from the merge-base 042c5f3:

run merge-base check.py this PR's check.py
on the GPU 166 of 211 pass, 45 skipped; ps_table_fetch ok 166 of 211 pass, 45 skipped; ps_table_fetch ok (every row identical)
VK_DRIVER_FILES=/nonexistent/none.json (no driver) 1 of 211 pass, 21 skipped; ps_table_fetch ok 0 of 211 pass, 21 skipped; ps_table_fetch SKIP (unsupported device)

So the reproduction from the description holds on Linux/ANV too, the fix changes only that row in the no-driver run, and nothing changes when the device is there. (Both no-driver runs exit 1 here because the other rows fail; the off-by-one in failed is what the PR's tests/test_shader_check_skips.py covers: 6 OK.)

Synthetic fixtures only, no game files. AI-assisted (Claude Code).

@inf1425

inf1425 commented Nov 23, 2026

Copy link
Copy Markdown

Tested 34fb524f7 on native Windows: pass. The bug reproduces on main and the fix holds.

Setup: Windows 11 build 26300, VS 2026 (MSVC 14.52) RelWithDebInfo, Vulkan SDK 1.4.363.1, llvm-mc 23.1.6, Python 3.15.2. The test programs were built from main 603d53eb3; fixtures from build.py (269/269 translated and spirv-val-valid).

No driver (VK_DRIVER_FILES=C:\nonexistent\none.json; vk_texture_test.exe then exits 77 and prints nothing), same programs and fixtures:

check.py ps_table_fetch row summary
main ok 1 of 211 pass, 21 skipped
this PR SKIP (unsupported device) 0 of 211 pass, 21 skipped

With a driver, the PR's check.py gives the same results as main's, and ps_table_fetch is ok on both GPUs:

  • NVIDIA GeForce RTX 4060 Laptop, 616.64: 176 of 211 pass, 35 skipped, exit 0.
  • AMD Radeon 780M (RDNA3 iGPU), 26.11.2: 208 of 211 pass, 3 skipped, exit 0.

Unit tests: tests/test_shader_check_skips.py: 6/6 OK. With main's check.py swapped in, 5 of them fail.

A side note on the reproduction, not a problem with this PR: on Windows, the description's empty out-dir form doesn't reach the exit-77 path. table_fetch_test starts vk_texture_test in a subfolder of the out dir, so on both main and the PR the row is exit 1: could not start vk_texture_test.exe: [WinError 267] The directory name is invalid. Using a built out dir, as above, shows the bug.

Synthetic fixtures only, no game files. AI-assisted (Claude Code).

@rojasruiz

Copy link
Copy Markdown

Tested 34fb524 merged onto main dde82f2 (clean merge) on NVIDIA GeForce RTX 3080, driver 615.78.08, Linux 7.2.15, test programs built from this tree: pass, no change in what's judged on this device.

  • runtime/test/shaders/check.py <build> <build>: this branch 176 of 211 pass, 35 skipped, exit 0. main gives the same, and the two logs are line-for-line identical once timings are stripped. NVIDIA has no silent exit 77 here that the change would reclassify, so this only shows it doesn't disturb a clean run.
  • tests/test_shader_check_skips.py: 6 OK.
  • run_gpu_tests.py: 192/241, 48 skipped, identical to main. check_no_game_data.py on both files: clean.

AI-assisted (Claude Code).

@airp1ane

Copy link
Copy Markdown
Contributor

Tested 34fb524 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass.

Ran the test files this PR adds or changes, from a clean checkout of the PR head: test_shader_check_skips.py - all exit 0.

AI-assisted (Claude Code).

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.

6 participants