fix(prover): print per-table instruments report on the continuation path#853
Open
MauroToscano wants to merge 1 commit into
Open
fix(prover): print per-table instruments report on the continuation path#853MauroToscano wants to merge 1 commit into
MauroToscano wants to merge 1 commit into
Conversation
The `instruments` feature's per-table-kind timing report only printed on the monolithic `prove()` path. The continuation path (`prove_epoch`/`prove_global`) calls `Prover::multi_prove` directly; `multi_prove` still `store()`s the `MultiProveTiming` for each call, but nothing ever printed it, so `prove --continuations` with `--features instruments` produced no per-table report at all. Factor the mp-derived per-table block out of `instruments::print_report` into a shared `print_multi_prove()` helper, and add `print_epoch_report()` which drains the stored timing via `stark::instruments::take()` and formats it with that same helper. `prove_epoch`/`prove_global` now call it (feature-gated) right after each `multi_prove`, labeled "EPOCH N" / "GLOBAL". The monolithic path's output is unchanged (same statements, same order). All new code and both call sites are under `#[cfg(feature = "instruments")]`, so the feature-off build compiles identically with zero added overhead.
nicole-graus
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
The
instrumentscargo feature prints a rich per-table-kind timing report(merges split tables by kind, e.g.
MEMW[0..4] -> MEMW x5, aggregatescount / rows / duration / sub-ops, sorted by cost). That report was only ever
emitted on the monolithic
prove()path, from the#[cfg(feature = "instruments")]block inprover/src/lib.rs.The continuation path never went through that block:
prove_epochandprove_globalinprover/src/continuation.rscallProver::multi_provedirectly.
multi_provedoesinstruments::store(MultiProveTiming { .. })forevery call, so the per-table data was already being computed and stored — but
nothing on the continuation path ever printed it. Result:
prove --continuationswith--features instrumentsproduced no per-tablereport at all.
Fix
Feature-gated only (zero cost, and byte-for-byte identical compile, when the
feature is off):
prover/src/instruments.rs: factor the mp-derived per-table block out ofprint_reportinto a sharedprint_multi_prove(mp, total)helper, and addprint_epoch_report(label)which drains the timing stored by the precedingmulti_proveviastark::instruments::take()and formats it with that samehelper (so both paths format from a single source of truth). Also inlined a
literal into one
eprintln!format string to silence a pre-existingclippy::print_literalthat only trips under--features instruments;rendered output is unchanged.
prover/src/continuation.rs: after eachProver::multi_prove, callprint_epoch_report, labeledEPOCH Nfor each epoch (from the 1-basedEpochStart.label) andGLOBALfor the cross-epoch memory proof.The monolithic path's output is unchanged (same statements, same order — the
mp block was moved into a function and called with the same
mp/total). Noproving logic changed; this is purely gated reporting.
Note on
GLOBAL: its per-epochtotalis derived from the sum of the provingphases, so for a trivially small global proof (a couple of tiny tables that run
in parallel) individual table percentages can exceed 100% — an honest artifact
of parallel per-table timing against a tiny sequential-phase denominator (the
monolithic formatter has the same parallel overlap, just diluted by a larger
wall-clock total). The
EPOCH Nreports, which carry the real work, readnormally.
Verification
Built and ran a continuation prove that exercises
prove_epoch(x2) +prove_global:Per-epoch reports now print. Sample (trimmed):
EPOCH 0,EPOCH 1,GLOBAL).cargo build --release -p cli): zero instruments lines in thecontinuation prove output; compiles clean (all new code is
#[cfg(feature = "instruments")]).cargo test --release -p lambda-vm-prover --lib: 521 passed, 0 failed.clippy --features instruments(which CI'smake lintdoes not exercise)is clean on the changed crates; all three
make lintclippy passes exit 0;cargo fmt --checkis clean on the changed crates.