1- # Incremental Compilation in detail
1+ # Incremental compilation in detail
22
33<!-- toc -->
44
@@ -66,7 +66,7 @@ because it reads the up-to-date version of `Hir(bar)`. Also, we re-run
6666` type_check_item(bar) ` because result of ` type_of(bar) ` might have changed.
6767
6868
69- ## The Problem With The Basic Algorithm: False Positives
69+ ## The problem with the basic algorithm: false positives
7070
7171If you read the previous paragraph carefully you'll notice that it says that
7272` type_of(bar) ` * might* have changed because one of its inputs has changed.
@@ -93,7 +93,7 @@ of examples like this and small changes to the input often potentially affect
9393very large parts of the output binaries. As a consequence, we had to make the
9494change detection system smarter and more accurate.
9595
96- ## Improving Accuracy: The red-green Algorithm
96+ ## Improving accuracy: the red-green algorithm
9797
9898The "false positives" problem can be solved by interleaving change detection
9999and query re-evaluation. Instead of walking the graph all the way to the
@@ -191,7 +191,7 @@ then itself involve recursively invoking more queries, which can mean we come ba
191191to the ` try_mark_green() ` algorithm for the dependencies recursively.
192192
193193
194- ## The Real World: How Persistence Makes Everything Complicated
194+ ## The real world: how persistence makes everything complicated
195195
196196The sections above described the underlying algorithm for incremental
197197compilation but because the compiler process exits after being finished and
@@ -258,7 +258,7 @@ the `LocalId`s within it are still the same.
258258
259259
260260
261- ### Checking Query Results For Changes: HashStable And Fingerprints
261+ ### Checking query results for changes: ` HashStable ` and ` Fingerprint ` s
262262
263263In order to do red-green-marking we often need to check if the result of a
264264query has changed compared to the result it had during the previous
@@ -306,7 +306,7 @@ This approach works rather well but it's not without flaws:
306306 their stable equivalents while doing the hashing.
307307
308308
309- ### A Tale Of Two DepGraphs: The Old And The New
309+ ### A tale of two ` DepGraph ` s: the old and the new
310310
311311The initial description of dependency tracking glosses over a few details
312312that quickly become a head scratcher when actually trying to implement things.
@@ -344,7 +344,7 @@ new graph is serialized out to disk, alongside the query result cache, and can
344344act as the previous dep-graph in a subsequent compilation session.
345345
346346
347- ### Didn't You Forget Something ?: Cache Promotion
347+ ### Didn't you forget something ?: cache promotion
348348
349349The system described so far has a somewhat subtle property: If all inputs of a
350350dep-node are green then the dep-node itself can be marked as green without
@@ -374,7 +374,7 @@ the result cache doesn't unnecessarily shrink again.
374374
375375
376376
377- # Incremental Compilation and the Compiler Backend
377+ # Incremental compilation and the compiler backend
378378
379379The compiler backend, the part involving LLVM, is using the query system but
380380it is not implemented in terms of queries itself. As a consequence it does not
@@ -406,7 +406,7 @@ would save.
406406
407407
408408
409- ## Query Modifiers
409+ ## Query modifiers
410410
411411The query system allows for applying [ modifiers] [ mod ] to queries. These
412412modifiers affect certain aspects of how the system treats the query with
@@ -472,7 +472,7 @@ respect to incremental compilation:
472472[ mod ] : ../query.html#adding-a-new-kind-of-query
473473
474474
475- ## The Projection Query Pattern
475+ ## The projection query pattern
476476
477477It's interesting to note that ` eval_always ` and ` no_hash ` can be used together
478478in the so-called "projection query" pattern. It is often the case that there is
@@ -516,7 +516,7 @@ because we have the projections to take care of keeping things green as much
516516as possible.
517517
518518
519- # Shortcomings of the Current System
519+ # Shortcomings of the current system
520520
521521There are many things that still can be improved.
522522
0 commit comments