Documentation

7.16 Worked CLI-to-settings-to-rerun round trip

This worked example demonstrates equivalence between explicit CLI options and a reviewed .power file, then demonstrates CLI precedence. It is an interface/configuration test, not a validation of FIM power against another software package.

1. Generate the reference

nlmx power --print-config documents/ch07/power-template.power

The compact configuration is documents/ch07/roundtrip.power. It fixes method, thresholds, seed, threads, sample sizes, tested effect, FIM controls and output switches. Its control-stream path is relative to the settings file.

2. Run the CLI form

nlmx power documents/ch06/blq.ctl `
  --method fim --sample-sizes 12,24 `
  --test "THETA(4)=0.55;null=0;name=WT exponent" `
  --seed 70701 --threads 1 `
  --fim-approximation fo --fim-kind reduced --fim-draws 20 `
  --no-plots --no-report `
  -o documents/ch07/results/cli-run

3. Run the file form

nlmx power -c documents/ch07/roundtrip.power `
  -o documents/ch07/results/config-run

The harness parsed and compared power_scenarios.csv and fim_power.csv. Both files had three CSV rows including headers, and their row arrays were identical between the two runs. Log IDs and output-directory fields were deliberately excluded because they are execution-specific.

4. Prove override precedence

nlmx power -c documents/ch07/roundtrip.power `
  --sample-sizes 18 --target-power 0.9 `
  -o documents/ch07/results/override-run `
  --no-plots --no-report

Parsing power_settings_used.power showed [18] and 0.9, replacing [12, 24] and 0.8. Other file values remained.

5. Reproduce the evidence

python tools/ch07_examples.py `
  --nlmx ../nlmx/target/release/nlmx.exe `
  --output documents/ch07/results-recheck

Use a new output path; the harness refuses a non-empty destination and writes its generated template inside that destination. The summary records version 4.3.0, executable SHA-256, eight commands and the two table comparisons. Two commands intentionally fail: wrong extension exits 2 and unknown key exits 4.

Interpretation limits

The experiment establishes parser mapping and effective-setting equivalence for this fixture. It does not establish equivalence for every option, platform, stochastic engine or competing software. Broaden it into a matrix of positive and negative fixtures for release validation.

Common mistakes

  • Calling an internal round trip cross-software validation.
  • Comparing timestamped logs byte-for-byte.
  • Reusing the same output directory.

Checklist

  • Freeze version, executable hash, seed and threads.
  • Compare stable scientific outputs.
  • Retain expected-failure tests as well as successful runs.

Further reading

See option mapping, rerun records and Chapter 42's planned formal validation matrix.