Skip to content

refactor(ir): split L2 relational + converter into asap-l2, slim asap-ir to L3 - #65

Merged
zzylol merged 1 commit into
mainfrom
refactor/split-asap-l2
Jul 2, 2026
Merged

refactor(ir): split L2 relational + converter into asap-l2, slim asap-ir to L3#65
zzylol merged 1 commit into
mainfrom
refactor/split-asap-l2

Conversation

@zzylol

@zzylol zzylol commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Addresses @milindsrivastava1997's #57 feedback ("a lot fits into asap-ir"). asap-ir was 3.9k LOC holding L2 relational + L3 IR + the L2→L3 converter + binder + resolution.

Split (along the real, non-cyclic seam)

  • asap-ir — now the L3 canonical IR only: query_expr, agg_intent, expr_ir, schema, names (+ types, workload). 3,872 → 2,288 LOC (−41%).
  • asap-l2 (new) — the L2 relational algebra + the L2→L3 converter: relational, lower (convert_root), binder, column_resolution. ~1,600 LOC. Depends on asap-ir.

The apparent L2↔L3 module cycles turned out to be doc-comment links, not code deps — the real use-graph layers cleanly.

Isolation wins

  • asap-sketch and asap-plan now depend on asap-ir alone — they never pull the converter/binder machinery. cargo tree: 0 asap-l2 in either.
  • Front ends depend on asap-ir (L3 types) + asap-l2 (relational + convert_root).
  • Parser quarantine unchanged (promql frontend: 0 datafusion).

Docs

README, design.md (§5.1 table + tree, §6.0 map, P1), and migration-plan.md updated with the dependency table, the new directory tree, and a "why L2 and L3 are separate crates" rationale.

No behavior change; full suite green (29 binaries), clippy clean. Follow-up to the reorg (#57).

🤖 Generated with Claude Code

…-ir to L3

Per @milind's #57 feedback ("a lot fits into asap-ir"). asap-ir was 3.9k LOC
holding L2 relational + L3 canonical IR + the L2→L3 converter + binder +
resolution. Split along the real (non-cyclic) seam:

- asap-ir (2.3k, was 3.9k): the L3 canonical IR only — query_expr, agg_intent,
  expr_ir, schema, names (+ types, workload).
- asap-l2 (1.6k, new): the L2 relational algebra + the L2→L3 converter —
  relational, lower (convert_root), binder, column_resolution. Depends on asap-ir.

The apparent L2↔L3 module cycles were doc-comment links, not code deps; the
real graph layers cleanly.

Isolation wins:
- asap-sketch and asap-plan now depend on asap-ir alone — they never pull the
  converter/binder machinery (cargo tree: 0 asap-l2 in either).
- Front ends depend on asap-ir (L3 types) + asap-l2 (relational + convert_root).
- Parser quarantine unchanged (promql frontend: 0 datafusion).

Docs (README, design.md §5.1/§6.0/P1, migration-plan) updated: dependency
table, directory tree, and the "why L2 and L3 are separate crates" rationale.

No behavior change; full workspace suite green; clippy --all-targets clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 99635bc into main Jul 2, 2026
1 check passed
@zzylol
zzylol deleted the refactor/split-asap-l2 branch July 2, 2026 17:43
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.

1 participant