Skip to content

Controls batch 16a: the session timeline, carried like a source; the browser's anchored seek and seek report - #1705

Merged
tamashi095 merged 9 commits into
mainfrom
codex/controls-batch-16a
Oct 16, 2026
Merged

tamashi095 merged 9 commits into
mainfrom
codex/controls-batch-16a

Conversation

@tamashi095

@tamashi095 tamashi095 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Controls batch 16a: the session timeline. The source crate gains the session's playhead, a timeline consumer and producer that share one written copy of the seek rules with the PCM sources. Every prepared plan, on both hosts, holds one timeline and carries it to a successor exactly as it carries an unchanged source. The browser engine module also exports the anchored source seek and the per-source seek report, through the same core calls as the C ABI. Nothing in render reads the timeline yet (the first reader is #1647). The session seek that moves it lands in batch 16b (#1642, #1643).

Closes #1640
Closes #1641
Closes #1293

What changed

Evidence

  • The full local CI-equivalent set (batch-gates.sh) passes at the 16a head 35a125e. It covers:

    • fmt, the bench policy, and the realtime policy (153 marked regions in 33 files);
    • the host-core feature matrix and loom;
    • workspace clippy (--all-targets --all-features -D warnings) and the workspace tests;
    • the doc job (cargo doc -D warnings);
    • all 15 shell gates, the web build, check-web-audioworklet, check-sdk-headless (564 of 564), the 7 Python gates and the fuzz check.
  • An earlier run at 454d656 (before the folds) failed only the doc job, on three private intra-doc links. The fold fixed them.

  • Browser qualification passes at 35a125e on Chromium 151.0.7922.34, Firefox 153.0 and WebKit 26.5 (--check-matrix --self-test-mutations). Render-locked allocations are 0 on all three (render and SDK rows).

  • audit capi: pcm_digest 4f52089e4a8cf83c, unchanged from main. 0 violations.

  • Realtime policy: 153 marked regions in 33 files (+2, Build the timeline consumer and producer in the source crate #1640's timeline regions; floor 151 -> 153).

  • Built artifact miso-engine-v1-audio-worklet.simd128.wasm at the 16a head: 4,203,669 bytes, sha256 ad535e83943d2bcaed785a743c5424e0a80cef0d3bf7fd3851b424638196c5b1 (the committed release pin is not re-pinned).

  • Export transaction apply and anchored seek from the browser engine module #1293 gate 7 asks for workspace clippy. The implementer ran clippy on two packages only. The batch gates' workspace clippy (--workspace --all-targets --all-features -D warnings) covers it at the 16a head.

Re-pins (each measured; reason: the timeline consumer's fixed bytes, #1641 D7)

The step is 480 B native (command queue 320, history 16 per entry, inline consumer 144) and 448 B on wasm32. The consumer is charged once, in the driver's allocation row. Each new ceiling is the measured value plus 10 %, rounded up to 64 B.

Pin Before After Ceiling
capi source_overhead_bytes (x86-64) 4,174 4,654 4,352 -> 5,120
host-web source_overhead_bytes (x86-64) 2,658 3,138 2,688 -> 3,456
host-web source_total_bytes (x86-64) 3,682 4,162 3,840 -> 4,608
expected.json sourceOverheadBytes (wasm32) 2,474 2,922 2,496 -> 3,264
expected.json sourceTotalBytes (wasm32) 3,498 3,946 3,648 -> 4,352

These stay inside their ceilings with no re-pin: capi source_total_bytes 12,366 -> 12,846, and capi_retained_bytes 167,754 -> 168,378 (ceiling 175,296). The identity source_overhead + carried_source_overhead == fresh holds. Browser boot high-water growth: 19,857,408 bytes, unchanged, within the 20 MiB pin (20,971,520).

Review

  • Batch review (opus-high, with three opus-xhigh reviewers running mutations): FAIL, no blocker, four majors, all folded in 90b76cf.
    • M1: timeline_block reported no step where a declared discontinuity steps the source-read clock back.
    • M2: the carry program's timeline flag had no test. A successor that carries no source would have restarted the timeline while the moved producer acked seeks: an ack before a drop.
    • M3: a timeline vacant on both sides refused every lane's carry.
    • M4: Feed and retire the sources a browser edit adds or removes #1297 D3 had the feed worklet's render path call source_seek_at, which runs the service step, and Send a session transaction to the browser control plane #1294 D1 named exports Export transaction apply and anchored seek from the browser engine module #1293 dropped. Both specs are amended: anchored seeks go through the message handler only, and Send a session transaction to the browser control plane #1294 applies through control_request_ptr / control_command.
    • Eleven minors were folded. These include: tests for the rate/quantum guard, a never-adopted timeline, a seek queued at the swap block and the reader's search order; unread report rows removed; two byte guards that had become vacuous; a behavioural test for the seek-report pointer; a name-swap mutation in the ABI self-test; check-session-map-shape.py excluding _ptr exports by rule; install_carry_program refusing a timeline carry with no source set; three tests with no unique catch deleted; private intra-doc links that failed the doc job.
    • M1, M2 and M3 each have a test that is red on the unfixed code.
  • Fold verification (opus-high, 14 mutations, all red): FAIL on one major. The M1 fix still missed a step-back where the node block reads before every held entry. Fold 2 (35a125e) adds the missing comparison, with K=2 and K=3 cases and a sweep over K 1..5 and five step-backs, red on the fold-1 reader. The verifier had checked this exact fix in a scratch copy, so there was no second verification round. The same commit folds three minors: re-anchored cites, the control-handler wake (miso.seek-at.v1) in Send a session transaction to the browser control plane #1294/Feed and retire the sources a browser edit adds or removes #1297, and record wording.

Issues to file from this batch's specs

Spec bodies to sync after merge

#1640, #1641, #1642 (batch 16 check, B16-R1, B16-R2), #1293 (batch 16 check, decision record), #1643 (batch 16 check, B16-R1, R5, R6), #1355 (B16-R3), #1294 and #1297 (batch 16a review amendments; the miso.seek-at.v1 wake is coordinator wording for their re-brief to confirm), #1704. Decision 17 ruling doc: C13 list (B16-R1).

🤖 Generated with Claude Code


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

tamashi095 and others added 9 commits October 16, 2026 12:24
35ac175

Moved anchors, landed dependencies (#1285, #1316, #1318, #1320, #1323,
#1396, #1317, #1319, #1562b), stale text against the code, and the
decision-17 points. No frozen decision is changed; open questions go to
root as rulings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R1: seven seek exports join decision 17 C13's approved list. R2: the
session seek's publish fence (#1642 paths and concurrency gate 1b). R3:
the timeline's readiness is the non-PCM test (#1641, #1355). R4: #1641
D6 deferred to placeholder TBD45. R5: the SDK chooses the generation
(#1643). R6: #1643 parity row. R7 is recorded in #1293's decision record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…engine module (#1293)

D5 miso_engine_web_v1_source_seek_at calls SessionState::seek_at, never
prepare_source_seek. D6 miso_engine_web_v1_source_seek_report and its
record pointer copy SessionState::seek_report into a 64-byte record with
the C miso_engine_v1_seek_report layout (root ruling R7). Both refuse a
host with no control half. D7 mirrors: EXPORTS 105 -> 108, the ABI layout
document gains the seekReport structure, the SDK mirrors are regenerated,
and the self-tests catch an omitted export. The parity row compares the
browser record with the C struct per block for plain, late and future
seeks at 48 and 96 kHz.

check-session-map-shape.py skips the record pointer by name: it takes
only the handle like a source-map count query but is not one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D1 factors the seek rules once: a private SeekState (active generation,
held seek, one observe for the Now, At and Hold clocks) shared by the PCM
source consumer and the timeline consumer, and a private SeekProducer
(check_seek, try_seek) shared by the PCM producer and the timeline
producer. PcmSourceProducer and HostChunkProvider gain check_seek.
D2-D5: TimelineConsumer (begin_block_at, timeline_at, timeline_block,
copy_history_from), TimelineProducer, TIMELINE_SAMPLE_LIMIT = 2^53 with
SourceSeekError::FrameOutOfRange (source.seek.frame_out_of_range), and
TimelineResourceReport. No plan holds the timeline yet (#1641); no
rendered bit moves. Realtime-policy region floor 151 -> 153 for the two
new marked regions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D1: every host-core plan's source set holds one TimelineConsumer with
K = ceil(A_max / q) + 1 from the floored input arrivals; the driver
advances it at block entry before the sources, from the source-read
sample. D2: SourceControlSet owns the TimelineProducer and
adopt_persisting moves it. D3/D4: a successor builds a vacant timeline
with its own history; GraphCarryProgram gains timeline: bool, and the
swap moves the seek state, command consumer and position and copies the
newest history entries, allocating nothing. D5 (B16-R3): the timeline's
readiness is the shared non-PCM test (SeekState::prime_window_clear),
also used by PcmSourceConsumer::prime_ready; its prime advances k blocks.
No production prime caller until #1355. D6 deferred to TBD45 (B16-R4).
D7: the timeline's fixed bytes join the source overhead. D8:
graph::test_only_timeline_at with a host-core test-support re-export.

Re-pins, each for the timeline consumer's fixed bytes (#1641 D7),
measured: capi source_overhead 4,174 -> 4,654 (ceiling 4,352 -> 5,120);
host-web source_overhead 2,658 -> 3,138 (2,688 -> 3,456) and
source_total 3,682 -> 4,162 (3,840 -> 4,608); wasm32 expected.json
sourceOverheadBytes 2,474 -> 2,922 (2,496 -> 3,264) and sourceTotalBytes
3,498 -> 3,946 (3,648 -> 4,352). audit capi pcm_digest unchanged
(4f52089e4a8cf83c).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M1: timeline_block reports the first sample where the timeline is not
the previous sample plus one, so a source-read step-back at a declared
discontinuity is a step (test red on the old reader). M2: a rebuild that
carries no source still carries the timeline (red without either flag
clause). M3: the timeline no longer blocks the other lanes' carry; it is
adopted only from an occupied predecessor into a vacant successor. M4:
#1297 D3 sends anchored seeks through the message handler only, and
#1294 D1 applies through control_request_ptr / control_command.
Minors: adopt_persisting doc states the vacant-timeline exception; two
byte guards no longer pass on the timeline queue alone; tests for the
rate/quantum guard, a never-adopted timeline, a seek queued at the swap
block and the reader's search order; unread TimelineResourceReport rows
removed (no charged byte moves); offset_timeline inside its policy
region; the seek report pointer export has a behavioural test; the ABI
self-test swaps seekReport field names; check-session-map-shape.py
excludes _ptr exports as a rule; install_carry_program refuses a
timeline carry on a plan with no source set; three tests with no unique
catch deleted; private intra-doc links fixed. pcm_digest unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M1 completed: where no held entry starts at or before s - 1, step_at also
reports a step when timeline_at(s - 1) + 1 != timeline_at(s), so a
source-read step-back that leaves the oldest held entry above the
lowest sample is a step. Tests: the K=3 and K=2 cases and a sweep over
K 1..5 and five step-backs (red on the fold-1 reader). Read bound
6K^2 + 10K + 1. #1294/#1297 amendment cites re-anchored to 90b76cf; the
publisher of an anchored seek also posts it to the control half as
miso.seek-at.v1. #1641 record wording; two rewraps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tamashi095
tamashi095 merged commit 4e35f5e into main Oct 16, 2026
22 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

1 participant