Repository navigation
Reduce SuzukiCancellation coefficient replay memory - #1061
Conversation
|
Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict. [Medium impact] No actionable issue was found in this proof-only refactor. SummaryThis refactor stages the coefficient checks in
Reviews (1) · Last reviewed commit: "Reduce SuzukiCancellation coefficient re..." · Reviewed by Greptile |
Proof profile (new / modified Lean files)Statement changes✅ No statements changed — all 45 tracked declarations across 2 modified files kept their type; only proofs / definition bodies changed. Also: 6 declarations added, 0 removed. A reorganization moves declarations between files, which shows up here as an add in one file and a remove in another. ➕ Declarations added (6)
Statements are compared textually against the merge base (comments and whitespace ignored; Compile cost of modified files — base → headHeartbeats: 669,231 → 772,512 (+103,281, +15.4%). Commands: 74 → 82. Per-file wall sum: 48.4 s → 49.6 s (+2.5%). Wall clock is measured under parallel load and is noisy; heartbeats are deterministic and are the regression signal. Files: 1 compared — 0 cheaper, 1 costlier, 0 within noise (threshold: |Δ heartbeats| ≥ 1,000 and ≥ 1%). Both sides are elaborated against the merge-base build of the pool — sound when only proofs and definition bodies change; a file whose statements changed may fail there and is flagged ⚠. Heartbeats come from disjoint root command traces with
New files — absolute profileTotal heartbeats: 15,849 maxHeartbeats units across 1 valid file (37 added LOC). Sum of Count-heartbeats wall-clock total: 4.13 s. Repeated import cost inside Heartbeat values sum disjoint root command traces with LOC counts added lines in the profiled Lean files from this PR diff.
Aggregate phase totals
Advisory only — never blocks merge. Full log uploaded as the |
Vilin97
left a comment
There was a problem hiding this comment.
Source review passed for a5e7c870554cf276340e8148d743f7178a37febf.
- The three public theorem statements are unchanged. The split coefficient replay preserves the order of the noncommutative factors and checks each table through degree five in the kernel. An independent integer convolution reproduced all 292 new suffix entries.
- The quintic jet proof uses the existing degree gap to eliminate the middle terms. It retains both degree-six products,
G * LandL * G, with the original factor of1/2. - The three reported matched project builds show 36.6% lower median peak sampled private memory and 14.6% lower median wall time. The hosted profile measured 15.4% more heartbeats for
SuzukiSeries. It recorded 15,849 heartbeats for the newQuinticJetproof after the baseline profiler hit its 200,000-heartbeat limit, so the profile does not provide a project-wide comparison. Hosted proof profile
The required pool build was still running at review time. Lean Action CI
🤖 LLM review — refactor (
|
| Aspect | Value |
|---|---|
| Scope | coefficient certificate staging and jet proof rewrite |
| Introduces tech debt | 🛑 yes |
| Maintainability | ✅ improved |
| Brittleness | ✅ more_robust |
| Risk | ✅ low |
The lower peak memory and clearer jet proof outweigh the small maintenance cost of one more kernel-checked coefficient table.
Findings (1)
- certificate-regeneration —
LeanPool/SuzukiCancellation/Analysis/Normed/Algebra/ProductFormula/SuzukiSeries.lean:450
Changes to the suffix factors or collection order can require refreshing all 292 rows, and a failed Boolean check identifies the degree without showing the differing row. Record a regeneration recipe beside the table. A scratch#reduceof(List.range 6).map (tableExpFrom ((argumentTables.take 6).drop 3) argumentTail)reproduced every row in order with increased recursion depth and deep-term printing enabled.
Tokens: 3,049,617 in / 17,410 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $12.4596 (Standard API equivalent; uncached input) (long-context rate)
Automated review against .github/REFACTOR_REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.
Ready for review. SuzukiCancellation cuts peak compiler memory by 36.6% and clean-build wall time by 14.6%, using medians of three runs.
Changes
eq_of_beq. Keep the original per-degree equality certificates.Mathlib.Tactic.Moduleimport and mark the remaining direct tactic dependencies for Shake.Declaration audit
The baseline came from
bf11e8085efe1edbea05c2e093be80c3616bade6before editing. The PR base is03eb2d5240860e41d7ebc71891311d07c0d6e282and the head isa5e7c870554cf276340e8148d743f7178a37febf. The project, its dependency pins, and its compiler-linter inputs are byte-identical between the measured and PR bases.A Lean environment inspector loaded the private and exported module views and serialized the kernel declarations into compressed manifests. It compared names, owners, universe parameters, elaborated types, safety, declaration kinds and metadata, and non-proof values structurally, ignoring expression annotations and theorem proof terms. All 1,677 private-view entries and 1,256 exported-view entries matched across 99 modules. The 24 new declarations are private helpers and their generated declarations.
Measurements
The existing source profile identified 21.46 s in
SuzukiSeries.leanand 7.49 s inQuinticJet.lean. These concentrated costs made the 99-module project a suitable target.Each run rebuilt all 99 project modules with Lean 4.36.0 and Mathlib
fc4f59e577feb1a4956671bc04ac18aaaf8cd842. I cleared only the project's Lake compiler outputs between runs, kept dependency artifacts warm, and used the same four VM cores.SuzukiSeriesQuinticJetRAM is the maximum per Lean process sampled at 50 ms intervals using
RssAnon + VmSwap.SuzukiSeriesaccounted for the peak in every run. The measurements apply to cached dependencies on this shared VM, and the wall times reflect contention.Local validation
lake env lean --run scripts/ci/lint-project.lean …over all 99 owned modules, with the compiler plugin and warnings-as-errors in the targeted build.lake exe lint-style LeanPool.SuzukiCancellation.Importsandlake shake --force --keep-public --keep-implied LeanPool.SuzukiCancellation.Importsfor import review. The import review is advisory. The explicit tactic imports are retained for their proof uses.python -m lean_pool.quality --repo . --static-onlyand the repository's project-scoped axiom, backdoor, declaration-resolution, and compiler-message audits.lake exe mk_all --module --check,python -m lean_pool.rebase_fastpath check-index,python -m lean_pool.build_time_limits check, andgit diff --check.