Skip to content

【代码贡献】Fix SPSA termination when tolerance is set - #68

Open
tokenjunkielabs wants to merge 2 commits into
OriginQ:developfrom
woahwhattheheck:zz-sol-73/spsa-termination-contract-20260920
Open

tokenjunkielabs wants to merge 2 commits into
OriginQ:developfrom
woahwhattheheck:zz-sol-73/spsa-termination-contract-20260920

Conversation

@tokenjunkielabs

Copy link
Copy Markdown

Fixes a liveness bug in spsa_minimize where supplying tol disabled the documented maxiter termination cap because the cap was guarded by elif.

The change makes the two termination conditions independent:

  • a satisfied tolerance still stops early;
  • maxiter remains a hard cap even when a tolerance is supplied but never satisfied (including zero/NaN-like non-satisfying cases).

Regression coverage adds the unsatisfied-tolerance hard-cap case and preserves early tolerance termination behavior.

Target: develop.

No hosted or local test run is claimed in this submission.

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