Problem
The generator is non-deterministic: regenerating the same pathway with identical code produces structurally different networks run-to-run.
Evidence (TP53, R-HSA-3700989, 31,884 edges):
- Two runs, default env: 1,852 edges differ (~5.8%) in stId-space (input/output/depletion edges).
- Two runs with
PYTHONHASHSEED=0: identical (0 differing).
Root cause: Python hash randomization → set/dict iteration order of strings varies between runs → somewhere the generator's output depends on that order (matching picking among equivalent options, or set/variant selection, or entity iteration order).
Impact
- Benchmark comparisons carry ±1–2 cases of regeneration noise, confounding A/B evaluation of generator changes (e.g. a spurious "−1 TP53" appeared when comparing two networks that only differed by noise).
- Results aren't reproducible.
Fix
- Immediate: set
PYTHONHASHSEED=0 for all generation + benchmark runs.
- Proper: make output order-independent — sort sets before iterating anywhere the choice affects output (matching, variant enumeration, entity iteration). Then determinism holds regardless of hash seed.
To do
- Locate the order-dependent site(s) (start with
find_best_reaction_match / matching, and any for x in <set> that picks a representative).
- Add a determinism test: generate a pathway twice, assert stId-space edge multisets equal.
Problem
The generator is non-deterministic: regenerating the same pathway with identical code produces structurally different networks run-to-run.
Evidence (TP53, R-HSA-3700989, 31,884 edges):
PYTHONHASHSEED=0: identical (0 differing).Root cause: Python hash randomization → set/dict iteration order of strings varies between runs → somewhere the generator's output depends on that order (matching picking among equivalent options, or set/variant selection, or entity iteration order).
Impact
Fix
PYTHONHASHSEED=0for all generation + benchmark runs.To do
find_best_reaction_match/ matching, and anyfor x in <set>that picks a representative).