awc_opus: write Ogg pages incrementally to the staged file #2457

Merged
leonida/mandy
kirigayakazima merged 1 commit from codex/awc-opus-incremental-ogg-pages into main 2026-11-28 15:15:20 +00:00

Pull request successfully merged and closed

kirigayakazima commented 2026-11-27 11:09:34 +00:00

Claimed in the coordination issue as: AWC-OPUS-INCREMENTAL-OGG-PAGES

What and why

Feed encoded Ogg pages directly to the existing staged writer. The previous implementation kept every encoded page and joined them into a second complete buffer. On 3,072 synthetic packets, separate processes measured 3,337,055 versus 153,479 bytes peak traced allocation after input creation. SHA-256 and the final granule were identical. The regression checks that writing begins before the next page is encoded.

Tested

Windows, Python 3.14.7. The added regression failed on the parent and passed with this change.

  • python -I tests/test_awc_opus.py
  • Changed-path game-data scan and git diff --check passed. Shared main baseline: 6,374 semantic tests passed across 500 files.

GPUs tested: N/A (CPU-only).

AI-assisted: Yes.

Checklist

  • Based on current main and merges cleanly with the tested base.
  • One topic.
  • No game data, keys or decryption.
  • Translator contract table: N/A.
Claimed in the coordination issue as: [AWC-OPUS-INCREMENTAL-OGG-PAGES](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7216624385) ### What and why Feed encoded Ogg pages directly to the existing staged writer. The previous implementation kept every encoded page and joined them into a second complete buffer. On 3,072 synthetic packets, separate processes measured 3,337,055 versus 153,479 bytes peak traced allocation after input creation. SHA-256 and the final granule were identical. The regression checks that writing begins before the next page is encoded. ### Tested Windows, Python 3.14.7. The added regression failed on the parent and passed with this change. - `python -I tests/test_awc_opus.py` - Changed-path game-data scan and `git diff --check` passed. Shared main baseline: 6,374 semantic tests passed across 500 files. GPUs tested: N/A (CPU-only). AI-assisted: Yes. ### Checklist - [x] Based on current main and merges cleanly with the tested base. - [x] One topic. - [x] No game data, keys or decryption. - Translator contract table: N/A.
MSedgeMC reviewed 2026-11-27 14:49:33 +00:00
MSedgeMC left a comment
No description provided.
Verified on the PR branch: python3 -m unittest tests.test_awc_opus -v -> 62 tests OK, including the new incremental Ogg page-write cases. Not approving yet: the branch is 613 commits behind current main, so merging would drag in unrelated history. Please rebase and re-run the suite.
zmasi commented 2026-11-28 06:36:12 +00:00

#2457 | head 6be918469103236e5bbe3f6b3a6385a3dda50aae (merged cleanly with main 6dfca6428) | python -I tests/test_awc_opus.py | red on main: FAILED (failures=1: 6 != 1 in test_staged_writer_receives_ogg_pages_as_they_are_encoded) in 62 tests | green on PR+main: Ran 62 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Diff reviewed across both touched files (write_ogg_opus yields encoded Ogg pages directly into _write_file_parts's atomic staging file, and combining #2457 + #2456 together onto main 6dfca6428 auto-merges tools/awc_opus.py with 0 conflicts and passes 62/62 in test_awc_opus.py and 24/24 in test_awc_manifest.py). Also verified on merged PR+main: test_awc_manifest.py (23/23 OK, skipped=2), test_audio_wav.py (43/43 OK, skipped=5), test_runner_calls_all_tests.py (3/3 OK), test_text_write_line_endings.py (3/3 OK), compileall, git diff --check, and scripts/check_no_game_data.py (clean).

#2457 | head 6be918469103236e5bbe3f6b3a6385a3dda50aae (merged cleanly with main 6dfca6428) | `python -I tests/test_awc_opus.py` | red on main: FAILED (failures=1: `6 != 1` in `test_staged_writer_receives_ogg_pages_as_they_are_encoded`) in 62 tests | green on PR+main: Ran 62 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes Diff reviewed across both touched files (`write_ogg_opus` yields encoded Ogg pages directly into `_write_file_parts`'s atomic staging file, and combining `#2457` + `#2456` together onto `main` `6dfca6428` auto-merges `tools/awc_opus.py` with `0` conflicts and passes 62/62 in `test_awc_opus.py` and 24/24 in `test_awc_manifest.py`). Also verified on merged `PR+main`: `test_awc_manifest.py` (23/23 OK, skipped=2), `test_audio_wav.py` (43/43 OK, skipped=5), `test_runner_calls_all_tests.py` (3/3 OK), `test_text_write_line_endings.py` (3/3 OK), `compileall`, `git diff --check`, and `scripts/check_no_game_data.py` (clean).
MoonEyes commented 2026-11-28 15:15:17 +00:00

Red/green: classified READY by oreo-lot3 (red on main b1619e0a3, green on head merged with main); head 6be918469103 unchanged since 2026-11-27, before that run.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: classified READY by oreo-lot3 (red on main b1619e0a3, green on head merged with main); head 6be918469103 unchanged since 2026-11-27, before that run. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.