Skip to content

Editor suite step 0: guard plain auto-clipping before the editor work - #218

Open
ColinGPT9 wants to merge 1 commit into
mainfrom
editor-suite/step-0-guardrails
Open

ColinGPT9 wants to merge 1 commit into
mainfrom
editor-suite/step-0-guardrails

Conversation

@ColinGPT9

Copy link
Copy Markdown
Owner

Step 0 of the editor suite (docs/editor-suite/): the checks that every later editor step is held to, so plain auto-clipping can't change by accident while the new editor is built. No app code changes.

What's in it

  • Argv snapshots (tests/render_harness.py, tests/test_render_argv_snapshots.py)
    • Every FFmpeg/ffprobe command a render would run is faked and recorded, together with the ASS caption text and the saved render options, for both the CPU and NVENC encoders.
    • The 14 light-tier cases run in the Python job.
    • 9 cropper modes and a 15-case pipeline matrix run in the Plugin platform job: plain, captions, word highlight, cuts, speed, music, hook, text and image watermarks, colour, letterbox, center, landscape, vertical live and gaming.
    • Snapshots change only with --update-snapshots. A missing snapshot fails.
  • Import guard: nothing that core/pipeline.py loads, directly or through other modules, may import the new editor's project model.
  • i18n check for the new editor folder: no bare JSX text and no literal title/placeholder/aria-label.
  • scripts/golden_renders.py: bit-exact CPU renders of a generated 10 s source, recorded and checked on one machine.
  • scripts/bench_render.py: wall time, CPU time, RAM, VRAM and file size per render case, on CPU and NVENC.
  • docs/editor-suite/: research, decision records, the tracker (state.json), status, a benchmark how-to, and the user guide skeleton.

How it was checked

  • Independent QC
    • A CI-light run of the whole suite: compileall and ruff are clean, and the new tests pass or skip cleanly.
    • 27 failures appear only on the Windows dev PC. They are the same on main, which QC showed in a throwaway worktree.
  • Mutation proof: QC changed four things in turn, and the snapshot tests failed each time and passed after each revert. The four changes were the x264 CRF, a caption style default, the music duck ratio and the vertical scale. The golden check also caught the CRF change.
  • Determinism: snapshots pass under four hash seeds and in reverse order. No real process is launched. Linux is first checked by this PR's CI.
  • Golden renders: 4 cases, identical from run to run.
  • Import guard: it now catches an import of the project model inside a module the pipeline uses, and reports the chain, for example core.pipeline -> video_editor.timeline.

Baseline numbers (dev PC, CPU encoder)

Real 1080p60 clips come to 48–54 MB per minute, so a vertical clip passes WoopSocial's 100 MB limit after about 2.1 minutes (#203). NVENC wasn't available on that PC, because the bundled FFmpeg needs NVIDIA driver 610 or newer.

Found in existing code (not changed here; recorded in docs/editor-suite/STATUS.md)

  • Ducked music ends early: up to 0.26 s early, by a different amount each run (sidechaincompress stops when either input ends).
  • Clips carry 96 kHz audio after loudnorm, so the shipped 48 kHz end cards are rebuilt on first use.

🤖 Generated with Claude Code

Adds the checks every later editor step is held to, and the editor
suite's working documents. No app code changes.

- Argv snapshots (tests/render_harness.py, tests/test_render_argv_snapshots.py):
  every FFmpeg/ffprobe command a render runs is faked and recorded, with
  the ASS text and saved render options, for the CPU and NVENC encoders.
  14 light-tier cases run in the Python job; 9 cropper modes and a
  15-case pipeline matrix run in the Plugin platform job. Snapshots
  change only with --update-snapshots; a missing one fails.
- Import guard: nothing core/pipeline.py loads, directly or through
  other modules, may import the editor's project model.
- i18n check for the new editor folder: no bare JSX text or literal
  title/placeholder/aria-label.
- scripts/golden_renders.py: bit-exact CPU renders of a generated
  10 s source, recorded and checked on one machine.
- scripts/bench_render.py: render timing, RAM, VRAM and file size per
  case, CPU and NVENC.
- docs/editor-suite/: research, decisions, tracker (state.json),
  status, benchmarks how-to and the user guide skeleton.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clips-kitty-web Ready Ready Preview Nov 5, 2026 2:25pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
clips-studio Ignored Ignored Preview Nov 5, 2026 2:25pm UTC

Comment thread scripts/bench_render.py
"""CPU seconds of a Windows job object holding this process: every process
it starts afterwards joins the job, and the job's totals keep the time of
processes that have exited. None when the job cannot be set up."""
import ctypes
Comment thread scripts/bench_render.py

info["physical_cores"] = psutil.cpu_count(logical=False)
info["ram_gb"] = round(psutil.virtual_memory().total / 2**30, 1)
except ImportError:
Comment thread scripts/bench_render.py
for stream in (sys.stdout, sys.stderr):
try:
stream.reconfigure(encoding="utf-8", errors="replace")
except (AttributeError, ValueError, OSError):
Comment thread scripts/golden_renders.py
num, _, den = value.strip().partition("/")
try:
timebase[stream] = float(num) / float(den)
except (ValueError, ZeroDivisionError):
Comment thread scripts/golden_renders.py
for stream in (sys.stdout, sys.stderr):
try:
stream.reconfigure(encoding="utf-8", errors="replace")
except (AttributeError, ValueError, OSError):
Comment thread tests/render_harness.py
would load a model or read real footage."""
original = getattr(owner, name)

def stand_in(*args, **kwargs):
Comment thread tests/render_harness.py
try:
resolved = path.resolve()
forms |= {str(resolved), resolved.as_posix()}
except OSError:

This branch was successfully deployed

1 active deployment
Preview – clips-kitty-web — 008d69a3 Deployed Nov 5, 2026 by vercel[bot]
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