Debug harness: use load_scaling when evaluating the original plan#4218
Merged
Conversation
…he re-calculated plan run_single_debug --redo rebuilt load_minutes_step with scale_fixed=1.0, then calculate_plan rebuilds it with the user's load_scaling (and load_adjust / load_baseline). The original plan metric was therefore evaluated against lighter load than the final plan, making identical plans look like a metric regression (e.g. -1146.86 vs -1131.92 with load_scaling 1.05). Mirror the calculate_plan load model parameters so the two printed metrics are comparable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns the debug harness’s “original plan” metric evaluation with the same load-model parameters used by Plan.calculate_plan, preventing misleading metric deltas when the plan itself is unchanged.
Changes:
- Rebuild the debug harness load step data using
load_scaling(instead of a fixed 1.0), matchingcalculate_plan. - Include
load_adjustandload_baselinein the harness load-model rebuild to fully mirror the planning path. - Add explanatory comments documenting why the harness must mirror
calculate_planfor fair metric comparison.
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.
Problem
unit_test.py --debug <file> --redoprints two headline metrics: the original plan's (as loaded from the customer dump) and the re-calculated plan's. The original plan was evaluated against a load model built withscale_fixed=1.0, butcalculate_planimmediately rebuildsload_minutes_stepwith the customer'sload_scaling(plusload_adjust/load_baseline).With
load_scaling: 1.05this made byte-identical plans appear to be a ~15p optimizer regression (orig metric -1146.86 vs final -1131.92), which cost a debugging session chasing a phantom "levels stage won't charge" bug.Fix
Mirror
calculate_plan's load-model parameters in the harness'sreset_load_modelblock so both metrics are computed against the same load data. Verified on the triggering dump: orig and final now both report -1131.9186 for the identical plan.Only affects manual
--debug --redoruns; thedebug_casesregression suite callsrun_single_debugwithredo=Falseand is unaffected (suite passes).Testing
./run_all --test debug_cases— PASSED./run_pre_commit— clean--redo: orig/final metrics now identical for identical plans🤖 Generated with Claude Code