[PR #494] SHADER-INDEX-RECOVERY: rebuild damaged translation indexes from shards #543

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

📋 Pull Request Information

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

Base: main ← Head: shader-index-recovery


📝 Commits (1)

  • 8a5be5c make_game: rebuild damaged translation indexes from shards

📊 Changes

6 files changed (+159 additions, -53 deletions)

View changed files

📝 make_game.py (+73 -49)
📝 tests/test_make_game_argparse.py (+1 -1)
📝 tests/test_make_game_empty_translation.py (+74 -1)
📝 tests/test_make_game_preflight.py (+2 -1)
📝 tests/test_native_pso_hashes.py (+8 -0)
📝 tools/native_pso_hashes.py (+1 -1)

📄 Description

Claimed in the coordination issue as: SHADER-INDEX-RECOVERY

What and why

A truncated or malformed shaders/spirv/index.json could let the shaders stage report success while the pipeline stage later rejected the same file and asked for another full translation. This treats a readable but malformed index as recoverable from the already completed shards, keeps a UTF-8 BOM index reusable, and still rejects a genuine empty merge. It also halves jobs correctly when shaders and assets overlap during free-space preflight.

Carried from the source patch in Sigtryggur-Mani-Gudmundsson's graphics-runtime-patches collection:
github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches@33ab48d3ea/README.md (recovering-a-damaged-shader-index)

No game data, keys, or decryption are included.

Tested

  • python -I tests/test_make_game_argparse.py — 38 tests OK
  • python -I tests/test_make_game_empty_translation.py — 20 tests OK
  • python -I tests/test_make_game_preflight.py — 98 tests OK, 1 skipped
  • python -I tests/test_make_game_translator_flags.py — 33 tests OK
  • python -I tests/test_shader_stage_resume.py — 46 tests OK
  • baseline source + patched tests fails the new damaged-index cases (6 failures, 2 errors); patched source passes
  • python -I tests/test_docs_links.py — 16 tests OK
  • python -I tests/test_docs_cli_flags.py — 4 tests OK
  • python -I tests/test_ci_registration.py — 15 tests OK
  • python -m compileall -q make_game.py tools tests — OK
  • git diff --check clean
  • security sweep of the diff: 0 hits

The source report rebuilt a truncated merged index from two synthetic pixel shards with matching original bytes. I reproduced the regression locally with the new tests; no game files were involved.

GPUs tested: n/a (CPU-only pipeline/tooling change)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • Regression tests added for damaged, BOM, non-object, locked-index and real-shard cases.

🔄 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/494 **Author:** [@bobcatchris](https://github.com/bobcatchris) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `shader-index-recovery` --- ### 📝 Commits (1) - [`8a5be5c`](https://github.com/ubiquitarianism/leonida/commit/8a5be5ce7727d29de1f70b6331da0e16ac6e2f10) make_game: rebuild damaged translation indexes from shards ### 📊 Changes **6 files changed** (+159 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+73 -49) 📝 `tests/test_make_game_argparse.py` (+1 -1) 📝 `tests/test_make_game_empty_translation.py` (+74 -1) 📝 `tests/test_make_game_preflight.py` (+2 -1) 📝 `tests/test_native_pso_hashes.py` (+8 -0) 📝 `tools/native_pso_hashes.py` (+1 -1) </details> ### 📄 Description Claimed in the coordination issue as: SHADER-INDEX-RECOVERY ### What and why A truncated or malformed `shaders/spirv/index.json` could let the shaders stage report success while the pipeline stage later rejected the same file and asked for another full translation. This treats a readable but malformed index as recoverable from the already completed shards, keeps a UTF-8 BOM index reusable, and still rejects a genuine empty merge. It also halves jobs correctly when shaders and assets overlap during free-space preflight. Carried from the source patch in Sigtryggur-Mani-Gudmundsson's graphics-runtime-patches collection: https://github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches/blob/33ab48d3ea90f9925351aeee8708181a71fb9634/README.md#recovering-a-damaged-shader-index No game data, keys, or decryption are included. ### Tested - `python -I tests/test_make_game_argparse.py` — 38 tests OK - `python -I tests/test_make_game_empty_translation.py` — 20 tests OK - `python -I tests/test_make_game_preflight.py` — 98 tests OK, 1 skipped - `python -I tests/test_make_game_translator_flags.py` — 33 tests OK - `python -I tests/test_shader_stage_resume.py` — 46 tests OK - baseline source + patched tests fails the new damaged-index cases (6 failures, 2 errors); patched source passes - `python -I tests/test_docs_links.py` — 16 tests OK - `python -I tests/test_docs_cli_flags.py` — 4 tests OK - `python -I tests/test_ci_registration.py` — 15 tests OK - `python -m compileall -q make_game.py tools tests` — OK - `git diff --check` clean - security sweep of the diff: 0 hits The source report rebuilt a truncated merged index from two synthetic pixel shards with matching original bytes. I reproduced the regression locally with the new tests; no game files were involved. GPUs tested: n/a (CPU-only pipeline/tooling change) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] Regression tests added for damaged, BOM, non-object, locked-index and real-shard cases. --- <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#543
No description provided.