Commit Graph

33 Commits

Author SHA1 Message Date
8c890cc19f Merge pull request #2452 from kirigayakazima/codex/bink-names-duplicate-stream-locations
bink_names: reject duplicate stream locations before assigning names
2026-11-28 20:43:30 +01:00
df59232b30 Merge pull request #2451 from kirigayakazima/codex/bink-names-inactive-mount-entries
bink_names: ignore commented-out movie mount entries
2026-11-28 20:43:05 +01:00
12102bc1de Merge pull request #1635 from KoLolX3/fix/bink-unlistable-case
bink_names: recognize aliases of unlistable folders (BINK-NAMES-UNLISTABLE-CASE)
2026-11-28 15:46:03 +01:00
921212bc71 bink_names: reject duplicate stream locations before assigning names 2026-11-27 18:31:46 +08:00
46bd6c88bc bink_names: ignore commented-out movie mount entries 2026-11-27 18:31:18 +08:00
ec9b0967f5 Recognize folder aliases in Bink report guard 2026-11-24 22:35:58 -08:00
1b7344c20e bink_names: restore write mode before unlink on replace failure and publish mode on Windows (BINK-NAMES-STAGE-CLEANUP)
agent: yes
AI-assisted: yes
2026-11-24 16:49:08 +03:00
c95d935727 Merge pull request #4728 from rafaelpssz/fix/walk-bink_names
bink_names: a sub-folder the --out check cannot list is an error, not a silent skip (BUILD-1374)
2026-11-24 00:17:50 +01:00
833669159b bink_names: stage --out so a write failure keeps the previous report
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-23 23:05:19 +01:00
13671b7ac6 bink_names: refuse only an --out inside the folder the check cannot list
Any other unlistable folder is left to the scan, which stops on it with exit 1,
so the result no longer depends on whether the report already exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 15:38:36 -03:00
63f0e0dea3 Merge main into fix/walk-bink_names
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 15:36:26 -03:00
26ecd9f960 bink_names: reserve the carve manifest path before it exists (#6777)
Squash-merged after diff review of PR #6777
2026-11-23 10:45:00 -06:00
51931245d5 docs: point 15 more tools at their --help usage line (#5535)
Squash-merged after review of PR #5535 - docs: point 15 more tools at their --help usage line
2026-11-23 08:09:32 -06:00
f78f7d6a2a bink_names: a sub-folder the --out check cannot list is an error, not a silent skip (BUILD-1374)
When --out names an existing file, main() walks every source and mount
folder to make sure the report would not overwrite an input. That
os.walk had no onerror, so a sub-folder it could not list was skipped
and the check passed without having looked inside it: a report file in
that folder could be overwritten.

This is a safety check, so a folder it cannot list is an error: the
walk's onerror calls ap.error, which names the folder and exits 2
before anything is written, like the other "--out would overwrite ..."
refusals. The discovery walk in mount_documents() is left to #4176,
which already makes it fail on an unlistable folder.

The test forces os.scandir to raise PermissionError for one sub-folder
(chmod cannot lock a folder on Windows) and checks the exit code, the
folder in the message and that the existing report is untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:32:58 -03:00
d9a0d0867b Merge pull request #4176 from Marco Luzzaro
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:12:03 -05:00
bf8c5486fb Fail Bink name scans on incomplete mount discovery 2026-11-23 00:46:41 +01:00
5286ad1a0a bink_names: a pin or index source written with "\" on Windows still matches
Before the previous commit, bink_index wrote a nested source as "movies\x.bk2" on Windows, and
load_pins keys pins on the exact (source, offset), so a pins CSV or an index CSV/JSON made that way
would no longer match the "/" sources. load_pins and load_streams now turn "\" into "/" in the source
they read. Pointed out by JRamos1993 in the review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 02:25:02 +03:00
20303ef33f Merge pull request #3088 from cixotdev 2026-11-22 15:14:43 -05:00
3fb7bfd327 fix(bink_names): tighten confidence classification, 4k family normalization, and input checks
- Do not classify contradicted name-stream pairs (unary < 0) or pairs only
  adjacent to a contradicted sibling as "anchored" or "bracketed" in classify().
- Include _4k in FAMILY_TAIL so 4k clip names match their family siblings.
- Reject empty or whitespace/pipe-only pin rows in load_pins(), normalize backslashes
  and $(common)/movies/ prefixes, and reject negative offsets.
- Reject booleans, floats, negative offsets, and non-positive stream sizes,
  dimensions, or frame counts in _int() and load_streams().
- Add synthetic regression tests and negative controls in tests/test_bink_names.py.

AI-assisted with Argon (Antigravity).
2026-11-22 16:20:02 -03:00
a3e7a45054 bink_names: bound the unmatched tail of a movie list 2026-11-22 15:33:33 -03:00
1323a7b900 bink_names: validate --pins CSV rows and guard directory inputs from --out 2026-11-22 13:30:11 -03:00
016ed9abce Merge pull request #1824 from Tayar 2026-11-22 09:48:29 -05:00
376f17dffc bink_names: reject negative alignment skip counts 2026-11-22 11:26:12 -03:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.

AI-assisted (Claude), on behalf of dev-ewann.
2026-11-22 14:20:30 +00:00
c334c78477 tools: CSV reports end their lines with LF on Windows too
csv.writer and csv.DictWriter default to lineterminator="\r\n", and every
one of these tools opens its report with newline="", which turns that into
CRLF on Windows and LF elsewhere: the same archive gave different report
bytes depending on the machine that exported it. awc_manifest and awc_shorts
already pin "\n" and bink_index documents why its stdout writer needs it, so
this brings the remaining 16 writers onto the same convention. A structural
test keeps new writers on it, and three tools are run end to end to check the
bytes.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 07:13:06 -06:00
df16e5d653 Merge pull request #1593 from bbareth 2026-11-22 07:38:26 -05:00
97f7b5875d bink_names.py: report malformed stream indexes with the input path 2026-11-22 13:30:43 +01:00
fabc35aac7 Merge pull request #1532 from bbareth 2026-11-22 07:08:04 -05:00
c8020f2b01 Merge pull request #1503 from bbareth 2026-11-22 07:07:56 -05:00
1d218b1c6a bink_names.py: keep alternatives from repeated pin rows 2026-11-22 13:00:35 +01:00
99f99890c5 Register #291's M1 tests with ctest; awc_names and bink_names replace unencodable stdout
- d3d12_compute_test and d3d12_draw_test (built when glslangValidator is found) had no add_test, which
  test_ctest_registration catches; registered like their neighbours (exit 77 is a skip).
- awc_names.py (#1421) and bink_names.py (#1403) are new tools without #1428's stdout errors='replace' guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:59:37 -05:00
a0ab677fb3 bink_names.py: prevent reports from overwriting the pins CSV 2026-11-22 12:47:23 +01:00
c9650fe70b tools: name Bink 2 streams from the mount lists
The RPF9 TOC is encrypted, but each pack's CDataFileMgr__ContentChangeSetDef
mount list names its videos, and the archive stores them in the list's
lowercase-path order. bink_names.py aligns the sorted list with the streams
from bink_index.py (a monotone DP that may skip list entries held by other
packs), scores header facts (resolution hints, portrait snapmatic, family
siblings sharing a shape), and labels each row verified / anchored /
bracketed / positional. Mount lists are read from an archive or an
rpf9_carve.py directory through gamedata_index, so a list split over two
zlib streams stays whole.

On 1.0.2.1 it names all 797 streams in movies.rpf, story000.rpf,
story000_restofworld.rpf and core_restofworld.rpf. Tests are synthetic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:03:33 +01:00