Skip to content

test: #509 Example 1 acceptance spec and end-to-end tests - #577

Draft
zzylol wants to merge 2 commits into
stack/509-c3-stage2-3from
stack/509-c4-example1-acceptance
Draft

zzylol wants to merge 2 commits into
stack/509-c3-stage2-3from
stack/509-c4-example1-acceptance

Conversation

@zzylol

@zzylol zzylol commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #576 (Stage 2/3), #575, #561 and #543 (Phase C).

Why

#509 Example 1 is the end-to-end reference for planner layering. An acceptance spec written before the implementation records what each stage must produce, and which deviations remain, so a reviewer can measure the stages against the design doc and not against themselves.

What

  • docs/design_docs/proposals/planner-layering-example1-acceptance.md: the MVP acceptance spec.
    • Expected counts 1 → 6 → 6 → 1.
    • Per-stage candidate tables and invariants.
    • The doc's ambiguities and the MVP deviations.
  • tools/dag-viewer/examples/planner-layering-example1.expected.json: the expected-only asap-stage-pipeline/v1 shape (data only, no viewer change).
  • crates/integration-tests/tests/planner_layering_example1.rs: 21 tests that run against the real Stage 0–3 (10 run, 11 ignored).
    • Tests that pass are enabled.
    • Every test that still fails is #[ignore]d, with the exact difference from the spec as the reason.
    • Runtime capability checks: the selected plan compiles in the physical planner. The check that every candidate compiles stays ignored and names the two runtime gaps.

How

The spec was written first, against todo!() stubs (first commit). The second commit replaces the stubs with thin adapters over the stages from #575 and #576. Tests identify candidates by structure, not by id.

Example 1

Before this PR: nothing checks Example 1 end to end. A stage can change its output without any test failing.

After this PR: cargo test -p asap-integration-tests --test planner_layering_example1 runs the stages and observes 1 → 24 → 24 → 1. The selected plan is P20 (Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc)), and the test checks that it compiles in the physical planner. The ignored tests document the gaps:

  • Stage 1 gives 24 candidates, not 6, because Pass 1 offers exact accumulators and CountSketch+heap.
  • There is no Hydra and no shared-input variants (Pass 2).
  • Only 8 of 24 physical candidates compile:
    • CountSketch+heap: the summary schema does not match what the runtime builds.
    • CMS+heap: needs non-negative weights.
  • Costs are illustrative statistics.
  • There is no latency check.

🤖 Generated with Claude Code

zzylol and others added 2 commits October 3, 2026 21:41
Define MVP acceptance for #509 Example 1 before the Phase C stage APIs
exist: 1 -> 6 -> 6 -> 1 candidates (Pass 1 x identical-expression
sharing; physical operator implementation only, no materialization).

- Spec with per-stage candidate tables, invariants and doc ambiguities.
- Integration tests against todo!() stage stubs, ignored until the
  stages land; workload and Stage 0 frontend-shape tests run now.
- Expected-only asap-stage-pipeline/v1 fixture for the DAG viewer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the todo!() stubs with adapters over Stage 0-3, un-ignore the 11
tests that pass, and give each still-ignored test the precise difference
between the implementation and the spec. Add runtime capability checks:
the selected plan compiles in the physical planner; compiling every
candidate stays ignored with the two runtime gaps it finds.

Co-Authored-By: Claude Opus 5.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.

1 participant