cli tutorial

This tutorial shows how to build the floating-conformance executable and run the four conformance runners through it, either directly or through the just conformance tooling that downloads and plans whole corpora.

I want toUse
build the executable and see its usagerun … tooling/src/cli -- --help
run decTest, ITL, MPFR or TestFloat data--backend gda, itl, mpfr, testfloat
run whole pinned corpora in paralleljust conformance …
use the result in a scriptthe exit code and --json
see the options of one runnerthe runner tutorials

Quick start

The executable is native-only and is built from a checkout of the repository, not installed with moon add. From the repository root, build it and print the usage line:

sh tools/run_moon_clean_exec.sh run --release --target native tooling/src/cli -- --help
usage: floating-conformance --backend <gda|testfloat|mpfr|itl> [backend options]

Run the committed GDA smoke file (the default path of the gda runner):

sh tools/run_moon_clean_exec.sh run --release --target native tooling/src/cli -- --backend gda

The runner prints a summary and the process exits with 0 when every executable row passed.

Everyday tasks

Choose a backend

Everything after the dispatcher’s own options goes to the runner:

floating-conformance --backend gda --json testdata/decimal_gda/smoke.decTest
floating-conformance --backend itl testdata/interval/smoke.itl
floating-conformance --backend mpfr --json testdata/binary/mpfr-4.2.2-elementary.txt
floating-conformance --backend testfloat --function f64_mul --rounding rnear_even vectors.tv

(floating-conformance stands for the built executable, for example _build/conformance/gda/native/release/build/gda-conformance.exe.)

Use the tooling instead of raw invocations

For full corpora, let tools/conformance.py build the executable, fetch the pinned data, plan the phases and run the shards in parallel:

just conformance build decimal_gda
just conformance smoke binary
just conformance run interval
just gate decimal_gda 8

Read the exit code

0 means success, 1 means failing cases (for itl also diagnostic cases; in strict mode also unsupported cases), 2 means a usage, file or parse error. Scripts should check the code and, with --json, parse the single JSON object on standard output.

Going further

Common pitfalls

  • --help is the dispatcher’s. --backend gda --help prints the dispatcher usage and exits with 0; it does not show the runner’s options.
  • Relative default paths. Runners default to files under testdata/; run them from the repository root.
  • One backend per invocation. --backend may be given only once.
  • An empty directory is not an error. The gda runner rejects a named file without the .decTest suffix (not a .decTest file: PATH, exit 2), but a directory contributes only its direct .decTest files, so a directory without any gives an empty run that exits with 0.

Next steps