Skip to content

Fix flow-filter bug in prefixes splitting#1306

Open
qmonnet wants to merge 2 commits intomainfrom
pr/qmonnet/flow-filter-bug
Open

Fix flow-filter bug in prefixes splitting#1306
qmonnet wants to merge 2 commits intomainfrom
pr/qmonnet/flow-filter-bug

Conversation

@qmonnet
Copy link
Member

@qmonnet qmonnet commented Feb 28, 2026

We had a bug in function get_split_prefixes_for_manifest(): when splitting a prefix against some overlap prefix, we would immediately store all resulting fragments into the vector prefixes_with_vpcd, considering the one matching the overlap prefix as a MultipleMatches, the others as Single results. This is wrong, because the fragments associated to Single results can in fact still overlap with some over prefix in the overlaps list, and we need to compare them again. Fix the issue by re-inserting the resulting fragments into a queue, and comparing them with the overlap prefixes from the list.

Fixes: 8691a71 ("feat(flow-filter): Split prefixes with partial overlap")

@qmonnet qmonnet requested a review from mvachhar February 28, 2026 02:28
@qmonnet qmonnet self-assigned this Feb 28, 2026
@qmonnet qmonnet requested a review from a team as a code owner February 28, 2026 02:28
Copilot AI review requested due to automatic review settings February 28, 2026 02:28
@qmonnet qmonnet added the bug Something isn't working label Feb 28, 2026
Copy link
Contributor

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 a correctness bug in get_split_prefixes_for_manifest() where prefix fragments produced by a split were prematurely classified as Single without being re-checked against the full overlap set, which could yield incorrect VpcdLookupResult decisions in multi-overlap scenarios.

Changes:

  • Reworks prefix splitting to use a worklist so newly created fragments are re-evaluated against all overlap prefixes before being finalized.
  • Adds a regression test covering splitting against two overlaps, plus small test cleanups via helper constructors.

@qmonnet qmonnet force-pushed the pr/qmonnet/flow-filter-bug branch from b434739 to 9f53670 Compare February 28, 2026 02:33
@qmonnet qmonnet enabled auto-merge February 28, 2026 02:34
@qmonnet qmonnet requested a review from Fredi-raspall March 1, 2026 14:41
qmonnet added 2 commits March 3, 2026 00:19
We have an issue in function get_split_prefixes_for_manifest(), because
we do not match fragments resulting from a split against the remaining
overlapping prefixes in the list. Add a test to illustrate the issue
(the test was in part generated with Claude Opus 4.6): we'll fix it in a
follow-up commit.

Signed-off-by: Quentin Monnet <qmo@qmon.net>
We had a bug in function get_split_prefixes_for_manifest(): when
splitting a prefix against some overlap prefix, we would immediately
store all resulting fragments into the vector prefixes_with_vpcd,
considering the one matching the overlap prefix as a MultipleMatches,
the others as Single results. This is wrong, because the fragments
associated to Single results can in fact still overlap with some over
prefix in the overlaps list, and we need to compare them again.

Fix the issue by re-inserting the resulting fragments into a stack, to
later compare them with the overlap prefixes from the list.

Fixes: 8691a71 ("feat(flow-filter): Split prefixes with partial overlap")
Signed-off-by: Quentin Monnet <qmo@qmon.net>
@qmonnet qmonnet force-pushed the pr/qmonnet/flow-filter-bug branch from 9f53670 to 6d75ee8 Compare March 2, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants