Repository navigation
Controls batch 15c: seeks anchored on the source-read clock, prime check and replay, seek contract docs, source-read clock, seqlock loom model (#1316, #1320, #1317, #1396, #1702) - #1703
Merged
Conversation
…here it landed - begin_block_at's anchor is the source-read sample (equal to the render clock in this version). - Render publishes one seek report per ring through the engine's one single-writer seqlock (new crates/engine/src/realtime/seqlock.rs, B15-R1; watermark.rs moved onto it): generation in effect, source-read sample and source frame of its first block, cumulative underrun and held frames. - C ABI: miso_engine_v1_source_seek_report (struct miso_engine_v1_seek_report, 64 bytes; feature bit 1 << 8, mask 0x1ff); frozen symbol list 18. Browser export is out of scope per the spec (#1332, #1293). - seek_report_bytes resource row (64 B per ring on 64-bit, 56 on wasm32); no ceiling moved. realtime policy floors 32/150 -> 33/151. audit capi pcm_digest unchanged (4f52089e4a8cf83c). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndependent of #1332 (root ruling) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rime - spsc Consumer::peek (shared read, changes nothing; unit and loom tests). - source: prime_ready (read-only readiness walk) and prime_block_at (plays the blocks the consumer would have played, observing no command), PcmSourcePrimeFlag shared by the handle and the consumer, prime_required_bytes report row (24 B per ring on 64-bit, 12 on wasm32). - 0 allocations for readiness and sixteen primes; realtime policy unchanged (151/33); audit capi unchanged (4f52089e4a8cf83c). Callers are #1355's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ader Eleven seek paragraphs on the source-read clock (equal to the render clock in this version), the ABI growth comment (B15-R3), the qualification record, and abi_smoke.c tests each defined feature bit instead of the exact mask. #1355 note: amend the clock sentence and call prime_ready on the source-read sample when the offset becomes nonzero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plan carries a source-read offset: the source section reads at render sample + offset (checked; overflow is TimeOverflow). The inventory records it; an ordinary successor inherits it and a discontinuity successor resets it to 0 (runs_behind_natural_timing gains the offset term). Render publishes the active plan's render and source-read clocks after each block (two Release stores into a preallocated record, 32 B native / 24 B wasm32); PlanPublisher reads them. In production the offset stays 0 until #1355; the header's "equal to the render clock in this version" stays true. realtime policy 151/33; audit capi unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd redundant ffi pin, clock-pair snapshot note, rewraps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
seqlock.rs takes its atomics and fences from the realtime sync shim (spsc.rs's mod sync, now visible inside crate::realtime), so loom models the protocol; a non-loom build resolves to the same core items. Loom model seqlock_loom_a_read_is_one_whole_record_or_busy (one writer, two records, one reader): a read is one whole record or Busy. Under cfg(loom) only, a read takes 2 attempts instead of 64 so loom can finish (4.3 s). Red with the reader's Acquire fence, the second sequence compare or the writer's Release fence removed (torn records). CI: a seqlock loom step next to the SPSC leg. No ordering changed; realtime policy 151/33. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # crates/source/src/lib.rs
…agraphs and the policy comment; the clock-pair doc says a reader needing both would need them published as one seqlock record Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l index (Ms6 -> Ms7, #1396 added impl PlanClocks above it; count unchanged; owner-approved) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Controls batch 15c: the source and latency chain's second half. Every seek is anchored on the plan's source-read clock, and a host can read where each seek landed. A plan carries a source-read offset that a successor inherits and a declared discontinuity resets. A source consumer can check and replay its next blocks for a prime. The C header documents the seek contract and the ABI growth rule. The engine's one seqlock is modelled under loom. This PR sits on batch 15b and merges after it.
Closes #1316
Closes #1320
Closes #1317
Closes #1396
Closes #1702
What changed
begin_block_at's anchor is the source-read sample (equal to the render clock in this version). Render publishes one seek report per ring: the generation in effect, the source-read sample and source frame of its first block, and the cumulative underrun and held frames. It goes through the engine's one single-writer seqlock (newcrates/engine/src/realtime/seqlock.rs, B15-R1;watermark.rsmoved onto it; record size unchanged). C ABI:miso_engine_v1_source_seek_report, structmiso_engine_v1_seek_report(64 bytes; the struct cannot share the function's name in C),FEATURE_SOURCE_SEEK_REPORT= 1 << 9 (batch 15b's Reset latency floors at a host-declared discontinuity #1323 took bit 8 first), mask 0x3ff, frozen symbol list 19. The browser export is Export transaction apply and anchored seek from the browser engine module #1293 D6 in batch 16, with a parity row against the C struct, independent of Run the browser control plane in a Worker and keep the AudioWorklet render-only #1332 (root ruling); the browser cannot seek through the core before Export transaction apply and anchored seek from the browser engine module #1293 either.spsc::Consumer::peek(a shared read that changes nothing; unit and loom tests).source:prime_ready(a read-only readiness walk) andprime_block_at(plays exactly the blocks the consumer would have played and observes no command), a prime flag shared by the handle and the consumer, and theprime_required_bytesreport row (24 B per ring on 64-bit, 12 B on wasm32).abi_smoke.cnow tests each defined feature bit instead of the exact mask. Every sentence was checked against the code.TimeOverflow). The inventory records it; an ordinary successor inherits it and a discontinuity successor resets it (runs_behind_natural_timinggains the offset term). After each block render publishes the active plan's render and source-read clocks (two Release stores into a preallocated record, 32 B native, 24 B wasm32). No reader needs the two as a consistent pair (checked in review: the planned callers Adopt a warm successor with a raw-frame prime at the first ready block #1355, Fall back to the transition when a warm successor is not ready by its deadline #1358, Check the warm-successor deadline in miso_engine_v1_service and report its outcome #1360 and Check the warm-successor deadline in the browser Worker's service loop and report its outcome #1361 each read one); the doc says a reader that needs both must use the seqlock.seqlock.rsruns through the engine's sync shim, and a loom model (one writer, one reader) proves a read never returns a torn record. CI runs it in the realtime race-model job. Undercfg(loom)only, a read takes 2 attempts instead of 64 so loom can finish; shipped builds keep 64. Red with the reader's Acquire fence, the second sequence compare or the writer's Release fence removed (loom finds torn records[1, 2]/[0, 1]). No ordering changed. Known limit: a cargo test filter that matches no test passes, so a rename that drops theseqlock_loomprefix would run nothing (the SPSC leg has the same exposure).Evidence
batch-gates.sh) passes at 8e73689 (the tree of ae580b0): fmt, bench and realtime policy (151 marked regions in 33 files), host-core feature matrix and loom, workspace clippy, the workspace tests, the doc job (cargo doc -D warnings), all 15 shell gates, the web build,check-sdk-headless(564 of 564), the 7 Python gates and the fuzz check.check-web-audioworkletfailed there only becauseINDIRECT_SITESpinsenter_block's mangled name, and Give a plan a source-read clock that leads its render clock #1396'simpl PlanClocksmoved it fromMs6toMs7; the site count stays 4 and the trap owners and panic entries are unchanged. The pin edit (c48cc38, owner-approved, made by root) renames the key;check-web-audioworkletpasses at c48cc38. Later commits change comments and docs only (doc job and realtime policy re-run green).--check-matrix --self-test-mutations); render-locked allocations are 0. Two earlier Firefox failures ("spectrum collection audio resume timed out") came from the local harness, not from 15c: its PulseAudio socket path was 119 bytes, over the 108-byte Unix limit, so the null sink never opened and Firefox'sresume()waited for an audio server that did not exist (bisection: the result depended on time, not on the commit; with the socket up, 15c's head and its parents pass 2 of 2). The harness now uses a short path and stops if the socket is missing.audit capi: 0 allocations, deallocations, locks and syscalls;pcm_digest4f52089e4a8cf83c(unchanged from batch 15b).seqlock.rs's publish).spsc_loom15 of 15 (with the newpeekmodel);seqlock_loompasses (4.3 s test time).Re-pins (each from a measurement)
seek_report_bytes(64 B per ring on 64-bit, 56 B on wasm32),prime_required_bytes(24 B / 12 B) and the clock record (32 B / 24 B); every host-web and C ABI ceiling holds (tightest: browsersourceOverheadBytes2,474 of 2,496).Review
Issues to file from this batch's specs
model-the-engine-seqlock-under-loom(lands and closes in this PR).Spec bodies to sync after merge
#1316, #1320, #1317, #1396, #1293 (D6 amendment), #1355 (note), #1702.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.