Repository navigation
fix(lint): back-to-back audio clips no longer count as overlapping after float rounding - #5837
Merged
Merged
Conversation
…ter float rounding duplicate_audio_track compared raw float ends, so 21.03 + 0.1 (21.130000000000003) overlapped a clip starting at 21.13. The one-instant span helpers move from core's clipFacts to parsers, which lint and core both depend on; core re-exports them and the rule uses spansOverlap.
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 174 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
somanshreddy
approved these changes
Oct 18, 2026
somanshreddy
left a comment
Contributor
There was a problem hiding this comment.
Clean at 47c1a19b: no blocker.
- The helpers move into
@hyperframes/parsers/time-spansunchanged, andclipFacts.tsre-exports them, so existing imports keep working. The subpath is registered inpackage-subpaths.json, in bothpackage.jsonexport maps and in the tsup entry. - I brute-forced the rule outside the repo with the same
spansOverlap. That covered about 2.5M back-to-back pairs at 2- and 3-decimal starts and durations, each parsed the way the attributes are, with starts up to 3600 s and durations up to 60 s:- The old
a.start < b.end && b.start < a.endcheck gives 314,892 falseduplicate_audio_trackwarnings. - The new check gives 0.
- A real overlap of one unit (0.01 s or 0.001 s) still warns in every case: 0 misses.
- The old
- Zero-length clips behave as before. One inside another still overlaps; one at the other's start still doesn't.
— Somu
3 tasks done
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
lintandcheckno longer warnduplicate_audio_trackfor audio clips placed end to end on one track when the first clip's start plus duration only lands past the next start because of float rounding. For example, a clip atdata-start="21.03" data-duration="0.1"followed by one atdata-start="21.13"used to be reported as layered audio ("a.mp3 at 21.03-21.1s, a.mp3 at 21.13-26.1s"), because21.03 + 0.1is21.130000000000003.Why
The rule compared raw float ends:
a.start < b.end && b.start < a.end. Any end that rounds a step past the next start counts as overlap. In the reported pattern (music cut at 21.03 s and laid back to back), 712 of the 3,000 two-decimal durations from 0.01 to 30 s produce such an end. The warning then sends authors and agents to "fix" a timeline that plays correctly, and trains them to ignore the real overlap warning.Reproduced on 0.8.170: a project with
0-21.03,21.03-21.13and21.13-26.13on track 9 gets the warning.Related work
None found (searched open PRs and issues for duplicate_audio_track and audio overlap).
How
instantTolerance,sameInstantand the span helpers inclipFacts.ts, used by the runtime and the timeline commands. Lint cannot import core (core depends on lint), so those helpers move unchanged to a new@hyperframes/parsers/time-spanssubpath. Both packages already depend on parsers, and the runtime already imports parsers subpaths.clipFacts.tsre-exports them, so every existing import keeps working.spansOverlap, so ends within one instant of the next start do not overlap, and a real overlap still warns.package-subpaths.jsonand synced topackage.jsonwithbun run sync:package-subpaths; tsup builds it.Test plan
project.test.ts"stays quiet for back-to-back clips whose start plus duration only rounds past the next start" fails on main (the warning is reported) and passes here, 3 runs in a row (61 passed). The existing "warns when audible videos overlap on one track" still passes.linton the reproducing project with noduplicate_audio_track(3 warnings, down from 4). Moving the third clip to start at 21.10 (0.03 s of real overlap) still warns.src/runtimeandclipFacts(2121 passed), the runtime CI suite (test:hyperframe-runtime-ci), CLIsrc/timeline(113 passed),tscfor parsers, lint, core and cli,check:package-cyclesandcheck:package-subpaths.