Repository navigation
Teleport probe (D-TELEPORT-0) + W2: IntOr, fused Boolean mode, first procedures (D-SQLP-2) - #1484
Conversation
…ly reduces it D-TELEPORT-0. One probe example, no new op or lowering. For K(s,o) AND B(o) over 1M edges it compares scan/join/filter (A), the gated-gather semijoin (B) and an extent found by binary search on a sorted source (C), on clustered and scattered layouts, with work counters taken from the masks. C's visited words and foreign reads track |K|; B still reads every source row. The scattered layout is the control: there C does not exist. The intersection section measures two row ranges ANDed (three passes, ~10 us) against the precomputed intersection (one fused Range, ~28 ns), and a sorted-lane compare scanned against its crossing point found by partition_point. Neither rewrite exists in a lowering today. Board: entry, index, STATUS_BOARD (D-SQLP-0/1 shipped, D-TELEPORT-0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 21 minutes. View limit details
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
D-SQLP-2. - IntOr is wired onto MaskOp::Or for mask operands (slot or resident plane) and onto bitwise or for scalars. It is no longer refused. - BoolMode::Fused collects IntAnd/IntOr/IntNot on masks into one BoolExpr; the first consumer lowers it through mask-risc fuse into ternlogs. BoolMode::InPlace (default) is unchanged: one op per call, with survivor gating. The two mirror quack's lower and lower_fused. - procs: filter_lt, select_lt, sum, group_sum and margin as Rust functions that emit R2IL calls through Dialect::call. No new opcode. margin re-emits its selection per SUM, because a fold ends the epoch of every earlier slot. Plan: W2 now names the inlined form, and section 4 records the decision and the OPEN OGAR item (an executable PROC_DEF/PROC_CALL contract). Tests (tests/procs.rs): every answer against a row-by-row reference with four groups and empty, partial and full selections. Disable runs, each red: KEEP dropped from filter_lt; margin's sums swapped; IntOr lowered as And in-place; IntOr lowered as And in the fused mode; the fused mode ignored. r2il-mask-abi-probe's suite is unchanged (6/24/2/8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Add Carrot credits or activate Agent usage billing to use Autofix |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ca7cfb757
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… search - FoldDialect: IntAnd of two resident planes emits one in-place And. It was accepted only in the fused mode; now both modes take the same mask expressions. Test plane_and_plane_is_accepted_in_both_modes (red with the arm disabled). - teleport_probe: arm C times its partition_point per repetition and adds it, as S4 already did. At 0.01% selectivity C goes from ~0.29 us to ~0.48 us; the board entry is updated (~370x over B, not ~600x). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP
D-TELEPORT-1. fold_ranges runs at the top of lower_with, so lower,
lower_fused and lower_group_by all see it. Inside each AND, the direct
children Cmp(col, Range{lo, hi}) sharing a col become one range
[max(lo), max(max(lo), min(hi))), kept at the first one's position.
- Empty intersections stay valid empty ranges (lo == hi), never lo > hi.
- Row-order identity: only ranges on the same col merge; col is the only
order identity a Filter carries.
- Siblings of one AND only; never across OR or NOT; nested ANDs are not
flattened.
- A range with lo > hi is not merged, so mask-risc still refuses it. A
bound past n_rows on the side the intersection drops cannot be seen
here; the producers that bound ranges never emit one. Documented.
Under COUNT/ANY the single range takes mask-risc's closed form (hi - lo,
no row visited). Under other terminals the survivors are still visited,
minus two passes and two slots.
Tests (range_fold_tests): one op and Lowering::Range for an overlapping
pair; an empty range for a disjoint pair; different columns, OR and NOT
left alone; an inverted range not merged; 400 seeded conjunctions with
planes and lane compares equal to a row-by-row oracle under both
lowerings. Disable runs, each red: hook removed; merge across columns;
min instead of max; no empty clamp; inverted merged; OR merged.
quack full suite and lance-graph-cypher-quack green.
Board: D-TELEPORT-1 row; D-TELEPORT-0 and D-SQLP-2 marked shipped (#1484).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP
Two pieces on one branch, in separate commits.
1. Teleport probe (D-TELEPORT-0)
crates/lance-graph-quack/examples/teleport_probe.rsadds no library code. ForR(s,o) = K(s,o) AND B(o)it asks whether reading only the rows that can survive actually skips work, or does the same work faster. To tell the two apart, every arm reports work counts taken from the masks themselves, next to its time. Every count is checked against a row-by-row reference.Arms
K(the existing gated semijoin).partition_point) finds whereKends, then the gather runs over rows0..hi. The search is included in C's time, as in S4.Kis not a contiguous run of rows, so C cannot be applied.Intersection. Two row ranges ANDed are lowered today as
Range,Range,And: 3 passes and 3 slots. Computing[max lo, min hi)before execution leaves oneRange. For COUNT that single range is answered from its two boundaries (hi − lo) and visits no row. That is the ~28 ns figure.That closed form applies only to COUNT and ANY. A fold that needs the rows (
SUM,GROUP_SUM,KEEP, a gated gather) still visits every row of the intersected range; there the rewrite saves two passes and two slots, not the work over the range. No rewrite does this in quack today. The point is that a three-pass computation becomes a property of two boundaries; the speed ratio is secondary.Sorted compares. A compare on a sorted lane (
s < t) takes ~150–190 µs to scan, versus ~0.1 µs for a binary search plus one range. The probe knows the lane is sorted only because it built the fixture that way. A lowering would need the sorted order proven by an order witness, which today exists only for facet lanes.Timings come from a shared 4-vCPU host and vary by up to ~1.5× between runs.
perfis unavailable, so there are no cache-miss numbers.2. W2 (D-SQLP-2)
IntOr: wired. On masks it lowers toMaskOp::Or; on scalars it is a bitwise or.IntAndof two resident planes: now accepted in the default (in-place) mode as oneAnd, matching the fused mode.BoolMode::Fused:IntAnd/IntOr/IntNoton masks build oneBoolExpr. The first consumer lowers it through mask-riscfuseinto ternlogs.InPlaceremains the default and is unchanged, survivor gating included. The two correspond to quack'slowerandlower_fused.procs:filter_lt,select_lt,sum,group_sumandmargin, written as Rust functions that emit R2IL calls throughDialect::call. No new opcode.PROC_DEF/PROC_CALLcontract.Tests: 8 in
tests/procs.rs, each checked against a row-by-row reference with 4 groups and empty, partial and full selections. Each of these sabotages turns a test red:KEEPdropped fromfilter_lt;margin's two sums swapped;IntOrlowered asAnd(both modes);Board
Test plan
lance-graph-r2il: all tests (7 + 8) pass;clippy --all-targets -D warningsandcargo doccleanr2il-mask-abi-probesuite unchanged🤖 Generated with Claude Code
https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP