Skip to content

Report ActionClip conflicts instead of panicking and fix field span offset - #142

Merged
Sheerwin02 merged 3 commits into
mainfrom
sheerwin/overlap-error-logging
Aug 16, 2026
Merged

Report ActionClip conflicts instead of panicking and fix field span offset#142
Sheerwin02 merged 3 commits into
mainfrom
sheerwin/overlap-error-logging

Conversation

@Sheerwin02

Copy link
Copy Markdown
Contributor

Sequence::push and Sequence::extend guarded against overlapping
clips with a debug_assert!. That meant an authoring mistake took the
whole app down in a debug build, and in a release build the clips were
accepted silently — the animation came out wrong with nothing to point
at why.

Conflicts are now reported through tracing::error! and the clips are
kept. Reporting a conflict is not the same as resolving one, so the
animation is still wrong; you just find out immediately, in either
profile, instead of guessing.

Two things get reported, because baking walks a lane in list order
carrying one value forward (start = end in pipeline::bake) while
playback runs in time order:

  • A clip listed after one that starts later. No overlap needed —
    the two orders simply disagree, so the later-listed clip opens on a
    value that has not happened yet.
  • A clip overlapping any earlier clip in the lane. Every offender
    is named, not just the nearest one, so a clip buried under a long
    one is reported even when the clips either side of it are clear.

Adds tracing as an optional dependency, enabled by default. With the
feature off the checks compile out entirely.


Also fixes field_offset in TrackFragment::compile assigning rather
than accumulating, which made every field lookup past the second one
point at the wrong lanes — field_offset = field_len overwrote the
running position with the size of the previous run. The first boundary
was accidentally correct (the offset is still zero there), so it only
shows up with three or more distinct fields.

This is latent: nothing reads field_lookups yet, per the TODO on
Track. The added test fails without the fix and asserts the spans
partition the lanes , every lane reachable through exactly one field,
none skipped, none repeated.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5858425b-f7a6-4a5e-942c-ee08d84b0154

📥 Commits

Reviewing files that changed from the base of the PR and between dc132ce and 393a1fe.

📒 Files selected for processing (1)
  • crates/motiongfx/Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/motiongfx/Cargo.toml

Included review availability: Your plan includes up to 2 reviews per rolling hour; 0 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added diagnostic reporting for overlapping or out-of-order clips during sequence updates, rather than halting the operation.
  • Bug Fixes

    • Corrected compiled track field offsets so lookups consistently cover every sequence lane.
    • Improved conflict detection when adding clips individually or in batches.

Walkthrough

The PR adds tracing-based conflict reporting for sequence insertion and extension. It also fixes cumulative field offsets in track compilation and adds regression coverage for field-to-lane lookups.

Changes

Sequence and track corrections

Layer / File(s) Summary
Sequence conflict reporting
crates/motiongfx/Cargo.toml, crates/motiongfx/src/sequence.rs
The crate enables tracing by default. Sequence::push and Extend::extend report out-of-order and overlapping clips instead of rejecting them with debug assertions.
Track field offset correction
crates/motiongfx/src/track.rs
Track compilation now advances field offsets cumulatively. Regression coverage verifies field lookups, key ownership, and complete lane coverage.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 393a1

The PR replaces debug-only panics with error reporting and corrects field span offsets while preserving existing clips; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

Suggested reviewers: jaghov

Poem

A rabbit traces clips in flight,
And marks each conflict clear and bright.
Field offsets move in steady rows,
Each lane is found where it should go.
The compiled track stays on track.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes both main changes: reporting ActionClip conflicts and fixing field span offsets.
Description check ✅ Passed The description accurately explains the conflict reporting behavior, feature configuration, and field span offset fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Sheerwin02
Sheerwin02 requested a review from nixonyh August 16, 2026 10:44

@nixonyh nixonyh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small nit, good to merge once addressed.

Comment thread crates/motiongfx/Cargo.toml
@Sheerwin02
Sheerwin02 merged commit 7a8b6b3 into main Aug 16, 2026
8 checks passed
@Sheerwin02
Sheerwin02 deleted the sheerwin/overlap-error-logging branch August 16, 2026 12:45
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