Fix inverted use_stale_model gating in DDWEStreamThinker - #49
Merged
Conversation
The two branches guarding inference submission were swapped relative to what the flag means. With use_stale_model=False the thinker only waited for train_output to become non-None, so it would happily submit inference against an arbitrarily stale model. With use_stale_model=True it blocked until train_iteration caught up to the current ensemble iteration, which is the strict freshness wait that the False case was supposed to perform. Swap them: when a stale model is acceptable, block only until the first model arrives; otherwise block until the current iteration's model is ready. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The two branches guarding inference submission in
DDWEStreamThinker.process_simulation_resultwere swapped relative to whatuse_stale_modelmeans:So
use_stale_model=False— the strict setting — merely waited fortrain_outputto become non-Noneand would then submit inference against an arbitrarily old model.use_stale_model=True— the permissive setting — took the strict path and blocked untiltrain_iterationcaught up with the current ensemble iteration, serializing inference behind training on every iteration.The branches are now swapped so the flag means what it says:
use_stale_model=Trueblocks only until the first model exists, then reuses whatever is current.use_stale_model=Falseblocks until the current iteration's model is ready.Log messages are updated to distinguish the two waits ("first" vs "next" streaming train task), which previously printed identical text from both branches.
Extracted from #40 so it can land on its own.
🤖 Generated with Claude Code