Skip to content

docs: post-asap-ir and asap-aware-mapping - #206

Merged
milindsrivastava1997 merged 7 commits into
mainfrom
dev-milind
Aug 15, 2026
Merged

milindsrivastava1997 merged 7 commits into
mainfrom
dev-milind

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Collaborator

No description provided.

@milindsrivastava1997
milindsrivastava1997 marked this pull request as ready for review August 15, 2026 13:45
@milindsrivastava1997
milindsrivastava1997 merged commit 832909c into main Aug 15, 2026
1 check passed
@milindsrivastava1997
milindsrivastava1997 deleted the dev-milind branch August 15, 2026 14:24
zzylol added a commit that referenced this pull request Aug 23, 2026
…, open issue #33 sub-issues (#258)

* docs(asap-aware-mapping): flesh out ReplacementStrategy/search design, link issue #33 sub-issues

docs/asap_aware_mapping.md already stubbed TargetSubDAG/ReplacementSubDAG/
ReplacementStrategy/CostModel and a Volcano/Cascades-style search pseudocode
as "not yet implemented" (since #206/#211). This turns that stub into an
actionable design and ties each piece to a tracked sub-issue of #33:

- #251: generalize today's single-pick decisions (boundary::implementation_for,
  cse::share_common_subtrees) into real ReplacementStrategy impls that report
  every valid candidate instead of collapsing to one.
- #252: the Cascades/Volcano-style search engine itself — MEMO-based candidate
  plan space (not a flat plan list), deduped via pre_asap::cse's existing
  structural-hash/InternTable machinery, sorted by CostModel. Explicitly
  reconciled against docs/cse-cost-model-decision.md (#237), which scoped a
  narrower binary share/don't-share decision away from full search
  infrastructure — #252 is the multi-axis case that decision itself flagged
  as the reason a real engine would eventually be needed.
- #253: semantic-equivalent rewriting (avg -> sum/count) as a ReplacementStrategy,
  no longer needing its own bespoke before/after-CSE heuristic once a real
  search exists to let both forms compete on cost directly.
- #254: group-by-lattice roll-up reuse (AHA vs. independent per-subpopulation
  treatment) as a ReplacementStrategy, gated on agg_is_mergeable and
  Schema::unique_keys the same way CSE's own legality gate is.
- #256: GroupingStrategy::{PerSubpopulationInstance, SharedMultiSubpopulation}
  (Hydra) as a new axis orthogonal to SketchKind/SamplingKind/..., named for
  sharing across a query's own subpopulations (not multi-tenant deployment
  isolation).
- #257: rebuild applicability.rs (#247) as a view over the search's candidate
  space instead of a parallel tree-walking system.

Also resolves the doc's stale "(TODO: is this implemented?)" on parameter
sizing — boundary::implementation_for's bind_summary_with already sizes
every candidate via CostModel::size_params.

No code change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* changes for readability

* docs(asap-aware-mapping): plain-English rewrite per Milind's PR #258/#259 comments

- MEMO-sharing bullet: spell out why flat plan lists blow up and how
  Rc-sharing avoids it, without leaning on jargon.
- Drop the docs/cse-cost-model-decision.md (#237) history/scope-change
  framing; keep just the forward-looking design rationale.
- Applicability-reporting paragraph: explain MEMO groups concretely
  instead of the abstract 'candidate-plan space' framing.

* Revise ASAP-aware mapping documentation for clarity

Updated the documentation for ASAP-aware mapping to improve clarity and structure. Enhanced sections on key concepts, goals, and design principles, and corrected formatting issues.

* Enhance glossary and definitions in ASAP-aware mapping

Added glossary terms and clarified definitions related to ASAP-aware mapping, including distinctions between alternatives and candidate plans.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Milind Srivastava <milindsrivastava1997@gmail.com>
zzylol added a commit that referenced this pull request Aug 24, 2026
…in the merged search engine

## Why

search.rs's own vocabulary (inherited from the design doc's old
pseudocode, `plan.bindable_sites()`) used the word "site" throughout
-- function names (discover_sites, discover_new_descendant_sites),
doc-comment prose, and local variables -- for the exact same concept
TargetSubDAG already names: a discovered site is immediately wrapped
as `TargetSubDAG::with_consumer_count(&target, consumer_count)` to
call a ReplacementStrategy. Same terminology-drift category as the
earlier implementation/bind/Logical renames this session -- there
shouldn't be two names for one concept.

## What

- discover_sites -> discover_targets, discover_new_descendant_sites ->
  discover_new_descendant_targets (definitions and all call sites).
- Local variables in search_workload_with's round loop: the
  TargetSubDAG-typed local (previously `site`) is now `target`; the
  Rc<QueryExpr> it wraps (previously also `target`, colliding) is
  renamed `root` to make room -- matches the root/target naming
  TargetSubDAG's own fields and this crate's other fixtures already
  use. `sites_before`/`new_sites` -> `targets_before`/`new_targets`.
- Doc-comment prose describing the real implementation (module docs'
  "Where 'for site in plan.bindable_sites()' comes from" section ->
  "Where TargetSubDAG discovery comes from", MemoGroup's "one distinct
  site" -> "one distinct TargetSubDAG", PlanSpace/discovery/dedup/
  termination prose throughout replacement.rs, plus the search-engine
  prose in lib.rs's Status/Terminology and the developer guide that
  was written earlier in this same session) all now say
  "target"/`TargetSubDAG` instead of "site".
- The one place "site" stays: the module doc's literal quoted
  pseudocode block (`for site in plan.bindable_sites(): ...`) and one
  sentence explicitly introducing it as a historical quote -- that
  block is explicitly framed as what the design doc "has stubbed out
  since #206/#211", not current API, so it stays verbatim.
- Left alone as unrelated: cost_model.rs's two pre-existing "site"
  uses (a physical "site count" in a list of example cost dimensions,
  and "a single use site" in cse_recompute_cost's doc) -- both predate
  this session and mean something else (a deployment's execution
  site / a CSE consumer location), not TargetSubDAG.

## Output

$ cargo build --workspace --all-targets && cargo test --workspace \
    && cargo fmt --all -- --check \
    && cargo clippy --workspace --all-targets --all-features -- -D warnings
(all clean; asap-aware-mapping: 69 passed, 0 failed)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants