Repository navigation
fix(skills): measure seam-gate speed-match on the frame grid - #7396
Open
PaprikaChen wants to merge 1 commit into
Open
PaprikaChen wants to merge 1 commit into
PaprikaChen wants to merge 1 commit into
Conversation
Contributor
Author
|
@jrusso1020 thanks for confirming the approach on #7021! Could you approve the workflow runs when you get a chance? The CI jobs are waiting on fork approval. |
PaprikaChen
force-pushed
the
fix/seam-gate-frame-grid
branch
from
November 11, 2026 00:42
5627c41 to
d556960
Compare
Contributor
Author
|
Rebased onto #7454's async seek. The frame-grid sampling now goes through the awaited |
The player floors every seek to a frame, so sampling an off-grid cut at cut - 0.1 / cut - 1f / cut + 1f / cut + 0.1 shifts both exit samples up to a frame early and puts the first entry sample on the cut itself. Exit is under-read, entry over-read: with the stamped defaults a cut just under a frame past the grid scores 1.67 (x/y) and 3.5 (z) instead of 0.82 / 1.09. Sample whole frames placed symmetrically around the nearest frame, warn with a cut-grid row when the cut is off the grid, and document in seam-gate.md and cut-the-curve section 3 that speed-match compares window averages. Grid-aligned cuts sample the same frames as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PaprikaChen
force-pushed
the
fix/seam-gate-frame-grid
branch
from
November 14, 2026 00:09
d556960 to
caf4506
Compare
This branch has not been deployed
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.
What
seam-gate.mjsnow samples speed-match (and the checks that share its samples) on whole frames placed symmetrically around the nearest frame to the cut. It adds acut-gridWARN row when a ledgercutsits between frames.references/seam-gate.mdand cut-the-curve §3 now say that speed-match compares window averages, not the instantaneous velocity at the cut. The stamp defaults are unchanged.Why
The player floors every seek to the frame grid (
quantizeTimeToFrameinpackages/core/src/inline-scripts/parityContract.ts). The gate sampled atcut - 0.1,cut - 1f,cut + 1f,cut + 0.1. Whencutfalls between two frames, both exit samples land up to a frame early and miss the fastest part of the exit, while the first entry sample lands on the cut itself, at the fastest part of the entry. Exit is under-read and entry is over-read, which produces the 1.70 / 3.7 ratios in the issue.Measured on a 7-scene / 6-seam 1080×1080 film (↓ ← ↑ → z+ z−), stamp defaults, current
main:The issue's other observations also come from this off-grid sampling, not from the stamp durations:
power4.in/power4.out(andexpo.in/expo.out) with matched travel and duration read exactly 1.00, because the two windows are symmetric. The issue measured 2.60 / 3.84 for the same setup.Related work
Fixes #7021. The root cause and data are also in a comment on the issue. The maintainer's original plan was to change the stamp defaults instead; if you'd still prefer that, I'm happy to update this PR.
How
cutFrame = Math.round(cut * fps). The four sample times are integer frames:cutFrame - win,cutFrame - 1,cutFrame + 1,cutFrame + win, withwin = round(0.1 * fps). For an on-grid cut these are the same frames as before. For an off-grid cut,cutFrame - 1is still before the cut andcutFrame + 1still after it, so zero-overlap and carrier keep their meaning.cut-gridis a WARN, so the gate's exit code is unchanged (it fails only on FAIL rows).cut-gridinstead of compensating for it..agents/skillsand.claude/skillsare updated together.Test plan
Built the test film above. For each cut offset and duration variant I stamped it with
seam-stamp.mjs --write, ranseam-gate.mjs verify --json, and compared the ratios before and after. With the change, every other row (ledger, exit/entry vector, zero-overlap, z-sign-scan) still PASSES at every offset.node scripts/check-skill-mirror.mjs,node scripts/check-comment-citations.mjs,node scripts/comment-ratchet.mjs, oxlint and oxfmt on the changed files: all pass.Unit tests added/updated (the skill scripts have no test harness; verified with the film above)
Manual testing performed
Documentation updated (if applicable)
Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug
🤖 Generated with Claude Code