Documentation

20.41 Reading retry outcomes and exit semantics

The retry loop has three broad terminal outcomes. First, attempt 0 or a retry converges; the command succeeds and stops at the first converged fit. Second, no attempt converges but at least one produces a completed result; nlmx returns normally with a warning, consistent with the behavior of an ordinary nonconverged fit. Third, every attempt ends in a numerical error without usable results; the original numerical failure is returned.

Three retry terminal outcomes
Final state Process result Scientific interpretation
A retry converged Exit 0 Use that folder, then perform full qualification.
Results exist but none converged Exit may be 0 with warning Evidence for troubleshooting, not a successful estimate.
All attempts failed numerically Numerical failure No usable fit; revise starts, model, data, or numerics.
Setup failed before estimation Immediate nonnumerical error Correct the setup; retries do not begin.

This distinction matters for automation. A shell exit code alone cannot certify minimization convergence because a nonconverged fit can intentionally write diagnostic results and return without a fatal process error. Automated gates should read retries.csv, fit_summary.json, and the exact termination field. Require converged=true for a successful estimation gate, then apply separate covariance, boundary, condition-number, and diagnostic gates.

When several attempts complete but none converges, the ledger makes their OFVs available. The lowest OFV may identify the most promising starting point for investigation only when the model, dataset, approximation, and likelihood are identical. It must not be reported as a final maximum-likelihood result merely because it is the lowest among incomplete runs.

When a retry converges, downstream commands must point at its folder. For example:

# If retries.csv identifies retries/retry_01 as the converged run:
nlmx cov --model-dir fit_out/retries/retry_01 --run-stem run101 -c nlmx.covar
nlmx forest fit_out/retries/retry_01/run101.ctl --results-dir fit_out/retries/retry_01

Do not use the parent output by habit: it contains attempt 0. Consider copying the winning final control stream into a separately versioned model-development location only through an explicit, documented promotion step. Keep the original evidence tree unchanged.

Common mistakes

  • Equating exit 0 with converged minimization.
  • Treating the last retry as the winner even when an earlier one converged.
  • Using the parent .ext after a retry won.
  • Comparing incomplete OFVs across different models or datasets.

Checklist

  • Require converged=true in the ledger.
  • Read the winning summary and termination rule.
  • Use the folder named in the winning row downstream.
  • Preserve but do not promote incomplete attempts.
  • Add independent uncertainty and diagnostic gates.

Further reading

See reading the fit listing, convergence evidence, and post-retry qualification.