Repository navigation
Conversation
e1ecca5 to
99de22f
Compare
|
Verified on main a73a57e (Ubuntu 24.04 x86-64, Python 3.13, no GPU, no game data). Merges cleanly. With this PR, python -I tests/test_awc_opus.py: 62 tests OK. The PR's test file against main's tools: 1 error, so the new test fails on main and passes with the change. compileall clean. AI-assisted: yes (Claude Code) |
|
Thanks - that is the third independent verification of this one and the only one on Linux, so it covers the half the two Windows runs could not see. Recording what it establishes: on For the record, the claim in the body is measured on one machine only: a 1 MB bank with 29 outputs, first export 0.8 s, second run with the flag 0.23 s and 0 of 29 files rewritten, while the same export without the flag rewrites them. What that does not prove, and nothing here claims: that the skip is safe for a bank whose outputs are truncated mid-write (the writer publishes each file atomically, which is why an existing file is assumed complete) and that a resumed run over the full 664,446-file export behaves the same - neither has been run. Nothing to adjust on my side. Thank you for taking the time to run it on the platform where the stage's own resume logic is easiest to get wrong. Written with an AI assistant. |
99de22f to
67d19c6
Compare
|
Rebased onto current What the overnight CI drained to, on this branch and on the other three we have open:
New head after the rebase: So: one red job is the repository's ( Written with an AI assistant. |
67d19c6 to
3b79064
Compare
|
Rebased onto current The conflict was real and worth describing, because resolving it changes behaviour. Resolution: the skip now looks at the same de-duplicated name the write uses - target = os.path.join(od, stem + ".ogg")
if skip_existing and os.path.exists(target):
counts["music"] += 1
continueKeeping it on the raw id would have left a bank whose streams share an id rewriting Testing after the rebase: Gap I am not hiding: the PR's test covers a bank with distinct ids, and there is no test for the shared-id case that this resolution turns Worth noting for the record: the three verifications quoted above (two on Windows, one on Linux) were done against Written with an AI assistant. |
|
I tried to close the gap I mentioned above on my own rather than leaving it as an offer, and it did not work. Recording it so nobody thinks the What I attempted: a test in Why it does not work: the synthetic bank the test file builds ( What would be needed to do it properly: a way to build a bank with a music block and two channels sharing an id, which means extending the Written with an AI assistant. |
|
After the rebase, the red checks on this pull request are not from this diff: every job failing here is already failing on Measured, both sides from CI rather than from a local run:
What that establishes: the rebase did not introduce a red job, and anyone reading the checks can discount them when judging the change. What it does not establish: that the passing jobs exercise this diff. A green check on a job that does not touch the changed files says The state before the rebase was different and worth remembering: the same jobs were red then too, but the branch was also Written with an AI assistant. |
3b79064 to
56840e8
Compare
|
Heads refreshed:
Verification on the new base, run here rather than assumed: the runtime and the test target build from the rebased tree, and the pull request's own One thing I cannot state: GitHub was still recomputing mergeability when I pushed ( Written with an AI assistant. |
|
I covered the shared-music-ID case from your earlier comment at A separate CLI result for
The early |
|
The failing checks on this pull request are not its own failures: they are the three items that keep
Two things about how it is done, because they change how this lands:
The branch was also re-verified end to end after the merge, including the GitHub Actions tree on the current What this does not fix: the Written with an AI assistant. |
|
One of the failing checks was this change's fault, and it is fixed: It asserts the exact command line the assets stage builds for the Ogg Opus step, and this branch adds The flag is the point of the pull request, so the expectation is what was stale, not the code: a stopped export leaves most of the Ogg files written and Verified on the branch, not just reasoned: That was the only check on this pull request that came from its own diff. The rest were the three items that keep Written with an AI assistant. |
3738402 to
3ff8715
Compare
|
Ready state, for whoever picks this up: every check on this pull request is green. It also carries a fix that is not its own subject: Verified on the branch itself, not only in CI: Written with an AI assistant. |
|
You were right, and it is fixed in The bug, exactly as you described it: the early if cue_sheet and rate == 48000 and samples > 0:
frame_limits[cid] = min(samples, max(0, granule - pre_skip))so a cue sheet rebuilt by a later run described only the channels that run had written. With two music ids and one Ogg kept, the kept channel's cue disappeared from the sheet. The fix reads the granule back from the file that is actually there, rather than recomputing it from this run's packets - recomputing would describe a file that was not written: if skip_existing and os.path.exists(target):
counts["music"] += 1
if cue_sheet and rate == 48000 and samples > 0:
kept = ogg_last_granule(target) # the kept file's own EOS granule
if kept is not None:
frame_limits[cid] = min(samples, max(0, kept - pre_skip))
continue
A regression test, verified both ways -
Thank you for taking the CLI route - the unit tests I had never exercised a partially kept export, which is the only shape where this shows. Written with an AI assistant. |
…xport resumes awc_opus.py repacked every bank on every run, so a stopped assets run redid the whole Ogg Opus step: on one machine 664,446 .ogg files were already written and the restart began at bank 0. The stage marks the step done only after it finishes, so there was no per-bank resume. --skip-existing leaves an output that exists alone before packing a music channel or writing a stream's .ogg/.wav, and make_game.py passes it in the audio step. The staged writer publishes atomically, so an existing file is always complete. Measured on a 1 MB bank with 29 outputs: first export 0.8 s, second with the flag 0.23 s and 0 files rewritten, while the same export without the flag does rewrite them. tests/test_awc_opus.py covers that with the control.
The assets test asserted the command line without the flag this branch adds, so it failed as soon as the stage started passing it. The flag is the point of the change: a stopped export leaves most of the Ogg files written and no marker, and --skip-existing makes the restart keep the ones already done. Written with an AI assistant.
merzleckeier found it: the early `continue` on an Ogg that --skip-existing keeps also skipped `frame_limits[cid]`, so a rebuilt cue sheet described only the channels this run wrote. The kept file's own EOS granule is the authority - recomputing the limit from this run's packets would describe a file that was not written - so read it back with ogg_last_granule(). The regression test fails without the change. Written with an AI assistant.
3fcf87d to
8b605a7
Compare
|
Re-verified after the rebase onto What I did not test: the rest of the change, and anything the rebase did not touch. This confirms the rebase kept the change working, not that the change is correct - that is what the review and the CI are for. Written with an AI assistant. |
No content change.
|
I tested MEASURED. I used two synthetic banks, each producing two Ogg outputs. I stopped a subprocess immediately before its second staged file was published. Three complete outputs and one temporary file were present. The missing final path was absent. I set the complete files’ mtimes to a known value and resumed through the actual CLI.
A run without The stock audio suite passed 85 tests plus 68 subtests, and the focused |
merzleckeier measured it on CachyOS: --skip-existing --jobs 1 left 0 of 3 existing outputs alone, --skip-existing --jobs 2 rewrote 3 of 3. The submit call passed export_bank four arguments where the serial call passed five, so the flag never crossed into the pool. The unit test above it calls export_bank directly - the function, not the CLI - which is why the plumbing was not covered; the new test runs the tool as a subprocess for --jobs 1 and 2, freezes an output, and carries its own control (the same command without the flag must rewrite the frozen file).
|
You are right, and the fix is in: Reproduced here before changing anything, with a test that runs the tool as a subprocess (Windows 11, Python 3.13.14, same commit): Your table is the same finding on a different machine and a different Python, and I did not have it: my unit test calls So the commit is two things:
It has to be a subprocess, and that is worth knowing if you write a similar one: the suite imports the module under a test-only name, so an in-process pool cannot pickle Suites after the change, on this machine: The What changed in the record: head is Written with an AI assistant. |
tools/awc_opus.pyrepacked every bank on every run, so a stopped assets export redid the whole Ogg Opus pass from the beginning.--skip-existingleaves an output that exists alone, and the run resumes where it stopped.Measured on a 1 MB bank with 29 outputs, on this machine, when the change was written: first export 0.8 s; second run with the flag 0.23 s, 0 outputs rewritten. That timing was not re-run today - the run today was the test suite below.
What the change is:
--skip-existingskips a music channel whose output already exists, and skips writing a bank that is already on disk.ogg_last_granule), not from this run's packets: the earlier run wrote the file, so its granule is the authority, and recomputing from packets this run never encoded would describe a file that was not written.Files:
tools/awc_opus.py,make_game.py(the switch), and three test files (tests/test_awc_opus.py,tests/test_awc_markers.py,tests/test_make_game_argparse.py).Tested here:
The case that carries the weight is
test_skip_existing_leaves_written_files_alone: it freezes an output's mtime, runs with the flag, and asserts the file is untouched - with its own control in the same test, the same export without the flag does rewrite the frozen file. So the green result is not a skip in disguise.GPUs tested: none - this is the audio packing tool, no GPU path.
AI-assisted: yes - DeepSeek v4.1 (flash) as the coding agent, with a separate reviewer agent reading the change. Where and on what: the test run below is from today on Windows 11 with Python 3.13.14; the timing line is from the run that motivated the change, and is marked as such.
Not tested: the
make_game.pyswitch end to end on a real game export. The test asserts the argparse wiring, not a full assets run.Written with an AI assistant.