Skip to content

recording: pace drivers in content-time (lockstep follow-up)#22

Merged
borisbat merged 3 commits into
masterfrom
bbatkin/recording-content-time-holds
Jun 7, 2026
Merged

recording: pace drivers in content-time (lockstep follow-up)#22
borisbat merged 3 commits into
masterfrom
bbatkin/recording-content-time-holds

Conversation

@borisbat

@borisbat borisbat commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Follow-up to the lockstep-recording sweep (dasImgui #189 / #191, both merged). Converts the ImPlot recording drivers from wall-clock pacing to content-time, so beats match their intended length regardless of render rate and stay aligned with the voiceover.

Why

Under lockstep the recorder captures every rendered frame at a fixed 1/fps delay, so a wall-clock sleep(ms) yields render_rate/fps * ms of video (beats stretch on a fast machine and drift off the real-time voiceover). Content-time holds wait for ms/1000*fps captured frames, so a beat is exactly ms of video.

Changes (per driver)

  • Drop the local wall-clock def hold_remainder(dwell, t0) helper; use dasImgui's hold_remainder_content.
  • Anchor each beat in captured frames (record_frame_count) instead of ref_time_ticks.
  • Convert pacing sleep(ms)hold_content(app, ms) (leads, mid-beat dwells). Effect-waits (wait_for_mouse_idle / record_check_* / move_to) are untouched.
  • Drop a pre-existing unused require implot (STYLE030) that lingered in three drivers — required for the now-changed files to pass the CI lint gate.

record_drag_tools.das needs no change: it already paces every beat with say() (content-time since #191) and has no wall-clock holds.

Validation

All 10 drivers lint clean (-load_module dasImgui -load_module dasImguiImplot). Re-recorded two self-verifying drivers end-to-end:

line_plot       869 frames / 30 fps = 28.967 s exactly,  dropped 0, exit 0
query_and_hover 802 frames / 30 fps = 26.733 s exactly,  dropped 0, exit 0

exit 0 means every record_check_* gesture assertion passed → the content-time holds stay in sync with the synth mouse/scroll timelines.

🤖 Generated with Claude Code

Convert the ImPlot recording drivers from wall-clock pacing to content-time,
matching dasImgui's content-time helpers (now on master). Under lockstep the
recorder captures every rendered frame at a fixed 1/fps delay, so a wall-clock
sleep(ms) stretches a beat to render_rate/fps * ms of video and drifts it off the
voiceover; content-time holds wait for ms/1000*fps captured frames instead.

Per driver: drop the local wall-clock hold_remainder(dwell, t0) helper and use
dasImgui's hold_remainder_content; anchor each beat in captured frames
(record_frame_count) instead of ref_time_ticks; convert pacing sleep(ms) ->
hold_content(app, ms). Also drop a pre-existing unused `require implot` (STYLE030)
that lingered in three of the drivers (needed for the changed files to pass lint).

record_drag_tools.das needs no change -- it already paces every beat with say()
(content-time since dasImgui #191) and has no wall-clock holds.

Validated by re-recording line_plot (869 frames / 30fps = 28.967s) and
query_and_hover (802 / 30 = 26.733s): exit 0 (every record_check_* gesture assertion
passes -> content-time waits match the synth timelines), dropped 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ImPlot integration recording drivers to pace narration beats in content-time (captured frames) rather than wall-clock time, so recorded beat lengths remain consistent regardless of render rate and stay aligned with voiceover.

Changes:

  • Replaces wall-clock beat timing (ref_time_ticks() + sleep) with captured-frame timing (record_frame_count(app) + hold_content / hold_remainder_content).
  • Removes per-file hold_remainder helpers in favor of the shared hold_remainder_content.
  • Drops an unused require implot in the affected drivers to satisfy linting.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/integration/record_subplots.das Switches beat lead/hold pacing to content-time; removes unused require implot and local hold_remainder.
tests/integration/record_shaded_and_stairs.das Replaces wall-clock beat anchoring/holds with record_frame_count + hold_remainder_content.
tests/integration/record_realtime_scroll.das Anchors the narration window to captured frames and uses hold_remainder_content; removes unused require implot.
tests/integration/record_query_and_hover.das Converts beat timing to content-time and removes unused require implot.
tests/integration/record_multi_series.das Uses hold_content for lead-in and hold_remainder_content for beat remainder timing.
tests/integration/record_multi_axes.das Converts lead-in sleeps to hold_content and beat remainder to hold_remainder_content.
tests/integration/record_line_plot.das Converts lead-in and intra-zoom pacing from sleep to hold_content, and uses hold_remainder_content for beat remainder.
tests/integration/record_heatmap_histogram.das Switches beat anchors to captured frames and uses hold_remainder_content.
tests/integration/record_colormaps_and_style.das Switches beat anchors to captured frames and uses hold_remainder_content.
tests/integration/record_bar_groups_and_pie.das Converts lead-in and dwell sleeps to hold_content and uses hold_remainder_content for beat remainder.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

borisbat and others added 2 commits June 7, 2026 08:52
Re-records all 11 tutorial .mp4s on the content-time recording drivers
(matches the dasImgui content-time pacing rework). Even beat timing under
the lockstep fixed-dt clock; no wall-clock judder. line_plot driver was
already content-time in this branch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…l videos

Self-contained per-repo runner: Clean -> Prepare (TTS) -> Record -> Convert
for every tests/integration/record_*.das driver. Run one repo at a time;
defaults re-record the whole repo. Computes its own repo root from
$PSScriptRoot, resolves the sibling dasImgui checkout for the recording
infra + module, and picks up $env:DASLANG.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@borisbat borisbat merged commit 4c5772d into master Jun 7, 2026
5 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

Development

Successfully merging this pull request may close these issues.

2 participants