Skip to content

FIX: Stable linking with degeneracy, via sorting#802

Merged
nkeim merged 3 commits into
soft-matter:masterfrom
nkeim:sort-by-uuid
Jun 29, 2026
Merged

FIX: Stable linking with degeneracy, via sorting#802
nkeim merged 3 commits into
soft-matter:masterfrom
nkeim:sort-by-uuid

Conversation

@nkeim

@nkeim nkeim commented May 8, 2026

Copy link
Copy Markdown
Contributor

This fixes #776 by making sure candidates are considered in order during subnet linking. It supersedes #801 because that fix's performance regression was much worse (and, it did not actually guarantee ordering).

Each subnet linker implementation now sorts source candidates by the number of forward candidates first, and then by their uuid. The performance penalty appears to be within 1%, too small to measure easily.

Previously, the numba linker did not sort by the number of forward candidates, which is a helpful optimization for this depth-first algorithm. Because the core linking algorithm was so fast, this optimization was not always worthwhile in practice. However, introducing sorting by uuid in the numba linker caused a serious performance regression for large subnets, much worse than for the other linker implementations. I found that when the numba linker also sorts by forward candidates, the regression seems to go away. So I include that optimization in this PR.

@nkeim

nkeim commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

I've now checked the performance of linking in the walkthrough tutorial, and there's no significant change.

Merging, in the hope that we get performance data for more use cases. The new tests will also help us finalize #795 .

@nkeim nkeim merged commit 186fa02 into soft-matter:master Jun 29, 2026
14 checks passed
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.

memory not stable between runs

1 participant