feat(timeline): sample-accurate clip-launch foundation#6463
Merged
Conversation
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
force-pushed
the
feature/timeline-clip-launch
branch
from
July 22, 2026 07:59
835b1ec to
f3ece5d
Compare
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.
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.hpp—LaunchQuantize(monotonic-domain grid + phase),Slot, andScenevalue types describing what is launchable and how it quantizes.launch_immediate/launch_every_quarters/launch_every_barshelpers.core/playback/include/pulp/playback/clip_launch.hpp— the RT engine:next_launch_boundaryresolves the next monotonic boundary (ceil onto the{phase + k*grid}set), saturating over a 128-bit intermediate.resolve_launch_samplemaps 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 equalsframe_count.LaunchHandledrives theStopped → Armed → Playing → Stopping → Stoppedstate 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)resolve_launch_sample: mid-block exact offset, beyond-blocknullopt, block-end deferral sweep, already-behind fire-now.LaunchHandleend-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.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/timelinefollows the integration slice (skip trailers on the commit record why).🤖 Generated with Claude Code
🔎 Provenance
claudem3/Volumes/Workshop/Code/pulp-cliplaunchc66f4a64-25ea-42e5-b184-d48611a066a2Resume
Jump to this tab
Relaunch (any agent)
Restore URL — https://claude.ai/code/session_01TVQHcnbg3t6TvXsdv6gXhS
stamped 2026-07-22 07:57 UTC