Repository navigation
awc_opus: probe the new-file mode once per folder, check codec 0 sizes (ASSET-355) - #4399
Conversation
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
…nnels * 2 Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 69485269 on Windows 11: python -I tests/test_awc_opus.py -> 49 tests, OK; git diff --check clean.
A codec 0 stream whose data size is not samples * channels * 2 is now refused with the expected size, and the new-file probe runs once per folder; the existing audio tests pass. No blocking issue.
|
Tested 6948526 on Windows 11, Python 3.12: pass.
Hand-built banks only, no game data. AI-assisted (omp orchestrator). |
|
PASS ( A refusing folder fails only that bank ( Minor: the per-folder probe cache is unbounded (one int per folder, so small), and the padding risk is unverified without game data. Approve. AI-assisted review, no game files, no GPU. |
|
Heads-up, non-blocking: |
…d replace Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
|
@bobcatchris thanks for leaving it to this PR. Done in Regression
|
Claimed in the coordination issue as: ASSET-355 (claim)
What and why
Two small fixes in
tools/awc_opus.py, one commit each:published_mode()fell back tonew_file_mode(dir)for every new output, which creates and deletes a probe file each time. That's one per output, about 1.6M over the corpus. The mode is now cached per output folder insideawc_opus.py, and the sharedfile_mode.pyis untouched. On APFS, 5,000 writes took 1.31 s before and 0.80 s after; NTFS with Defender is probably worse.samples * channels * 2now takes the same "not handled" path as codec 2.Worth checking by someone with their package: the codec-0 check isn't confirmed against the 19 real codec-0 streams yet. The WAV count should stay at 246. If a real stream carries padding, it would now be refused. I'll run it on my own copy when it's ready, unless someone gets there first.
Tested
macOS 27.0.1 (Apple M3 Pro), Python 3.14:
python -I tests/test_awc_opus.py: 49 OK. The probe test counts the probe files actually opened (5 onmain, 1 here). The codec-0 test uses a synthetic bank with 401, 399 and 400-byte streams (3 WAVs onmain, 1 here).test_audio_wav,test_awc_manifest,test_awc_shorts,test_opus_tags,test_file_mode,test_pool_workersand the repo-wide guards OK.Synthetic banks only. AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (no translator change)