Skip to content

make_game: rebuild BVH shader modules the Windows runtime cannot read - #8387

Open
vgineer wants to merge 1 commit into
ItsNotRexed:mainfrom
vgineer:vgineer/bvh-module-cache-framing
Open

vgineer wants to merge 1 commit into
ItsNotRexed:mainfrom
vgineer:vgineer/bvh-module-cache-framing

Conversation

@vgineer

@vgineer vgineer commented Nov 23, 2026

Copy link
Copy Markdown

Claimed in the coordination thread. No dependency.

The BVH build stage can report all programs translated even when an indexed module is zero bytes. With a matching build stamp, every later run reuses it. The native compute pipeline then rejects the module in read_spirv_words; the builder constructor gives up on the first failed pipeline. I reproduced the build/runtime disagreement with synthetic inputs.

Check each indexed BVH module against the runtime's inexpensive framing rules before accepting either cached or freshly translated output. A bad cache triggers a rebuild. A bad fresh result names the module and leaves no published index or completion marker. This reads only the magic word and file size. Instruction and device-capability validation stay with their existing validators.

Verification

  • Windows 10 x64, Python 3.13.9. All four cache-damage cases and the fresh-publication case failed before the fix. Afterward, the BVH stage passed 15/15, the FSPX stage 22/22, and shader-stage resume 46/46.
  • Ran the real extraction, unpacking, disassembly wrapper and translator on three synthetic programs, with a stand-in disassembler, the in-process assembler and external validation disabled. After shortening one module, rerunning restored all three byte-for-byte. The native C++ reader accepted all three and a second rerun reused them.
  • In a separate headless Vulkan check on a GeForce RTX 2060 SUPER (576.02), the same C++ reader rejected all four malformed inputs. The build restored the hand-assembled compute module each time and vkCreateComputePipelines succeeded with a restored module. No retail boot was attempted.
  • Tested alongside make_game: rebuild bvh_shaders cache when cached index has 0 translated programs #8142, which covers a nonproductive index. The two patches merged cleanly and the combined BVH suite passed 16/16. Diff and no-game-data checks passed.

AI-assisted (Codex).

@molodayamama

Copy link
Copy Markdown

Verified commit d499b577ad9df8bae6638975cbbd9957e2d67620. All 15 BVH shader-stage tests passed on Windows with synthetic staged files. The focused cases cover missing or unreadable cached modules and an index entry the runtime cannot resolve. This was validation of the build/resume path, without a retail executable or a GPU run.

AI-assisted verification.

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested d499b577 on Linux, CPython 3.14, CPU only, synthetic inputs, merged onto main 46492b02: pass

  • python -I tests/test_bvh_shaders_stage.py: Ran 15 tests, OK. With only the non-test files reverted to main: FAILED (failures=5), so the new tests exercise the change.
  • compileall and scripts/check_no_game_data.py on the changed files: clean.

Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting; claimed in #8047.

@garuspl

garuspl commented Nov 23, 2026

Copy link
Copy Markdown

Tested d499b57 on Windows 11 (CPU only, no GPU needed): pass

Windows 11 Pro, Python 3.14.7, no GPU or game files involved; pytest/numpy/Pillow pinned from tests/requirements.txt in a fresh venv. Method: PR head merged onto main d9aa42a, the PR's test files run with python -m pytest before and after the merge, plus python -m compileall -q on the changed files (clean).

  • tests/test_bvh_shaders_stage.py: main 13 passed; with the PR 15 passed, 4 subtests passed.

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

@Atomic258

Copy link
Copy Markdown
Contributor

Tested d499b577 on Windows Server 2022, CPython 3.13.12: pass

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

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

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