Skip to content

D-FOUNDRY-PARITY-1: evidence matrix + 64-store read-only operational lab (DT64 + mask-RISC) - #1991

Merged
AdaWorldAPI merged 4 commits into
mainfrom
ccr-ca0562e7-hudvlz
Nov 10, 2026
Merged

AdaWorldAPI merged 4 commits into
mainfrom
ccr-ca0562e7-hudvlz

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

What

This is a lab-only PR. It adds a Foundry parity evidence matrix and a small executable lab that is independent of the rest of the workspace.

  • .claude/plans/foundry-parity-v1.md: 18 Foundry capability rows. Each row has its source evidence, a status, the missing contract, the smallest falsifier and a verdict. It also has the missing-contract register G1–G6, the three hypotheses H1–H3 and a roadmap P0–P5. No row claims parity: there was no Foundry comparator. The Foundry cells cite only the official documentation, fetched 2026-11-10.
  • crates/foundry-parity-lab: has its own workspace root. Nothing depends on it, and it changes no production contract. The fixture covers 64 stores × 64 inventory categories in source-owned planes, under a 211-field DT64 class. Each question binds only the fields it needs, then calls borrow_all once. The answers are mask-RISC programs:
    • CanCook(q) = visible ∧ offered ∧ equip ∧ ⋀_k(known_k ∧ stock_k ≥ d_k·q) ∧ staff ≥ ⌈q/u⌉
    • CanFulfill: CanCook plus a free delivery slot and the deadline
    • NetworkCapacity = Σ_q Count(CanCook(q)). This is valid because feasibility is monotone in q, and the sweep checks that rather than assuming it.
    • Network cost: Σ_k d_k·q · MaskedSumI32(CanCook(q), cost_k)

Evidence

16 integration tests. Arm B (DT64 + mask-RISC) matches an independent scalar oracle and a materialized-object null model (arm A) for 8 items × 3 quantities × 64 stores. All nine named stores answer as designed:

  • missing ingredient, missing cook and unavailable oven give 0
  • the exactly-one-unit store can make 1 but not 2
  • the restocked store refuses its stale binding, then becomes feasible after a rebind
  • the denied store answers NotAuthorized, not "cannot cook"
  • a source in another row order is refused under the canonical selection and gives the same answers by global identity under its own selection
  • unknown stock answers Unknown, never zero

These are also refused: a lane serving a foreign scope, a field the source does not map, a question that needs a field that was not bound, and a quantity outside 1..=128 at every entry point that takes one (cook_mask, answers, fulfill_mask, network_cost).

Negative controls: bypassing the known-stock guard reads the stale 1000 as stock. Bypassing the authorization predicate reveals exactly the denied store.

Disable runs: five guards were broken one at a time. Each one turned the suite red, and the tree was restored afterwards.

Gates: cargo test --release, cargo clippy --all-targets -- -D warnings and cargo fmt --check all pass on the lab crate.

Measured

cargo run --release --manifest-path crates/foundry-parity-lab/Cargo.toml --bin bench. One VM (Xeon @ 2.30 GHz, 4 vCPU), single thread, median of 41 runs, three runs.

Measurement Result
Bind, 15 of 211 fields (cold) 5.5 µs
borrow_all + pointer table 0.26 µs
One CanCook question over 64 stores 470 ns, 0 source bytes copied
Arm A walk over already-built objects 1.8 µs
Building those objects 21 µs, 52 KB second copy
Per-store maximum (layer-cake) ~15 µs
NetworkCapacity ~14 µs

The per-store maximum and NetworkCapacity are about 8× slower than arm A's walk. The admitted algebra has no element-wise cross-lane min, so it has to sweep q.

Not done

  • The per-store limiting resource and per-store cost cannot be expressed (G1, needs a decision).
  • Authorization is a lab stand-in. DR Scope is only a consistency witness; no IAM is involved (G2).
  • The scenario (store 12 closed) runs in the oracle only. There is no overlay frame contract (G3).
  • No actions or writeback (G4).
  • No bound relations, because of ADMISSION B (G5).
  • Programs are hand-written, not lowered from MethodRef (G6).
  • Scaling beyond one mask word was not measured.

Locality contract questions

  1. Resolved once per binding: route, frame, basis, lane mapping and the pointer table. Per operation: one mask-RISC program.
  2. What invalidates reuse: frame (tested), route, basis, mapping, scope and coordinate space. All of these are checked by LaneBinding::check.
  3. Bytes copied: none from the source. Arm A's 51 968 B is the null model.
  4. Measured: the table above. Hypotheses: everything Foundry-side.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p

@coderabbitai

coderabbitai Bot commented Nov 10, 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: 13af8f18-1c57-4d2a-ac7a-eb741d0d549c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A read-only (Level R) lab: 64 stores x 64 inventory categories in
source-owned planes, a 211-field DT64 class, one LaneBinding per
question (demanded fields only), borrow_all once, and mask-RISC
programs for CanCook, CanFulfill, NetworkCapacity and network cost.
An independent scalar oracle and a materialized-object null model
agree with it on every item, quantity and store. Stale frame, foreign
scope, other row order, unmapped and unbound fields are refused;
unknown stock is not read as zero; a denied store is NotAuthorized.
Five disable runs turn the suite red.

Per-store limiting resource and cost are not expressible in the
admitted algebra (no element-wise cross-lane arithmetic); the
per-store maximum costs a layer-cake sweep. Recorded as G1-G6 in
.claude/plans/foundry-parity-v1.md with the evidence matrix. No
production contract changed; no Foundry comparator; no parity claimed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 10, 2026 17:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T17:35:31.104847Z f9cdcd1 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: f9cdcd1aac

ℹ️ 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/foundry-parity-lab/src/arm_b.rs Resolved
answers() swept its own valid quantities and only compared the
caller's q against the result, so answers(0) reported zero-stock
stores as feasible (max 0 >= 0) and answers(129) succeeded. It now
refuses q outside 1..=Q_MAX like cook_mask does. New test covers
answers, fulfill_mask and network_cost at 0, -1 and Q_MAX + 1, plus
the admitted bounds. (Codex review on #1991.)

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

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Add Carrot credits or activate Agent usage billing to use Autofix

@AdaWorldAPI
AdaWorldAPI merged commit 637d638 into main Nov 10, 2026
13 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Nov 10, 2026
… transfer

PR_ARC_INVENTORY gets arc entries for #1991 and #1995; LATEST_STATE a row
for main after both; STATUS_BOARD marks D-FOUNDRY-PARITY-1 shipped and G1
partial (per-store cost done, limiting resource open as P1b);
INTEGRATION_PLANS points at the new entry and EXO-223. New entry
D-FOUNDRY-PARITY-1-P1A records arm C and the read-only LGJ crosswalk (the
R11 layout-witness gap is D-DRISA-M1). Entries index regenerated;
supersession index unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
AdaWorldAPI added a commit that referenced this pull request Nov 11, 2026
foundry-parity-lab: CanCook as a registered DT64 method (G6) + board record for #1991/#1995
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