Skip to content

Plan: SQL() as a polyfill of R2IL procedures over mask-risc (D-SQLP) - #1476

Merged
AdaWorldAPI merged 2 commits into
mainfrom
ccr-b576712f-pexwof
Oct 11, 2026
Merged

AdaWorldAPI merged 2 commits into
mainfrom
ccr-b576712f-pexwof

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

This PR adds a plan and board rows only; there is no code change. It proposes one query vocabulary for every front end, with mask-risc as the only engine. The plan is in .claude/plans/sql-polyfill-r2il-v1.md.

Key decisions

  • SQL operations are procedures, not opcodes. Each one is an ogar-loco PROC_DEF body made of R2IL fold-reading calls.
    • No new opcode, and no meta layer between ogar-r2il and ogar-loco. Loco already nests through PROC_DEF/PROC_CALL.
  • One spelling per query. quack, lance-graph-java plan_eval and the SAP binder all lower through the procedures.
    • The gate is that every pinned case still produces a byte-identical mask_risc::Program.
  • Two execution modes, kept separate in every claim:
    • Declared queries compile to Rust at build time, with opcodes as const generics. This is the only "compile time" mode.
    • Ad-hoc sql() text runs interpreted, at mask-risc's existing cost of one dispatch per opcode per tile.
  • Java holds no operations. sql() is one Panama call, and parameters and results cross as Valhalla value records.

Waves

  • W1 (D-SQLP-1): move FoldDialect out of r2il-mask-abi-probe/tests/row_bridge.rs into a lance-graph-r2il crate.
  • W2: write the first procedures.
  • W3: a benchmark with a pre-registered threshold: interpreted must be ≤ 1.05× hand-built Programs. Nothing past W1 is authorized until W3 clears it.
  • W4: the build-time generator.
  • W5: move the front ends onto the procedures.
  • W6: the lance-graph-java sql() membrane.
  • W7: the backlog of refused fold opcodes and missing lane types, one item at a time, mask-risc first.
  • W8: a request to OGAR to mint 0xC400/0xC401.

Open

  • Which SQL text parser. DataFusion is in its grace period, so its parser is not the route.
  • The SAP cost comparison. Unmeasured until W3/W4 run.

Checks run

  • plan_dids.py passes.
  • SUPERSESSION-INDEX.md regenerated: unchanged.
  • entries_index.py --check: clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP


Generated by Claude Code

Summary by CodeRabbit

  • Documentation
    • Added planning documentation for a proposed SQL capability, including its staged rollout, validation criteria, and performance gates.
    • Recorded that later stages depend on benchmark results and consistency across integrations. No product behavior changes in this update.

SQL operations become ogar-loco PROC_DEF bodies over R2IL fold-reading
calls: no new opcode, no meta layer. FoldDialect moves from a probe test
file into a lance-graph-r2il crate; quack, plan_eval and the SAP binder
lower through the procedures, gated on byte-identical Programs. Declared
queries compile to Rust at build time; ad-hoc sql() text runs interpreted.
Nothing past W1 until the D-SQLP-3 benchmark clears its threshold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0a19085c-accf-4b30-b203-747c6488072d

📥 Commits

Reviewing files that changed from the base of the PR and between 7baa05d and e6d02ee.


📒 Files selected for processing (3)
  • .claude/board/INTEGRATION_PLANS.md
  • .claude/board/STATUS_BOARD.md
  • .claude/plans/sql-polyfill-r2il-v1.md

 ___________________________________________________________________________
< I love a good shortcut. This is a great shortcut to production incidents. >
 ---------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 @coderabbitai help to get the list of available commands.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 11, 2026 09:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T09:14:15.107017Z e6d02ee Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6d02ee150

ℹ️ 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".

Comment thread .claude/plans/sql-polyfill-r2il-v1.md Outdated
Comment thread .claude/plans/sql-polyfill-r2il-v1.md Outdated
Comment thread .claude/plans/sql-polyfill-r2il-v1.md Outdated
- Authorize W1-W3, which build what the D-SQLP-3 benchmark measures;
  gate W4 onward on it (the old wording deadlocked W2/W3).
- IntAdd is scalar-only: wire it in FoldDialect like IntSub, with no
  ndarray or mask-risc change.
- lance-graph-java's lowering_convergence compares row counts, not
  Programs; W5 now adds a Program-level test before requiring
  byte-identical Programs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015JH7YkXs5us6g3tG8NiFfP

Copy link
Copy Markdown
Owner Author

Correction to my three thread replies: they cite commit fb0b5e5, but the fix commit is 730bfa4, which is now pushed.


Generated by Claude Code

@AdaWorldAPI
AdaWorldAPI merged commit 5a9e8f4 into main Oct 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants