Skip to content

feat(timeline): sample-accurate clip-launch foundation#6463

Merged
shipyard-local[bot] merged 1 commit into
mainfrom
feature/timeline-clip-launch
Jul 22, 2026
Merged

feat(timeline): sample-accurate clip-launch foundation#6463
shipyard-local[bot] merged 1 commit into
mainfrom
feature/timeline-clip-launch

Conversation

@shipyard-local

@shipyard-local shipyard-local Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Header-only, real-time clip-launch engine and its authored launch model — the Phase-3 clip-launch foundation. Deliberately not wired into Project identity/serialization yet (that is the explicit follow-up slice).

What lands

  • core/timeline/include/pulp/timeline/clip_launch.hppLaunchQuantize (monotonic-domain grid + phase), Slot, and Scene value types describing what is launchable and how it quantizes. launch_immediate / launch_every_quarters / launch_every_bars helpers.
  • core/playback/include/pulp/playback/clip_launch.hpp — the RT engine:
    • next_launch_boundary resolves the next monotonic boundary (ceil onto the {phase + k*grid} set), saturating over a 128-bit intermediate.
    • resolve_launch_sample maps a target through the transport's half-open [monotonic_start, monotonic_end) ranges to a block-relative sample offset — the boundary on a loop wrap belongs to the post-wrap range, keeping resolution sample-accurate across the wrap. Includes a block-end rounding guard so an offset never equals frame_count.
    • LaunchHandle drives the Stopped → Armed → Playing → Stopping → Stopped state machine. Allocation-free, audio-callback safe.

Quantizing on the transport's monotonic clock (never wraps) is what keeps "launch at the next bar" well-defined when a rendered block straddles a loop wrap.

Tests (test/test_playback_clip_launch.cpp, 13 cases / 588 assertions)

  • Boundary math (on/just-past/just-before a grid point; phase offset; immediate).
  • resolve_launch_sample: mid-block exact offset, beyond-block nullopt, block-end deferral sweep, already-behind fire-now.
  • Sample-accuracy across a loop wrap (DoD): synthetic split snapshot — exactly-at-wrap (→ post-wrap range, half-open), strictly-inside-wrapped-base (→ 800 proves the wrapped base was used), and a one-sample-past-wrap off-by-one check (→ 501).
  • LaunchHandle end-to-end across a real loop wrap: a frame-granular run is ground truth (fire @ 500), and 1024/333/500/250-frame blocks (including a split-block boundary landing exactly on the wrap) all resolve to the identical absolute sample.
  • Immediate launch, armed-while-stopped, quantized stop, and an RT no-alloc probe on process().

Scope

Header-only foundation only. Follow-ups (not in this PR): Project/serialize integration, scene-launch arbitration, follow-actions, examples. Skill guidance for playback/timeline follows the integration slice (skip trailers on the commit record why).

🤖 Generated with Claude Code


🔎 Provenance

Agent claude
Machine m3
Tab Timeline v3
Directory /Volumes/Workshop/Code/pulp-cliplaunch
Session c66f4a64-25ea-42e5-b184-d48611a066a2

Resume

claude --resume c66f4a64-25ea-42e5-b184-d48611a066a2

Jump to this tab

cmux surface focus C0B3DA54-39AF-4DAA-8089-AA08DAB71968

Relaunch (any agent)

cmux surface resume get --surface C0B3DA54-39AF-4DAA-8089-AA08DAB71968

Restore URLhttps://claude.ai/code/session_01TVQHcnbg3t6TvXsdv6gXhS

stamped 2026-07-22 07:57 UTC

Header-only, real-time clip-launch engine and its authored launch model.

- timeline/clip_launch.hpp: LaunchQuantize (monotonic-domain grid + phase),
  Slot, and Scene value types describing what is launchable and how it
  quantizes. Deliberately not yet wired into Project identity/serialization.
- playback/clip_launch.hpp: next_launch_boundary resolves the next monotonic
  boundary; resolve_launch_sample maps a target through half-open transport
  ranges to a block-relative sample offset that stays wrap-safe across a loop
  boundary; LaunchHandle drives the Stopped->Armed->Playing->Stopping state
  machine. Allocation-free and audio-callback safe.

Quantizing on the transport's monotonic clock keeps "launch at the next bar"
well-defined even when a rendered block straddles a loop wrap: the boundary on
the wrap belongs to the post-wrap range under the half-open convention.

Tests cover the boundary math, mid-block/beyond-block/behind-block resolution,
the block-end rounding guard, sample-accuracy across both a synthetic and a
real loop wrap (with a frame-granular ground truth and a split-block case), an
off-by-one-at-wrap check, the launch/stop state machine, and an RT no-alloc
probe.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TVQHcnbg3t6TvXsdv6gXhS

Skill-Update: skip skill=playback reason="header-only clip-launch foundation; the monotonic-domain quantization and half-open loop-wrap convention are documented in the new headers, and no launch behavior is wired into a host yet — skill guidance follows the Project/serialize integration slice"
Skill-Update: skip skill=timeline reason="Slot/Scene are value types not yet wired into Project identity/serialization; nothing operational for a skill user until the integration slice"
Skill-Update: skip skill=web-plugins reason="no web-plugin surface touched; core/timeline + core/playback map here only via the web timeline source-closure check"
@danielraffel
danielraffel force-pushed the feature/timeline-clip-launch branch from 835b1ec to f3ece5d Compare July 22, 2026 07:59
@shipyard-local
shipyard-local Bot added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit c172afe Jul 22, 2026
30 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant