A family is a base whose numbered suffixes hit ids in one bank: at
least 3 members, or 2 with adjacent numbers (docs/audio.md, the module
docstring). family_ok took each member's trailing number from the whole
name, so when the base itself ends in a digit its unsuffixed member got
a number too: amb_1 + amb_1_02 counted as the adjacent pair 1/2 and was
accepted, while the same shape on a base without a digit (horn +
horn_02) is rejected. Dictionary bases can end in a digit token.
Pass family_ok the members' suffixes, so the base's own digits never
count.
Tested: new test_a_digit_that_ends_the_base_is_not_a_member_number
(fails before for amb_1; two adjacent suffixes and three members on the
same base are still families).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Publish CSV and JSON name reports through a temp file + replace so a mid-write OSError leaves any prior complete report intact.
Co-authored-by: Cursor <cursoragent@cursor.com>
A --words .json file holding a JSON scalar (42, null, true) raised a
TypeError traceback from read_words and exited 1, because main() only
turns OSError/ValueError into the one-line exit-2 error. A JSON string
was read as one word per character. read_words now raises ValueError
for anything but an object or a list, so all of them take the existing
error path.
load_banks() now raises ValueError when the banks JSON is not a list of
objects, so main() prints one error line and exits 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
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>
- 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>
AWC stream tables keep only joaat(lowercase name) & 0x1FFFFFFF. With ~1.8M
distinct ids in a 2^29 space, ~0.3% of arbitrary words collide, so
awc_names.py accepts a hit only as an exact dialogue-wave word
(<root>au_<4 letters>_<NN>) or as a numbered family in one bank (3+
members or 2 adjacent, common-token base, one member a dictionary word).
A salted control run estimates the false names and sets each rule's
threshold per source.
The dictionary takes word lists or a hashdict.py JSON, and builds dialogue
wave names from conversation key/label pairs (<key>_01.._N per label).
Banks come from .awc files, directories or rpf9dump's audio_manifest.json.
On 1.0.2.1: 266,781 of 1.85M ids named (story000 73.7%, audio 5.7%),
with 417 control hits. Standard library only; tests are synthetic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>