Skip to content

fix: multi-segment full coverage misclassified as PartialOverlap#37

Merged
Zious11 merged 2 commits intodevelopfrom
worktree-fix-overlap-classification
Apr 7, 2026
Merged

fix: multi-segment full coverage misclassified as PartialOverlap#37
Zious11 merged 2 commits intodevelopfrom
worktree-fix-overlap-classification

Conversation

@Zious11
Copy link
Copy Markdown
Owner

@Zious11 Zious11 commented Apr 7, 2026

Summary

  • Fix insert_segment returning PartialOverlap instead of Duplicate when a new segment is fully covered by the union of multiple existing segments (but not by any single segment)
  • Add regression tests for both duplicate and conflicting multi-segment coverage cases
  • Update misleading comment on the overlap return logic

Fixes #34

Test plan

Zious11 added 2 commits April 7, 2026 14:39
The fully_covered check only tested single-segment coverage. When a new
segment was covered by the union of multiple adjacent existing segments,
gaps was empty but the return logic fell through to PartialOverlap.
This inflated segments_inserted stats. Fixes #34.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes FlowDirection::insert_segment so a new segment that’s fully covered by the union of multiple existing segments is classified as Duplicate (or ConflictingOverlap when bytes differ), instead of incorrectly falling through to PartialOverlap.

Changes:

  • Update overlap return logic to treat “no gaps to fill” as full coverage by union → return Duplicate when non-conflicting.
  • Add regression tests for multi-segment full-coverage duplicate and conflict cases.
  • Clarify the in-code comment describing the overlap return logic.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/reassembly/segment.rs Adjusts overlap return classification when the new segment has no uncovered gaps after union coverage.
tests/reassembly_segment_tests.rs Adds regression tests for duplicate vs conflicting multi-segment full-coverage overlap cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Zious11 Zious11 merged commit 3002990 into develop Apr 7, 2026
8 checks passed
@Zious11 Zious11 deleted the worktree-fix-overlap-classification branch April 7, 2026 19:50
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.

fix: multi-segment full coverage misclassified as PartialOverlap

2 participants