Build and verification report

ビルド・検証報告

Parallel build: the cleaned-up tree of the community repository並列ビルド:コミュニティのリポジトリの整理後のツリー

The community repository has reorganised the sources since the distribution. We built one of its later commits from scratch on one node, at 144, 64 and 32 threads, and measured the time. The page shows the times, what changed in the tree, and the limit that the build graph sets. This is a later build of another tree: the record of the first build (step 1) on the overview page is unchanged.

コミュニティのリポジトリでは,配布のあとにソースの整理が進んでいる.その後のコミットの 1 つを,1 ノードの上で,144,64,32 スレッドで最初からビルドし,時間を測った.所要時間,ツリーの変化,ビルドグラフから決まる限界を示す.これは別のツリーの,後から行ったビルドであり,概要のページにある最初のビルド(工程 1)の記録は変えていない.

This is one of the pages of the report “Independent build report on Alpöge’s Lean formal proof of the Riemann Hypothesis”. Its scope, and the pointer to the statement of the Lean and Mathlib communities, are on the page Overview.

このページは,報告「AlpögeによるRiemann予想のLean形式証明の独立ビルド報告」の一部である.報告の範囲と,Lean・Mathlib コミュニティの声明への案内は,ページ「概要」にある.

Data assembled: 2026-11-26. Page generated: 2026-11-26.

データ集約日:2026-11-26.ページ生成日:2026-11-26.

11Timing builds of the cleaned-up tree of the community repositoryコミュニティのリポジトリの整理後のツリーの計測ビルド

Summary要約

What this page is, and what it is notこのページが何であり,何でないか

Since the distribution, the community repository leanprover-community/riemann-hypothesis has reorganised the sources of the project. A public post by a developer of Lean reports that the reorganised tree compiles much faster on one large machine, and names the commit. We built that commit (9282d3a1) ourselves on RIKYU (RIKEN R-CCS), from scratch, at three thread counts. This page gives our own measurements only; the figures of the post are not repeated here.

コミュニティのリポジトリ leanprover-community/riemann-hypothesis では,配布のあとにプロジェクトのソースの整理が進んでいる.Lean の開発者による公開の投稿が,整理後のツリーは大きな機械 1 台で以前よりはるかに速くコンパイルできると報告し,コミットを示している.我々はそのコミット(9282d3a1)を,RIKYU (RIKEN R-CCS) で,3 通りのスレッド数で最初からビルドした.このページに載せるのは我々自身の計測だけである(投稿の数値は載せていない).

This is a later build of another tree. The record of the first build (Overview, section 2) and the statistics computed from it (Build analysis) are unchanged. Comparator was not run on this tree: the page says that the build completed and how long it took, nothing more. As everywhere in this report, it does not assess the mathematics.

これは別のツリーの,後から行ったビルドである.最初のビルドの記録(概要,第 2 節)と,そこから計算した統計(ビルドの解析)は変えていない.このツリーに対して Comparator は実行していない.このページが述べるのは,ビルドが完了したことと,その所要時間だけである.この報告の他の部分と同じく,数学的内容の評価は行わない.

lake build at 144 threads (one node)144 スレッド(1 ノード)での lake build
57 min 49 s57 分 49 秒
commit 9282d3a1, Lean v4.37.0-rc1, from scratchコミット 9282d3a1,Lean v4.37.0-rc1,最初から
Speed, 64 → 144 threads速さの比(64 → 144 スレッド)
1.74 times1.74 倍
for 2.25 times the cores: 1.60 per doublingコア数は 2.25 倍.2 倍あたり 1.60 倍
Work: sum of the module times仕事量(モジュール時間の和)
115 core-hours115 コア時間
distributed tree: 399 core-hours配布時のツリーは 399 コア時間
Longest chain of imports最長の依存の鎖
36 min 14 s36 分 14 秒
more cores cannot make the build shorter than thisコアを増やしても,これより短くはならない

What changed in the treeツリーで何が変わったか

The commit built here is 9282d3a102c4aff0e6026746db2a8990f5d9cddd of 2026-11-25. It is 123 first-parent merges after f1f6d654 (2026-11-22), the commit of the community repository used on the page Proof analysis for the indicators. The numbers of files below were counted by us in the public history of the repository.

ここでビルドしたコミットは 2026-11-25 の 9282d3a102c4aff0e6026746db2a8990f5d9cddd である.ページ「証明の解析」の指標に用いたコミュニティのリポジトリのコミット f1f6d654(2026-11-22)から,first-parent で 123 個のマージを経ている.以下のファイル数は,リポジトリの公開の履歴から我々が数えたものである.

Figure 29. Number of .lean files under src/ in the community repository, after each first-parent merge that changed it noticeably. In less than three days it went from 164,464 to 59,869.図 29. コミュニティのリポジトリの src/ にある .lean ファイルの数(数が目立って変わった first-parent のマージごと).3 日足らずで 164,464 から 59,869 になった.
.lean files under src/src/ にある .lean ファイルの数050K100K150K200K01224364860hours after commit f1f6d654コミット f1f6d654 からの経過(時間)
Data tableデータ表
merge or commitマージまたはコミットhours after f1f6d654f1f6d654 からの時間.lean files.lean ファイル
f1f6d654 (22 November)f1f6d654(11 月 22 日)0.0164,464
#68#683.9164,283
#66: Lean 4.36.0, module system, unreachable modules removed#66:Lean 4.36.0,module 形式,到達しないモジュールの削除10.6149,396
#185: Lean 4.37.0-rc1, imports minimised#185:Lean 4.37.0-rc1,import の最小化27.8149,217
#221#22135.9148,230
#324: thin wrappers removed, modules merged#324:薄いラッパーの削除とモジュールの結合43.462,159
#539#53943.962,074
#438: unused modules removed#438:使われないモジュールの削除46.260,790
9282d3a1 (the commit built here)9282d3a1(ここでビルドしたコミット)62.959,869

Four groups of changes account for almost all of this. The descriptions are those of the pull requests and commit messages of the community repository; we did not repeat these steps.

この変化のほとんどは,次の 4 つの変更による.説明はコミュニティのリポジトリのプルリクエストとコミットメッセージによるもので,我々がこれらの操作をやり直したわけではない.

Between the two commits, lakefile.toml differs only in the revision of Mathlib and in two libraries that had become empty; the options passed to Lean are the same. The build was not made faster by a build option.

2 つのコミットの間で,lakefile.toml の違いは Mathlib の版と,空になった 2 つのライブラリの削除だけで,Lean に渡すオプションは同じである.ビルドのオプションによって速くなったのではない.

The table compares the two trees as they were built. In the distributed tree, 136,003 of the 175,187 files (78%) began with import Mathlib, which loads the whole library. In 9282d3a1, 45 files do; the others import the Mathlib modules they need, 34 lines per file on average.

表は,ビルドした 2 つのツリーを比べたものである.配布時のツリーでは,175,187 ファイルのうち 136,003 ファイル(78%)が,ライブラリ全体を読み込む import Mathlib で始まっていた.9282d3a1 では 45 ファイルで,残りは必要な Mathlib のモジュールだけを import している(1 ファイルあたり平均 34 行).

quantity量distributed tree (Lean v4.33.1)配布時のツリー(Lean v4.33.1)9282d3a1 (Lean v4.37.0-rc1)9282d3a1(Lean v4.37.0-rc1)ratio比
.lean files under src/src/ にある .lean ファイル175,18759,8690.34 times0.34 倍
lines of sourceソースの行数17,549,40216,060,2400.92 times0.92 倍
size of the sources (MB)ソースの大きさ(MB)1,0311,0581.03 times1.03 倍
files in the module systemmodule 形式のファイル059,868—
files that import all of Mathlib (import Mathlib)Mathlib 全体を import するファイル(import Mathlib)136,00345—
imports between files of the project (edges)プロジェクト内の import(辺)720,138367,7890.51 times0.51 倍
depth of the import graph (modules)import グラフの深さ(モジュール)182940.52 times0.52 倍
work: sum of the module times (core-hours)仕事量:モジュール時間の和(コア時間)399.5114.80.29 times0.29 倍
mean time of a moduleモジュール 1 つの時間の平均8.3 s8.3 秒6.9 s6.9 秒0.83 times0.83 倍
median time of a moduleモジュール 1 つの時間の中央値6.7 s6.7 秒4.4 s4.4 秒0.66 times0.66 倍
modules that take 60 s or more60 秒以上かかるモジュール5772640.46 times0.46 倍
longest chain of imports (minutes)最長の依存の鎖(分)49.136.20.74 times0.74 倍

The module times are those printed by Lake in the log of each build: for the distributed tree the build of step 1 (64 threads; times are in the logs for 173,570 of its modules), for 9282d3a1 the build at 144 threads. The two builds ran under different load and with different versions of Lean, so the ratio of the work is indicative. We did not separate the effect of the new version of Lean from the effect of the changes in the tree.

モジュール時間は,それぞれのビルドのログに Lake が出力した値である.配布時のツリーは工程 1 のビルド(64 スレッド.時間がログにあるのは 173,570 モジュール),9282d3a1 は 144 スレッドのビルドによる.2 つのビルドは負荷も Lean の版も違うので,仕事量の比は目安である.Lean の版が新しくなった効果と,ツリーの変化の効果は,分けていない.

How the builds were runビルドの方法

Results結果

threadsスレッドGPUsGPUlake build, wall-clocklake build の実時間cores in use, mean使用コア数の平均share of the allocated cores割り当てコアに対する割合time to 90% of the filesファイルの 90% までの時間time for the last 10%残り 10% の時間CPU time (core-hours)CPU 時間(コア時間)
144457 min 49 s57 分 49 秒122.585%44 min 43 s44 分 43 秒13 min 06 s13 分 06 秒117.8
6421 h 40 min1 時間 40 分61.596%1 h 28 min1 時間 28 分11 min 54 s11 分 54 秒102.8
3212 h 29 min2 時間 29 分31.799%2 h 17 min2 時間 17 分12 min 24 s12 分 24 秒78.7

“Cores in use” is the CPU time of the job divided by the wall-clock time of lake build; it includes Lake itself.

「使用コア数」は,ジョブの CPU 時間を lake build の実時間で割ったもので,Lake 自身の分を含む.

threadsスレッドexit code of lake buildlake build の終了コードfailed jobs失敗したジョブerror linesエラー行sorry warningssorry の警告modules compiledコンパイルしたモジュールwarning lines警告の行smallest free memory of the nodeノードの空きメモリの最小値
144000059,868257,3131,402 GiB
64000059,868257,3131,447 GiB
32000059,868257,3131,499 GiB

59,868 of the 59,869 files were compiled. The remaining one is Challenge.lean, the statement file of the Comparator set-up of the repository; it is not imported by Main and is not part of the default build target.

59,869 ファイルのうち 59,868 個をコンパイルした.残りの 1 つは,リポジトリの Comparator の設定で言明を述べるファイル Challenge.lean で,Main からは import されず,既定のビルド対象に入っていない.

Figure 30. Progress of the three builds: number of .olean files written (one per compiled module) against the time since the start of lake build.図 30. 3 本のビルドの進み方:できた .olean ファイルの数(コンパイルしたモジュール 1 つにつき 1 個)と,lake build の開始からの時間.
144 threads144 スレッド64 threads64 スレッド32 threads32 スレッド
.olean files writtenできた .olean ファイルの数020K40K60K0255075100125minutes since the start of lake buildlake build の開始からの経過(分)144 threads144 スレッド64 threads64 スレッド32 threads32 スレッド

Samples taken every 15 seconds, drawn once per minute.

15 秒ごとの標本を 1 分ごとに描いた.

Figure 31. Cores in use during the three builds. At 144 threads the last 8 minutes used at most 10 cores. At 64 threads the last 4 minutes used at most 5 cores. At 32 threads nearly all cores were in use until the end.図 31. 3 本のビルドで使われていたコアの数.144 スレッドでは,最後の 約 8 分に使われたコアは 10 個以下だった.64 スレッドでは,最後の 約 4 分に使われたコアは 5 個以下だった.32 スレッドでは,最後までほぼ全コアが使われた.
144 threads144 スレッド64 threads64 スレッド32 threads32 スレッド
cores in use使われていたコア数0501001500255075100125minutes since the start of lake buildlake build の開始からの経過(分)144 threads144 スレッド64 threads64 スレッド32 threads32 スレッド

Increase of the CPU time of the job (control group) in each minute, divided by 60 seconds.

ジョブの CPU 時間(コントロールグループ)の 1 分ごとの増分を 60 秒で割った値.

The build at 144 threads has two parts. For about 50 minutes nearly all cores were busy; 99% of the files were written by 48 min 25 s. In the remaining 8 minutes at most 10 cores were busy. With fewer cores this last part is shorter or absent: the modules of the chain are finished one by one while the other work is still going on.

144 スレッドのビルドは 2 つの部分に分かれる.開始から 約 50 分はほぼ全コアが使われ,ファイルの 99% は 48 分 25 秒までにできた.残りの 約 8 分に使われたコアは 10 個以下である.コアが少ないと,この終盤は短いか,現れない.鎖の上のモジュールが,ほかの仕事が終わる前に順に片づいていくためである.

After the build, the build directory held 211 GiB: 140.6 GiB of .setup.json files, in which Lake lists the imports of each module (about 2.3 MiB each), 51.3 GiB of .olean.private files and 9.2 GiB of .olean files.

ビルド後のビルドディレクトリは 211 GiB だった.内訳は,Lake がモジュールごとに import の一覧を書く .setup.json が 140.6 GiB(1 つ 約 2.3 MiB),.olean.private が 51.3 GiB,.olean が 9.2 GiB である.

Threads and speedスレッド数と速さ

Figure 32. Speed of the build against the number of threads, relative to the build at 32 threads.図 32. スレッド数とビルドの速さ(32 スレッドのビルドを 1 とした比).
measured実測in proportion to the coresコア数に比例する場合
speed relative to 32 threads32 スレッドに対する速さの比0.001.002.003.004.005.0003264144Lake threads (= allocated cores)Lake のスレッド数(=割り当てたコア数)measured実測in proportion to the coresコア数に比例する場合
Data tableデータ表
threadsスレッドlake build, wall-clocklake build の実時間speed relative to 32 threads32 スレッドに対する速さの比cores relativeコア数の比
322 h 29 min2 時間 29 分1.001.00
641 h 40 min1 時間 40 分1.482.00
14457 min 49 s57 分 49 秒2.584.50

The shortfall from proportionality has two parts.

比例から外れる分は,2 つに分けられる.

Together: 4.50 times the cores, divided by 1.50 for the larger CPU time and multiplied by 0.86 for the lower share in use, gives 2.58, the measured ratio of 2.58.

合わせると,コア数 4.50 倍を,CPU 時間の増加の 1.50 で割り,使用率の低下の 0.86 を掛けて,2.58 倍になる.実測の比は 2.58 倍である.

On the distributed tree with Lean v4.33.1, short trials had shown the opposite at 144 threads: the build rate fell to about 176 modules per minute, below the rate at 96 threads (Build analysis, section 5). That did not happen here: at 144 threads, 59,868 modules were compiled in 57 min 49 s, about 1,036 per minute on average. The version of Lake, the number of modules and the size of the import closures all differ between the two cases; we did not isolate the cause.

配布時のツリーと Lean v4.33.1 では,短い試行で,144 スレッドにすると逆の結果が出ていた.ビルド速度は毎分 約 176 モジュールに落ち,96 スレッドのときより遅かった(ビルドの解析,第 5 節).今回はそれが起きなかった.144 スレッドで,59,868 モジュールを 57 分 49 秒でコンパイルしており,平均で毎分 約 1,036 モジュールである.2 つの場合では,Lake の版,モジュール数,import の閉包の大きさがどれも違う.原因は切り分けていない.

What the build graph allowsビルドグラフから決まる限界

Lake compiles one module (one .lean file) per lean process, and starts a module when all the modules it imports are done. The time of a build is therefore set by three things: the total work (the sum of the module times), the longest chain of modules that import one another, and the fixed cost of each module (starting the process and loading its imports).

Lake は,モジュール(.lean ファイル)1 つを lean プロセス 1 つでコンパイルし,import するモジュールがすべてできてから,そのモジュールを始める.したがってビルドの時間は,仕事量の合計(モジュール時間の和),互いに import し合うモジュールの最長の鎖,モジュールごとの固定費(プロセスの起動と import の読み込み),の 3 つで決まる.

From the import graph and the module times of the build at 144 threads we simulated a build in which a free core takes a module that is ready, in two orders: the module that became ready first, and the module with the longest chain of work still depending on it. The simulation contains neither the work of Lake itself nor the change of the module times with the load.

import のグラフと,144 スレッドのビルドのモジュール時間から,空いたコアが準備のできたモジュールを取るビルドを模擬した.取る順序は 2 通りで,先に準備ができたものからと,それに依存する仕事の鎖が最も長いものからである.模擬には,Lake 自身の処理も,負荷によるモジュール時間の変化も入っていない.

modules at the same time同時に動かせる数9282d3a1: simulated, first ready first9282d3a1:模擬(準備ができた順)9282d3a1: simulated, longest chain first9282d3a1:模擬(最長の鎖を優先)9282d3a1: measured9282d3a1:実測distributed tree: simulated, first ready first配布時のツリー:模擬(準備ができた順)distributed tree: simulated, longest chain first配布時のツリー:模擬(最長の鎖を優先)
323 h 49 min3 時間 49 分3 h 36 min3 時間 36 分2 h 29 min2 時間 29 分12 h 36 min12 時間 36 分12 h 29 min12 時間 29 分
642 h 05 min2 時間 05 分1 h 48 min1 時間 48 分1 h 40 min1 時間 40 分6 h 24 min6 時間 24 分6 h 16 min6 時間 16 分
1441 h 08 min1 時間 08 分48 min 40 s48 分 40 秒57 min 49 s57 分 49 秒2 h 57 min2 時間 57 分2 h 48 min2 時間 48 分
19256 min 04 s56 分 04 秒36 min 43 s36 分 43 秒—2 h 16 min2 時間 16 分2 h 07 min2 時間 07 分
28845 min 36 s45 分 36 秒36 min 14 s36 分 14 秒—1 h 35 min1 時間 35 分1 h 25 min1 時間 25 分
57636 min 29 s36 分 29 秒36 min 14 s36 分 14 秒—1 h 01 min1 時間 01 分49 min 06 s49 分 06 秒
1,15236 min 14 s36 分 14 秒36 min 14 s36 分 14 秒—50 min 34 s50 分 34 秒49 min 06 s49 分 06 秒
no limit制限なし36 min 14 s36 分 14 秒36 min 14 s36 分 14 秒—49 min 06 s49 分 06 秒49 min 06 s49 分 06 秒

The simulation of 9282d3a1 uses the module times measured at 144 threads, which are longer than under a lighter load; its rows for fewer threads therefore do not match the measured times. The simulation of the distributed tree uses the times of the build of step 1 (64 threads).

9282d3a1 の模擬は 144 スレッドで測ったモジュール時間を使っている.この時間は負荷が軽いときより長いので,スレッドの少ない行は実測と合わない.配布時のツリーの模擬は,工程 1 のビルド(64 スレッド)の時間を使っている.

Figure 33. Modules being compiled at the same time in the build at 144 threads: measured, and simulated from the import graph (first ready first). In both, the number falls to a few at the end. The fall follows from the shape of the graph.図 33. 144 スレッドのビルドで同時にコンパイルされていたモジュールの数:実測と,import のグラフからの模擬(準備ができた順).どちらでも,終盤に数個まで落ちる.この低下はグラフの形から生じている.
measured: lean processes実測:lean プロセスの数simulated: modules being compiled模擬:コンパイル中のモジュールの数
modules being compiledコンパイル中のモジュールの数0501001500204060minutes since the start of lake buildlake build の開始からの経過(分)measured: lean processes実測:lean プロセスの数simulated: modules being compiled模擬:コンパイル中のモジュールの数

Measured: number of lean processes, mean of the 15-second samples of each minute. The simulated build ends later than the measured one: Lake does not take the modules in the simulated order.

実測は lean プロセスの数で,15 秒ごとの標本の 1 分ごとの平均.模擬のビルドは実測より遅く終わる.Lake がモジュールを取る順序は,模擬の順序と同じではない.

The 8 slowest modules on the longest chain最長の鎖の上で時間のかかるモジュール(上位 8)
moduleモジュールtime at 144 threads (s)144 スレッドでの時間(秒)
Development.AbelianVarietyTheory.Proofs.DivisorProofs.HarrisTaylorExistsGluedFirstOrderDeformation329
Development.AbelianVarietyTheory.Proofs.Div…orProofs.ExistsUniversalTangentHarrisTaylorRepresentingFaStatement306
Development.AbelianVarietyTheory.Proofs.CoherentCohomologyProofs.HigherDirectImagesVanishOfIsAffineHom220
Development.AbelianVarietyTheory.Proofs.DivisorProofs.ExistsSqZeroLiftRealisingKs205
Development.AbelianVarietyTheory.Proofs.DivisorProofs.SmoothOfRelativeDimensionStatement187
Development.AbelianVarietyTheory.Proofs.CoherentCohomologyProofs.PushComparisonBijectiveOfIsClosedEmbedding145
Development.AutomorphicArithmetic.Foundatio…presentations.LefschetzSigmaSums.HodgeTraceOfLefschetzAndGroupSide135
Development.AbelianVarietyTheory.Proofs.CoherentCohomologyProofs.MapFOneInjectiveOfSectionsSurjective81

Cost, and what was not checked費用と,確認していないこと

threadsスレッドrun実行jobジョブstarted開始GPUsGPUelapsed time of the jobジョブの経過時間GPU-hoursGPU 時間cost (yen)費用(円)
14420261126-021844-build-bench1443964302026-11-26 02:1841 h 03 min1 時間 03 分4.201,260
6420261126-022525-build-bench643964322026-11-26 02:2521 h 47 min1 時間 47 分3.551,066
3220261126-022527-build-bench323964332026-11-26 02:2512 h 35 min2 時間 35 分2.58775
sum和5 h 25 min5 時間 25 分10.343,101

The time of a job also contains the download of the sources, of the toolchain and of the Mathlib cache, before lake build starts.

ジョブの時間には,lake build を始める前の,ソース,toolchain,Mathlib のキャッシュの取得が入っている.