bencher.results.rerun_result

Classes

RerunResult

Result class that renders N-dimensional benchmark data into a rerun viewer.

Functions

_rv_name_and_path(→ tuple[str, str])

Return (rv_name, entity_path/rv_name) for a result variable.

_extract_scalar(dataset, rv_name[, sel])

Extract a scalar value from dataset[rv_name], optionally slicing first.

_log_to_rerun(rr, recording, dataset, entity_path, ...)

Recursively map N-dimensional data to rerun entity paths and timelines.

_log_line_graph(rr, recording, dataset, entity_path, ...)

Log a 1D float sweep as a line graph by iterating the float dim as log_tick.

_log_bar_chart(rr, recording, dataset, entity_path, ...)

Log a result variable as a BarChart over a categorical dimension.

_log_tensor(rr, recording, dataset, entity_path, rv, dims)

Log a result variable as an N-D Tensor (heatmap for 2D, volume for 3D).

_log_result_var(rr, recording, dataset, entity_path, rv)

Log a single result variable to rerun at the current entity path.

_build_blueprint(rrb, result_vars, float_dims, ...)

Build a rerun Blueprint with typed views matching the data layout.

_peel_dim_as_grid(rrb, entity_path, dim, dim_values, ...)

Build a Grid by peeling dim and calling build_child for each value.

_build_blueprint_contents(rrb, entity_path, ...[, ...])

Recursively build blueprint containers/views mirroring _log_to_rerun structure.

_make_leaf_view(rrb, entity_path, rv, all_dims, ...)

Build a single typed rerun view for a result variable.

Module Contents

class bencher.results.rerun_result.RerunResult(bench_cfg: bencher.bench_cfg.BenchCfg)

Bases: bencher.results.bench_result_base.BenchResultBase

Result class that renders N-dimensional benchmark data into a rerun viewer.

Mapping strategy (three phases):

Phase 0 - over_time (the only rerun timeline): - If over_time is present it is iterated as the log_tick timeline. - All other data is logged statically (no timeline scrubber unless

over_time is used).

Phase A - Peel categorical dims as entity-tree branches: - If cats AND floats exist: peel ALL cats as entity branches. - If cats ONLY (no floats): peel cats until exactly 1 remains

(the last cat becomes the BarChart axis).

Phase B - Handle remaining float dims: - 0 dims -> rr.Scalars (scalar value) - 1 dim, cat -> rr.BarChart - 1 dim, float (no over_time) -> line graph via _log_line_graph - 1 dim, float (inside over_time) -> rr.Tensor (1-D) - 2 dims -> rr.Tensor (2-D array displayed as heatmap) - 3 dims -> rr.Tensor (3-D array displayed as volume slices) - >3 dims -> peel outermost float dim as entity branch, recurse

A rerun blueprint is built to control the viewer layout, with typed views (TimeSeriesView, TensorView, BarChartView) arranged in Grid/Vertical containers. The log_time timeline is disabled so only log_tick is shown.

to_rerun(result_var: param.Parameter | None = None, width: int = 950, height: int = 712) panel.panel

Convert N-dimensional benchmark results to a rerun viewer.

Saves the recording to an .rrd file and returns a Panel pane with the rerun web viewer embedded as an iframe. Requires the Flask file server to be running (call bch.run_flask_in_thread() first).

Parameters:
  • result_var – Optional specific result variable to display. If None, all are shown.

  • width – Width of the rerun viewer widget.

  • height – Height of the rerun viewer widget.

Returns:

A panel pane containing the rerun viewer.

to_rerun_plots(**kwargs) panel.panel

Plot callback for the rerun backend — drop-in replacement for to_auto_plots.

Renders the sweep summary, the rerun viewer, and the post-description, mirroring the structure of BenchResult.to_auto_plots so that switching backend="rerun" on BenchRunCfg produces a familiar report layout.

bencher.results.rerun_result._rv_name_and_path(entity_path: str, rv) tuple[str, str]

Return (rv_name, entity_path/rv_name) for a result variable.

bencher.results.rerun_result._extract_scalar(dataset: xarray.Dataset, rv_name: str, sel: dict | None = None)

Extract a scalar value from dataset[rv_name], optionally slicing first.

bencher.results.rerun_result._log_to_rerun(rr, recording, dataset: xarray.Dataset, entity_path: str, result_vars: list, float_dims: list[str], cat_dims: list[str], time_dim: str | None, inside_time_iteration: bool = False)

Recursively map N-dimensional data to rerun entity paths and timelines.

Phase 0: iterate over_time as the sole rerun timeline (log_tick). Phase A: peel categorical dims as entity-tree branches. Phase B: map remaining float dims to native rerun archetypes (Scalars, BarChart, line graph, or Tensor).

bencher.results.rerun_result._log_line_graph(rr, recording, dataset: xarray.Dataset, entity_path: str, rv, float_dim: str)

Log a 1D float sweep as a line graph by iterating the float dim as log_tick.

bencher.results.rerun_result._log_bar_chart(rr, recording, dataset: xarray.Dataset, entity_path: str, rv, cat_dim: str)

Log a result variable as a BarChart over a categorical dimension.

bencher.results.rerun_result._log_tensor(rr, recording, dataset: xarray.Dataset, entity_path: str, rv, dims: list[str])

Log a result variable as an N-D Tensor (heatmap for 2D, volume for 3D).

bencher.results.rerun_result._log_result_var(rr, recording, dataset: xarray.Dataset, entity_path: str, rv)

Log a single result variable to rerun at the current entity path.

bencher.results.rerun_result._build_blueprint(rrb, result_vars, float_dims, cat_dims, time_dim, dim_values)

Build a rerun Blueprint with typed views matching the data layout.

bencher.results.rerun_result._peel_dim_as_grid(rrb, entity_path, dim, dim_values, build_child)

Build a Grid by peeling dim and calling build_child for each value.

bencher.results.rerun_result._build_blueprint_contents(rrb, entity_path: str, result_vars: list, float_dims: list[str], cat_dims: list[str], time_dim: str | None, dim_values: dict[str, list[str]], inside_time_iteration: bool = False)

Recursively build blueprint containers/views mirroring _log_to_rerun structure.

bencher.results.rerun_result._make_leaf_view(rrb, entity_path, rv, all_dims, cat_dims, inside_time_iteration)

Build a single typed rerun view for a result variable.