Repository navigation
totk: grow Opus decoder registry and protect decoder lifetimes - #40
Merged
ly05010419 merged 1 commit intoOct 19, 2026
Merged
Conversation
ly05010419
added a commit
that referenced
this pull request
Oct 20, 2026
…ultrawide HUD, 1.4.3 survey, mods, controls.txt) into the Breath of the Wild branch Resolved by hand: nvn_mtl.m (PR #34's paged-bitmap serial sets keep the serial forgetting of 635fb31: totk_serial_del clears a bit; the memory line shows both; the BotW frame reset stays in mtl_present), build_app.py (make -j and the per-game launcher defines), the Makefile (the BotW targets and the Opus test), loader.c (the #57 stale-reference handler and 1.4.3's survey return address are TOTK-only: Breath of the Wild has no GAME_ADDR for them), world_survey.c (BotW keeps its stub, with runtime_survey_sync), README (both update-history rows). Found by the merged build: Breath of the Wild lacked runtime_output_size_current (frontend.m's shortcut text) and runtime_survey_sync (hle_nvn.c); and the add-on content file handles shared fs_host.c's 0x200000000 range, so closing a host file at the title ended the game ("close invalid add-on content handle"): they now start at 0x400000000. Tested on the merged binaries: TOTK 1.2.1 jump session (anomalies 0, occlusion normal, serial set 48,606 / 13 pages), Breath of the Wild DLC + key 3 (k3a6) and key 2 (k2c, 11 of 12 pairs within 5 px). Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #18: preserve reinitialization of the same guest decoder, remove the remaining fixed-capacity abort, and protect decoder state during use.
The current 256-entry table still exits with
hardware Opus decoder table fullwhen 257 distinct decoder objects are live. The same reproducer succeeds with this change. Each live decoder now owns a stable allocated node, which is removed and freed at Finalize. Reinitialization replaces the existing node's libopus state, preserving the behavior and one-time diagnostic added upstream. Per-decoder locking makes reinitialization and Finalize wait for an in-flight decode/reset/getter, while independent streams can decode in parallel.Added
make test-opus-codec, which uses real Opus packets without game data or an audio device. On Apple Silicon / macOS 27, both commands passed:cd games/totk make test-opus-codec OPUS_TEST_WORK=/tmp/totk-opus-asan make test-opus-codec OPUS_TEST_WORK=/tmp/totk-opus-tsan OPUS_SANITIZERS=threadEach run covers 512 simultaneously live decoders, 3,517 balanced node creations/finalizations, 8,691 same-object reinitializations, 8 worker threads, and reinitialize/Finalize waiting for a paused in-flight decode. PCM matches an independent libopus decoder across all five supported sample rates and mono/stereo. Invalid-input handling and final-range corruption rejection are also checked. ASan/UBSan and TSan report no errors (55,667 checks per run).
The 1.4.3 native runtime also rebuilt and passed its module-loader probe. The original in-game exit was observed on an older 64-slot build; the 257-object failure above is a synthetic test of current main. Long-session gameplay after this change remains unverified.