Repository navigation
D-RFT-1 typed composition + r2il PostgreSQL primitive polyfill (IntXor/ANY/ALL/KEY_RUNS, checked scalar arithmetic, 19 procedures) - #1681
Conversation
|
@codex review Generated by Claude Code |
|
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. |
…dures The D-RFT-1 composition needs three things FoldDialect refused as Unimplemented: a Boolean reduction terminal (ANY, ALL) and IntXor. They lower to mask-risc Terminal::Any/All and MaskOp::Xor (BoolExpr::Xor when fused); ANY/ALL push 1 or 0. The new procedures are call sequences over those, so mask equality (differ = IntXor then ANY) and a composed path count (count_and = IntAnd chain then PopCount) are folds, not row loops. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
…torical Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
count_and is now intersect + PopCount. union is the IntOr chain; keep writes the mask on top of the stack into the dialect's KEEP sink. Tested against the word-wise OR, compared by differ. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
User -> group membership composed with role carriers over one shared slot coordinate, bound by one Qr witness. Bag (count of paths) and Distinct (existence) are two readings of one computation; Xor is refused (an even number of parallel paths reads zero). A key with payload set and presence clear is NULL and matches nothing. The stratum comes from the measured cardinality witness (left fan of present keys, right fan of carriers), never from the caller. Bag sums are checked; a wrap is refused. Every count, existence and mask equality is an r2il procedure (intersect, union, keep, count_and, differ) compiled once and replayed through mask-risc over zero-copy row slices. Support first: a user's roles are the union of its present keys' role words, so only coordinates in that union are counted. Tests: the IAM diamond (Bag 2, Distinct 1), Xor, NULL key, seal mismatch, stale binding, overflow, functional stratum, and a random fixture against an independent DFS over Prepared ordinals (lane compared, supports by differ). examples/rft1_pg_parity: PostgreSQL 16 recursive CTE, count(*) vs count(DISTINCT) and the per-coordinate multiplicities, with NULL-key rows. examples/rft1_bench: bind, pages, program prep and execution separately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a5d41f786
ℹ️ 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".
…tation The entry's heading id collided with the D-RFT-1..5 assessment entry (entries_index DUPLICATE ID). The metta-datalog plan cited FoldDialect by line number, which the r2il additions moved; it now cites the symbols. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
3a5d41f to
031e4c2
Compare
…IntSDiv, 12 procedures) Dialect: KEY_RUNS lowers to CountKeyRunsU32 (COUNT(DISTINCT key) on a key-ordered lane; an unordered lane is refused by mask-risc). IntAdd, IntMult and IntSDiv combine fold results, checked: overflow and division by zero are refused (new FoldError::Overflow / DivisionByZero), as PostgreSQL raises for bigint. Procedures: is_null, is_not_null, and_between_i32, in_u32 (IN () keeps nothing), count_valid (COUNT(x) vs COUNT(*)), avg_parts (SUM and COUNT; avg(int) is numeric, so the quotient is the caller's), bool_or, bool_and, not_exists, except, count_distinct_sorted, count_union_all. Each WHERE-shaped procedure leaves a mask; KEEP it and it is a Lance 13 row-address prefilter (with_row_addr_prefilter, as crepe-plan-probe #1633 does). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
… in the D-RFT-1 entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
|
Rebased onto main and fixed the two red checks. Both were mine:
New in this push: the PostgreSQL primitive card in Dialect:
Procedures: Checks: 6 more disables, all red. r2il has 28 tests; clippy @codex review Generated by Claude Code |
…ts own witness Two Codex findings on #1681: - procs::union/intersect/in_u32 now chain through FoldDialect::call_owned, so a chain over k planes reuses two scratch slots instead of k-1. A user with >= 9 present groups no longer panics with ScratchBufferTooSmall. Fused mode still refuses a 24-leaf chain (mask-risc fuse gives each ternlog group its own slot); pinned as a refusal, recorded as open. - Page now carries the Witness it was resolved against, and Members::of stamps that witness, not the register's. An old page paired with a newly bound register fails compose's seal check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
|
@codex review Generated by Claude Code |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
What
D-RFT-1, PROBE (
crates/dir-rmap-probe/src/compose.rs). It composes user → group membership with the role carriers over the DR256 register's shared 256-slot coordinate, under oneWitness.i, roler),member_i ∧ valid_i ∧ carriers_r.r2il polyfill (
lance-graph-r2il):IntXor(R2IL ordinal 22) lowers toMaskOp::Xor, or toBoolExpr::Xorwhen fused.ANYandALLlower toTerminal::Any/Alland push 1 or 0. They wereUnimplementedbefore.exists,all,differ(IntXorthenANY, mask equality as a fold),intersect,union,keep,count_and.How it executes. Every count, existence and mask equality in the composition is one of those procedures. Each is compiled once by
FoldDialect(Composer::new, a prepared statement) and replayed through mask-riscexecute_intoover zero-copy row slices. The probe has no counting loop of its own.Support first. A user's roles are the union of its present keys' role words. Only coordinates in that union are counted; the others have no path by construction.
Evidence
tests/compose.rs):PreparedCSRs, notQr's closure. Compared lane to lane, with supports compared bydiffer; anti-vacuity on counts 1 and ≥ 2.examples/rft1_pg_parity.rs,WITH RECURSIVE):count(*);count(DISTINCT (u, role));examples/rft1_bench.rs, release, median of 101 runs, 600 users):ndarray::simdndarray::simdThe first wiring ran one fold per (user, role) coordinate and took 17 ms with 78 210 allocations. Program replay plus support-first brought it to 310 µs.
Open
execute_intoon 4-word planes (about 2 600 executions). Not profiled.Members::ofcopiesmemberinto an ownedvalidplane (8 KiB per page). A real source would supply its own presence plane.Spec::iam(8000)exceeds 256 security slots, so the bench runsSpec::small().Manifests
dir-rmap-probeaddslance-graph-r2iland moveslance-graph-mask-riscfrom a dev-dependency to a dependency.ogar-locoandogar-r2il, plus a lance-graph patch so the contract resolves once.No production ABI changes.
Board:
entries/2026-10-21-d-rft-1-typed-composition.md, and the STATUS_BOARD D-RFT-1 row (In PR).Generated by Claude Code