fix(semantic): sort deferred edges by (score desc, j) for deterministic admission (#998)#1014
Conversation
…ic admission (DeusData#998) Signed-off-by: Harshita Joshi <j.harshitaa06@gmail.com>
|
Thank you for digging into the admission ordering — before you invest more here, an important status update: the nondeterminism this PR targets no longer reproduces on current main. I re-ran #998's measurement on main (db330bf): six full-mode indexes of the same flask checkout — three back-to-back plus On the mechanism this PR proposes: the candidate rank Either way — thanks for engaging with one of the gnarlier corners of the pipeline; determinism reports and fixes are exactly the kind of contribution this project needs. |
What does this PR do?
Fixes the ~50% SEMANTICALLY_RELATED edge churn across identical runs reported in #998. The root cause is
cmp_deferred_edge_canonicalsorting deferred edges by(i, c)wherecis the candidate's LSH arrival rank, which varies with worker scheduling. This PR replaces the sort key with(i, score desc, j)so the per-nodemax_edgesbudget always admits the highest-scored edges first, with the partner func index (sorted by qualified_name in phase 1a) as a deterministic tie-break.Checklist
git commit -s) -- required, CI rejectsunsigned commits (DCO, see CONTRIBUTING.md)
make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)tests/repro/repro_parallel_determinism.calready guards this class of fix