Reproducible benchmarking, statistical comparison, tuning, and self-contained reports for MoonBit payloads.
Dependencies
moon add Luna-Flow/mare_mark@0.4.0import {
"Luna-Flow/mare_mark/model",
"Luna-Flow/mare_mark/env_detect",
"Luna-Flow/mare_mark/event",
"Luna-Flow/mare_mark/runner",
"Luna-Flow/mare_mark/report",
"moonbitlang/async",
}async test "loop versus closed form" {
let looped = @runner.Implementation::stateless("loop", "1", (n : Int) => {
let mut total = 0
for i in 0..<n {
total i
}
@model.OperationResult::completed(total, ())
})
let formula = @runner.Implementation::stateless("formula", "1", (n : Int) => {
@model.OperationResult::completed(n * (n - 1) / 2, ())
})
let plan = @runner.single_step("triangle", [1000, 100000])
.with_immutable_input(context => context.dataset_key.scale, n => n.to_string())
.compare([looped, formula])
.against_equal(n => n * (n - 1) / 2, (expected, actual) => expected == actual)
.compile()
.unwrap()
let record = @event.JsonlSink::new()
let environment = @env_detect.detect(compiler_flags="release", concurrency=1)
.snapshot
let summary = @runner.run(
plan,
@runner.RunContext::new(environment, record.as_sink(), 42UL, @runner.ProtocolPreset::QuickCheck.validated()),
)
inspect(summary.passed_count, content="4")
let html = @report.html(@report.document_from_jsonl(record.to_jsonl(), target="native").unwrap())
inspect(html.has_prefix("<!doctype html>"), content="true")
}moon run src/cli --target native -- report --baseline scalar testdata/report/compare.jsonl report.html
moon run src/cli --target native -- replay testdata/replay/sample.jsonl --dry-run| Package | Role |
|---|---|
| model | shared vocabulary: versions, protocols, environments, outcomes, events, decisions |
| env_detect | environment snapshots detected from the running process |
| generator | seed derivation and input fingerprints |
| fixture | input lifecycle and setup timing |
| experiment | oracles, shrinking, crossover analysis |
| runner | validation, warmup, calibration, balanced blocks, raw events |
| event | sinks and the JSONL record |
| ir_sink | short constructors for the common sinks |
| stats | summaries, paired comparisons, bootstrap intervals, outlier views |
| ir_model | Plot IR |
| report | JSONL to JSON, SVG and self-contained HTML |
| tune | tuning policy: scores, practical ties, Pareto fronts, seeded subsets |
| tune_gemm | worked tuning domain: blocked matrix multiplication |
| cli | the mare-mark executable: report and guarded replay |
Install
Download zipReproducible benchmarking, statistical comparison, tuning, and self-contained reports for MoonBit payloads.
Dependencies