[PR #1235] make_game: rebuild empty compute shader modules on resume #1265

Open
opened 2026-11-26 20:20:39 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1235
Author: @titoreinaldo
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: contrib/r2-cache


📝 Commits (1)

  • bb68bb9 make_game: rebuild empty cached compute shader modules

📊 Changes

3 files changed (+32 additions, -13 deletions)

View changed files

📝 make_game.py (+10 -1)
📝 tests/test_fspx_shaders_stage.py (+11 -7)
📝 tests/test_library_shaders_stage.py (+11 -5)

📄 Description

Claimed in the coordination issue as: BUILD-EMPTY-SPV-CACHE
Claim in #14

What and why

Both the FSPX and pipeline-library stages accepted a zero-byte .spv if its filename, index and settings marker were still present. Rerunning the shaders step skipped the rebuild and left an unusable module for the runtime. The shared cache check now requires every indexed module to be a nonempty regular file. It uses one stat per entry.

Tested

  • Before the change the two stage regressions both failed for an empty module. After the change both rebuild it, check the restored bytes, and reuse the repaired cache on the next run.
  • python -m pytest -q tests/test_fspx_shaders_stage.py tests/test_library_shaders_stage.py — 41 passed, plus 21 subtests passed.
  • Repeated the failure with each stage’s synthetic input builder and the real LLVM disassembler, translator and SPIR-V tools. Truncating the FSPX module (4,040 bytes) and pipeline-library module (4,192 bytes) regenerated the exact original bytes. Both passed spirv-val --target-env vulkan1.2, and the third invocation preserved each module’s modification time.
  • python -I make_game.py --help and python -m compileall -q make_game.py tools tests passed. The shared base 58be9cdf ran 6,168 translator tests in 470 files with zero failing files. Verified a clean merge with main at 705ea091.

GPUs tested: CPU-only build and recovery on Windows 11 Pro 26H2 build 26300.9974, Python 3.12.14.

AI-assisted: yes, OpenAI Codex. All inputs were synthetic.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1235 **Author:** [@titoreinaldo](https://github.com/titoreinaldo) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `contrib/r2-cache` --- ### 📝 Commits (1) - [`bb68bb9`](https://github.com/ubiquitarianism/leonida/commit/bb68bb93ae5e40b9e4f5b7893cce410e6cfe9b09) make_game: rebuild empty cached compute shader modules ### 📊 Changes **3 files changed** (+32 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+10 -1) 📝 `tests/test_fspx_shaders_stage.py` (+11 -7) 📝 `tests/test_library_shaders_stage.py` (+11 -5) </details> ### 📄 Description Claimed in the coordination issue as: BUILD-EMPTY-SPV-CACHE [Claim in #14](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143476751) ### What and why Both the FSPX and pipeline-library stages accepted a zero-byte `.spv` if its filename, index and settings marker were still present. Rerunning the shaders step skipped the rebuild and left an unusable module for the runtime. The shared cache check now requires every indexed module to be a nonempty regular file. It uses one stat per entry. ### Tested - Before the change the two stage regressions both failed for an empty module. After the change both rebuild it, check the restored bytes, and reuse the repaired cache on the next run. - `python -m pytest -q tests/test_fspx_shaders_stage.py tests/test_library_shaders_stage.py` — 41 passed, plus 21 subtests passed. - Repeated the failure with each stage’s synthetic input builder and the real LLVM disassembler, translator and SPIR-V tools. Truncating the FSPX module (4,040 bytes) and pipeline-library module (4,192 bytes) regenerated the exact original bytes. Both passed `spirv-val --target-env vulkan1.2`, and the third invocation preserved each module’s modification time. - `python -I make_game.py --help` and `python -m compileall -q make_game.py tools tests` passed. The shared base `58be9cdf` ran 6,168 translator tests in 470 files with zero failing files. Verified a clean merge with `main` at `705ea091`. GPUs tested: CPU-only build and recovery on Windows 11 Pro 26H2 build 26300.9974, Python 3.12.14. AI-assisted: yes, OpenAI Codex. All inputs were synthetic. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1265
No description provided.