Repository navigation
U2 (D-RU-2): let-bound planes over the contract set algebra - #1649
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30087ccaaf
ℹ️ 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".
lance-graph-contract::set_program: SetProgram { version, resident, lets,
queries }. A let is referenced as Sym(resident + k), only from later lets
and from queries; validate() refuses forward and unknown references.
share() lifts every junction subset held by two or more junctions of one
kind into a let, largest first, judged after normalize().
lance-graph-relalg::program: run_program evaluates each let once into a
scratch plane, then every query over the resident planes plus those
planes; run_recompute runs each query with its lets inlined. Both refuse
a program built for another table version. ProgramCost counts programs,
ops, lane reads, plane reads, planes materialized and their bytes.
Tests: program, recompute and a row oracle agree on answers and kept
masks, for hand-built and 60 generated query sets; lane reads, planes
and bytes are pinned for the shared case.
Benchmark (examples/program_bench, n = 1M, 16 queries, 2 lets, release):
program 4.63 ms, 14 lane reads, 250000 bytes materialized;
recompute 14.49 ms, 59 lane reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
The benchmark set bits past the last row in its resident plane, which mask-risc refuses (PlaneTail) for n not a multiple of 64. The plane tail is now cleared, and CI runs the benchmark once at n = 100003. Board: STATUS_BOARD D-RU-2 MEASURED, entry 2026-10-21-u2-let-planes.md, plan stage note, entries index. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
validate() and let_sym() added `resident + lets.len()` unchecked; with resident = u32::MAX that panics in debug and wraps in release. Now: - let_sym returns Option<u32>; validate refuses with TooManyIds; - share stops lifting before `resident + lets.len()` would not fit, so every program it builds still validates; - relalg checks its u16 plane limit before validate, so an oversized program is refused as TooManyPlanes. The benchmark also prints which SIMD arm it was compiled for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
e3305a2 to
7422305
Compare
What this adds
lance_graph_contract::set_programSetProgram { version, resident, lets, queries }:Sym(i)withi < residentis a resident plane;Sym(resident + k)islets[k];validate()refuses forward and unknown references.share(version, resident, queries)turns a junction subset held by two or more junctions of one kind into a let, largest first.normalize.normalizeflattens nested junctions, so whole identical subtrees are rare and sharing has to work on subsets.lance_graph_relalg::programrun_programevaluates each let once into a scratch plane, then runs every query over the resident planes plus those planes.run_recomputeis the baseline: each query with its lets inlined.ProgramCostcounts programs, ops, lane reads, plane reads, planes materialized and their bytes, and the most scratch slots any one fold used.Measured
examples/program_bench: 16 queries sharing one three-comparison conjunction. Release build, medians of 9 runs.n_rowsvalues.Correctness
nested_and_distinct_lets_agree_with_recompute_and_the_oraclewas added for them.Also
crepe-plan-probeworkflow's relalg step now runs the benchmark once at n = 100003.PlaneTail).entries/2026-10-21-u2-let-planes.md;Open
shareis greedy and does not weigh one plane's materialization against the reads it saves. It is measured here only where sharing wins.Generated by Claude Code