Repository navigation
Conversation
mstan
approved these changes
Oct 21, 2026
mstan
left a comment
Member
There was a problem hiding this comment.
Reviewed lock order, recursion prevention, tick-wrap handling and rearming on actual PCM consumption. The host wait is bounded and bypassed for inactive consumers, fast-forward and speculative frames. Production audio-delivery, APU-port guest-time and all four DSP trace-gate variants pass. This does not establish the cause of the earlier X2/X3 startup delay.
Validation: five-head integration passed 826 Python tests (2 skipped) and 109 Rust tests. After excluding #198 for its separate title-save compatibility blocker, the four-head combination passed all 69 focused tests. Linux, Windows, macOS and Lua CI are green for this reviewed head. No new cross-title gameplay playtest is claimed.
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.
Audio callbacks can run without consuming native PCM. Previously, that callback activity rearmed the desktop producer's stall timeout, potentially adding another 250 ms at each later checkpoint.
Add optional host producer-wait registration and invoke the desktop callback after releasing the outermost APU mutex. Bound waits with wrap-safe ticks and rearm stalled pacing only after FIFO consumption. Preserve inactive-consumer, fast-forward, and speculative-frame bypasses. A thread-local guard prevents recursive entry when the host callback inspects the FIFO under its mutex. Pacing does not discard PCM or alter guest clocks.
Validation:
python -m pytest tests/test_audio_producer_pacing.py -q: 2 passed. The original callback-only stall behavior was reproduced before the fix.tests/runtime_dispatch/run_apu_port_guest_time_test.ps1: passed.tests/audio/run_dsp_trace_gate_test.ps1: all four variants passed.Validation limits: the completed broad local run had 755 passed, 6 skipped and the same 36 environment failures as the baseline (shell discovery/compiler environment). A corrected-PATH retry was stopped in the scaffolder. The existing audio trace matrix also failed
audio_trace_clock_gate_test_0(wall calls with path stats: got 0, want 7); SDL3 headers were unavailable. No hardware-device or ROM playback qualification is claimed here. A permanently stopped consumer intentionally allows execution after the bounded wait, so existing FIFO overflow remains possible.Extracted from ISSD Native's audio-upload investigation and adapted to current upstream pacing. No obsolete handshake API, timing-model replacement, or commercial game content is included. See docs/audio-producer-backpressure.md for host integration and reproduction.