Repository navigation
Align statistics cache sharing test comments with reset-free contract - #25965
Merged
Merged
Conversation
…s_statistics_cache test
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25965 +/- ##
==========================================
+ Coverage 82.59% 82.64% +0.04%
==========================================
Files 1145 1147 +2
Lines 444096 445440 +1344
Branches 444096 445440 +1344
==========================================
+ Hits 366806 368113 +1307
+ Misses 55021 54975 -46
- Partials 22269 22352 +83 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
asolimando
approved these changes
Oct 2, 2026
asolimando
left a comment
Member
There was a problem hiding this comment.
@kosiew LGTM, one minor nit, thanks for the improvement over StatisticsContext cache!
Comment on lines
+5954
to
+5958
| // The measured arm drives the real `EnsureRequirements` rule, so the shared | ||
| // context under test is the one the rule actually uses — reimplementing it | ||
| // here would keep passing even if the rule stopped sharing. The baseline arm | ||
| // allocates a fresh `StatisticsContext` per node, reproducing the behavior | ||
| // before this change. |
Member
There was a problem hiding this comment.
Nit: I wonder if this comment is needed at all, the test reads well without, and it seems to cover why we did the change rather than the current state of the test itself. wdyt?
Contributor
Author
There was a problem hiding this comment.
alamb
approved these changes
Oct 29, 2026
alamb
left a comment
Contributor
There was a problem hiding this comment.
Thank you @kosiew and @asolimando
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
This is the last of a series of PR which
Rationale for this change
The
ensure_distribution_shares_statistics_cacheregression test still describes cache reset behavior that is no longer part of the intendedStatisticsContextcontract.The issue moves cache correctness away from an
EnsureRequirementsrewrite-specific reset protocol. The existing regression should therefore describe only what it actually verifies: that sharing oneStatisticsContextacross the distribution pass reduces repeated statistics computation compared with creating a fresh context for each node.What changes are included in this PR?
This PR updates comments and Rustdoc around
ensure_distribution_shares_statistics_cacheto remove references toreset_cache()behavior.In particular, it:
StatisticsContextacross nodes rather than resetting the cacheStatisticsContextper nodeThere are no executable code changes in this patch.
Are these changes tested?
The existing
ensure_distribution_shares_statistics_cacheregression test is unchanged.It continues to compare the real
EnsureRequirementspath using a sharedStatisticsContextagainst a baseline that creates a fresh context per node at depths 4 and 12, and asserts that the shared path performs fewer leaf-statistics computations.No new test cases are added by this patch.
Are there any user-facing changes?
No. This patch only updates test comments and Rustdoc to match the intended statistics-cache contract. There are no public API or runtime behavior changes in this patch.
LLM-generated code disclosure
This PR includes LLM-generated code and comments. All LLM-generated content has been manually reviewed.