You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fccecf4
Browse filesBrowse the repository at this point in the historyBrowse files
fix(asap-aware-mapping): SketchApplicabilityRule must dedup shared nodes like SharedSubexpressionRule does
collect_sketch_findings (SketchApplicabilityRule) walked the workload
as a tree, with no Rc-identity tracking - unlike SharedSubexpressionRule's
register_site, which explicitly dedupes by Rc::as_ptr. A bindable
Aggregate reachable via two paths after share_common_subtrees (two
different roots, or two branches of one root, e.g. median(x) / median(x))
was reported as two separate "sketch-approximation is applicable"
findings, even though it's bound exactly once - one CostModel::cse_share_decision
per shared Rc, per bind::implement_workload_with, not one per path
that reaches it. Overstated the number of independent opportunities.
for_each_operator_child now passes an Option<usize> Rc pointer alongside
each child (None only for Concat's by-value branches, which have no Rc
identity of their own) so collect_sketch_findings can thread a `visited`
HashSet across the whole evaluate() call - shared across all roots, not
reset per root - and skip re-descending into an already-visited pointer,
mirroring register_site's exact dedup rationale.
New test: a_shared_sketchable_aggregate_is_reported_only_once, the same
median(x)/median(x) shape pre_asap::cse's own
single_query_shares_its_own_repeated_subtree test uses, pinning that a
single shared Aggregate produces exactly one finding.
Found while auditing other open PRs for the same tree-vs-DAG issue
fixed in PR #243 (default_cse_recompute_cost's naive serde_json-length
proxy over-counting internally-shared subtrees).
Verified: cargo build --workspace --all-targets, cargo test --workspace
(444 passed, 0 failed), cargo fmt --all -- --check, cargo clippy
--workspace --all-targets --all-features -- -D warnings.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments