Skip to content

build_runtime.ps1: the cl.exe fallback builds the GPU test harnesses the tools need - #1238

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
etcetera-yt:build-runtime-fallback-harnesses
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
etcetera-yt:build-runtime-fallback-harnesses

Conversation

@etcetera-yt

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: @derekhearst's finding (finding, claim). No ID assigned yet.

What and why

When Visual Studio has no "C++ CMake tools" component, scripts/build_runtime.ps1 (what make_game.py and docs/testing.md use) compiles with cl.exe directly. That fallback built gta6rt and nine test programs, but not:

  • vk_compute_test, vk_store_test, vk_harness: check.py's TEST_PROGRAMS and run_gpu_tests.py's REQUIRED_TEST_PROGRAMS, and the program valu_fuzz.py/lds_fuzz.py/crosslane_fuzz.py run;
  • vk_image_fuzz: image_fuzz.py's HARNESS.

So TEST-71 and the GPU suite stopped at "vk_compute_test not found" / "Test programs not found" on that path.

  • scripts/build_runtime.ps1: four more if defined VULKAN_SDK cl ... lines, the same flags the fallback uses for vk_texture_test. Each harness is one runtime/test/<name>.cpp, as in runtime/CMakeLists.txt's Vulkan tool loop. The CMake path is unchanged.
  • tests/test_build_runtime_fallback.py (stdlib, CPU only): reads the fallback branch of the script. It checks that the /Fe: list contains every harness those tools name (imported from run_gpu_tests, check and image_fuzz, so it follows them), and that every runtime\test\*.cpp the fallback compiles exists.

What's left: nothing for this finding. The fallback still leaves out the optional parts its comment lists (SDL3 GameInput) and the ctest-only test programs, which is unchanged.

Tested

NVIDIA GeForce RTX 5060 Ti, driver 621.14, Windows 10 19045, VS 2022 BuildTools, Vulkan SDK 1.4.363.0, Python 3.14.7.

python -I tests/test_build_runtime_fallback.py
python -I tests/test_run_gpu_tests.py
python -m compileall -q make_game.py tools tests scripts
  • The fallback itself, forced: this machine has VS's CMake, so I ran an untracked copy of build_runtime.ps1 (deleted afterwards) whose only change makes $cmake point at a path that doesn't exist. It printed WARNING: VS C++ CMake tools not found: building with cl.exe directly... and built ...\runtime\build\gta6rt.exe, exit 0, 0 compiler warnings. It produced 14 programs, now including vk_harness, vk_compute_test, vk_store_test and vk_image_fuzz. On main the same fallback produces 10.
  • The new programs on the GPU: each prints its usage when run without arguments. With placeholder shaders, vk_compute_test (device: NVIDIA GeForce RTX 5060 Ti (subgroup 32..32)), vk_store_test and vk_image_fuzz each create the Vulkan device, then stop at the shader. There's no llvm-mc here to assemble real ones.
  • run_gpu_tests.py --build runtime/build on that fallback build: it passes the harness check. With vk_compute_test.exe moved away, it stops with Test programs not found in ...: vk_compute_test.exe, which is what main's fallback gives. After the check it stops at the missing llvm-mc the same way the CMake build of main does.
  • Negative controls for the new test:
    • With main's build_runtime.ps1, it fails, listing vk_compute_test, vk_harness, vk_store_test and vk_image_fuzz as missing.
    • With only the vk_store_test line dropped, it names vk_store_test.
    • With vk_harness.cpp misspelled, the source check fails.

Not tested: a machine that really lacks the CMake component (I forced the branch instead), full GPU suite and fuzzer runs (no llvm-mc here), and -Debug on the fallback.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: no translator change.)

AI-assisted (Claude Code).

🤖 Generated with Claude Code

…the tools need

Without VS's "C++ CMake tools" component, build_runtime.ps1 compiles
with cl.exe directly, and that list never built vk_compute_test,
vk_store_test or vk_harness (the programs check.py and run_gpu_tests.py
require and valu_fuzz.py/lds_fuzz.py run), nor vk_image_fuzz
(image_fuzz.py's harness). TEST-71 on that path stopped at
"vk_compute_test not found". Build them the way the fallback builds
vk_texture_test. tests/test_build_runtime_fallback.py checks that the
fallback builds every harness those tools name and that each source it
compiles exists.

Found by @derekhearst.

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

Copy link
Copy Markdown
Contributor

Tested f4ee349 on Windows 11, VS 18 / MSVC 14.51. I forced the cl.exe fallback by replacing the (Test-Path $cmake) -and (Test-Path $ninja) check with $false in a scratch worktree. build_runtime.ps1 exits 0 and produces gta6rt.exe plus vk_harness, vk_compute_test, vk_store_test, vk_texture_test, vk_bindless_test, vk_image_fuzz, vk_pipeline_check, vk_descriptor_bench and the unit-test exes.

Overlaps #1236, which also extends the same fallback and conflicts with this in scripts/build_runtime.ps1. Under the same forced fallback, #1236 builds the same set except vk_image_fuzz, and it has no test. So this PR covers everything #1236 does plus vk_image_fuzz and tests/test_build_runtime_fallback.py.

@abilliontokens

Copy link
Copy Markdown
Contributor

Verified from the #1236 side: the three harness lines here match what we tested (compile/link/launch under vcvars64); the superset + regression test makes this the one to land. We closed #1236 in its favor. AI-assisted (omp orchestrator).

@Rainmaker33

Copy link
Copy Markdown

Tested f4ee349 on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass.

This adds a functional run to @kapitche's build check: the programs the fallback builds are used for the GPU suite and the fuzzers, and compared with a normal CMake build.

  • Setup: the PR's diff applied to current main (426023a, clean apply), with VS 2022 Community (MSVC 14.4x), Vulkan SDK 1.4.363.0 and llvm-mc 21.1.8 from scripts/build_llvm_mc.ps1. VS 2022 has the CMake tools here, so the fallback was forced in a copy of the script by pointing $cmakeDir at a folder that doesn't exist. The log opens with the "VS C++ CMake tools not found" warning.
  • Build: exit 0 in 67 s, no compiler warnings. It produced vk_compute_test, vk_store_test, vk_harness, vk_image_fuzz and the rest.
  • tests/test_build_runtime_fallback.py: OK. The same test against build_runtime.ps1: the cl.exe fallback builds check.py's three test programs #1236's script fails on 'vk_image_fuzz' : missing, as expected.
  • From the fallback build, with --seed 1 and 50 programs each:
    • run_gpu_tests.py --build runtime\build: 91/118 pass, 27 skipped (all need 64-wide subgroups).
    • valu_fuzz --family f16: 50/50 that ran match.
    • valu_fuzz --family mem: 50/50 match.
    • lds_fuzz: 50/50 match.
    • image_fuzz: 8/8 match.
    • crosslane_fuzz --no-maskdata: wave32 33 match / 17 hyp_only, wave64 emulated 36 match / 14 hyp_only, 0 mismatches.
  • main built through the CMake path (build_runtime.ps1 unmodified) gives the same results. run_gpu_tests.py matches per test, and image_fuzz and crosslane_fuzz give the same counts. With the default options crosslane_fuzz shows 11 (wave32) and 12 (wave64 emulated) mismatches, the same on both builds. With --no-maskdata there are none, which points to the maskdata ops (Translator: a lane mask read as data gives the wave's bits (SHADER-21 part 1, #210) #293) and not to the fallback.

No game files.

@etcetera-yt

Copy link
Copy Markdown
Contributor Author

Thanks @kapitche, @Rainmaker33 and @abilliontokens. Rainmaker33's functional run from the forced fallback build (GPU suite 91/118 with 27 wave64 skips, and every fuzzer matching the CMake build) covers what I couldn't do here without llvm-mc. Thanks too for closing #1236 in favour of this one. AI-assisted (Claude Code).

@ItsNotRexed
ItsNotRexed merged commit 4ee52ca into ItsNotRexed:main Nov 22, 2026
11 checks passed

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

Tested f4ee349 on NVIDIA RTX 3050 6GB Laptop GPU, driver 610.62, Windows 11 (10.0.26200): pass

Visual Studio 2026 Community without the "C++ CMake tools" component, so build_runtime.ps1 took the cl.exe fallback (VULKAN_SDK=1.4.363.0).

  • tests/test_build_runtime_fallback.py: 2/2 OK
  • Fallback build succeeded; vk_compute_test, vk_store_test, vk_harness and vk_image_fuzz.exe are all built (on main the fallback builds none of them, so the fuzzers stop with "missing vk_compute_test")
  • With that build: lds_fuzz --emulate 40/40 match, valu_fuzz --family f16 --emulate 40/40 match (seed 2, --wave both)
  • run_gpu_tests.py --build runtime\build: 89/116 passed, 27 skipped (all wave64 without emulation), 0 failed

(Tested with AI assistance.)

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