fix(fusion): bound moment components to shared overlapping interval (#87) - #141
Open
Muhammad-AbdullahGhani wants to merge 1 commit into
Conversation
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.
Related issue
Closes #87
Summary
When grouping search hits into moments in
_connected_components, VidXP previously combined hits whenever their time ranges touched or overlapped (hit.start <= current_end, withcurrent_end = max(current_end, hit.end)). This transitive interval chaining caused a single bridging hit spanning two otherwise separate moments (e.g. A overlaps B and B overlaps C, but A and C are disjoint) to collapse into one broad moment.This change bounds each moment component to hits that share a common overlapping interval (
current_overlap_end = min(current_overlap_end, hit.end)). Nearby duplicate hits covering the same scene or action still combine, while disjoint moments bridged by a longer hit remain separate occurrences.Validation
pytest tests/test_search_fusion.py -p no:asyncio(5 passed in 0.27s, including regression testtest_bridging_hit_does_not_merge_separate_momentsandtest_nearby_duplicate_hits_combine_into_one_moment)pytest tests/test_query_service.py tests/test_evidence_delivery.py -p no:asyncio(23 passed in 1.23s)ruff check src/vidxp/search_fusion.py tests/test_search_fusion.py(All checks passed)ruff format --check src/vidxp/search_fusion.py tests/test_search_fusion.py(2 files already formatted)