Documentation

39.14 Exit code 12: internal invariant violation

39.14 Exit code 12: internal invariant violation

What you will learn

  • Treat the result as a potential nlmx defect
  • Preserve first-panic and environment evidence
  • Build a minimal, safe reproducer

Prerequisites: Chapter 36 exit-code reference, Chapter 38 output completion, and the Chapter 39 overview.

This page describes nlmx 4.16.2. Troubleshooting must preserve the failed attempt: keep its exact command, working directory, log, resolved settings, input/model identities, partial outputs, and process exit code. Correct one causal condition at a time and compare the new evidence with the failed run. Never convert a nonzero exit into success in a wrapper, and never interpret exit 0 as scientific acceptance without the command-native verdict.

Exit 12 means nlmx reached a state its implementation considers impossible or caught an unexpected failure. run_guarded records the first panic (including source file and line when available), converts it from a bare process abort into a normal Fail, and sends it through the failure logger. A panic outside the guarded worker can still end with 12 but less context.

Stop the dependent workflow and preserve the entire folder, terminal capture, and exact executable. Do not repeatedly run on production data or hide the condition with a wrapper. Record nlmx version/banner, executable hash, OS/architecture, command/CWD, environment relevant to threads/backend, input/settings/model hashes, stage, full log, panic text/source location, and whether it is reproducible.

Minimize by copying the case into an access-controlled workspace, removing irrelevant columns/records/options one at a time while preserving the failure. Protect PHI and proprietary model code; a synthetic reproducer is preferable if it triggers the same invariant. State whether changing thread count, platform, or seed changes the behavior, but do not claim a workaround is a fix.

After a corrected build arrives, rerun both the minimal reproducer and the original controlled case. Verify expected outputs and regression tests, not merely absence of panic. Record defect ID, fixed version, test evidence, and impact assessment for prior analyses.

Page checklist

  • Did you retain the exact exit code, stage, message, hint, log, and partial output?
  • Did you identify one causal layer before changing anything?
  • Is the recovery a new, traceable attempt with the same intended estimand?
  • Did you check command-native and scientific acceptance after process completion?

See the previous page, next page, and complete error reference.