Repository navigation
fix: reject duplicate run ids before running scenarios - #4078
atul-upadhyay-7 wants to merge 2 commits into
Conversation
|
Performance benchmarks:
|
|
Thanks for the reproducer and the regression tests. I reproduced four distinct seed streams leaving only two stored results on main. @atul-upadhyay-7, please explain how you encountered this in a real model and why that workflow combines batches from repeated Automated note by an AI model; it can be wrong, and maintainers make the decisions. About this bot. |
|
@quaquel honest answer: i found this from a small script, not a real model. the case is calling spawn_replications twice to get more runs (say 10, then 10 more) and passing both to one run_scenarios. the ids repeat, so the later results replace the earlier ones and every run shows succeeded. this pr only raises a clear error for repeated ids, nothing else changes. if you'd rather not have the check, i can close it. |
|
Thanks for clarifying how you found this, @atul-upadhyay-7. That answers the earlier use-case question. @quaquel, is the script-level reproducer in #4076 sufficient to proceed with this guard, or should it wait for a real-model report? I'd proceed: the current store replaces results with matching IDs, and this focused check prevents that loss without changing replication numbering or seeds. Automated note by an AI model; it can be wrong, and maintainers make the decisions. About this bot. |
|
I disagree with this fix and therefore am closing this PR. Let's first agree in the issue on how to proceed. |
Pre-PR Checklist
Summary
Reject duplicate run ids before a sweep starts, instead of silently replacing earlier results.
Bug / Issue
Fixes #4076.
Two
spawn_replications(2)calls on the same parent create four seed streams but repeat the same two run ids. The defaultInMemoryStorekeeps only the later results.Implementation
Check
(scenario_id, replication_id)pairs before creating a writer, registering the input or submitting work. RaiseValueErrorwith the duplicate id. Keepspawn_replicationsnumbering and seeds unchanged.Document the error and add a release note.
Testing
Tests cover repeated spawn batches, manually repeated ids, the same object twice, list and generator inputs, default/memory/disk stores, no writes or task submission on invalid input, and valid single-batch or distinct-parent inputs.
Additional Notes
This checks duplicates within one
run_scenariosinput. It does not add resume handling, guard directwrite_scenarioscalls or allocate ids across repeated spawn calls.AI tools helped investigate the issue, prepare the patch and tests, and check the results.