Repository navigation
lgj-abi minor 13: a plan folded to one scalar, plus provenance and convergence tests - #95
Merged
Merged
Conversation
lgj_plan_scalar folds the fused plan straight into a count or a sum (LGJ_FOLD_COUNT, LGJ_FOLD_SUM_I32). plan_lower::lower_scalar reuses lower_plan's ops unchanged and ends in mask-RISC's Count / MaskedSumI32 terminals. lgj_plan_eval is unchanged and still lands its mask and count. View.count() and View.sumOf() call the new symbol at minor >= 13 and keep the mask path against an older library. Measured: native 205 tests (9 new), 6 of 6 disable runs red; Java core 617 checks; consumers 70 / 68 / 3 / 12. sumOf() goes from 2 crossings to 1; the per-call mask write is removed; native latency is unchanged for count and 3-25% lower for sum. docs/abi.md section 21 has the tables. Re-pinned: LazinessTest (sumOf 2 -> 1) and GroupSumTest (per-group path 32 -> 16 crossings). Claude-Session: https://claude.ai/code/session_01XAqKMP36eRfzsppfaEWMVz
provenance.rs states, as an asserted table, which of twelve mask-taking exports require a mask's parent to be the resource they read (three, plus the mask algebra) and which check only its row count (nine). It also shows what the row-count rule permits: a predicate evaluated on one resource, stored in another's mask and summed over the other's values, with status OK. No rule is changed. lowering_convergence.rs gains both_lowerings_emit_the_same_program: for 56 plans and four terminals, plan_lower and quack::lower emit structurally identical Programs (224 of 224). Two disable runs (survivor gate dropped, AND operands swapped) turn only this test red. Claude-Session: https://claude.ai/code/session_01XAqKMP36eRfzsppfaEWMVz
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AdaWorldAPI
marked this pull request as ready for review
November 12, 2026 22:27
Codex Review Summary: ✅ CompletedThis 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. |
AdaWorldAPI
pushed a commit
that referenced
this pull request
Nov 12, 2026
Nine mask arguments checked only the row count: lgj_op_eq_u32, lgj_op_gt_i32, lgj_plan_eval, lgj_reduce_sum_i32, lgj_reduce_i32, lgj_op_eq_classid, lgj_op_ternary_match, and the source and destination of lgj_hop. They now compare the mask's parent with the resource by registry identity (Arc::ptr_eq), as the register sweeps already did. Status stays MASK_LENGTH_MISMATCH. No new symbol, no registry change. docs/abi.md section 3.1 is new and normative. The change narrows accepted input, so it is not additive. The major is not bumped; the minor is (13 -> 14), and 3.1 records that as a deliberate exception to section 2 together with its reason. provenance.rs is re-pinned: all twelve exports refuse a sibling mask and a mask of the other resource kind, every refusal leaves the mask and all other outputs unchanged, lgj_hop is checked per mask, and the earlier relabelling hazard is now a refusal. Four disable runs, four red. Measured: native 212 tests; AllTests 617 checks; consumers 70 / 68 / 3 / 12; TinkerPop 25 + 55. bench/ not run. Board: the scalar-terminal entries now say merged in #95. Claude-Session: https://claude.ai/code/session_01XAqKMP36eRfzsppfaEWMVz
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.
Three commits on top of #94. The first adds one export; the second adds tests only; the third is a board status line.
1.
lgj_plan_scalar(ABI minor 13,docs/abi.md§21)lgj_plan_evallands a mask and returns its count. A caller that wants only a number still pays for the mask, and a sum pays a second crossing to read it back.lgj_plan_scalarfolds the plan straight into a count or anI32sum.plan_lower::lower_scalarreuseslower_plan's ops unchanged and ends in mask-RISC's existingCount/MaskedSumI32terminals. No new evaluator.lgj_plan_evalis unchanged. It still lands its mask and its count.View.count()andView.sumOf()keep their signatures. They call the new symbol at minor 13 or later and keep the mask path against an older library.count()sumOf()8 × ceil(rows / 64)The gain is the removed mask write and the saved crossing for a sum. It is not a large speed-up; §21.5 has the numbers.
Verified against lance-graph
0683c74, ndarray5fc71d7:{AND, OR}^nsweep at 1,000 and 65,536 rows.plan_defects_are_reported_as_lgj_plan_eval_reports_them.AllTests617 checks; consumer mains 70 / 68 / 3 / 12 (JDK 28+23-ea).OldAbiCompatTestreturns the same answers (71, 6257, 111296) in 2 crossings where minor 13 takes 1.Re-pinned:
LazinessTest(sumOf2 → 1 crossing) andGroupSumTest(the per-group path 32 → 16 crossings).Not done: JMH numbers through the JVM. The latency figures are native calls only.
2. Tests only: provenance and Program convergence
provenance.rspins, as an asserted table, what twelve mask-taking exports check about where a mask came from. No rule is changed.lgj_op_eq_u32,lgj_op_gt_i32,lgj_plan_eval, both lane reductions,lgj_op_eq_classid,lgj_op_ternary_match,lgj_hopsource and destination). They accept a mask created over a different resource, including one of the other kind.a_selection_can_be_relabelled_onto_another_resource_todayshows what the first rule permits: a predicate evaluated on B, stored in A's mask and summed over A's values, returnsOKand a number that answers neither.Experiment, not in this PR: with the same-parent rule in all nine paths,
AllTests, the consumer mains and the TinkerPop harness still pass; natively only the two tests that pin the lenient rule fail.bench/was not run. Whether to tighten the rule is a separate decision.both_lowerings_emit_the_same_programcompares loweredProgramvalues, not answers: for 56 plans (arity 2–5, all nine opcodes) and four terminals,plan_lower(ops) == quack::lower(fold_to_tree(ops)), 224 of 224. Dropping the survivor gate or swapping an AND's operands turns only this test red. Scope: the Quack side receives this file's tree reading of the flat plan; plans with no AND and the fk-keyed grouped sum are outside the claim.Totals
Native: 211 tests,
fmtandclippy -D warningsclean.Generated by Claude Code