perf: share depth-invariant type class cache entries across synthPendingDepth#14298
perf: share depth-invariant type class cache entries across synthPendingDepth#14298Kha wants to merge 3 commits into
synthPendingDepth#14298Conversation
|
!bench |
|
!bench mathlib |
|
Benchmark results for 888c16a against 41b2fe8 are in. No significant results found. @Kha
Small changes (7✅, 4🟥)
|
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@164b1c9 against leanprover-community/mathlib4-nightly-testing@ce52fd1 are in. There are significant results. @Kha
No significant changes detected. |
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@25a481d against leanprover-community/mathlib4-nightly-testing@8d815fe are in. There are significant results. @Kha
No significant changes detected. |
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@bce7bc3 against leanprover-community/mathlib4-nightly-testing@8d815fe are in. There are significant results. @Kha
Large changes (1✅) 1 hidden Medium changes (5✅)
Small changes (98✅, 1🟥) Too many entries to display here. View the full report on radar instead. |
|
!bench |
|
Benchmark results for 898391e against 41b2fe8 are in. No significant results found. @Kha
Small changes (9✅, 2🟥)
|
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@fb458b8 against leanprover-community/mathlib4-nightly-testing@8d815fe are in. There are significant results. @Kha
Large changes (1✅) 1 hidden Medium changes (16✅)
Small changes (164✅) Too many entries to display here. View the full report on radar instead. |
|
!bench |
|
Benchmark results for e7b4775 against 41b2fe8 are in. No significant results found. @Kha
Small changes (9✅, 10🟥)
|
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@79f909f against leanprover-community/mathlib4-nightly-testing@8d815fe are in. There are significant results. @Kha
No significant changes detected. |
…dingDepth` The type class resolution cache is keyed by `synthPendingDepth` (issue #2522), which partitions the whole cache by depth even though the depth can only influence a query through the `synthPending` give-up check. Track whether a query ever reached a `synthPending` decision (via a non-backtrackable `IO.Ref` in `Meta.Context`, so discarded search branches still count); results of queries that never did are now cached with `synthPendingDepth := none` and shared across all depths. Depth-sensitive results remain keyed by their exact depth as before. The `Meta.synthInstance.cache` trace now includes the depth when it is nonzero. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…epth Instead of a single depth-invariant class, each shared type class resolution cache entry now records the maximal `synthPendingDepth` (relative to the query) at which a `synthPending` decision was reached during synthesis, and is reused at any depth at which no such decision can reach the `maxSynthPendingDepth` give-up threshold. Only results whose synthesis actually hit the threshold remain keyed to their exact depth. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drop `synthPendingDepth` from the type class resolution cache key: an entry now pairs an optional shared result (bounded by its relative `synthPending` activity depth) with an optional depth-exact result (from syntheses that hit the `maxSynthPendingDepth` give-up). Each query thus performs a single cache lookup, and both kinds of result for the same query can coexist without evicting each other. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
!bench |
|
!bench mathlib |
|
Benchmark results for 8b0a880 against 1422c82 are in. No significant results found. @Kha
Small changes (8✅, 3🟥)
|
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@a7ee3d2 against leanprover-community/mathlib4-nightly-testing@de3a9cf are in. There are significant results. @Kha
No significant changes detected. |
The type class resolution cache is keyed by
synthPendingDepth(issue #2522), which partitions the whole cache by depth even though the depth can only influence a query through thesynthPendinggive-up check. Track whether a query ever reached asynthPendingdecision (via a non-backtrackableIO.RefinMeta.Context, so discarded search branches still count); results of queries that never did are now cached withsynthPendingDepth := noneand shared across all depths. Depth-sensitive results remain keyed by their exact depth as before. TheMeta.synthInstance.cachetrace now includes the depth when it is nonzero.