Frame Lab: Repeatable Performance Benchmarks and Game Charts
- ..
- .metadata619 B
- README.md3.0 KB
- workflow.js11.6 KB
- workflow.yaml2.4 KB
README.md
benchmark-a-change
Answers "did my change make the world faster or slower?" with benchKit, as a run the engine holds stage by stage. Use it to compare performance between two builds, benchmark a change, measure before and after performance, or run a performance regression check.
What it does
- Conditions. Checks the benchmark exists and records the device, build type, window size, quality level and render scale. Nothing of these may change until the run ends: benchKit refuses to compare reports taken under different conditions.
- Baseline. Runs the benchmark twice (
zero benchKit run <benchmark> --label "...") and compares the two. Two runs of the same thing must read no change and both be settled. If not, it tries up to two more pairs, then stops withoutcome = "machine too noisy"and what to look at (other programs, the frame cap, thermal throttling). - Change. With
args.change, an agent makes that change in the world's files. Without it, the run asks the person or agent to make the change and confirm it is in place. - After. Runs the same benchmark again, labelled with the change.
- Compare.
zero benchKit compare <baseline> <after>. A refusal ends the run withoutcome = "refused: conditions differ"and the differences it named. - Verdict. Summarises the numbers that moved beyond noise in this order: 95th percentile
frame and 1% low, engine CPU and GPU, draw calls / triangles / pixels shaded / shadow pages,
memory; then faster, slower, mixed or no change. With
args.promote, a faster or unchanged after-run is promoted to the reference shelf for that device.
The run returns { outcome, summary, promoted, change, conditions, baseline, after, compare },
where baseline and after are { id, settled, headline, warnings } and compare is
{ summary, changed, refused, differences }.
Args
| Arg | |
|---|---|
benchmark | The benchmark (a Bench.define name or a module returning a definition). Default benchKit.sample. |
change | The change under test, in plain words, for an agent to make. Optional. |
label | Short name for the change used in report labels. Defaults to change. |
promote | Device name to promote the after-run under, when it is not slower. Optional. |
Running it
From the engine shell:
zero workflow start --name benchKit.benchmark-a-change --args '{"benchmark":"benchKit.sample","change":"halve the prop count"}'
zero workflow status
zero workflow next --runner <who you are>
zero workflow answer --request <id> --value '<json>'
From Luau:
asset.resolve("benchKit.benchmark-a-change", "workflow"):start({ benchmark = "benchKit.sample", change = "..." })
It needs benchKit (this package) and a quiet machine. Each benchmark run takes about 1 to 3
minutes; a full run is five of them. The step-by-step guide
workflow-benchmark-a-change-step-by-step describes the same procedure for people doing it by hand.