Skip to content

build_runtime: the cl.exe fallback builds vk_sandbox and vk_ps_sweep (EGEN-FALLBACK-SANDBOX-SWEEP) - #9712

Closed
evilclanker9000 wants to merge 1 commit into
ProjectLeonida:mainfrom
evilclanker9000:deepseek/8-fallback-sandbox-sweep
Closed

evilclanker9000 wants to merge 1 commit into
ProjectLeonida:mainfrom
evilclanker9000:deepseek/8-fallback-sandbox-sweep

Conversation

@evilclanker9000

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: EGEN-FALLBACK-SANDBOX-SWEEP (#9677 (comment))

Depends on: #8854, #9169 and #8393 — conflicts only (they rewrite the neighbouring cl.exe lines and the launcher's source list in the same file); this change needs none of them.

What and why

scripts/build_runtime.ps1's cl.exe fallback — the branch that runs when Visual Studio's "C++ CMake tools" component is missing — built every Vulkan harness the GPU runners need, but not the two that the pixel-check tools start by name from runtime/build:

  • tools/sandbox.py looks for vk_sandbox.exe / vk_sandbox and ends at unsupported: vk_sandbox is not built without it; the tool renders a translated VS/PS pair over placed props.
  • tools/ps_sweep.py --exe draws one pixel shader against an RGBA32F target, and tools/ab_control_flow.py --all-attachments runs vk_ps_sweep.exe by default path — neither has a harness to start on a fallback build.

runtime/CMakeLists.txt builds both in its Vulkan tools loop (vk_harness vk_ps_sweep ... vk_sandbox), so the fallback was the only Windows build path that produced no artifact for either, and the pixel checks of translated game shaders could not be run from it at all. The fix adds the two cl lines beside the other VULKAN_SDK harnesses.

The regression collects the harness names every Python tool under tools/, scripts/ and runtime/test/shaders/ starts (quoted vk_* names that name a real runtime/test/*.cpp) and requires the fallback to build all of them, so the next such gap fails the suite instead of being found on a user's machine.

Tested

Base commit 5d74c2723, Windows 11, Python 3.12. This machine has no MSVC, so the two lines were not compiled here; the evidence is the fallback's own definitions, its regression test, and the real generated batch executed with a stand-in cl.exe that records its arguments:

  • python -I tests/test_build_runtime_fallback.py FallbackBuildsTheHarnesses.test_the_fallback_builds_every_harness_a_tool_starts
    • before: FAIL — AssertionError: Items in the first set but not the second: 'vk_sandbox', 'vk_ps_sweep'
    • after: OK
  • python -I tests/test_build_runtime_fallback.py — 9 tests. The only failure left is the pre-existing shims\xg_xs.cpp gap in the launcher's $files list, which open build_runtime: the cl.exe fallback compiles the xg_xs shim again #8393 fixes; it failed the same way before this change.
  • The generated fallback batch, run end to end with a recording cl.exe: 16 cl invocations on 5d74c272 with no /Fe:vk_sandbox.exe and no /Fe:vk_ps_sweep.exe; 18 after, one each (... vk_sandbox.cpp /Fe:vk_sandbox.exe, ... vk_ps_sweep.cpp /Fe:vk_ps_sweep.exe), and the batch still exits 0.
  • tools/sandbox.py's lookup against the build folder of that run: find_tool(...) -> None, the branch that prints unsupported: vk_sandbox is not built.
  • python -m compileall -q make_game.py tools tests, python -I make_game.py --help, python -I scripts/check_no_game_data.py and python -I tests/test_build_runtime_batch.py pass, and scripts/build_runtime.ps1 parses with 0 errors.

What remains to run on a machine with MSVC (or where CMake/Ninja are absent, which selects this branch): scripts/build_runtime.ps1, then python -I tools/sandbox.py --work <work> and python -I tools/ps_sweep.py ... --exe runtime\build\vk_ps_sweep.exe. No game files, no GPU output and no performance claim in this pull request.

AI-assisted: yes (Cline, deepseek8)

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 a translator change)

Tag: SHAYDERRR

…(EGEN-FALLBACK-SANDBOX-SWEEP)

tools/sandbox.py starts runtime/build/vk_sandbox.exe (without it the tool ends at 'unsupported: vk_sandbox is not built'), and tools/ps_sweep.py --exe / tools/ab_control_flow.py --all-attachments start runtime/build/vk_ps_sweep.exe. CMake builds both in its Vulkan tools loop; the fallback built neither, so a fallback build had no harness for either pixel check of translated shaders.

tests/test_build_runtime_fallback.py collects the harness names every Python tool under tools/, scripts/ and runtime/test/shaders/ starts and requires the fallback to build them: vk_sandbox and vk_ps_sweep fail on 5d74c27 and pass with the two cl lines.

@Grimkaaah Grimkaaah 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 review (Linux CPU) — PASS (PR scope); note pre-existing FAIL on main

Checked

  • build_runtime.ps1 cl.exe fallback now builds vk_sandbox.exe and vk_ps_sweep.exe when VULKAN_SDK is set — matches what sandbox.py / ps_sweep.py start by name.
  • New test test_the_fallback_builds_every_harness_a_tool_starts → passed.
  • Paths case-sensitive OK.

Note (not introduced by this PR): on both this tip and current upstream/main, test_the_launcher_compiles_every_source_cmake_gives_gta6rt fails with shims\xg_xs.cpp in CMake's gta6rt sources but missing from the cl.exe launcher list. Unrelated to EGEN-FALLBACK-SANDBOX-SWEEP; worth a separate fix.

No game files. Reviewer: Grimkeh (AI-assisted Cursor / Composer).

@chpeu

chpeu commented Nov 23, 2026

Copy link
Copy Markdown

Re-tested head 1cd7eb9e7 on Linux Mint 22 (Ubuntu 24.04 base), GCC 13.3, Python 3.12.3, pytest 9.2.0; base/main 5d74c2723 measured in the same session.

tests/test_build_runtime_fallback.py is pure Python (it parses scripts/build_runtime.ps1 and runtime/CMakeLists.txt), so it is fully exercised here. I ran it together with the other build_runtime / make_game pytest files:

  • head 1cd7eb9e7: 1 failed, 96 passed, 9 skipped, 35 subtests passed
  • main 5d74c2723: 1 failed, 95 passed, 9 skipped, 33 subtests passed

The single red is the same on both sides: test_the_launcher_compiles_every_source_cmake_gives_gta6rt — shims\xg_xs.cpp is in CMake's gta6rt sources but not in the cl.exe fallback. That gap entered main with #6891 (xg_xs shim) and this PR does not touch it.

The new test is not vacuous: with the two added cl lines removed from scripts/build_runtime.ps1, test_the_fallback_builds_every_harness_a_tool_starts fails; restored, it passes. Names checked against the callers: tools/sandbox.py:80 looks for vk_sandbox.exe/vk_sandbox, tools/ps_sweep.py:538 and tools/ab_control_flow.py:246 use vk_ps_sweep, and both runtime/test/vk_sandbox.cpp and runtime/test/vk_ps_sweep.cpp exist.

Not covered by Linux: the cl.exe fallback itself is Windows/PowerShell + MSVC, so no build of vk_sandbox.cpp / vk_ps_sweep.cpp through that script was run. The CMake Linux build already has both targets and this diff does not change it. GPU battery and translation suite not re-run — the diff only touches scripts/build_runtime.ps1 and a test file.

AI-assisted testing, counts read through by hand.

@molodayamama

Copy link
Copy Markdown
Contributor

Independent Windows check on 1cd7eb9e7c8d0b9d5423d8a98147c5d5d6d14d71 (CPython 3.13.5 for Python tests).

python -I tests/test_build_runtime_fallback.py ran 9 tests. The new fallback harness inventory check passed. The one failure was the CMake-versus-fallback source comparison for missing shims/xg_xs.cpp. I reproduced the same failure on 5d74c272363f2703265d44e6aaab1a1df8ddfaf3 (8 tests there). This was a static launcher check.

Scope: local fixtures, no retail files or live GPU run. AI-assisted verification.

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.

5 participants