Part of #33.
What
Rebuild applicability.rs (PR #247) as a reporting view over the Cascades/Volcano search's resulting candidate-plan space, instead of a parallel system that re-walks the tree itself.
Today, SketchApplicabilityRule/SharedSubexpressionRule each do their own traversal and re-derive a yes/no fact that the search (once the other #33 sub-issues land) will already have computed as part of building the full candidate space. Once that space exists, "which optimizations are applicable" and "which summary is applicable" collapse into the same question: for a given TargetSubDAG, what does its candidate list (across every registered ReplacementStrategy) actually contain?
Design
ApplicabilityFinding stays the public shape (optimization kind, location, reason) — only its data source changes, from "re-walk the tree" to "read off the search's per-site candidate list."
OptimizationKind gains one variant per landed ReplacementStrategy (SemanticRewrite, RollupReuse, SharedMultiSubpopulation), same #[non_exhaustive] discipline as today.
- Existing tests in
applicability.rs (positive/negative fixtures for sketch and CSE reuse) should keep passing unchanged against the new data source — they're pinning behavior, not implementation.
Depends on
The ReplacementStrategy trait and the search-engine sub-issues landing first; this is the last piece, once there's an actual candidate-plan space to report on instead of re-deriving.
Part of #33.
What
Rebuild
applicability.rs(PR #247) as a reporting view over the Cascades/Volcano search's resulting candidate-plan space, instead of a parallel system that re-walks the tree itself.Today,
SketchApplicabilityRule/SharedSubexpressionRuleeach do their own traversal and re-derive a yes/no fact that the search (once the other #33 sub-issues land) will already have computed as part of building the full candidate space. Once that space exists, "which optimizations are applicable" and "which summary is applicable" collapse into the same question: for a givenTargetSubDAG, what does its candidate list (across every registeredReplacementStrategy) actually contain?Design
ApplicabilityFindingstays the public shape (optimization kind, location, reason) — only its data source changes, from "re-walk the tree" to "read off the search's per-site candidate list."OptimizationKindgains one variant per landedReplacementStrategy(SemanticRewrite,RollupReuse,SharedMultiSubpopulation), same#[non_exhaustive]discipline as today.applicability.rs(positive/negative fixtures for sketch and CSE reuse) should keep passing unchanged against the new data source — they're pinning behavior, not implementation.Depends on
The
ReplacementStrategytrait and the search-engine sub-issues landing first; this is the last piece, once there's an actual candidate-plan space to report on instead of re-deriving.