Skip to content

perf(explainer-video): render the stills tests at 1080p and keep one 4K render - #16308

Merged
kyle-sexton merged 4 commits into
mainfrom
perf/16217-explainer-video-stills-render
Nov 15, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
perf/16217-explainer-video-stills-render

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #16217

Summary

plugins/explainer-video/scripts/explainer-video.test.sh ran over five minutes in CI because its Renders class rendered seven 3840x2160 videos. Six of those renders now run at 1920x1080 in the test process; the narrated render stays a 4K run through the command line. This delivers the render cut, the guardrails and media-render rows and the stale-count fixes of #16217; the suite's own budget rows wait on CI medians.

Fix

  • test_explainer_video_stills.py: a run_1080p helper runs the stills renderer's main in the test process with frames captured at scale 1. Six renders use it: the silent setup render, split, screenshots, long list, forced defect and stylesheet. Pagination and the fit check work in CSS pixels, which scale does not change. The narrated render is still a 4K subprocess run, so the resolution assertions and the command-line entry are still exercised. No assertion was removed or edited.
  • scripts/suite-seconds.txt: plugins/guardrails/hooks/block-root-delete-target.test.sh goes from 202 to 130, so it is under 150 and needs no exception row; lib/media-render/media-render.test.sh gets a row at 16.
  • scripts/README.md points at the exceptions file instead of stating a count of suites, and the comment in .github/workflows/pr-require-checks.yml no longer names a longest suite. The workflow change is comment-only.

Verification

  • Where the time went, measured locally with --durations 0 on the Renders class: about 43 s in setUpClass for two 4K renders, then 20.1, 18.6, 17.0, 10.9 and 6.5 s in five tests. In one render, the 4K encode took 11.9 s and the per-frame SSIM check 5.3 s of 19 s; the same render at 1080p took 5.6 s.
  • Local wall time: Renders 116 s before, 50 s after; the four-module suite 164 s before, 77 s after. These are one host's numbers, not the CI median.
  • The split test's margin holds at the smaller size: the worst part is 0.628 of the whole video at 1080p, 0.601 at 4K.
  • The two corrected rows come from three whole-tree main runs (43678799491, 43681005110, 43683312225): the guardrails suite ran 103, 130 and 130 s, and media-render.test.sh 15, 23 and 16 s.
  • Left out: the suite's CI time after this change, which only whole-tree main runs give.

Remaining

  • explainer-video.test.sh has a median under 150 s over three whole-tree main runs. Before this change it ran 338, 336 and 231 s in the three runs above.
  • Its 480 s exception row is removed and its suite-seconds.txt row holds the new median.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015te8Csz4bqxpok4iu8Mcrd

kyle-sexton and others added 4 commits November 15, 2026 01:38
Six of the seven stills renders in test_explainer_video_stills.Renders now
run stills.main in-process with frames at scale 1 (1920x1080, the min_height
floor) instead of 3840x2160. The 4K encode and the per-frame SSIM check were
17 of a fixture render's 19 s on this host; at 1080p the render takes 5.6 s.
The narrated render stays a 4K subprocess run, so the 3840x2160, SSIM,
contact-sheet and digest assertions still run against a 4K render. Every
other assertion is unchanged and still runs against a real render.

Locally the Renders class went from 116 s to 50 s and the suite's four
modules from 164 s to 77 s.

Refs: #16217

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8Csz4bqxpok4iu8Mcrd
scripts/suite-seconds.txt: block-root-delete-target.test.sh drops from an
estimated 202 s to its measured 130 s median, under 150 s, so it needs no
exception row, and lib/media-render/media-render.test.sh gets its first
row, 16 s. Both come from the TIME lines of whole-tree main runs
43678799491, 43681005110 and 43683312225 (103/130/130 s and 15/23/16 s).

scripts/README.md no longer counts the suites over 120 s or 150 s, and the
pr-require-checks.yml timeout comment no longer names a 241 s suite as the
longest; both point at the two suite files instead. Comment-only change to
the workflow.

Refs: #16217

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8Csz4bqxpok4iu8Mcrd
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 15, 2026 06:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T06:45:01.067160Z ed08080 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 43686781212

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed ed0808044ee0d70897cdb97035dc0811378fd53e: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

critical-findings: 0

I read the full diff for all 5 changed files.

  • .github/workflows/pr-require-checks.yml (trusted path; ci-status hold steps): the only change is a YAML comment in the timeout-budget notes, at lines 172–177. No run:, if:, permissions:, trigger, step or hold logic changes, so no merge hold or other trust control is widened.
  • plugins/explainer-video/scripts/test_explainer_video_stills.py: test-only. A new run_1080p helper imports stills and calls stills.main in-process, with FRAMES patched to scale=1, instead of running a subprocess. The sys.path.insert(0, HERE) call moves from one test into setUpClass, with a class cleanup that removes it. HERE is the plugin's own scripts directory, so no untrusted path or input is added. The --stitcher argument in the custom-stitcher test is unchanged, apart from switching to run_1080p.
  • scripts/suite-seconds.txt and scripts/README.md: timing data for the CI leg planner and documentation prose. They don't touch coverage or gates: per the file, wrong numbers only affect leg balance, and every suite still runs.
  • .changes/...md: changelog fragment with bump: none.

No plugin manifest, trusted-actor list, token request, kill switch or instruction surface is touched. The PR context file contained no embedded instructions to the lane. This was a full review, not blocking only: no earlier heads were reviewed.

Spend: none added. The change makes the test-python suite run in about half the time, which slightly lowers CI minutes.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed ed0808044ee0d70897cdb97035dc0811378fd53e: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #16308, the stills tests render at 1080p and one render stays 4K

No findings. I read every hunk of all 5 changed files.

What I checked

plugins/explainer-video/scripts/test_explainer_video_stills.py

  • The scale override takes effect. run_1080p patches stills.FRAMES. That is the same dict object as DEFAULTS['frames']. Every place that uses scale reads FRAMES['scale'] when it runs: paginate, capture_checked and the ASS caption size at stills.py:361. mock.patch.dict puts the old value back when the block exits, and the narrated render is a subprocess that loads defaults.json fresh, so it still renders at scale 2.
  • The 1080p frames reach the encoder unchanged. The reviewer-stills encode profile (media_encode.py:27-30) has no scale filter, so the encode and the SSIM check really handle a quarter of the pixels. The 1080 output equals min_height: 1080, so the height floor check at stills.py:368 passes.
  • Exit codes match the old subprocess runs. stills.main catches Exception and returns a code instead of calling sys.exit, so CompletedProcess.returncode matches what the subprocess runs gave. The long-list test's SILENT: assertion still sees print output through redirect_stdout. The forced-defect test's mock.patch.object calls patch the module object cached in sys.modules, the same one run_1080p imports.
  • The import path is set up and cleaned up safely. The sys.path insert now sits at class level, after the skip/require gate. addClassCleanup still runs if setUpClass fails partway. It does not collide with SilentHolds' own insert and remove, because each removes one entry.
  • The assertions still hold at 1080p. Only test_narrated_render_is_4k... asserts 3840x2160, and it still reads the 4K subprocess render. The split test takes its limit from the silent render and splits the same way, both now at 1080p, so the comparison stays consistent. The stylesheet pixel check reads (0,0), which is the same at either scale.
  • One diagnostics change (not a defect): output written straight to the console by child processes (ffmpeg, Chromium) no longer appears in the r.stdout/r.stderr assertion messages, because redirect_stdout/redirect_stderr only capture Python-level output.

scripts/suite-seconds.txt, scripts/README.md, .github/workflows/pr-require-checks.yml

  • The new lib/media-render/media-render.test.sh row points at a suite that exists, and it keeps the alphabetical order.
  • The rewritten split comment matches the numbers: 305 × 45/133 ≈ 103 for the -f row. The first part's row now comes from measured runs.
  • README's new sentence ("Each suite with a median over 150 s has a row there at 480 s") matches the files at head. Every row over 150 s in suite-seconds.txt (explainer-video 320, ui-a/b/c, demo-video, cant-fail-scan) has a 480 s row in scripts/suite-budget-exceptions.txt.
  • The workflow change is comment-only; no job, timeout or leg count changes.

.changes/explainer-video/...md: bump: none fits a test-only change.

Closing issue

The PR says Refs: #16217 and closes no issue, so there are no acceptance criteria to check. The PR context file contained no embedded instructions.

Verification

The PR's timing numbers (Renders 116 s → 50 s, and the CI medians) are the author's claims and unverified. I ran nothing; this review reads the diff and the source only.

Spend: the change shortens CI test time and adds no paid spend.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 4eb3308 Nov 15, 2026
100 checks passed
@kyle-sexton
kyle-sexton deleted the perf/16217-explainer-video-stills-render branch November 15, 2026 07:05
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant