Skip to content

w64_graphics: find vk_harness in a CMake configuration folder, and say so in one line when it was not built (TEST-1764) - #7850

Open
evilclanker9000 wants to merge 3 commits into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/8-w64graphics-harness-dir
Open

evilclanker9000 wants to merge 3 commits into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/8-w64graphics-harness-dir

Conversation

@evilclanker9000

Copy link
Copy Markdown
Contributor

Fixes TEST-1764.

runtime/test/shaders/w64_graphics.py joined the tools folder it was given with vk_harness + .exe and handed that to subprocess.run. With the Visual Studio generator (any multi-config CMake generator) the program is in runtime/build/RelWithDebInfo, not runtime/build, so the probe stopped on a FileNotFoundError traceback before the first fixture.

What changed:

  • harness_dir(build) returns the folder that holds vk_harness: build itself (Ninja, Makefiles), or its RelWithDebInfo/Release subfolder, as run_gpu_tests.py and check.py already do for the same reason (TEST-38). main resolves it once and hands that folder to every draw and probe.
  • A harness that was not built anywhere is one line on stderr naming the folder and the searched subfolders, and exit 1, instead of a traceback.
  • docs/testing.md ("Wave64 pixel, vertex and geometry shaders") says the tools dir may be the build folder.

Test

tests/test_w64_graphics_paths.py, fake files only, no GPU or game data:

python -I tests/test_w64_graphics_paths.py

Before (upstream/main at dde82f2):

ERROR: ... AttributeError: module 'w64_graphics' has no attribute 'harness_dir'
ERROR: test_a_missing_harness_is_one_error_line ... FileNotFoundError: [WinError 2] The system cannot find the file specified
FAIL: test_the_configuration_folder_is_handed_to_the_fixtures
AssertionError: Lists differ: [...\build'] != [...\build/RelWithDebInfo']
Ran 7 tests in 0.046s
FAILED (failures=1, errors=5)

After:

Ran 7 tests in 0.039s

OK

End to end, on a real build folder whose only harness is in RelWithDebInfo (vk_harness.exe copied from an existing Ninja build, fixtures for ps_w64_a_skip and vs_ids from an existing translated out dir), same command on both trees:

python -I runtime/test/shaders/w64_graphics.py <out> <build>
  • before: FileNotFoundError: [WinError 2] The system cannot find the file specified (from draw)
  • after: ps_w64_a_skip A ok

GPU: NVIDIA GeForce RTX 5080, driver 616.92, Windows. python -m compileall clean, python -I scripts/check_no_game_data.py clean on the three files.

Notes

  • CONFIG_DIRS is RelWithDebInfo and Release, the two folders run_gpu_tests.py searches; compute_fixture.find_test_program makes the same choice and leaves Debug out on purpose (a GPU probe wants an optimized harness).
  • I did not reuse check.py's resolve_build_dir/not_found_message: importing the 113 KB script into a standalone probe for two functions is more coupling than the ten-line helper, and its message names the three test programs, not this one.
  • Not related to this change, at dde82f27e: python -I tests/test_text_write_line_endings.py fails on tools/leonida_tui.py:753 and tools/wave_diff.py:373, and python -I tests/test_docs_links.py fails on an anchor in docs/dev-tools.md. The files this PR touches are not among them.

AI-assisted.

…764)

A Visual Studio (or any multi-config) build puts vk_harness.exe in build/RelWithDebInfo, so the probe died with a FileNotFoundError traceback on the folder it was given. harness_dir() now looks in the build folder and its RelWithDebInfo/Release subfolders, the fixture run uses the folder it found, and a harness that was not built is one error line and exit 1.
…EST-1764)

Seven fake-file cases: the build folder itself, build/RelWithDebInfo, build/Release, an unknown folder that is not searched, a configuration folder passed as the tools dir, and a harness that was not built. On main the wiring case hands build instead of build/RelWithDebInfo and the missing-harness case raises FileNotFoundError.
Name that the RelWithDebInfo/Release subfolder is found by itself and that a missing harness is one error line (TEST-1764).
@skorex

skorex commented Nov 23, 2026

Copy link
Copy Markdown

Duplicate of #7835

#7835 makes the same change and was opened earlier. Topic: w64_graphics: find vk_harness in a multi-config CMake build folder.

Suggest closing this PR in favour of #7835, and porting anything this one adds that #7835 lacks there.

@kett1m

kett1m commented Nov 23, 2026

Copy link
Copy Markdown

Thank you @skorex

@nnonno91

Copy link
Copy Markdown

Independent Windows verification of #7850 at 1b015664, using upstream dde82f27 as the control. I built vk_harness.exe with the Visual Studio multi-config generator. The executable was in RelWithDebInfo.

  • Passing the build root to the original probe raised FileNotFoundError. Passing the configuration folder directly ran all three fixtures.
  • With this PR, passing the same build root ran ps_w64_a_skip, ps_w64_a_uniform_vote, and ps_w64_b_readfirstlane successfully on the Radeon gfx1036 iGPU and RTX 5090. A build root with no harness produced a single error line and exit 1.

Existing regression checks
The related Python suite on this revision reported eight failures, including two subtests. The harness lookup runs before fixture-name validation, so three tests in test_w64_graphics_args.py get a missing-harness error for a misspelled fixture. The mocked VS/GS tests in test_w64_graphics_probe.py also stop at the new lookup before reaching their synthetic draw.

I verified a small correction locally. In w64_graphics.main, move the existing harness_dir lookup after the unknown-fixture check. In the mocked probe tests, touch vk_harness plus runner.EXE in the temporary folder and pass that folder explicitly as the tools directory. The fake executable is never launched because the draw remains mocked.

With those two edits, the related suite passed all 16 tests and 7 subtests. I reran the three fixtures on both GPUs and checked the single-line missing-harness diagnostic again. Windows 11 build 26200, MSVC 19.51, Vulkan validation enabled. Synthetic fixtures only. AI-assisted.

@ldicandia

Copy link
Copy Markdown

Tested 1b01566 on Windows 11, Python 3.14.5, CPU only (no MSVC/LLVM toolchain on this machine, so no GPU run): pass.

AI-assisted (Claude Code).

@byPreaZy

Copy link
Copy Markdown

Tested 1b01566 on Windows 11, MSVC 2022 BuildTools, AMD RX 9060 XT (driver 32.0.32015.7029), Python 3.14.

Reproduced TEST-1764 first on main: a Visual Studio-style layout (build/RelWithDebInfo/vk_harness.exe, nothing at build/ top level) made the script die with FileNotFoundError: [WinError 2] traceback. With this PR:

  • VS layout: vk_harness found in RelWithDebInfo, runs on the GPU (Vulkan device init logged), fixture reports a clean per-fixture result instead of the traceback.
  • Ninja layout (exe at build root): unchanged, still picked directly.
  • Harness not built anywhere: one clean stderr line naming the searched subfolders, exit 1, no traceback.
  • python -I tests/test_w64_graphics_paths.py: 7/7 pass.

One nit, non-blocking: CONFIG_DIRS covers only RelWithDebInfo/Release while check.py's TEST-38 list also has Debug/MinSizeRel. A build/Debug VS build would still traceback; either add them or leave as is since the error line now says what was searched.

AI-assisted verification; no game files, synthetic .spv stand-ins only.

@sergiocr06

Copy link
Copy Markdown

Tested 1b01566 on Windows 11, NVIDIA GeForce RTX 5060 Laptop (610.47), MSVC Build Tools 2026 (18.10), Visual Studio generator:

  • runtime/build/RelWithDebInfo/vk_harness.exe, no tools argument: found and launched; harness not built: one error line. Both pass.
  • tests/test_w64_graphics_paths.py, _reference.py: OK.
  • Fail in a checkout with no built harness (as on CI): tests/test_w64_graphics_args.py 3 failures and tests/test_w64_graphics_probe.py 5 failures, both OK on main. main() now returns 1 for the missing harness before the unknown-fixture check (args tests), and the probe tests call main([folder, name]) with no harness anywhere. Moving the harness check after the fixture-name check and giving test_w64_graphics_probe.py a tools folder with a fake vk_harness fixes both.

AI-assisted (Claude Code, Claude Opus 5.5).

@Maraco91

Copy link
Copy Markdown

Tested 1b015664 on a real Visual Studio build folder: NVIDIA GeForce RTX 3080 Ti, driver 616.56, Windows 11 26200, MSVC 19.42 (VS 2022 Build Tools), Python 3.12.6. Pass.

Setup, on main dde82f27 with runtime/test/shaders/w64_graphics.py and tests/test_w64_graphics_paths.py taken from this PR:

  • cmake -S runtime -B runtime\build -G "Visual Studio 17 2022" -A x64, then cmake --build runtime\build --config RelWithDebInfo --target vk_harness. The program lands in runtime\build\RelWithDebInfo\vk_harness.exe and nothing is in runtime\build itself.
  • python -I runtime/test/shaders/build.py <dir>: 270 shaders, 270 translated, 270 pass spirv-val.

python -I runtime/test/shaders/w64_graphics.py <dir> [tools dir]:

tools dir main dde82f27 this PR
not given (default runtime\build) FileNotFoundError traceback, exit 1 exit 0: 17 ok, 12 SKIP
runtime\build FileNotFoundError traceback, exit 1 exit 0: 17 ok, 12 SKIP
runtime\build\RelWithDebInfo exit 0: 17 ok, 12 SKIP the same
an empty folder (harness not built) FileNotFoundError traceback, exit 1 exit 1, one line: w64_graphics: vk_harness.exe not found in <folder> (its RelWithDebInfo, Release subfolders were searched too); build ..., no traceback

The 12 SKIPs are all tier C needs a device that can require both 64 and 32, or W64G_REF, which is expected on NVIDIA (32 only).

python -I tests/test_w64_graphics_paths.py: 7 OK. Negative control, the same tests with main's w64_graphics.py: 5 errors and 1 failure.

#7835, the other PR for TEST-1764, was closed while I was running this. I ran its cce12516 the same way: it fixes the first two rows too, and in the last row it still ends in the traceback.

Not checked: the docs/testing.md paragraph beyond reading it, and a Release-only build.

AI-assisted (Claude Code); no game files.

@gut0to gut0to 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.

The resolver accepts either a direct tools directory or the top-level multi-config build tree, passes the actual harness folder to the fixture runner, and reports a missing binary before subprocess launch. It searches the documented CMake configurations. Ran py -3.12 -I tests/test_w64_graphics_paths.py on this PR head: 7 tests passed.

@airp1ane

Copy link
Copy Markdown
Contributor

Tested 1b01566 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_w64_graphics_paths.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.

10 participants