Skip to content

fix(optimizer): skip converged PH iterations - #905

Merged
frahlg merged 1 commit into
masterfrom
agent/ph-zero-residual
Aug 11, 2026
Merged

fix(optimizer): skip converged PH iterations#905
frahlg merged 1 commit into
masterfrom
agent/ph-zero-residual

Conversation

@frahlg

@frahlg frahlg commented Aug 11, 2026

Copy link
Copy Markdown
Member

What changed

  • stop progressive hedging before its iteration loop when the initial scenario decisions already meet the residual tolerance;
  • report ph_iterations: 0 for that path;
  • add a deterministic one-scenario regression that fails if a second solver call occurs.

Root cause

The optimizer calculated the initial residual, but checked it only after one augmented PH iteration. A one-scenario plan has no non-anticipativity conflict, so its residual is already zero. The extra solve could hit USER_LIMIT and discard a valid plan.

Measured before the fix, the one-scenario repro made two solver calls and returned internal_error with USER_LIMIT in 5 of 5 runs. After the fix it makes one solver call, reports zero iterations and returns a replay-valid plan.

Checks

  • focused PH tests: 4 passed;
  • focused regression repeat: 20 of 20 passed;
  • full optimizer suite: 167 passed;
  • make verify-all passed, including Go tests, Core to optimizer contracts, vet, builds and release-target cross-builds;
  • two independent read-only reviews found no P0-P3 issue.

@frahlg
frahlg merged commit d8f534d into master Aug 11, 2026
14 checks passed
@frahlg
frahlg deleted the agent/ph-zero-residual branch August 11, 2026 18:25
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