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

Merged
JiyouProt merged 1 commit from upstream-pr/346 into main 2026-11-24 13:37:13 +00:00
JiyouProt commented 2026-11-24 03:39:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by JiyouProt on 2026-11-24T03:39:42Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465629563 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/346). Originally posted by [JiyouProt](https://github.com/JiyouProt) on 2026-11-24T03:39:42Z. --- Claimed in the coordination issue as: [VERIFY-CACHE-INPUTS](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121173113) ### 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.
Oliwettoo commented 2026-11-24 10:30:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:30:05Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7128863926 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/346#issuecomment-7128863926). Originally posted by [Oliwettoo](https://github.com/Oliwettoo) on 2026-11-24T10:30:05Z. --- 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.
QemmHD commented 2026-11-24 13:37:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T13:37:10Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7133090298 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/346#issuecomment-7133090298). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T13:37:10Z. --- 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).
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!346
No description provided.