Skip to content

Keep macOS wake capture at real-time speed across resumes - #2

Merged
aaamosh merged 3 commits into
mainfrom
fix/wake-pipeline-timing
Oct 5, 2026
Merged

aaamosh merged 3 commits into
mainfrom
fix/wake-pipeline-timing

Conversation

@aaamosh

@aaamosh aaamosh commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Why

The first post-merge macOS run exposed an intermittent wake-capture failure: after resume, the ARM runner delivered only 18 of the required 25 PCM blocks within seven seconds. All delivered blocks were acknowledged; the detector was ready and its queue stayed empty.

Failing main run

Timing instrumentation then reproduced a running Web Audio context whose render clock advanced only 8–16 ms during roughly 500 ms of wall time. This localizes the problem to audio rendering rather than Python backpressure or a changed wall clock; it does not establish the exact internal CoreAudio/Chromium defect.

Changes

  • Use a silent Web Audio sink for wake analysis, with a 0.1-second latency hint. Wake capture has no audible output. Chromium chooses the actual callback buffer; 100 ms is a request, not a promised device buffer size.
  • Exercise four suspend/resume cycles in native package acceptance.
  • Use monotonic deadlines and bounded PCM/acknowledgement timestamps to distinguish acquisition delays, stream stalls, and downstream backpressure.
  • Require the established stream's first 25 blocks to span 2.4 seconds ±500 ms, in addition to the existing 25-acknowledged-blocks-in-seven-seconds gate. Startup is excluded. The shorter restart check uses the same rule for 10 blocks.
  • Keep the optional read-only Web Audio clock observer off in standard package acceptance.

The renderer regression test still checks selected microphone input, unmodified nonzero PCM, acknowledgements, and cleanup. New cadence tests reject a continuously slow stream even when it meets the old count deadline.

Native investigation and rejected intermediate candidate

A silent sink with the default interactive buffer passed the old count-only gates, but delivered audio substantially slower than real time. Commit 6f4695c was therefore not accepted for release despite green CI. A live input FIFO can discard audio when its consumer falls behind.

A same-host, sequential comparison with debugging disabled then tested the default output and silent outputs with explicit buffer requests on both architectures:

Native host Default output, first-to-25th block Silent sink, 0.1-second hint
Apple Silicon One resumed stream took 6.229 s 2.345–2.410 s across initial capture and four resumes
Intel 2.394–2.512 s in this run 2.369–2.576 s across initial capture and four resumes

The PCM interval represented is 2.4 s. The 0.25-second hint also worked in the comparison; the smaller tested request was sufficient. These diagnostic comparisons inform the fix and do not replace full package acceptance.

Both native comparisons

Validation

Final source: fe50d2596c72d92a875c71086ce9283eb12ce1e5.

  • Focused local regression checks: 18 passed; syntax, public-source audit, and whitespace checks passed.
  • Linux CI: 394 tests passed, zero failures or skips, package builds and bundled CLI verification passed.
  • Native macOS acceptance: 394 tests and all 11 package gates passed on each architecture, first attempt, debugging disabled.
  • In the packaged apps, all initial/resumed 25-block cadence checks passed: 2.340–2.416 s on ARM and 2.332–2.444 s on Intel, for 2.4 s of PCM intervals. Both 10-block restart checks passed.
  • Every capture closed, no callbacks arrived after close, all detector processes were reaped, and there were no cleanup errors. The intentional stalled-reader test reached the expected bounded backpressure error and recovered cleanly.
  • GitHub tested merge commit 99f44807c8b80dfb69a56601b3501137ac0ecde0, whose tree 64e6adff11dcd11cb3e3aaebcbbe1bf123602375 exactly matches the final PR head.

Merged as f5520ecf1b9d170d086698a4ed665de45685146e. The published Preview 2 and its additional post-merge validation are recorded below.

Post-merge release validation and publication

The first Preview 2 publication run stopped before creating a release. In run 37339490068, ARM passed the strengthened PCM pipeline and nine other gates, but GUI wake startup failed at approximately its 15-second deadline. The existing report could not identify the unfinished startup operation. Intel separately failed while downloading Electron, followed by repeated artifact-service network timeouts.

Released source 0b9924b adds bounded, local startup-stage evidence and requires four fresh GUI captures, preserving the original deadlines and immediate cancellation. Packaging reuses cached Electron archives with checksums from the pinned npm package, avoiding a second remote checksum request. The primary download still requires network access. These additions do not establish the cause of the isolated GUI startup timeout.

  • Targeted regression checks: 37 passed.
  • Linux release-source CI: 404 tests passed, zero failures or skips, with package and bundled CLI checks successful.
  • Native release-source acceptance: both unit/source-audit steps succeeded and all 11 package gates passed on each architecture. ARM explicitly reports 404/404. The fetched Intel log omits its last test lines/footer, so its exact total is not independently asserted here.
  • Both packaged apps passed four fresh GUI captures and four pipeline resumes, with debugging disabled. All eight GUI captures became ready within 0.53 seconds, received PCM, and closed without late callbacks.
  • For the expected 2.4-second PCM interval, the five initial/resumed measurements were 2.324–2.365 seconds on ARM and 2.341–2.514 seconds on Intel. Both restart checks passed, every detector process was reaped, and no capture windows or cleanup errors remained.

The first publisher attempt created an empty draft and stopped on its immediate metadata readback. Later independent reads matched the exact source, title, notes, author and empty asset inventory. Only that publisher job was resumed, using the same original run artifacts. Job 111878337803 succeeded, verifying all seven uploaded sizes and SHA-256 digests before publication. The original mismatching API response was not retained; its precise cause remains undetermined.

Download macOS Preview 2. The public tag resolves to the exact tested source 0b9924b014d4c46271647e95d97806811fb45229. All seven assets and the release body were read back after publication. Preview 1's tag, notes, sizes and digests remain unchanged. Closeout be423d5 retires the completed publication job and adds direct README downloads.

These are ad-hoc signed previews tested with synthetic audio on macOS 15. Ventura runtime, physical devices, real permission prompts, sleep/unplug recovery, user-session Login Items and real account calls remain hands-on acceptance items.

Final main verification

Final main commit be423d51a8974627d66b98a5c63a27199cecbefd passed Linux CI and both native macOS jobs on their first attempt. All three logs explicitly report 404 tests passed, zero failures or skips; both Mac builds pass all 11 package gates, four fresh GUI captures, four pipeline resumes, cadence checks, and clean teardown. The native job definition and application runtime are unchanged from the released source by this documentation/workflow closeout.

All seven public Preview 2 files were independently downloaded over anonymous HTTPS, with HTTP 200, exact byte counts and SHA-256 matching GitHub metadata. All six entries in the downloaded SHA256SUMS match the streamed bytes, and both downloaded manifests identify the clean released source 0b9924b014d4c46271647e95d97806811fb45229. No native binaries were rebuilt for publication recovery.

aaamosh and others added 2 commits October 5, 2026 20:21
Preserve the 25-block/7-second gate while recording bounded PCM, acknowledgement and Web Audio clock evidence. Exercise four resume cycles in native package verification.

Co-authored-by: ChatGPT <noreply@openai.com>
Use Chromium's silent AudioContext sink for input-only wake analysis. Preserve the 16 kHz PCM and acknowledgement path. Keep optional CDP clock diagnostics disabled during normal native package acceptance.

Co-authored-by: ChatGPT <noreply@openai.com>
@aaamosh aaamosh changed the title Diagnose and stabilize resumed wake capture verification Keep macOS wake capture independent of the playback clock Oct 5, 2026
Request a 0.1-second latency hint for the software-clocked silent output. Native ARM and Intel comparisons confirm near-real-time PCM across four resume cycles.

Require steady PCM cadence as well as the existing count deadline so a continuously slow stream cannot pass package acceptance.

Co-authored-by: ChatGPT <noreply@openai.com>
@aaamosh aaamosh changed the title Keep macOS wake capture independent of the playback clock Keep macOS wake capture at real-time speed across resumes Oct 5, 2026
@aaamosh
aaamosh marked this pull request as ready for review October 5, 2026 16:14
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@aaamosh
aaamosh merged commit f5520ec into main Oct 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant