Conversation
zzylol
force-pushed
the
stack/509-w3-relative-coverage
branch
from
October 4, 2026 18:25
390d792 to
0f9db83
Compare
zzylol
added a commit
that referenced
this pull request
Oct 4, 2026
Pane coverage time is a CoverageTime since #592; the tumbling pane-merge test keeps absolute time ranges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 4, 2026
zzylol
changed the base branch from
stack/509-e2-keyed-additive-topk
to
stack/509-w6-counter-proof
October 4, 2026 18:25
This was referenced Oct 4, 2026
Draft
Share one UnivMon across distinct, L2 and entropy; document why those readouts stay uncertified
#596
Draft
CoverageRegion.time_ms is now Option<CoverageTime>: Absolute or
RelativeToEvaluation (tumbling pane i of width w covers -(i+1)w..-iw).
The two anchors are incomparable, so validate/merge_disjoint reject a
mix with MixedTimeAnchors; within one anchor, adjacent regions coalesce
and gaps are kept as before. Absolute time keeps the plain {start,end}
JSON encoding, so legacy coverage still deserializes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FieldDataType::family_merges() is true for exact Sum/Count/Min/Max, KLL, DDSketch, HLL, CMS, CountSketch and UnivMon; every other family fails closed (Rate/Increase accumulators and heap top-k sketches included, per W6). SummaryMerge::validate_inputs rejects the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
force-pushed
the
stack/509-w6-counter-proof
branch
from
October 5, 2026 06:21
ee6f881 to
761b2ce
Compare
zzylol
force-pushed
the
stack/509-w3-relative-coverage
branch
from
October 5, 2026 06:21
0f9db83 to
6b31d2d
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.
Rebased on main d4869a7 (DF 54).
Wave 1 chain: #594 → #593 → #592 → #591 → #595 → #596 → #597 → #598 → #599 (on #589)
Step 3 of the #580 plan (item A prerequisites). Part of #509.
Why
Stage 1 tumbling windows (W1) compose N
SummaryAggpanes with oneSummaryMerge. Two facts are missing fromcrates/types:CoverageRegion.time_mscould only hold absolute timestamps.SummaryMergeaccepted any state family with matching schemas, including Rate/Increase accumulators and CMS/CountSketch heaps. W6 says merged heaps are rejected until there is an accuracy model.What
CoverageRegion.time_msis nowOption<CoverageTime>, whereCoverageTimeisAbsolute(Range<i64>)orRelativeToEvaluation(Range<i64>). Paneiof widthwcovers-(i+1)w..-iw.SummaryCoverage::validate/merge_disjointtreat the two anchors as incomparable. A coverage, or a merge, that mixes them fails with the newCoverageError::MixedTimeAnchors. Within one anchor nothing changes: adjacent regions coalesce, gaps are kept, and overlaps arePossibleOverlap.FieldDataType::family_merges()returns true for exact Sum/Count/Min/Max, KLL, DDSketch, HLL, CMS, CountSketch and UnivMon. Everything else returns false, which fails closed: Rate/Increase/IRate,CmsWithHeap,CountSketchWithHeap, KMV/Theta, Sample/Wavelet/StatModel and plain values.SummaryMerge::validate_inputsrejects a family that does not merge.How
{"start","end"}encoding, so existing JSON and fixtures are unchanged. Relative time is encoded as{"relative_to_evaluation": {"start","end"}}.From<Range<i64>> for CoverageTimegivesAbsolute, so call sites only changeSome(a..b)toSome((a..b).into()). Only test call sites incrates/typesneeded this.Before this PR
After this PR
Tests
Tests were written first. With the
validate_inputscheck disabled,summary_merge_requires_a_mergeable_familyfails.summary_coverage.rs: adjacent relative panes coalesce to[-5m, 0), a relative gap is kept, overlapping relative regions are rejected, mixing anchors is rejected (in a merge and invalidate), and serde round trip plus legacy JSON.summary_merge_structure.rs: merging heap panes is rejected and merging KLL panes is accepted. There is also a table test offamily_merges.Design doc follow-up (#573,
asap-primitive-schema; this PR does not edit that branch)CoverageRegion.time_ms: Option<CoverageTime>, whereCoverageTime = Absolute(Range<i64>) | RelativeToEvaluation(Range<i64>). Relative bounds are offsets from the evaluation time (paneiof widthwis[-(i+1)w, -iw)). The two anchors are incomparable, so mixing them isMixedTimeAnchors. The legacy plaintime_msrange meansAbsolute.SummaryMerge): add one check, that the state family must satisfyFieldDataType::family_merges(). That holds for Sum/Count/Min/Max, KLL, DDSketch, HLL, CMS, CountSketch and UnivMon. Rate/Increase and heap top-k are rejected. The example can use relative panes: two[-60000, 0)/[-120000, -60000)KLL panes derive to[-120000, 0).Open questions for review
family_mergeslooks only at the algorithm, not atGroupingStrategy. Hydra-shared states merge under the same rule until W7 defines Hydra merge.Gate
cargo fmt --all --check: passescargo clippy --workspace --all-targets --all-features -- -D warnings: passescargo test --workspace: 1,524 passed, 10 ignored (feat(planner): whole-expression top-k heap sketch over raw samples #589: 1,517 / 10, plus 7 new tests)stage_pipeline --example planner-layering-1regeneratestools/dag-viewer/examples/planner-layering-example1.jsonbyte-identically🤖 Generated with Claude Code