Examples Index
Bencher’s examples come in two flavours. The generated gallery covers the combinatorial
space — every plot type, every result type, every sweep shape — and is rebuilt by
pixi run generate-docs; browse it in the Gallery Overview. The
hand-written examples below live directly in bencher/example/ and exist because each
one demonstrates something the generator cannot: a real image pipeline, a crash-and-resume
story, a multi-stage workflow.
Run any of them with pixi run python bencher/example/<file>.py.
Start here
File |
What it shows |
|---|---|
The minimal benchmark: one |
|
Sweeps |
|
A 3D volume sweep with four objectives and explicit |
Result types and media
File |
What it shows |
|---|---|
Renders a polygon to a PNG per sample with PIL and returns the path as a |
|
Simulates a Turing reaction-diffusion pattern, accumulates frames through |
|
Samples a 1D float variable and captures a Rerun recording per sweep point. |
|
Two paths for an |
|
A support module rather than a runnable example: a second-order control system whose step response is logged to a Rerun recording, plus peak-overshoot and settling-time metrics. Used by the generated Rerun and regression examples. |
|
The |
|
Sweeps the tab count and renders the resulting tab bar as an image, to see how it wraps under fixed styling. A UI regression benchmark of bencher’s own report chrome. |
Caching and execution
File |
What it shows |
|---|---|
|
|
Asserts exact worker/cache call counts across runs and tags, including |
|
The collect/render split: |
Configuration sources
File |
What it shows |
|---|---|
|
|
|
Reporting and self-measurement
File |
What it shows |
|---|---|
The benchmark health scorecard. Fabricates benchmark summaries with hand-shaped over-time distributions rather than running real sweeps, so every rendering path (sparklines, verdict colours, std bands, category grouping) and every |
|
Bencher benchmarking itself: sweeps problem size against a near-zero-cost worker and measures the framework’s own per-phase timing, so overhead scaling is visible. |
Runners and aggregate entry points
File |
What it shows |
|---|---|
|
|
Adds several examples to one |
|
The image and video examples run together through a |
Support modules
These sit in the same directory but are imported rather than run:
File |
Role |
|---|---|
Shared sweep configuration classes ( |
|
|
Subdirectories
bencher/example/optuna/— optimisation examples:example_optuna.py(a Rastrigin toy problem),example_optimize.py(the first-classbench.optimize()API and theto_optimize()one-liner), andexample_optimize_aggregate.py(optimising a metric aggregated over a nuisance dimension).bencher/example/generated/— the auto-generated gallery. Do not edit by hand; it is produced bybencher/example/meta/generate_examples.py.bencher/example/meta/— the generators themselves, plusBenchMeta, the self-describing benchmark thatexample_levels.pysweeps.bencher/example/experimental/andbencher/example/shelved/— work in progress and retired examples; not part of the documented surface.
Generated galleries by category
Gallery |
Covers |
|---|---|
Categorical-only sweeps, with and without repeats and over-time |
|
One float plus 0–3 categorical dimensions |
|
Two floats — the heatmap and surface cases |
|
Three floats — volume plots |
|
Optuna integration: basic, over time, and aggregated |
|
One example per result type across input dimensions |
|
Every supported plot type |
|
Plot types specialised for boolean results |
|
Sampling density as a single knob |
|
Custom values, levels, uniform, int vs float |
|
Combining results with composition strategies |
|
|
|
Collapsing dimensions with |
|
Pinning parameters with |
|
Error bands, distributions, repeat-count comparisons |
|
Entry-point conventions, multi-sweep and BenchRunner patterns |
|
Sweeping over YAML-defined configurations |
|
An animated build-up of the Cartesian product |
|
Time events, cache patterns, shared axes, report saving |
|
One example per |
|
Bencher’s own overhead |
|
Publishing reports |
|
Rerun recordings as results |