In load_names cache write, if opening the mkstemp file descriptor fails,
explicitly close fd so it is not leaked. On os.replace failure, reset os.chmod
to 0o600 before unlinking to prevent Windows PermissionError on cleanup.
agent: yes
AI-assisted: yes
load_names had bink_names write its report to one fixed file next to the cache (bink_names.tmp.csv)
and staged the cache in one fixed .part file. Two lookups at once (two bink_play.py processes, or two
threads) used the same files: the second removed the report before the first read it, so the first
stopped with "bink_names.py failed" although both runs of the name tool returned 0. Found by shdann
in the review of #4014.
Each lookup now gets its own report and staging file from tempfile.mkstemp in the cache folder; the
report is removed in a finally block, and an empty report still counts as a failure, as a missing one
did. The new test holds one lookup between its report being written and read while a second one runs:
on the old code the first fails, now both get their own names and only the cache file is left.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bink_play.py kept the name table keyed by the archive's stamp alone, so a run with a different
--mount (another mount-list XML, or a changed common.rpf) was served the names of the previous mount
source from the cache. The key now holds the mount file's stamp (path, size, mtime) as well. A table
written in the old format has a header that no longer matches, so it is rebuilt, not misread.
tests/test_bink_play.py names the streams from old.xml, then from new.xml, with hand-built inputs and
a stubbed bink_names, and checks the second run is not served from the cache; it also checks that an
old-format table is treated as a miss.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- shader_disasm: prune stale listings against every input, not the --skip-existing remainder (a resumed run
deleted every listing it had just reused).
- progress_dashboard: a drive-letter path is never inside the repository off Windows (it printed user names);
its own read_text helper is read_utf8, so the encoding check does not take it for pathlib's.
- Translator tests follow this round's rules: desc_lookup's BroadcastFirst in the typed-load condition walker;
resinfo sizes are 0 past the last level and a 2D depth word is 0 (SHADER-388); SHADER-315 constant folding in
the perm and i16 tests; #2089's structured wave64 emulation.
- test_semantic_translator_use: 57 oracle-only files merged before it are DEBT; test_spirv_tools_required is
allowed (CI meta-test).
- Test fixes: image_fuzz fake writes the programs, preflight follows c506d00c's loader hint rule, feature_scan
reads the first line of a pytest-decorated message, w64_graphics wording.
- docs: rows merged again in design.md, README.md, d3d12_vulkan.md; GameInput table rebuilt from #3172's rows;
orphan rows in models.md and embedded_shaders.md; repeated bullets; anchors; a flag not on main.
- Repo rules: stdout guard on 14 programs; LF writes; csv lineterminator in bink_play.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/test/bink_play.cpp maps the package's Bink2Scarlett.dll with rt::Loader
and plays a .bk2 at its frame rate (GDI window; pause, seek, loop). A movie
inside an archive plays where it is: archive.rpf@OFFSET goes to BinkOpen with
BinkSetFileOffset and the BINKFILEOFFSET flag, so nothing is extracted.
tools/bink_play.py finds the offset from the movie's name (bink_names.py).
CTest runs the headless smoke, which skips without a package and movie.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>