Skip to content

Plot the estimate of every solver on the benchmark pages - #17

Merged
mrava87 merged 2 commits into
mainfrom
estimate-figures
Oct 23, 2026
Merged

mrava87 merged 2 commits into
mainfrom
estimate-figures

Conversation

@mrava87

@mrava87 mrava87 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Each leaderboard row on a benchmark page now links a figure of that solver's estimate: true model | estimate | error, titled with the solver, its parameters and its PSNR.

  • Saving the estimates: each benchmarks/*/objective.py gets save_final_results(self, x). BenchOpt then stores each solver's estimate inline in the .parquet output.
  • Collecting (pylops_bench/results.py, scripts/collect_results.py): raw results are read with benchopt.results.read_results, which handles both .csv and .parquet.
    • Each estimate is saved as estimates/<bench>/<key>.npz, in float32 or complex64. The key is a hash of the configuration that stays the same when other solvers add parameter columns, and after a CSV round trip.
    • A new estimate column holds the file name.
    • .npz files no longer referenced by the table are deleted.
    • New option: --estimates-dir.
  • Datasets: every dataset has an optional plot_estimate(x_true, x, meta) method. It uses the same colour scales as plot. Seismic prestack gets a 3x3 grid, one row per parameter.
  • Docs (docs/generate_benchmarks.py): each dataset is loaded once per configuration. Estimates are plotted at build time, so changing the plot style needs no re-run. A Figure column links each PNG. Pages with no estimates don't get the column. A plot that fails is logged and skipped, so it can't break -W builds.
  • CI:
    • run_benchmarks.yml writes .parquet and publishes the estimates to an orphan estimates branch. It is force-pushed as a single parentless commit, so the binaries never pile up in git history. Each run first pulls that benchmark's existing estimates so stale files get pruned.
    • docs.yml extracts the estimates branch before building.
    • pr_smoke.yml writes .parquet too.

Rollout

The committed CSVs have no estimate column yet, so no links appear until the benchmarks are re-run. Merging this PR touches every objective.py, which triggers run_benchmarks.yml for all benchmarks. The first run creates the estimates branch; the fetch steps cope with it being missing.

Test plan

  • uv run pytest: 56 passed. New tests cover saving, keying, overwriting and pruning estimates, dry runs and CSV input, plus a plot_estimate test per benchmark.
  • Locally ran compressive_sensing and image_deblurring to .parquet, collected them into scratch folders and built the docs with -W. The Figure column renders as download links, and the figures were checked visually.
  • The CI git steps that publish the estimates branch (write-tree / commit-tree / force-push), on the first run after merge.
  • The docs build picks up the estimates branch.

🤖 Generated with Claude Code

mrava87 and others added 2 commits October 23, 2026 16:53
The objectives return the solver estimate from save_final_results, so that
BenchOpt stores it in the parquet output. collect_results.py saves each
estimate as estimates/<bench>/<key>.npz (single precision), records the file
name in a new `estimate` column of the result table and prunes the files no
longer referenced.

Each dataset gets an optional plot_estimate(x_true, x, meta) method (true
model, estimate and error), drawn at docs build time for every leaderboard
row with an estimate and linked from a new Figure column.

In CI the benchmarks write parquet files, and the estimates are kept on the
orphan `estimates` branch, force-pushed as a single parentless commit so that
binaries never pile up in the history. The docs build extracts that branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrava87
mrava87 merged commit f372d66 into main Oct 23, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant