Skip to content

make_game pipelines: check spirv/fspx (and every module folder) too (BUILD-1842) - #5751

Open
cynbun wants to merge 1 commit into
ItsNotRexed:mainfrom
cynbun:build-1842-pipelines-subdirs
Open

cynbun wants to merge 1 commit into
ItsNotRexed:mainfrom
cynbun:build-1842-pipelines-subdirs

Conversation

@cynbun

@cynbun cynbun commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

BUILD-1842 (finding by @zzEmmazz in #5581: #5581 (comment))

Related: #5680 (its spirv/bvh folder is picked up by this change with no further edit to the stage; no dependency in either direction).

Cause

vk_pipeline_check reads one folder's index.json and does not descend (runtime/test/vk_pipeline_check.cpp:884, index_path = dir + "/index.json"). The pipelines stage passed it only <work>/shaders/spirv (make_game.py:1871 and :1902, base = [exe, spirv, cache, ...]), so the FidelityFX programs the shaders stage translates into spirv/fspx (fspx_shaders, make_game.py:1139), which the runtime's shader library loads beside the game's own (runtime/src/shader_library.h:738), were never created on the driver by the build. A module a driver rejects there was found only at run time. #5680 adds spirv/bvh the same way.

Fix

  • pipelines() now runs the existing batched check once per module index: shaders/spirv, then each folder directly in it that has an index.json, by name (pipeline_folders, discovered rather than hard-coded, so make_game, shader library: XboxBvhBuilder.dll's embedded programs are translated and found on the Vulkan device (D3D-557) #5680's bvh folder is covered when it lands). The batching and crash recovery body moved unchanged into check_pipeline_folder(), which returns the exit code and crashed modules instead of failing.
  • One cache for all folders: every checker process loads pipeline_cache.bin and saves it back with its own pipelines added, as the batches already do, and the runtime seeds from that one file (d3d12_vulkan_device.cpp). The output path is unchanged.
  • A validation failure in one folder no longer hides the next; the stage fails at the end naming each failed folder, with crashed modules named as the runtime names them (fspx/<name>). A setup error (exit 2) or an interruption still stops at once. With one folder the old message and log are kept exactly.
  • With more than one folder the log announces each folder's shader count and ends with pipelines: shaders checked per folder: shaders/spirv N, shaders/spirv/fspx M.
  • docs/pipeline_check.md (Build-stage batches) and the README's vk_pipeline_check paragraph say the checker does not descend and the stage checks each folder.

Tests

Linux, Python 3.14.8.

  • New tests/test_make_game_pipeline_folders.py (9 tests, scripted checker): a work folder with spirv/index.json and spirv/fspx/index.json passes both folders to the checker, in order, with one cache and the stage's --jobs; also with an older checker; a subfolder without index.json is skipped; a bvh folder is found by name; a failure in the main folder still checks fspx and fails the stage; a rejected fspx module fails it; a crashing fspx module is named fspx/fsr_1; a setup error stops before the next folder; a single folder keeps today's message and log. 7 of the 9 fail on main (the other two pin behaviour that is unchanged).
  • tests/test_make_game_pipelines.py, test_make_game_pipeline_batches.py, test_make_game_pipeline_preflight.py and every other tests/test_make_game*.py, test_text_write_line_endings.py: pass. python -m compileall -q make_game.py tools tests and python -I make_game.py --help: OK.
  • End to end on an RTX 5080, NVIDIA 615.78.08, Linux, with a natively built vk_pipeline_check (-DLEONIDA_VULKAN_HEADERS_FETCH=ON -DLEONIDA_REQUIRE_VULKAN=ON): the 261 GPU-test fixtures from runtime/test/shaders/build.py laid out as spirv (232) and spirv/fspx (29 compute shaders). The stage checked both: 79 + 29 cs pipelines, 0 failures; the cache grew from 2,254,923 bytes after the first folder to 2,838,091 after fspx, so the second process seeds from and adds to the same file. With one fspx module replaced by 64 zero bytes, this branch fails with vk_pipeline_check failed for shaders/spirv/fspx: exited with 1 (MODULE FAIL), while main checks only the 232 top-level entries and prints pipelines: done.

No game files were used or committed.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

…BUILD-1842)

vk_pipeline_check reads one folder's index.json and does not descend, and the
pipelines stage passed it only <work>/shaders/spirv, so the FidelityFX programs
the shaders stage translates into spirv/fspx (and, with ItsNotRexed#5680, spirv/bvh) were
never created on the driver by the build.

The stage now runs its batched check once per module index: shaders/spirv, then
each folder directly in it that has an index.json, by name. All folders save to
the same pipeline_cache.bin, which the runtime seeds from. A validation failure
in one folder no longer hides the next; the stage fails at the end naming each
folder, with crashed modules named as the runtime names them (fspx/<name>).
With more than one folder the log gives each folder's shader count.

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

Copy link
Copy Markdown
Contributor

Tested 06a233b5 on Windows Server 2022, CPython 3.13.12: pass

  • python -I tests/test_make_game_pipeline_folders.py -> OK

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

@SirKingg

Copy link
Copy Markdown
Contributor

Independent Windows verification at 06a233b5da7867bdee06cbecc2715363f0190eec (BUILD-1842), AI-assisted; synthetic inputs only.

Real GPU: Windows, NVIDIA RTX 4070 Ti, driver 610.88; native MSVC-built vk_pipeline_check, two hand-written GLSL compute modules compiled with glslangValidator. Running make_game.pipelines with --jobs 1 checked shaders\spirv and shaders\spirv\fspx: 2/2 modules and compute pipelines passed, no skips. The first process saved a 5,699-byte pipeline_cache.bin; the second explicitly seeded from those 5,699 bytes and saved 11,365 bytes to the same path. Replacing the second module with 64 zero bytes produced MODULE FAIL and stage exit 1 naming shaders\spirv\fspx; the checker rejected the malformed header, not a driver shader-compilation rejection. This checks creation, not shader results or a real game corpus.

Simulated: py -3.14 -m unittest discover -s tests -p 'test_make_game_pipeline*.py' -v: 53 tests, OK, 1 skipped (POSIX execute permissions). They cover discovery, shared cache argument, failures, crashes and setup errors using a scripted checker. The initial run with the machine's default Python 3.11.3 had one preflight error because Python >=3.12 is required; the supported 3.14.3 rerun passed.

Limitation found: for an older checker without --inflight-file, check_pipeline_folder calls run(base) with its default check=True (make_game.py:1951), so a simulated exit 1 in shaders\spirv raises immediately and shaders\spirv\fspx is not checked. This contradicts the documented continuation after validation failure; the older-checker test only exercises success. No game files or online game services used.

@Kev-Ball

Copy link
Copy Markdown

Tested the build stage at 06a233b5 on CachyOS, RTX 3080 Ti, NVIDIA 620.73.04. I built this revision’s native checker and ran make_game.pipelines(..., jobs=1) from an empty output folder. The inputs were wave64-emulated modules from my Xbox 1.0.2.1 copy, including the BVH folder produced by #5680.

Folder Pipelines created Failed / skipped
Main (one each of CS, GS, MS, PS, VS) 5 0 / 0
BVH (all translated modules) 51 0 / 0
FSPX (all translated modules) 21 0 / 0

The stage discovered all three folders, exited 0 and left one 9,220,483-byte pipeline cache. The five main modules were a stage-coverage sample. This checks driver pipeline creation for the actual translated subfolder modules. AI-assisted.

@memorypressure

Copy link
Copy Markdown

Verified on your head at main 561b65a: the new folder-scan suite passes 9/9 (re-run) and the pipelines machinery is intact — test_make_game_pipelines 13, pipeline_batches 15, pipeline_preflight 16, dry_run 24, argparse 36 all green; every referenced helper exists in make_game.py (pipeline_names:2056 etc.). The single-folder failure wording is preserved verbatim for the one-folder case, and README/pipeline_check.md match the code. The branch reports no CI checks — worth a push. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@LukeOsland1

Copy link
Copy Markdown

Independent Windows retail test at 06a233b5, Windows 11 build 26300, RTX 4070 Ti SUPER, NVIDIA 610.88. Built the native checker from the PR with MSVC. Ran the head’s fspx_shaders on the Xbox 1.0.2.1 FidelityFX DLL with LLVM 23.1.6 and wave64 emulation, then pipelines(..., jobs=1) from an empty cache. The top-level control was one locally translated retail vertex module with its partner stub.

Folder Indexed Pipelines created Failed Skipped
Main (one VS) 1 1 0 0
FidelityFX (all translated modules) 21 21 0 0

The DLL yielded 29 programs. 21 translated and passed spirv-val; the other eight never reached the driver. The first process wrote 20,034 cache bytes. The second explicitly loaded all 20,034 bytes and saved 3,508,098 bytes to the same file. Both processes identified the RTX 4070 Ti SUPER (subgroup 32), and the stage exited successfully. This tests folder discovery, cache reuse and pipeline creation. AI-assisted with Codex.

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