Review follow-up from #934: the bank export directory check ran after
os.makedirs, so a refused run left an empty output folder. Both
collision checks now run first, and a test checks that out/ is not
created.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ools/awc_shorts.py previously published <out>/shorts.csv without
checking whether the catalog path collided with an input bank. When
an input was named shorts.csv or exported into a directory of that
name, publishing the catalog replaced the source input file with CSV
output and exited 0.
Verify upfront using same_report_path() that <out>/shorts.csv does
not alias any input bank or bank export destination directory, refusing
the collision with error diagnostic and exit code 2 before creating
directories or exporting clips.
Add regression tests covering input bank and directory export collisions.
AI-assisted: yes.
(cherry picked from commit 2496beffe5)
Windows waits on a pool's workers with WaitForMultipleObjects, which takes
at most 64 handles. With --jobs 62 or more, awc_opus.py, awc_shorts.py,
world_lights_paths.py and world_build.py stopped with "ValueError:
max_workers must be <= 61" (ProcessPoolExecutor), and anim_clips.py
(multiprocessing.Pool) printed "ValueError: need at most 63 handles" from
a helper thread and never returned: 62 workers were killed after 60 s where
61 finish in 0.8 s (Windows 11, Python 3.12.5).
awc_opus.py and awc_shorts.py default --jobs to half the CPU count, and
make_game.py hands its own --jobs to awc_opus.py, so a machine with 124
logical CPUs reached this with no option given.
tools/pool_workers.py holds the limit, and the five pools are created with
process_workers(jobs): unchanged elsewhere, 61 at most on Windows. The
job count is lowered rather than refused so that a build with a large
--jobs keeps running. world_census.py, which refuses --jobs above 61, is
not changed.
tests/test_pool_workers.py runs each tool's own code: with the limit
patched in and a recording pool (every platform), the audio tools from the
command line with --jobs 62, and the real pool with 62 jobs on Windows.
8 of its 10 tests fail on the tools as they were.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").
tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parse_awc raises struct.error on a bank shorter than its header claims.
awc_shorts caught ValueError, OSError and IndexError around each bank but
not struct.error, so one truncated bank ended the run with a traceback and
shorts.csv was never written. It is reported and skipped like the other
malformed banks now, in the serial and the pool path, as awc_manifest and
awc_opus already do.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A source path that did not exist printed a skip line, exited 0 and replaced an
existing shorts.csv with a header-only file. A NaN --min-seconds or
--max-seconds passed the range check (every NaN comparison is false), so the
run exited 0 with every clip filtered out.
Both are now one-line errors with exit 2, checked before the output folder is
created. Two regression tests in tests/test_awc_shorts.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>