Conversation
zzylol
force-pushed
the
stack/509-x9-pass1-coverage
branch
from
October 4, 2026 20:18
31ecc84 to
7c0019e
Compare
zzylol
changed the base branch from
stack/509-x8a-hydra-kernel
to
stack/509-x5b-example4-acceptance
October 4, 2026 20:18
This was referenced Oct 4, 2026
…value Pass 1 built every COUNT(*) update from ColumnRef::SampleValue, which SQL rows (e.g. flows(ts, src_ip)) do not have. Exact Count accumulators failed to compose, and sketches hashed a non-existent `value` item. SQL COUNT(*) now adds a unit weight per row; a sketch hashes a non-null column, a grouping column first. The executor builds an exact count with a unit weight (Operator::unit_count_build), so the accumulator executes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RootDemand gained latency_ms in #604; the Example 2 coverage test's demand sets it to None (no latency bound). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
force-pushed
the
stack/509-x5b-example4-acceptance
branch
from
October 5, 2026 06:21
25d2af0 to
215ed9e
Compare
zzylol
force-pushed
the
stack/509-x9-pass1-coverage
branch
from
October 5, 2026 06:21
7c0019e to
07adadb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack: Wave 2 chain: #599 → #601 → #600 → #604 → #606 → #603 → #605
Rebased on main d4869a7 (DF 54).
Why
Part of #509 and #580 (Stage 1 coverage). PR #590's acceptance work found that on SQL
flows(ts, src_ip), Stage 1 candidates forCOUNT(*) … GROUP BY src_ipfail to compose. Pass 1 builds every count update fromColumnRef::SampleValue, the implicit PromQLvaluecolumn, and SQL rows don't have one. W7b saw the same failure in Stage 2 for exactCountaccumulators.What
#509 Example 2's design queries (distinct, entropy, and the integer L2 that keeps
COUNT(*) GROUP BY src_ipas a target), throughplan_stageswith every candidate displayed:ColumnRef::SampleValue has no value column)valueitem. It passes Stages 2–3 but cannot bind.Countaccumulator, which executesHow
logical_candidates::summary_update: on SQL rows (a closed schema without PromQL series identity),COUNT(*)addsConstant(1.0)per row and carries theUnitCountproof.Operator::unit_count_buildis an exact count with no value column, soConstant(1.0)binds.SummaryBuild.valuebecomesOption<usize>.realize_value_frequency_summary_inputinpass1/replacement.rs, which uses a unit weight.Tests
I wrote
tests/pass1_sql_coverage.rsfirst. Both tests failed on the parent, and both pass now:sql_count_star_group_by_candidates_compose_and_execute: every candidate composes and compiles. Pass-through and theCountaccumulator execute toa=3, b=2, c=1.example2_design_candidates_all_build: no Stage 1 or Stage 2 build failure.Not in this PR
Count-Min, CountSketch and UnivMon count candidates still compile but do not bind. The executor's keyed build needs a weight column, so it rejects
Constant(1.0), and PromQL count sketches hit the same limit. Stage 3 never selects them here.Gates
cargo fmt --all --checkandcargo clippy --workspace --all-targets --all-features -- -D warnings: pass.cargo test --workspace: 1,638 passed, 23 ignored. Example 4 acceptance with materialization #606 had 1,636 / 23, and this PR adds 2 tests.fix: integrate with #604addslatency_ms: Noneto the Example 2 coverage test'sRootDemand. The Example 2 design queries still build all 400 candidates and select P2.🤖 Generated with Claude Code