Skip to content

probe(dr-math): associativity of Boolean relation composition [5/5] - #1707

Merged
AdaWorldAPI merged 5 commits into
mainfrom
lab/dr-math-5-assoc-probe-20261022
Oct 22, 2026
Merged

AdaWorldAPI merged 5 commits into
mainfrom
lab/dr-math-5-assoc-probe-20261022

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Stage 5 of the D-DRMC stack. Base is #1708, which lands the stranded stages 1–4 and the charter amendment on main. This is the first law the certified-compiler boundary can certify, per the amended charter.

(R ∘ S) ∘ T = R ∘ (S ∘ T) over OR/AND is established algebra. The probe tests whether the pieces around it preserve it.

What relcomp adds

  • Typing. A Chain composes bound DR64 operands only where:
    • each column domain is the next operand's row domain;
    • all operands share one current frame issue, one focus and one scope;
    • every operand is a two-valued Distinct relation (the Boolean semiring).
  • Law admission. admit_composition_assoc admits associativity only for BooleanCompose over two-valued Distinct relations. Bag (counting) and three-valued composition are refused. AdmittedLaw has no other constructor; a compile_fail doctest checks this.
  • Proof. egglog is given only the admitted rule. It proves every reassociation of a 5-chain and checks its own proofs. Commutation gets no proof, even with both terms in the e-graph.
  • Lowering. An order lowers to push/compose steps that raise back to the same order. This is a structural check. The compose kernel is checked separately, against an independent pair enumeration.
  • Certificate. certify_reassociation is the first issuer of a RecipeCertificate, which now carries egglog's proof text. It refuses a law reference for another shape, a non-reassociation, and a missing code identity. admit_recipe's single-operand path still has no certifier.

Measured

cargo run --release --example assoc_orders on one dense-to-sparse 5-chain (4-vCPU shared Xeon @ 2.10 GHz):

  • All 14 orders compute the same relation.
  • Work ranges from 6 414 to 15 310 row-ORs.
  • Time per evaluation ranges from about 4.4 to 10.8 µs.
  • The cold egglog proof takes about 12.5 ms. It runs outside the fold, so it is reported, not gated.

Checks

  • 11 new tests. All existing suites still pass, and the two doctests pass.
  • clippy -D warnings and fmt are clean.
  • Disable runs: each guard was switched off in turn, and each run fails a test. The guards are:
    • the domain check and the Boolean-Distinct gate;
    • the stale-frame check;
    • the semiring check in law admission;
    • the compose kernel itself;
    • adding a commutation rule, which breaks the refusal test;
    • the certificate's law check and the lowering round-trip.

Not done

  • Order selection. The costs above come from evaluating every order, which a selector must not do.
  • Certificate rebinding to a second frame (X8).
  • GF(2)/M4RI reduction. None is attempted.
  • R2IL/Quack wiring.

The crate now depends on egglog from git (public API only); no ndarray patch is needed.


Generated by Claude Code

The first law the certified-compiler boundary can certify, per the
amended charter.

- Chain: composes bound DR64 operands only where column domain meets row
  domain, under one current frame issue, one focus, one scope, and only
  for two-valued Distinct relations (Boolean semiring).
- Law admission: admit_composition_assoc admits associativity only for
  BooleanCompose over two-valued Distinct; Bag and K3 are refused.
  AdmittedLaw has no other constructor (compile_fail doctest).
- Proof: egglog, given only the admitted rule, proves every
  reassociation of a 5-chain and checks its proofs; commutation gets no
  proof even with both terms present.
- Lowering: push/compose steps that raise back to the same order. The
  kernel is checked against an independent pair enumeration.
- certify_reassociation is the first issuer of a RecipeCertificate,
  which now carries egglog's proof text. admit_recipe's single-operand
  path still has no certifier.

Example assoc_orders, release, 4-vCPU shared Xeon @ 2.10 GHz: 14 orders
of one 5-chain, same relation, 6 414 to 15 310 row-ORs, ~4.4 to 10.8 µs
per evaluation; cold egglog proof ~12.5 ms (reported, not a gate).

Not done: order selection, certificate rebinding (X8), GF(2)/M4RI
reduction, R2IL/Quack wiring.

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

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 284bc66c-ccea-4015-ae73-58afd6599eef
  • 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.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI
AdaWorldAPI changed the base branch from lab/dr-math-4-handoff-gates-20261022 to lab/dr-math-restack-20261022 October 22, 2026 17:00
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 22, 2026 17:12

@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: a554da1cc4

ℹ️ 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 crates/dr-math-binding-probe/src/relcomp.rs Outdated
Comment thread crates/dr-math-binding-probe/src/relcomp.rs
@chatgpt-codex-connector

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-22T17:13:37.451845Z a554da1 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.

…lowering digest

Two Codex findings on #1707:

- Chain::new checked frame freshness once and kept no borrow of the
  store, so the store could be advanced or dropped before eval. The
  chain now borrows the store; advancing it while a chain is alive does
  not compile (compile_fail doctest).
- certify_reassociation accepted any nonzero compiled_digest. The digest
  must now equal lowering_digest(lower(to)), a SHA-256 over a canonical
  encoding of the checked step list; anything else is CompiledMismatch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
@AdaWorldAPI
AdaWorldAPI changed the base branch from lab/dr-math-restack-20261022 to main October 22, 2026 21:48
@AdaWorldAPI
AdaWorldAPI merged commit 45328fa into main Oct 22, 2026
13 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Oct 23, 2026
Source-grounded matrix of the math-compiler lab work (#1690/#1693/#1696/#1698/#1707):
nothing SHIPPED; independent proof check, counterexample-driven refutation, full-domain
lowering validation, second-fresh-binding reuse and Thought-Git linkage ABSENT. 34 tactics
audited as a proposal vocabulary (no kernel emits a derivation; 15 unique signatures).
Minimal typed ABI reusing existing names; stages S1-S6 with positive/negative/silent/disable
tests. Plan only; no implementation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
AdaWorldAPI pushed a commit that referenced this pull request Oct 23, 2026
entries_index.py takes the first id in an entry's heading. Both L1
headings named D-DRMC-5, which #1707's entry already holds, and the
structural falsifier rejected the duplicate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
AdaWorldAPI pushed a commit that referenced this pull request Oct 23, 2026
…certified-compiler row

D-TGA-5D said In PR; #1739 merged as 9a458ca.
X8: #1740 ran the fresh-frame half; the catalogue multi-binding half is untouched.
Certified-compiler row: certify_reassociation (#1707) is an issuer; the
single-operand admit_recipe path still refuses. Independent checker, second
law and prover revision are still missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
AdaWorldAPI pushed a commit that referenced this pull request Oct 23, 2026
…ents

recipe.rs and tests/contract_handoff.rs said no certified-compiler boundary
exists for DR64 laws. The single-operand admit_recipe path still has no
certifier, but relcomp::certify_reassociation (#1707) certifies one law:
associativity of Boolean-Distinct composition over a DR64 chain. #1738
corrected two other sites; these two remained. Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
AdaWorldAPI pushed a commit that referenced this pull request Oct 23, 2026
… substrate

Documentation only. ONNX GraphProto stays the graph at the membrane; no new
AST, rewrite pass or interpreter. relalg takes only the Boolean/compare/reduce
fragment; value maths has no existing home (OP-ONNX-1, operator). Value-indexed
ops are refused under ADMISSION B; no float law is admitted; certified applies
only to egglog-proved Boolean-Distinct composition associativity (#1707, #1740).

The original DR64³ plan was not found (0 files; branch and PR search
negative). The DR64³ section is a new, labelled proposal.

Open points OP-ONNX-1..14. Board: STATUS_BOARD D-ONNX-0/1/3, INTEGRATION_PLANS,
entry 2026-10-23-d-onnx-relalg-cap-s0, entries index regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
AdaWorldAPI pushed a commit that referenced this pull request Oct 26, 2026
…endent invalidation falsifier

Corrects the binding-store wording: the generalized Quack Binding Store
is planned/unbuilt, while numeric binding, RelAlg let reuse (#1649,
#1653), witnessed DR populations (#1666), typed DR method binding
(#1701/#1708) and compiled mathematical recipes (#1693/#1694/#1707/
#1740) exist in production or lab. Notes #1666 Pop's witness refusal
in B.7(5).

Replaces "a property change is harmless" with the three-way invalidation
rule, and adds the falsifier it needs to the P2 lab: a property read by
R's criteria is mutated; the reused R2 keeps 1,032 rows vs 31 fresh and
a downstream read differs, silently (`--controls`, seed 0x0D0D_F00D).
Disable run red (skipping the mutation fails the non-vacuity assertion).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
AdaWorldAPI pushed a commit that referenced this pull request Oct 26, 2026
…, P2)

Links the existing implementation spine with source and status: #1649,
#1653, #1659, #1666, #1681, #1685, #1693, #1694 (landed via #1696/#1698),
#1701/#1703 (via #1708), #1707, #1740. Separates production (Quack
numeric binding, CompiledProgram, mask-risc terminals, r2il procedures,
the contract's SetProgram type) from lab.

Names the smallest missing seams with their owners: D-NFR-1 frame on a
bound Query (needs NFR-OP-1), an input-generation dependency witness for
kept planes (binding store; witness type is NFR-OP-3, so no new Pop),
and the D-NFR-2 codebook generation. Shows how one certified recipe
applies to many witnessed bindings without copying populations, re-reads
the DuckDB harvest against what exists, and states the authorization
boundary. Documentation only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
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