audio_wav: fall back to decoder timing across Ogg sequence gaps #2460

Merged
kirigayakazima merged 1 commit from upstream-pr/2460 into main 2026-11-28 19:43:54 +00:00
kirigayakazima commented 2026-11-27 11:09:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T11:09:46Z.


Claimed in the coordination issue as: AUDIO-WAV-DISCONTINUOUS-PAGE-TIMING

What and why

Only derive a WAV trim length from the final Ogg granule when the page numbers advance consecutively within the stream. On gaps and repeated numbers, return the existing decoder-timing fallback. Cover a valid stream, missing and repeated page numbers, and 32-bit rollover. The page sequence field is described in RFC 3533, section 6.

Tested

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

  • python -I tests/test_audio_wav.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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5525621411 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2460). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-27T11:09:46Z. --- Claimed in the coordination issue as: [AUDIO-WAV-DISCONTINUOUS-PAGE-TIMING](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7216624385) ### What and why Only derive a WAV trim length from the final Ogg granule when the page numbers advance consecutively within the stream. On gaps and repeated numbers, return the existing decoder-timing fallback. Cover a valid stream, missing and repeated page numbers, and 32-bit rollover. The page sequence field is described in [RFC 3533, section 6](https://www.rfc-editor.org/rfc/rfc3533#section-6). ### Tested Windows, Python 3.14.7. The added regression failed on the parent and passed with this change. - `python -I tests/test_audio_wav.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 commented 2026-11-27 14:48:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-27T14:48:35Z.

Review: COMMENTED


Verified on the PR branch: python3 -m unittest tests.test_audio_wav -v -> 44 tests OK (4 skips), including the new decoder-timing fallback cases for Ogg sequence gaps. Not approving yet: the branch is 613 commits behind current main, so a merge would bring in unrelated history. Please rebase and re-run the suite.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6089881490 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2460#pullrequestreview-6089881490). Originally posted by [MSedgeMC](https://github.com/MSedgeMC) on 2026-11-27T14:48:35Z. **Review:** COMMENTED --- Verified on the PR branch: python3 -m unittest tests.test_audio_wav -v -> 44 tests OK (4 skips), including the new decoder-timing fallback cases for Ogg sequence gaps. Not approving yet: the branch is 613 commits behind current main, so a merge would bring in unrelated history. Please rebase and re-run the suite.
zmasi commented 2026-11-28 03:13:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T03:13:39Z.


#2460 | head bddbf24ee8 (merged cleanly with main 02f71ccfe) | python -I tests/test_audio_wav.py | red on main: FAILED (failures=2, skipped=5) in 44 tests (seqs=(0, 2, 3) and seqs=(0, 1, 1) returned 960 instead of 0) | green on PR+main: Ran 44 tests, OK (skipped=5) | Windows 11, Python 3.12.10 | AI-assisted: yes

Diff reviewed across both touched files ((sequence + 1) & 0xffffffff checks contiguous RFC 3533 page numbering including 32-bit rollover, and git merge origin/main at 02f71ccfe applies cleanly with zero conflicts). Also verified on merged PR+main: python -I tests/test_awc_opus.py (61/61 OK), python -I tests/test_runner_calls_all_tests.py (3/3 OK), python -I tests/test_text_write_line_endings.py (3/3 OK), git diff --check, and scripts/check_no_game_data.py (clean).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232899823 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2460#issuecomment-7232899823). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T03:13:39Z. --- #2460 | head bddbf24ee88d8d48154b054b183e9a8b9eb64be7 (merged cleanly with main 02f71ccfe) | `python -I tests/test_audio_wav.py` | red on main: FAILED (failures=2, skipped=5) in 44 tests (`seqs=(0, 2, 3)` and `seqs=(0, 1, 1)` returned 960 instead of 0) | green on PR+main: Ran 44 tests, OK (skipped=5) | Windows 11, Python 3.12.10 | AI-assisted: yes Diff reviewed across both touched files (`(sequence + 1) & 0xffffffff` checks contiguous RFC 3533 page numbering including 32-bit rollover, and `git merge origin/main` at `02f71ccfe` applies cleanly with zero conflicts). Also verified on merged `PR+main`: `python -I tests/test_awc_opus.py` (61/61 OK), `python -I tests/test_runner_calls_all_tests.py` (3/3 OK), `python -I tests/test_text_write_line_endings.py` (3/3 OK), `git diff --check`, and `scripts/check_no_game_data.py` (clean).
MoonEyes commented 2026-11-28 19:43:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:43:51Z.


Red/green: tests/test_audio_wav.py fails 2 assertions on main (explicit trim applied across Ogg page sequence gaps) and passes with the PR (cloud run on main 7daa4a4).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7244762955 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2460#issuecomment-7244762955). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T19:43:51Z. --- Red/green: tests/test_audio_wav.py fails 2 assertions on main (explicit trim applied across Ogg page sequence gaps) and passes with the PR (cloud run on main 7daa4a4). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2460
No description provided.