Repository navigation
Clash detection: visit each pair of overlapping selections once - #152
Merged
mahach666 merged 1 commit intoNov 12, 2026
Merged
Conversation
RunCore took two selections with the same first mesh for the same
selection and started each row at i + 1, so A = {1,2} against B = {1,3}
found no clash, while overlapping selections (and every federated run)
reported each pair twice. Identical selections, compared by reference,
still start at i + 1; otherwise a pair is skipped when it was already
visited from an earlier mesh of A, using a first-index lookup of A and
the set of meshes in B, so memory stays linear in the selections.
Fixes IOExtend#16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #16
RunCoretook two selections with the same count and the same first mesh for one selection, and started each row ati + 1. So A={1,2}against B={1,3}found no clash. Overlapping selections, and every federated run, reported each unordered pair twice.How it works now:
i + 1. All vs All does the same work as before and allocates nothing.(a, b)can only be visited twice whenbis also in A andais also in B. Both paths build two lookups, by mesh reference: the first index of each mesh in A, and the set of meshes in B. Whena(at indexi) is in B andbis in A at a lower index, the pair was already visited fromband is skipped. Memory stays linear in the selection sizes.RunCoreMultiModeldoes the same, by reference, because mesh ids repeat across models. The existing same-mesh skip is unchanged.I avoided a set of visited pairs, which the issue suggests, because it would hold about n²/2 entries for a large All-vs-All run.
Tests (
ClashDetectiveTests):ClashDetection_OverlappingSelectionsReportsEachPairOnce: A={1,2}vs B={1,3}and A={1,2}vs B={1,2,3}, single-document and federated.AssemblyClashDetection_AllVsAllPreservesPairsWithRepeatedMeshIds: models that reuse mesh ids.3 cases fail without the src change: one finds no pairs, two report
(1,2)twice. The existing federated tests still pass.dotnet build NwcIO.slnxsucceeds, andNwcIO.Testspasses locally: 244 passed, and 2 skipped because they need private Navisworks files (.NET 10.0.400 on Windows, withglobal.jsonpinned down to it temporarily; not committed).The change was drafted with OpenAI Codex, then reviewed and verified with Claude Code.
🤖 Generated with Claude Code