Conversation
This PR adds path compression to the DiscrTree trie data structure. Instead of a single `.node` constructor, the `Trie` type now has four constructors: `.empty`, `.values`, `.path` (for compressed sequences of keys with no branching), and `.branch`. This significantly reduces the size and maximum depth of large discrimination trees. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2e0c3de to
f82aa9a
Compare
|
!radar |
|
Benchmark results for f82aa9a against 333ab1c are in! @nomeata
Large changes (1🟥)
Medium changes (9✅)
Small changes (407✅, 7🟥) Too many entries to display here. View the full report on radar instead. |
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@a873fb4 against leanprover-community/mathlib4-nightly-testing@ec89131 are in! @nomeata
No significant changes detected. |
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
|
This analysis was generated by Claude. DiscrTree value array length analysis (Mathlib, all eagerly-loaded extensions)Ran against Mathlib with Per-extension breakdown
Note: Grind does not use DiscrTree. Histogram of value array lengths (combined)
Singleton optimization potential96.7% of value nodes contain exactly one value. A dedicated singleton constructor (storing a single value instead of an |
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@d3612e5 against leanprover-community/mathlib4-nightly-testing@ec89131 are in! @nomeata
No significant changes detected. |
|
Mathlib CI status (docs):
|
|
Sorry for temporarily hijacking this PR for a test, but radar should now use mathlib significances for nightly-testing comparisons: |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@d3612e5 against leanprover-community/mathlib4-nightly-testing@ec89131 are in! @Garmelon
Medium changes (1✅) 1 hidden Small changes (244✅, 2🟥) Too many entries to display here. View the full report on radar instead. |

This PR adds path compression to the DiscrTree trie data structure.
Instead of a single
.nodeconstructor, theTrietype now has fourconstructors:
.empty,.values,.path(for compressed sequences ofkeys with no branching), and
.branch. This significantly reduces thesize and maximum depth of large discrimination trees.