Skip to content

bink_play: honor --no-cache without persistent storage (BINK-NO-CACHE) - #566

Merged
aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
JiyouProt:codex/bink-no-cache
Nov 25, 2026
Merged

aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
JiyouProt:codex/bink-no-cache

Conversation

@JiyouProt

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: BINK-NO-CACHE

What and why

--no-cache still consulted the persistent cache path, created its parent directory and placed the temporary names report there. Thus listing with caching disabled failed if that cache directory was unavailable (reproduced with an existing file at the directory path), and a successful uncached lookup still created persistent directories.

Only resolve, read and create the persistent cache when caching is enabled. Uncached lookups use the system temporary directory and retain the existing report cleanup on success and failure. Existing cache contents remain untouched. The cached path, invalidation keys and concurrent lookup behavior are unchanged.

Four synthetic regressions cover CLI listing with an unusable cache directory, no directory creation, preservation of an existing cache and cleanup after report-generation failure. All four fail on the original source.

Tested

Windows 11 build 26300.9974, Python 3.14.3, based on main 1c93c86.

  • python -I tests/test_bink_play.py: 14 passed, including the existing cache/invalidation/concurrency tests.
  • python -I tests/test_text_write_line_endings.py: 3 passed.
  • Full semantic suite with SPIRV-Tools available: 465 files, 6,107 tests, 0 files failed (515 s, 8 jobs).
  • compileall, both make_game.py --help and bink_play.py --help, changed-file no-game-data scan and git diff --check: passed.
  • Adjacent test_bink_names.py: 35/36 passed. The Windows path-representation assertion in test_unreadable_mount_directory_preserves_the_report fails identically in an untouched checkout of the same main. This is already covered by tests: expect the unreadable path as OSError prints it (bink_names, opus_tags, world_names) #312 and is independent of this change.

GPUs tested: n/a — only synthetic CSV/XML fixtures, no movie data, codec or GPU needed.

AI-assisted: yes, Codex.

Checklist

  • Based on current main at task start and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • No translator rule changed.

@kirigayakazima

Copy link
Copy Markdown
Contributor

Reviewed on Windows 11 x64 (Python 3.14.7, CPU only, synthetic fixtures only — no game files) against head commit 58d6fe27c11ebea71ac3c443353662445ba5eff9.

Verdict: Looks good — --no-cache now avoids reading, creating, or writing anything in the persistent cache directory and stages temporary bink_names output in the system temporary directory with cleanup on both success and failure.

Checks run locally

  • Clean merge with main (21625bca): git merge-tree --write-tree upstream/main HEAD exited 0; git diff --check upstream/main...HEAD clean.
  • Compatibility with bink_play: clean up failed cache writes (BINK-CACHE-CLEANUP) #568 (09867f49): git merge-tree --write-tree HEAD <PR-568-head> exited 0 (both changes in tools/bink_play.py compose cleanly with no conflicts).
  • python -I tests/test_bink_play.py -v: 14 tests, OK.
  • python -I tests/test_ci_registration.py: 15 tests, OK.
  • python -I tests/test_text_write_line_endings.py: 3 tests, OK.
  • python -I scripts/check_no_game_data.py tools/bink_play.py tests/test_bink_play.py and python -m compileall -q tools tests: clean (exit 0).

Additional Windows edge-case probes

  • LOCALAPPDATA pointing to a regular file with --no-cache --list: exited 0, printed synthetic stream entry, left the blocker file untouched, staged .tmp.csv under the system temp folder, and left no temporary files behind.
  • Corrupt existing cache file under load_names(..., use_cache=False): skipped cache lookup cleanly, returned fresh parsed entries, and left existing cache bytes intact.
  • Nonzero bink_names.main return (rc=2) under use_cache=False: raised SystemExit, removed the temporary report from system temp, and did not create the cache directory.

AI-assisted: yes

@JiyouProt

Copy link
Copy Markdown
Contributor Author

Rechecked head 58d6fe2 against current main 58be9cd on Windows / Python 3.14.3. It merges cleanly. On the combined tree: test_bink_play 14/14, test_bink_play_cache_write 3/3, CI registration 15/15 and LF writers 3/3 pass; changed-file no-game-data and whitespace checks are clean. CI registration was run outside the local sandbox because it needs Git Bash.

I also merged #840 (d6cee3e, the fd-cleanup follow-up to #568) into that local integration tree: no conflicts, test_bink_play 16/16 and test_bink_play_cache_write 3/3 pass. Thus the no-cache behavior here composes with that cache-error cleanup. No code or branch update is needed for #566. Synthetic inputs only, no GPU or game files. AI-assisted with Codex.

@aslan2142
aslan2142 merged commit c606788 into ProjectLeonida:main Nov 25, 2026
1 check passed
@aslan2142

Copy link
Copy Markdown
Collaborator

Merged, thanks! The new test fails on main and passes with this.

  • Checked on main 8c40e3b7a + 58d6fe27c: the semantic suite passes (491 files, 6,312 tests, 0 files failed); test_bink_play pass; the 15 docs and writer tests pass; check_no_game_data.py is clean on the 2 changed files.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants