Skip to content

Variant emission: no duplicate copies from an output with a bound and a shared slot - #114

Merged
adamjohnwright merged 2 commits into
mainfrom
fix-variant-duplicate-choices
Oct 16, 2026
Merged

adamjohnwright merged 2 commits into
mainfrom
fix-variant-duplicate-choices

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Found by the deltasignal week review (2026-10-15), verified by two independent skeptics.

In _choices, free_outputs dropped an output only when ALL its slots were bound. An output complex with one slot bound to an input slot and one slot shared with the inputs stayed free, so reaction_choices enumerated the bound slot and the binding loop then overwrote it: |members| identical choices per real copy, each minted as its own reaction node.

  • Canonical build 20261012-1401_01206ca: 2,905 of ~57,000 reaction nodes are exact duplicates, across 36 pathways (e.g. RAF R-HSA-5674373: 12 copies, 6 distinct). Under the solver's OR-mean, a duplicated reaction counts 2–6x in its output's mean; 4 reactions were pushed past LNG_MAX_VARIANTS and pooled only because of duplicates.
  • Fix: keep the first of each identical choice, before the cap is tested.
  • Test: test_output_with_a_bound_and_a_shared_slot_gives_no_duplicate_copies (fails on the old code).

tests/test_network_invariants.py::...Class_I_MHC... fails on main as well (it reads existing output files: ratio 54.4 vs 50); unrelated.

A deltasignal catalog rebuild and re-measurement follow before this is relied on.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits October 15, 2026 22:50
…th a bound and a shared slot enumerated the bound slot, then overwrote it: 2,905 duplicate reaction nodes in deltasignal's canonical build)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…too (week review: the docstring said once each)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 3451335 into main Oct 16, 2026
4 checks passed
@adamjohnwright
adamjohnwright deleted the fix-variant-duplicate-choices branch October 16, 2026 04:04
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.

1 participant