Repository navigation
lance-graph-r2il: polyfill lens 0xFFFF::0xF000 binds by position; R2IL, SQL and Quack names are aliases - #1899
Merged
Merged
Conversation
…ition Hardcoded behaviour is addressed 0xFFFF::0xF### (D-DT64-7 §1a). The new polyfill module fixes the relational polyfill as a positional lens: word p is POLYFILL[p], and each position carries its aliases (the R2IL opcode name, a SQL name where one fits, and the Quack variant). binding::prepare accepts this lens beside the R2IL fold reading. Under it the view's label at a position must be one of that position's aliases; a name belonging to another position is refused (NotAnAlias), never followed. The R2IL fold reading keeps its label binding unchanged. Tests: the table matches R2ILVocabulary (names, arity, result) and the EXECUTABLE order; every alias names one position; R2IL, SQL and Quack views bind the same plan and plan id; methods registered by Quack names answer exactly as Quack's own lowering does through mask-risc, over a partial, a full and an empty selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF
…ng runtime declaration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AdaWorldAPI
marked this pull request as ready for review
October 31, 2026 20:59
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. |
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.
Implements D-DT64-7 §1a/§1b (plan on #1898) for the relational polyfill.
The problem
binding::prepareturned an algebra word into an opcode by reading the view's label and searchingR2ILVocabularyfor that name. The module doc said it directly: "the position a lens gives a word is free and only the name binds".What changed
polyfill. It definesPOLYFILL_LENS = 0xFFFF_F000(left side0xFFFF= hardcoded, right side0xF000= the relational polyfill) andPOLYFILL: 17 positions inEXECUTABLEorder. Each position carries:binding::prepareaccepts this lens.pisPOLYFILL[p], and the view's label atpmust be one ofp's aliases.ExecRefusal::NotAnAlias. It never selects that other word.0xC401) keeps its label binding unchanged.lance-graph-quack, used by the parity tests. Quack is OGAR-free and does not depend on this crate.SQL via Quack
Quack has no SQL text parser. Its SQL surface is the typed
Query { Filter, Agg }, so SQL registers through Quack's variant names. Methods registered by those names give exactly the same answers as Quack's ownlower+ mask-riscexecuteover the same lanes:Cmp::LtI32combined with each ofAgg::{Count, Any, All, SumI32, MinI32, MaxI32, CountDistinctOrderedU32}, over a partial, a full and an empty selection.Cmp::EqI32,Filter::negateandFilter::and.The SQL keyword aliases (
<,AND,COUNT,EXISTS, …) are recorded in the table, but no parser in the tree produces them yet.Tests and disable runs
All tests are in
tests/integration/polyfill.rs. Each guard was disabled once to confirm a test fails:The table-arity disable was green at first, because registration already ties the argument count to the declared arity. A test with a wrong runtime
declare_algebranow makes that check load-bearing.Also checked: the table matches
R2ILVocabulary(name, arity, one result); R2IL, SQL and Quack views bind the same steps and the same plan id.Local gates:
cargo test -p lance-graph-r2il(all suites),clippy --all-targets -D warningsandfmtare clean;entries_index,citation_decayandappend_only_gatepass.Not covered
Rows,BlendI32,ScatterOrU32, theGroup*aggregates,Cmp::{Ne, Le, Gt, Ge}, the ternary matches, the strided compares andRange.SUM,MINandMAXreturn the fold identity where SQL returnsNULL.declare_algebraand its opcodes areogar-locovalues. DT64 acting as the authority for0xFFFFis a later item (D-DT64-7-4, O8).Board entry:
.claude/board/entries/2026-10-31-polyfill-positional-lens.md.Generated by Claude Code