Repository navigation
Reduce MarkoffModP numerical certificate compiler memory - #1056
Conversation
|
Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict. [Low impact] No blocking issue was found in this proof-only change. SummaryReplaces three
Reviews (1) · Last reviewed commit: "Reduce MarkoffModP numerical certificate..." · Reviewed by Greptile |
Vilin97
left a comment
There was a problem hiding this comment.
Source review passed at 6510f55af58cbbf7b9eaef3b1946cbcb5a6e5913.
- The three symbolic power rewrites prove the same inequalities with the same constants. The low-order certificate and its assembly alias retain their statements. The existing copyright remains in place, and the change is recorded in the source.
- I matched the measured source to this head and checked the stored declaration audit and compiler samples. Both clean runs covered 615 modules. The edited file's anonymous-memory peak fell from 632,400 to 262,752 KiB, and the largest compiler process fell from 632,400 to 471,700 KiB. The separate single-file comparison also showed lower memory and runtime.
- The single whole-project wall-time comparison was 5.54% slower. The measured benefit is lower peak compiler memory. Required hosted Lean CI is running. Lean Action CI
Proof profile (new / modified Lean files)Statement changes✅ No statements changed — all 23 tracked declarations across 1 modified file kept their type; only proofs / definition bodies changed. Statements are compared textually against the merge base (comments and whitespace ignored; Compile cost of modified files — base → headHeartbeats: 88,620 → 68,552 (-20,068, -22.6%). Commands: 32 → 32. Per-file wall sum: 22.1 s → 17.9 s (-18.9%). Wall clock is measured under parallel load and is noisy; heartbeats are deterministic and are the regression signal. Files: 1 compared — 1 cheaper, 0 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
Advisory only — never blocks merge. Full log uploaded as the |
🤖 LLM review — refactor (
|
| Aspect | Value |
|---|---|
| Scope | symbolic power proof rewrite |
| Introduces tech debt | ✅ no |
| Maintainability | ✅ improved |
| Brittleness | ✅ more_robust |
| Risk | ✅ low |
The explicit identities give maintainers a specific rewrite to inspect if a step fails and leave more elaboration headroom for future changes.
Tokens: 1,943,791 in / 12,859 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $7.9680 (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. Peak anonymous compiler memory for MarkoffModP is 25.41% lower in the clean build comparison.
Proof change
MarkoffModP builds 615 modules. Its largest compiler process in the baseline compiled
ExplicitNumericCertificates.lean. The published source profile attributes 5.60 seconds toexplicit_lowOrder_forces_corvajaZannier_cubein the same source revision of that file. Lean Pool source profileUse
mul_pow,pow_mul, associativity, andpow_succ'in that proof to keep the ninth-moment coefficient symbolic through the power comparisons. The patch changes three proof steps in one file and records the modification in its attribution notice.Declaration audit
bb99e52c3f05626056b5718b442ec2f84ece1122and head6510f55af58cbbf7b9eaef3b1946cbcb5a6e5913use Lean 4.36.0 and Mathlibfc4f59e577feb1a4956671bc04ac18aaaf8cd842._proof_1_11under the edited theorem, differs solely in the macro scope counter on one inaccessible binder (1028→1089). Its type is alpha-identical and its other fields match. The source statement check also found zero statement changes, binder renames, additions, or removals.Measurements
Both measurements compiled all 615 project modules afresh in the same Azure worktree with warm, identical external dependency and compiler-plugin artifacts. The sampler covered all 615 modules in each run and read
RssAnonplusVmSwapfrom the Lean process tree about every 100 ms. An initial clean base run was repeated because its process discovery missed 50 compiler starts. The peak shifted fromExplicitNumericCertificates.leantoExactConstantExtensionDifferentCoefficient.lean.With dependencies cached, separate targeted builds of the edited file measured 8.684 → 3.027 seconds for the Lake command and 619,828 → 275,276 KiB of sampled anonymous memory. Whole-project wall times and simultaneous memory are observations from a shared VM.
Validation
LeanPoolLinters, plus the original stored compiler-message audit and changed-file timing gate.lake env lean --run scripts/ci/lint-project.leanfor all 615 owned modules, andlake exe lint-style LeanPool.MarkoffModP.Imports.lean_pool.quality --static-only, plus the repository's compiled axiom dependency, option and axiom-injection, and registered declaration audits scoped to MarkoffModP. A separate axiom traversal checked all 31 declarations in the edited module, including its private auxiliaries.lake exe mk_all --module --check, documentation workspace pin comparison, source index check throughlean_pool.rebase_fastpath check-index, andgit diff --check.lake shake --force --keep-public --gh-stylefor the edited module returned identical dependency suggestions at base and head. Full-pool compiled integration remains with hosted CI.