Skip to content

feat(browser): expose bounded read-only PCM observation - #439

Open
tamashi095 wants to merge 5 commits into
codex/dx-sdk-bootfrom
codex/dx-pcm-observation
Open

feat(browser): expose bounded read-only PCM observation#439
tamashi095 wants to merge 5 commits into
codex/dx-sdk-bootfrom
codex/dx-pcm-observation

Conversation

@tamashi095

@tamashi095 tamashi095 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Expose a bounded read-only PCM observer for the app’s existing input-source spectrum. Each observer uses its own cursor and reusable scratch chunk, skips raced/stale data, and leaves every playback shared word unchanged. Existing feed counters gain the already-present fields needed by the app’s diagnostics.

Dedicated Astra medium PASS. Focused/type/package/headless checks pass; the post-copy guard mutant fails at the intended slot-reuse assertion. All six generated artifacts and PCM worklet bytes are unchanged. No new graph tap, FFT, wire layout or render work.

Related:#434; stacked on#432. App adoption remains separate.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@tamashi095

Copy link
Copy Markdown
Contributor Author

SDK #434 independent Astra medium review

PASS at 7e1713ec (implementation acf30599). Reviewed the frozen #434 spec and its complete bounded diff. No source/spec changes, Rust rebuild, artifact repin, or extra browser matrix.

The observer shares the existing ring validator and maintains only local cursor, scratch and metadata state. Constructor/pull/counters/close do not store/add any shared word or write shared PCM. Independent cursors begin at the currently live read index and catch up using the existing wrap domain. Candidate attempts, including invalid/stale slots, consume the fixed 1..32 budget. Scratch planes and metadata are constructed once and reused; callback data does not expose shared PCM. Close drops ring/scratch ownership and preserves only the final counter snapshot; closed pulls are zero and callback reentry is refused.

The copy admission checks cover sequence, generation/tag, frame bounds and live interval. After copying, the observer rechecks the live interval as well as sequence, seek epoch, tag and copied metadata. This specifically rejects reservation/zeroing of a consumed slot before the writer publishes its new sequence. Full seek generation is checked when the low generation tag repeats. The focused fixture covers mono/stereo and partial tails, independent readers, missed data/wrap, invalid-slot budget, seek/torn candidates, reusable identities, shared-byte preservation, closed no-op and constructor/view allocation traps. The three counter additions read their existing named wire words and correctly disclaim multiword atomicity.

Independent validation:

  • node --test sdk/test/browser-pcm-evals.mjs: 8/8 PASS, /private/tmp/dx434-review-focused.log.
  • bash scripts/check-sdk-types.sh: PASS, /private/tmp/dx434-review-types.log.
  • bash scripts/sdk-package.sh check /private/tmp/dx-393-current-artifacts: PASS, including generated checks, 11 CLI tests, strict extracted consumer types and public observer runtime/shared-byte assertions; /private/tmp/dx434-review-package.log.
  • Independent isolated discriminator: unmodified source copy passes the existing during-copy race test. Removing only the post-copy live-interval rejection while retaining all sequence/generation checks fails with delivered raced PCM. The hook advances READ_INDEX and reserves/zeroes the consumed slot while its old sequence remains published. This confirms the required non-sequence-only oracle is meaningful. Copies/logs: /private/tmp/dx434-review-mutants/ (green exit 0, sequence-only exit 1).
  • All six staged generated artifacts are byte-identical to the approved artifact directory; their manifest lengths/digests match. PCM prelude equals its staged copy and has no baseline diff, as does generated source. /private/tmp/dx434-review-bytes.log.

The author's full headless result of 160 passed / 1 existing skip is retained in the issue; this independent proportional review does not claim another full headless run. No concrete bug was found within the source-spectrum observation contract. Checkout remains clean. This PASS covers the SDK observation boundary, not downstream app spectrum integration or issue closure bookkeeping.

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