Documentation

16.27 Reproducibility, thread independence, and speed

NCA and NLS are deterministic. ML uses named random streams derived from the seed, group, iteration, and subject. Therefore, a fixed seed should produce identical results regardless of worker scheduling or --threads.

Validation dimensions

Reproducibility controls

Record nlmx version, executable hash, input/settings hashes, command, seed, ML sample count, thread count, platform, and outputs. The default seed is 20240611; using an explicit seed protects against future default changes.

Test one representative case with one and multiple threads and compare machine-readable files. Logs and elapsed seconds can differ, so define which artifacts require byte identity and which require numerical identity.

Performance

Subjects are parallelized across NCA, individual fits, two-compartment checks, and ML. ML usually dominates runtime, and ml_samples controls its cost. The minimum is 200; 2000 is the usual default. Lower values can be useful during exploration but should be justified and validated for release.

Benchmark equivalent workloads: same method, subjects, samples, plots, thread count, hardware, and warm/cold state. A tables-only run should not be compared with a reference tool rendering reports/figures.

Stable evidence

Use checksums.sha256 after generation and transfer. Conditional outputs differ by method—e.g., no NCA CSV in NLS-only mode—so validate an expected inventory rather than a universal file list.

Thread-independence testing should compare parsed values at an explicitly chosen tolerance as well as exact text. Exact equality is ideal for deterministic streams, while a documented tight numeric tolerance can accommodate platform-level floating-point formatting. Any difference that changes method availability, a structural decision, or a source label is categorical and must not be hidden by a numeric tolerance.

Common mistakes

  • Changing seed and interpreting variation as parameter uncertainty.
  • Comparing elapsed time with different ML sample counts.
  • Requiring logs with timestamps to be byte-identical.
  • Updating frozen outputs without mismatch disposition.

Checklist

  • Freeze seed, samples, threads, version and inputs.
  • Test thread independence.
  • Define numeric, categorical and byte comparisons.
  • Benchmark equivalent artifact generation.
  • Verify checksums and expected file inventory.

Further reading

See Chapter 9's reproducibility contract, ML controls, and validation limits.