manifest_verifier: protect listed files from cache writes (VERIFY-CACHE-INPUTS) #346

Manually merged
github merged 1 commit from gh-pr/346/head into gh-pr/346/base 2026-11-26 08:54:35 +00:00
Owner

@⁠JiyouProt on GitHub · 2026-11-24 03:39 UTC · original
JiyouProt:codex/verify-cache-inputs → main · +62 −0 · 2 files · 1 commits · merged 2026-11-24 13:37 UTC

Claimed in the coordination issue as: VERIFY-CACHE-INPUTS

What and why

With two listed files, passing one as --cache excludes it from the scan, reports it MISSING, then overwrites its original bytes with cache JSON when the other file passes. A missing listed file can likewise be created as cache JSON.

Check the cache destination against every manifest-listed input before scanning or hashing, using report_paths.same_report_path for normalized paths, case aliases and links. Refuse with ManifestError; the CLI exits 2 without a traceback and preserves the input bytes. An ordinary cache inside the target directory remains supported.

Six synthetic regression tests cover the CLI, alternate path spelling, case aliases, hard links, symlinks and a missing listed input. The four runnable negative controls fail on unchanged main. Independent of #334 (manifest collision) and #344 (temporary-file staging). Based on main d478a92.

Tested

Windows 11 build 26300, Python 3.14.3:

  • python -I tests/test_manifest_verifier.py: 63 tests, 59 passed, 4 platform/sandbox skips.
  • python -I tests/test_report_paths.py: 22 tests, 20 passed, 2 platform/sandbox skips.
  • The hard-link regression also passes under Python 3.11.9, where this sandbox permits hard links; the symlink test remains skipped.
  • python -m compileall -q make_game.py tools tests, changed-file check_no_game_data.py, and git diff --check: passed.
  • Shared translator-suite run on the same main base (translator and semantic-test trees unchanged by either cache fix): 463 files, 6,075 tests, 514 seconds; only test_sopc_validation and test_unary_f16_validation fail because spirv-as / spirv-val are unavailable.

GPUs tested: n/a (CPU-only input-preservation fix; synthetic bytes only).

AI-assisted: yes, Codex.

  • One topic, based on main.
  • No game data, keys or decryption.
  • No translator rule changed.
**@⁠JiyouProt** on GitHub · 2026-11-24 03:39 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/346) `JiyouProt:codex/verify-cache-inputs` → `main` · +62 −0 · 2 files · 1 commits · merged 2026-11-24 13:37 UTC Claimed in the coordination issue as: [VERIFY-CACHE-INPUTS](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why With two listed files, passing one as `--cache` excludes it from the scan, reports it MISSING, then overwrites its original bytes with cache JSON when the other file passes. A missing listed file can likewise be created as cache JSON. Check the cache destination against every manifest-listed input before scanning or hashing, using `report_paths.same_report_path` for normalized paths, case aliases and links. Refuse with `ManifestError`; the CLI exits 2 without a traceback and preserves the input bytes. An ordinary cache inside the target directory remains supported. Six synthetic regression tests cover the CLI, alternate path spelling, case aliases, hard links, symlinks and a missing listed input. The four runnable negative controls fail on unchanged main. Independent of #334 (manifest collision) and #344 (temporary-file staging). Based on main d478a92. ### Tested Windows 11 build 26300, Python 3.14.3: - `python -I tests/test_manifest_verifier.py`: 63 tests, 59 passed, 4 platform/sandbox skips. - `python -I tests/test_report_paths.py`: 22 tests, 20 passed, 2 platform/sandbox skips. - The hard-link regression also passes under Python 3.11.9, where this sandbox permits hard links; the symlink test remains skipped. - `python -m compileall -q make_game.py tools tests`, changed-file `check_no_game_data.py`, and `git diff --check`: passed. - Shared translator-suite run on the same main base (translator and semantic-test trees unchanged by either cache fix): 463 files, 6,075 tests, 514 seconds; only `test_sopc_validation` and `test_unary_f16_validation` fail because `spirv-as` / `spirv-val` are unavailable. GPUs tested: n/a (CPU-only input-preservation fix; synthetic bytes only). AI-assisted: yes, Codex. - [x] One topic, based on main. - [x] No game data, keys or decryption. - [x] No translator rule changed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:54:33 +00:00
github manually merged commit eb348cdd1f into gh-pr/346/base 2026-11-26 08:54:35 +00:00
Author
Owner

@⁠Oliwettoo on GitHub · 2026-11-24 10:30 UTC · original

Looks good. Applied on current main, tests/test_manifest_verifier.py passes. The per-file same_report_path loop is cheap here (the shipped manifest lists 108 files). Merge note: git merge-tree shows this conflicts with #344 (both edit the top of verify_manifest), so whichever lands second needs a rebase; it merges cleanly with #334. Ship. AI-assisted review.

**@⁠Oliwettoo** on GitHub · 2026-11-24 10:30 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/346#issuecomment-7128863926) Looks good. Applied on current `main`, `tests/test_manifest_verifier.py` passes. The per-file `same_report_path` loop is cheap here (the shipped manifest lists 108 files). Merge note: `git merge-tree` shows this conflicts with #344 (both edit the top of `verify_manifest`), so whichever lands second needs a rebase; it merges cleanly with #334. Ship. AI-assisted review.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 13:37 UTC · original

Merging.

Why merged: manifest_verifier also protects every file the manifest lists from being overwritten by cache writes (the companion to #334). Reviewed as good by Oliwettoo.

Why it's good: Its tests: 83 passed, 4 skipped, on its own and stacked with #334.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

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

**@⁠QemmHD** on GitHub · 2026-11-24 13:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/346#issuecomment-7133090298) Merging. **Why merged:** manifest_verifier also protects every file the manifest lists from being overwritten by cache writes (the companion to #334). Reviewed as good by Oliwettoo. **Why it's good:** Its tests: 83 passed, 4 skipped, on its own and stacked with #334. Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones). AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.