leanprover / leanprover/lean4

`lake` should prioritize files with deeper dependencies

Open
#7,296 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Lake P-medium
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Currently when building Mathlib we spend most of the build maxing out CPUs (at least at 24 cores), but there are at least several minutes at the end when we are using fewer.

We could easily avoid this: prioritize tasks according to the depth of downstream dependencies. In particular, this would keep a "pool" of leaf files available to run only when there are spare CPUs, and should ensure full parallelism until the very end.

This costs minutes of time (or at least, extra context switching) every time I am working on Mathlib in a way that requires full builds, and I'm sure it would improve life for many others as well (as well as CI responsiveness).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining lake's build-task scheduling and dependency handling, since the issue names no specific files or tests. The change should prioritize tasks with deeper downstream dependencies, reserve leaf files for spare CPUs, and preserve full parallelism until the build is nearly complete.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.