Repository navigation
Conversation
zzylol
force-pushed
the
feat/structural-free-variables
branch
from
December 4, 2026 02:52
868c9f0 to
5850b77
Compare
zzylol
added a commit
that referenced
this pull request
Dec 4, 2026
…t changes since 868c9f0 taken from it
…s choices (failing) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
… variable A free GROUP BY is the same weighted choice written in the select list and in GROUP BY: equal choices in one query take one alternative everywhere (the same items with other probabilities are refused), and an alternative in parentheses stands for its contents, so a key list may hold commas. A free window range is a choice over INTERVALs. Both lower to exclusive alternatives; covering is the planner's ordinary sharing (rollup from the finer grouping, one pane chain). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
…ew fix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
zzylol
force-pushed
the
feat/structural-free-variables
branch
from
December 4, 2026 03:31
5850b77 to
66d9653
Compare
zzylol
added a commit
that referenced
this pull request
Dec 4, 2026
…t changes since 5850b77 taken from it
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.
Summary
GROUP BY $groupover {region}, {region, service}, ...; window over {5m, 1h, 6h}). feat(planner): exclusive alternatives (Σp costing, SIL weighted choices) and a streamed copy per reader #1558's weighted choice could express a window, but not a free GROUP BY: the keys appear in SELECT and GROUP BY (two choices would combine as a product) and a key list holds commas.SELECT {host: 0.7, (host, user): 0.3}, sum(bytes) ... GROUP BY {host: 0.7, (host, user): 0.3}lowers to 2 exclusive alternatives (not 4 mismatched ones), and planned jointly costs less than each alternative planned alone (structural_free_variables_are_cheaper_planned_jointly).Review guide
feat/exclusive-alternatives(feat(planner): exclusive alternatives (Σp costing, SIL weighted choices) and a streamed copy per reader #1558), itself on feat(sil): plan SIL intents: parse/check, lowering, hole guard, planning modes, group latency (L_G) #1553.crates/frontend-sil/src/parse.rs::alternatives_of(distinct choices, expansion over occurrences) andwithout_enclosing_parentheses. Tests first in10180382ccommit; implementation in the last commit.Behavior: before → after
(region, service)substituted with its parentheses).q6#0..q6#8(3 groupings × 3 windows), one exclusive group, e.g.q6#0=SELECT region, sum(bytes) AS b ... WHERE ts > now() - INTERVAL '5 minutes' GROUP BY regionat 0.3. Serves the eval's free-variable suite column and M8.Interfaces
None in Rust (SIL grammar only): equal choice text in one query = one free variable;
(a, b)as an alternative =a, b. Documented incrates/frontend-sil/src/lib.rsandparse.rs.Algorithm changes
Choice expansion (
alternatives_of). Before: product over every{...}occurrence. After: occurrences grouped into distinct choices (equal alternative texts and probabilities; equal texts with different probabilities refused); product over distinct choices; each combination substitutes every occurrence with its choice's pick. Complexity: O(occurrences × distinct) to group, output size unchanged (≤ 1,000).Decisions and open questions
FREE $g IN {...}); repeating the same text is the smallest syntax consistent with SIL's "no client parameters".Verification
cargo test -p asap-frontend-silasap-planner --test planner sil_intents-D warningsfrontend-silFollow-ups
🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi