manifest_verifier: refuse cache aliases of the input manifest (VERIFY-CACHE-COLLISION) #334

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

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

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

What and why

Passing the same file to --manifest and --cache replaces the input manifest with cache JSON after reporting successful verification. Reject this configuration before hashing or writing, using report_paths.same_report_path so alternate path spellings, case aliases and links are also checked. The CLI exits 2 and preserves the original bytes.

Adds five synthetic regression tests. On the unchanged base, four fail and the symlink case is skipped on this Windows host. Based on main 84347bb; GitHub reports no merge conflicts.

Tested

Windows, Python 3.14.3:

  • python -I tests/test_manifest_verifier.py: 62 tests, 58 passed, 4 skipped.
  • python -I tests/test_report_paths.py: 22 tests, 20 passed, 2 skipped. The sandbox prevents hard/symbolic link creation; the other verifier skips are platform-specific.
  • Both suites also pass with Python 3.11.9: 80 passed, 4 skipped overall, including the new hard-link regression.
  • python -m compileall -q make_game.py tools tests, python -I make_game.py --help, scripts/check_no_game_data.py on both changed files, and git diff --check: passed.
  • python -I scripts/run_semantic_tests.py tests/semantic --jobs 8: completed in 501 s, 463 files and 6,075 tests run; 2 files failed (test_sopc_validation, test_unary_f16_validation) because spirv-as / spirv-val are unavailable. These translator files are unchanged by this PR.

GPUs tested: n/a. No game files used.

AI-assisted: yes, Codex.

Checklist

  • Based on main 84347bb and merges cleanly at submission.
  • One topic.
  • No game data, keys or decryption, including in fixtures and reports.
  • No new translator rule; contract table changes are not applicable.
**@⁠JiyouProt** on GitHub · 2026-11-24 03:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/334) `JiyouProt:codex/verify-cache-collision` → `main` · +57 −0 · 2 files · 1 commits · merged 2026-11-24 13:37 UTC Claimed in the coordination issue as: [VERIFY-CACHE-COLLISION](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why Passing the same file to `--manifest` and `--cache` replaces the input manifest with cache JSON after reporting successful verification. Reject this configuration before hashing or writing, using `report_paths.same_report_path` so alternate path spellings, case aliases and links are also checked. The CLI exits 2 and preserves the original bytes. Adds five synthetic regression tests. On the unchanged base, four fail and the symlink case is skipped on this Windows host. Based on main 84347bb; GitHub reports no merge conflicts. ### Tested Windows, Python 3.14.3: - `python -I tests/test_manifest_verifier.py`: 62 tests, 58 passed, 4 skipped. - `python -I tests/test_report_paths.py`: 22 tests, 20 passed, 2 skipped. The sandbox prevents hard/symbolic link creation; the other verifier skips are platform-specific. - Both suites also pass with Python 3.11.9: 80 passed, 4 skipped overall, including the new hard-link regression. - `python -m compileall -q make_game.py tools tests`, `python -I make_game.py --help`, `scripts/check_no_game_data.py` on both changed files, and `git diff --check`: passed. - `python -I scripts/run_semantic_tests.py tests/semantic --jobs 8`: completed in 501 s, 463 files and 6,075 tests run; 2 files failed (`test_sopc_validation`, `test_unary_f16_validation`) because `spirv-as` / `spirv-val` are unavailable. These translator files are unchanged by this PR. GPUs tested: n/a. No game files used. AI-assisted: yes, Codex. ### Checklist - [x] Based on main 84347bb and merges cleanly at submission. - [x] One topic. - [x] No game data, keys or decryption, including in fixtures and reports. - [x] No new translator rule; contract table changes are not applicable.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:53:58 +00:00
github manually merged commit 90b9fb86cc into gh-pr/334/base 2026-11-26 08:54:00 +00:00
Author
Owner

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

Looks good. This prevents real data loss: --cache pointing at the manifest (another spelling, hard link, symlink or case alias) would otherwise overwrite the input with the cache. It reuses same_report_path as CONTRIBUTING asks, and the CLI turns the ManifestError into exit 2. test_manifest_verifier.py and test_report_paths.py pass with the PR on current main. Merge note: this conflicts with #344 (git merge-tree), but not with #346, so whichever of #334/#344 lands second needs a rebase. Ship. AI-assisted review.

**@⁠Oliwettoo** on GitHub · 2026-11-24 10:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/334#issuecomment-7128777152) Looks good. This prevents real data loss: `--cache` pointing at the manifest (another spelling, hard link, symlink or case alias) would otherwise overwrite the input with the cache. It reuses `same_report_path` as CONTRIBUTING asks, and the CLI turns the `ManifestError` into exit 2. `test_manifest_verifier.py` and `test_report_paths.py` pass with the PR on current `main`. Merge note: this conflicts with #344 (`git merge-tree`), but not with #346, so whichever of #334/#344 lands second needs a rebase. Ship. AI-assisted review.
Author
Owner

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

Merging.

Why merged: manifest_verifier refuses a --cache path that aliases the input manifest (another spelling, a hard link, a symlink or a case alias), which would otherwise overwrite the manifest: a real data-loss guard. Reviewed as good by Oliwettoo.

Why it's good: Its tests: 82 passed, 4 skipped. It merges cleanly together with #346, which touches the same tool; the cumulative run includes both. Note from Oliwettoo: this conflicts with #344, which will need a rebase.

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:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/334#issuecomment-7133085724) Merging. **Why merged:** manifest_verifier refuses a --cache path that aliases the input manifest (another spelling, a hard link, a symlink or a case alias), which would otherwise overwrite the manifest: a real data-loss guard. Reviewed as good by Oliwettoo. **Why it's good:** Its tests: 82 passed, 4 skipped. It merges cleanly together with #346, which touches the same tool; the cumulative run includes both. Note from Oliwettoo: this conflicts with #344, which will need a rebase. 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.