Skip to content

fix: honor early-stopping patience with a zero convergence threshold - #566

Merged
codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
Yushu-Li:fix/zero-threshold-early-stopping
Oct 31, 2026
Merged

codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
Yushu-Li:fix/zero-threshold-early-stopping

Conversation

@Yushu-Li

Copy link
Copy Markdown
Contributor

I fixed patience-based early stopping when convergence_threshold is zero.

With early_stopping_patience = 3, convergence_threshold = 0.0, and a constant score of 0.0, the controller treats every tie as an improvement because 0.0 >= 0.0. It resets patience on every iteration and runs through the full iteration budget instead of stopping on the plateau.

Require the score to increase before applying the existing inclusive minimum-delta check. Equal scores then count toward patience at a zero threshold, while an improvement exactly equal to a positive threshold still resets it.

Four new controller regressions cover:

  • A constant zero score stops after iteration 4 rather than running all 8 iterations.
  • Tiny improvements to negative scores still reset patience with a zero threshold.
  • An improvement exactly equal to a positive threshold still resets patience.
  • Event-based stopping at a zero target still works.

The zero-threshold plateau regression fails on the original controller; the three compatibility controls pass.

Validation on macOS / Python 3.12:

  • All 18 focused early-stopping tests passed.
  • OPENAI_API_KEY=test-for-offline-tests PYTHONPATH="$PWD" python -m unittest discover -s tests -p 'test_*.py' -v: 958 tests passed.
  • Black checks on both changed files, isort on the edited test module, and git diff --check passed.

I used AI assistance for implementation, regression tests, and local validation. No paid model calls or model-backed integration runs were performed.

@codelion
codelion merged commit 23dc34b into algorithmicsuperintelligence:main Oct 31, 2026
5 checks passed
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.

2 participants