Skip to content

Scored scene-timing benchmark on the real clock - #70

Merged
jmjava merged 2 commits into
mainfrom
cursor/scene-clock-benchmark-75a9
Aug 15, 2026
Merged

Scored scene-timing benchmark on the real clock#70
jmjava merged 2 commits into
mainfrom
cursor/scene-clock-benchmark-75a9

Conversation

@jmjava

@jmjava jmjava commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Why

Past timing fixes passed unit tests (string checks on compiled source, a Python simulator) and still failed in production. Those tests never ran the compiled construct() against the real _TimedScene clock.

What

A standard corpus plus a scorer you can re-run after every clock / compile change:

docgen benchmark
# or
./scripts/benchmark-scenes.sh

No bundle, no Manim, no OpenAI. The harness execs compiled construct() with stub mobjects and the actual _TimedScene methods from BOOTSTRAP_HEADER.

Case Role
issue66_tight_clamped Tight words must not skip waits
issue66_tight_unclamped Control — unclamped compile still dumps (scorer is not blind)
early_title 0.55s first label vs title Write
wide_hold Long holds pulse more than once
emphasis_none Author opt-out stays still
paged_slide Slide transition does not skip the next wait
flow_edges Grow + edge-to-edge arrow still paces
audio_tail Last box keeps moving through a long tail

Scores are diffed against src/docgen/benchmark_data/baseline.json. Exit 1 if defect_points rise, quality_points / mid_hold_pulses fall, or the control case stops failing.

validate / generate-all preflight also execute the compiled clock when timing.json words exist (clock: issues).

After an intentional improvement: docgen benchmark --update-baseline and review the JSON diff.

Required for future changes

This is now a hard gate, not a suggestion:

  • CI job benchmark in .github/workflows/ci.yml runs docgen benchmark
  • tests/test_scene_benchmark.py fails if that job is removed
  • AGENTS.md Required gate section + .cursor/rules/docgen-benchmark.mdc (alwaysApply: true)

Tests

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 15, 2026 14:12
Add `docgen benchmark` and `scripts/benchmark-scenes.sh` so clock and
compile changes are measured, not guessed. The harness executes compiled
construct() with the real `_TimedScene` methods and stub Manim mobjects.
A committed baseline fails the command when wait-skips, overshoots, or
hold pulses regress. A control case keeps the historical issue #66 dump
visible so the scorer cannot go blind.

Co-authored-by: jmjava <jmjava@gmail.com>
Add a dedicated CI job that runs `docgen benchmark`, lock that job in
tests so it cannot be deleted quietly, and make the command a required
gate in AGENTS.md and Cursor rules.

Co-authored-by: jmjava <jmjava@gmail.com>
@jmjava
jmjava marked this pull request as ready for review August 15, 2026 16:39
@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@jmjava
jmjava merged commit 55fb792 into main Aug 15, 2026
6 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