Repository navigation
D-CMH-1: class-qualified methods compile into Quack algebra, with no Rust per method - #1504
Conversation
First slice of D-CMH-1 (class × method × payload → shared algebra). A MethodSpec belongs to the concept (0x0103) and names its fields in the canonical ClassView basis. MethodTable::prepare binds each spec once against one glove's claims and Binder; a call carries only numbers and runs through either Quack (Query → lower → mask-risc) or R2IL (FoldDialect → mask-risc). - required is a WideFieldMask over the canonical basis; a method prepares only when required ⊆ available (fields with an Exact/Converted claim). `duration` (Hypothesized) is refused at preparation. - An action body prepares and is refused by every pure call. - Labels resolve to a MethodKey once; only keys reach a call. - lance-graph-r2il: procs::count_eq (live plane AND U32 = v, popcount). Tests: count_billable agrees across Quack, R2IL and an oracle that reads the DTO's documented indicator values (n = 1, 64, 65, 4097); the bound query equals the one Quack binds from names; a swapped lane breaks parity on both frontends; wrong concept, unknown key, action refused. Not yet zero-friction: the body kind is a closed enum and the R2IL path calls a per-body procedure. The next commit makes the body declarative. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (13)
✨ Finishing Touches
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 |
A method body is now MethodBody::Query { filter: [Cond], folds: [Fold],
law }: conditions (= / !=) over code fields, folds Count and Sum. One
generic binder turns any such body into Quack queries (one per fold) and
the same selection into R2IL calls. src/ names no method.
r2il: count_eq is replaced by the general select_u32 (live plane AND
per-condition U32 equality, optionally negated) and count; POP_COUNT now
counts a resident plane in place, so an empty condition list counts the
live rows.
Tests declare every method in the test file. Two new shapes added there
only (a negated condition; Count + Sum over one selection) run on both
frontends against row-loop oracles, with no change to src/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
- call.rs: `SELECT <concept>::<method>(<table>) FROM <table>` resolved once into a typed MethodCall: the concept through OGAR's codebook (canonical_concept_id), the method through the table's labels, the payload checked against the FROM table and the bound table. Exactly one form is recognised; everything else is refused by name. - Binding seals: a spec carries the SchemaSeal of the canonical basis it was written for and the ReadingId it assumes; a call names the Universe of its planes. Any mismatch is refused. A basis wider than 256 positions is refused whole. - Grouped SUM fold, and Law::NarsRevision: revision of independent evidence compiled from two grouped sums and one certified finisher. The body must select the payload's first-occurrence mark, or it is refused (EvidenceNotIndependent): the algebra cannot compute that mark yet. tests/polyfill.rs: the call agrees with the same query written in Quack, with R2IL procedures and with a row loop; refusals for concept, method, payload, table, schema, reading, population, NULL and width; revision agrees with a float oracle and OpenNARS's reference points on both frontends; the repeated-stamp counterexample; the dropped out-of-domain key, pinned as a known gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
What the slice executes, what was measured, and the capability / insufficiency ledger: first-occurrence mask (NARS dedup), dropped out-of-domain group keys, NULL, the SQL frontend, unminted NARS concept and method identity, fixture reading/population ids, the fail-open compute-DAG check, unfused folds. Extension criteria for new algebra and laws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
PreparedMethod now holds its Quack programs, lowered when the method is prepared (a lowering error is PrepareError::Lower); a call executes them and never lowers. `programs()` exposes them, and the tests assert they equal the program the same query written directly in Quack lowers to: no separate row evaluator sits behind a method. examples/method_cost.rs measures cold preparation, resolution and lowering apart from warm execution, with the hot paths interleaved per rep, allocations counted, and every path's answer asserted first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
`hours_by_billable` (hours grouped by the billable code) is declared in tests/method.rs only, against the executor frozen at e984885. No other file changed (see this commit's stat). Result: correct on Quack against a per-group row loop at n = 1, 65, 4097. R2IL refuses it with a typed error: its GROUP_SUM (like SUM and KEEP) takes its mask only from a computed slot, and a body with no condition hands it the resident live plane. The test pins that refusal; the executor gap is closed in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
SUM, GROUP_SUM and KEEP took their mask only from a computed slot; POP_COUNT already read a resident plane. A fold over a body with no condition (the live plane alone) was therefore refused. One shared resolution now serves all four: shape first (`fold_mask`, so a wrong-kind operand is still reported as wrong-kind), then the epoch for a slot (`resolve_mask`). mask-risc's terminals already took any Operand. Found by Experiment B (a method declared after the executor was frozen): `hours_by_billable` now agrees with its row loop on both frontends. r2il test: every_fold_takes_a_resident_plane_as_its_mask (failed before this change on SUM with WrongOperandKind). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Replay identity (delta_id) and evidential identity (stamp) are kept apart: a replayed delta and the same stamp arriving in a second hypothesis layer leave the revised truth unchanged on both frontends, given the producer's marks; without them the raw sums move. Retraction is a pinned typed insufficiency: Law::NarsRevision does not declare it. A negative-weight delta is exact when the stamp was asserted and silently wrong when it was not; the sums cannot tell which. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Seam, frozen-executor authoring, NARS replay/layers/retraction, faults, and measured cost, appended to the D-CMH-1 ledger entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Regenerated the generated .claude/board/entries/README.md with entries_index.py, keeping this branch's curated summaries; --check passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
The probe reports `avx512f` / `avx2` as compiled target features, so a timing is labelled by the arm that produced it, not by whichever cargo config happened to apply (lance-graph's default is x86-64-v3; native gives AVX-512 on this host). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
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: 89fd1c65c9
ℹ️ 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".
Review fixes (Codex on #1504): - a repeated MethodKey is refused (DuplicateKey) instead of resolving to the first entry; a repeated label is refused (DuplicateLabel) and resolves to nothing; - two proven claims mapping different native fields onto one canonical field are refused (AmbiguousClaim) instead of binding by claim order; the same claim repeated is not ambiguous; - Law::NarsRevision with a zero scale (NaN) or zero horizon (confidence exactly 1) is refused at preparation (LawParameter). Each is pinned by a test with a twin that still prepares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
…#1504 Operator rulings 2026-10-15: CE64 header bits mean the same everywhere (K1 per-class readings withdrawn); 40..42 = Pearl method, 50..52 = the plasticity ladder (the Maslov pyramid), 59..63 = licence; O25 is a defect with a known fix over temporal.rs coordinates; N15 wires Pearl, Wang NAL S-P and the other families as views on the one wire. Records O22 and R1 as done, O20 and N10 as closed on main, O26 as dead code behind a non-compiling wip feature. Adds the 11 missing arc entries from the merged PR bodies, STATUS rows for D-RESIDUE-FP-0 / D-MATURATION3-0/-1, and moves D-HL-0 / D-NALP-0 to Shipped (#1496). Claude-Session: https://claude.ai/code/session_01EFw2WdKr1oxvaKCJC2ua2R
What this proves
A new method of a concept becomes executable by writing a declaration. No Rust function, adapter or interpreter is written for it.
Rust supplies two reusable layers, each written once:
Count,Sum,GroupSum.ValuesandNarsRevision.A method composes these layers. It cannot supply its own algebra or law.
Each law declares the body shape it requires, and preparation checks that shape. For example,
NarsRevisionrefuses a body that does not select independent evidence.Experiments A–E
Full results and the capability / insufficiency ledger are in
.claude/board/entries/2026-10-12-class-method-polyfill-ledger.md.A. The seam
The class-qualified call, the same query built directly through Quack's binder, R2IL's procedures and a row loop all agree at n ∈ {1, 64, 65, 4097}.
A prepared method's
programs()equalslower(direct query). So a method call executes exactly the program a direct Quack query would, and no separate row evaluator exists.No SQL frontend reaches Quack today.
resolve_callrecognises one call form and is the seam such a frontend would hand its parsed call to.B. Frozen executor
At
e984885,hours_by_billablewas declared intests/method.rsonly; that commit changes one file.SUM,GROUP_SUMandKEEPtook their mask only from a computed slot. A body with no condition hands them the resident live plane instead.Fixed in
8d5a36f: one shared mask resolution in R2IL, with no new op. Both frontends now agree. The method needed no Rust; the first condition-free method exposed an executor gap.C. NARS revision
Built from two grouped sums plus
Law::NarsRevision.delta_id, independence by(statement, stamp)).The missing reusable algebra is a first-occurrence mask over an ordered key, plus, for retraction, a semijoin of retraction stamps onto asserted stamps.
D. Faults
Each fault is either refused before execution with a typed error or turns its test red. A disable run was made for each guard: 13 so far, all red.
A compute body has no
MethodBodyvariant, so it cannot be written at all.E. Cost
Measured on 1,048,576 rows at the repo's
x86-64-v3tier, with the hot paths interleaved per repetition:Once prepared, the method layer adds no measurable cost over direct Quack. Both are about 1.6× slower than a fused scalar loop, because the program writes a mask and then sums it. That is the executor's cost, not the method layer's; fusing filter and fold is the lever.
Changes
glove-parity/src/method.rs:MethodSpec,Glove,MethodTable,PreparedMethod(with programs lowered once), theGroupSumfold,Law::NarsRevision,SchemaSeal/ReadingId/Universe.glove-parity/src/call.rs:resolve_call.glove-parity/examples/method_cost.rs: the Experiment E probe.r2il/src/procs.rs:select_u32andcount.r2il/src/lib.rs:POP_COUNT,SUM,GROUP_SUMandKEEPread a resident plane as their mask.Gates: fmt and
clippy -D warningspass on glove-parity and r2il. Tests pass for glove-parity (method 10, polyfill 12), r2il and r2il-mask-abi-probe.Open
FirstOfRunpredicate over an ordered key, so the dedup marks become algebra.sql_where.🤖 Generated with Claude Code
https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Summary by CodeRabbit
New Features
Improvements