dzmingli_vs_floating/bench_common 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.
Design decisions
- Fixed seed
0xDEC1A1and 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 operand profiles per size, so a result is not the accident of one operand pair; with 20 confirmatory repetitions this yields 60 paired samples. - 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
mainkeepsmoon check --target allworking on other targets.
The sizes are the coefficient lengths common in business decimals and in
fixed-width formats (16 digits for decimal64; 28 is the maximum scale of moonbitlang/x/decimal). A
separate executable keeps the short-number report independent of the
long-running scaling report.
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.
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.