floating_vs_decmial_x/bench design

Design goal

The executable turns the library package into a reproducible experiment: fixed operations, fixed sizes, a fixed seed and protocol, and output that keeps every raw record next to the summary.

Constraints

  • Published numbers are native release measurements, so the executable has to run on native and must not produce misleading numbers elsewhere.
  • A run must be reproducible from the repository alone: no arguments, no clock-derived seeds, no state carried between runs.

Main design decisions

  • Fixed seed 0xDEC1A1 and protocol. The corpus and the execution order are reproducible, and the fingerprints in the JSONL identify each dataset.
  • Three datasets per size. expand_digit_scales(sizes, 3) gives three datasets per size, so a result is not the accident of one operand pair; with 20 confirmatory repetitions this yields 60 paired samples, the samples value of every published record.
  • Records on standard output, report on disk. The JSONL can be piped and archived, and the HTML report is regenerated by every run.
  • Abort after reporting. A run with validation failures still writes its report, then exits with a failure so that scripts cannot mistake it for a clean run.
  • Native only. The published numbers are native release measurements; a fallback main keeps moon check --target all working on other targets.

The x_compatible division timings from 64 digits on compare GDA operands rounded to at most 51 digits with full-length X operands; see the known limitation.

The scale profiles rotate across sizes. Unlike the DzmingLi benchmark, which numbers datasets within each size, this package picks the scale pair from the global dataset id. Size number ii (counting from 00) owns the ids 3i,3i+1,3i+23i, 3i+1, 3i+2, and an operation with LL scale pairs uses the pairs

{ 3i mod L, (3i+1) mod L, (3i+2) mod L }.\{\, 3i \bmod L,\ (3i+1) \bmod L,\ (3i+2) \bmod L \,\} .

For L=5L = 5 (addition, subtraction, comparison, x_compatible division and the divisors of exact_overlap division) or L=4L = 4 and L=6L = 6 (multiplication), these sets change from one size to the next, because L∤3L \nmid 3. Neighbouring points of a curve therefore average over different scale pairs. For x_compatible division this also changes the working precision, since pp depends on sr−sℓs_r - s_\ell; the curve mixes size and scale effects.

Correctness and invariants

The executable validates every dataset before timing it, through the library’s oracle. A size enters the paired statistics only through valid observations, as described in the package design.

Alternatives rejected

  • Command-line arguments for sizes and operations. Rejected: a published number would then depend on how the executable was called, and the recorded replay commands could not reproduce it. Changing the experiment means editing main.mbt, which is versioned.
  • Writing the JSONL to a file chosen by the executable. Rejected: standard output can be filtered, piped and archived without the program knowing where the records go; only the HTML report has a fixed path.
  • Falling back to another target. Rejected: numbers from another target are not comparable with the published native ones, so other targets print a message instead of measuring.

Boundaries

The executable does not parse arguments, choose sizes at run time, render Matplotlib figures or compare runs with each other. It describes one host and one target per run.