lean4-htt/tests/bench/build
Garmelon 49715fe63c
chore: improve how test suite interacts with stages (#12913)
The tests need to run with certain environment variables set that only
cmake really knows and that differ between stages. Cmake could just set
the variables directly when running the tests and benchmarks, but that
would leave no good way to manually run a single benchmark. So cmake
generates some stage-specific scripts instead that set the required
environment variables.

Previously, those scripts were sourced directly by the individual
`run_*` scripts, so the env scripts of different stages would overwrite
each other. This PR changes the setup so they can instead be generated
next to each other. This also simplifies the `run_*` scripts themselves
a bit, and makes `tests/bench/build` less of a hack.
2026-03-16 15:20:03 +00:00
..
fake_root/bin
lakeprof_report_template.html
lakeprof_report_upload.py chore: improve how test suite interacts with stages (#12913) 2026-03-16 15:20:03 +00:00
lean_wrapper.py
README.md
run_bench.sh chore: improve how test suite interacts with stages (#12913) 2026-03-16 15:20:03 +00:00

The build benchmark

This benchmark executes a complete build of the stage3 stdlib from stage2 and collects global and per-module metrics. This is different from most other benchmarks, which benchmark the stage the bench suite is being executed in.

The following metrics are collected by a wrapper around the entire build process:

  • build//cycles
  • build//instructions
  • build//maxrss
  • build//task-clock
  • build//wall-clock

The following metrics are collected from leanc --profile and leanc --stat and summed across all modules:

  • build/profile/<name>//wall-clock
  • build/stat/<name>//amount
  • build/stat/<name>//bytes

The following metrics are collected from lakeprof report:

  • build/lakeprof/longest build path//wall-clock
  • build/lakeprof/longest rebuild path//wall-clock

The following metrics are collected individually for each module:

  • build/module/<name>//lines
  • build/module/<name>//cycles
  • build/module/<name>//instructions
  • build/module/<name>//bytes .ilean
  • build/module/<name>//bytes .olean
  • build/module/<name>//bytes .olean.server
  • build/module/<name>//bytes .olean.private

If the file build_upload_lakeprof_report is present in the repo root, the lakeprof report will be uploaded once the benchmark run concludes.