Skip to content

Commit 1422c82

Browse files
authored
test: use plain shareCommon before kernel check in vcgen benchmarks (#14304)
This PR restores the `vcgen` benchmarks that regressed with `maximum recursion depth has been reached` at larger sizes. The benchmark driver applied `Sym.shareCommon` to the whole proof term before kernel checking in order to restore structural sharing. `Sym.shareCommon` now enforces the `SymM` representation invariants and repairs kernel projections via `Meta.transform`, which recurses under `maxRecDepth`; on the O(n)-deep `State`/`Reader` proof terms this overflows the limit. The driver now calls `Lean.ShareCommon.shareCommon`, the primitive backing `shareCommonPreDefs`, which is the step the driver was emulating.
1 parent 3fce916 commit 1422c82

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/bench/vcgen/lib/Driver.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def driver (goal : Name) (unfold : List Name) (n : Nat) (discharge : MetaM (TSyn
4141
let ([], _) ← Lean.Elab.runTactic mvarId discharge.raw {} {}
4242
| throwError "{dischargePp} failed to solve {mvarId}"
4343
let (expr, instMs) ← timeItMs (instantiateMVars mvar)
44-
-- Emulate the shareCommonPreDefs step before sending the term to the kernel.
45-
-- If we don't do this, kernel checking time balloons.
46-
let expr ← SymM.run (shareCommon expr)
44+
-- Apply the `shareCommonPreDefs` structural sharing before sending the term to the
45+
-- kernel. If we don't do this, kernel checking time balloons.
46+
let expr := Lean.ShareCommon.shareCommon expr
4747
let (_, kernelMs) ← timeItMs (checkWithKernel expr)
4848
let label := s!"{goal.getPrefix}({n}):"
4949
let pad := "".pushn ' ' (24 - min label.length 24)

0 commit comments

Comments
 (0)