Skip to content

FIX: Stable linking with degeneracy, via sorting#802

Open
nkeim wants to merge 3 commits into
soft-matter:masterfrom
nkeim:sort-by-uuid
Open

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

Conversation

@nkeim
Copy link
Copy Markdown
Contributor

@nkeim nkeim commented May 8, 2026

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.

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