Skip to content

chore: reduce import all#41389

Open
felixpernegger wants to merge 1 commit into
leanprover-community:masterfrom
felixpernegger:lessimportall
Open

chore: reduce import all#41389
felixpernegger wants to merge 1 commit into
leanprover-community:masterfrom
felixpernegger:lessimportall

Conversation

@felixpernegger

@felixpernegger felixpernegger commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Removes import all whenever possible. I also tried to "downgrade" by changing to import from import all, but that never made a difference. Excludes MathlibTest.

For a related PR, see #41222.


Open in Gitpod

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

PR summary 65dd51a2d1

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Lean.Meta.RefinedDiscrTree.Encode 59 58 -1 (-1.69%)
Mathlib.Tactic.GCongr.Core 77 76 -1 (-1.30%)
Mathlib.Data.Int.Bitwise 397 394 -3 (-0.76%)
Mathlib.Control.Monad.Cont 134 133 -1 (-0.75%)
Mathlib.Data.Fintype.Parity 458 455 -3 (-0.66%)
Mathlib.Tactic.PNatToNat 483 480 -3 (-0.62%)
Import changes for all files
Files Import difference
../mathlib-ci/scripts/pr_summary/import_trans_difference.sh all
There are 7667 files with changed transitive imports taking up over 340132 characters: this is too many to display!
You can run this locally from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci


Declarations diff (regex)

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 65dd51a).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.

No changes to weak technical debt.

Current commit 65dd51a2d1
Reference commit 2051676240

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@felixpernegger

Copy link
Copy Markdown
Contributor Author

!bench

@leanprover-radar

leanprover-radar commented Jul 5, 2026

Copy link
Copy Markdown

Benchmark results for 65dd51a against 2051676 are in. No significant results found. @felixpernegger

  • 🟥 build//instructions: +66.3G (+0.04%)

Small changes (1✅)

  • build/module/Mathlib.Tactic.GCongr.Core//instructions: -889.3M (-3.86%)

@grunweg

grunweg commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

!bench

@leanprover-radar

Copy link
Copy Markdown

Benchmark results for 65dd51a against 2051676 are in. (These commits have already been benchmarked in a previous command.) No significant results found. @grunweg

  • 🟥 build//instructions: +66.3G (+0.04%)

Small changes (1✅)

  • build/module/Mathlib.Tactic.GCongr.Core//instructions: -889.3M (-3.86%)

@grunweg

grunweg commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Hm, I'm not sure what to make of the instruction increases. They are not large, but so is the benefit of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants