Skip to content

probe(dr-math): D-DRCA-2 DR256::WHERE × DR#3 with guarded reuse - #1836

Merged
AdaWorldAPI merged 9 commits into
mainfrom
ccr-39105428-bcm2m2-dr256-where-dr3
Oct 28, 2026
Merged

AdaWorldAPI merged 9 commits into
mainfrom
ccr-39105428-bcm2m2-dr256-where-dr3

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Base: main. #1834 (D-DRCA-1, hhtl16), which this was stacked on, has merged, and this PR now targets main. The diff against main contains only D-DRCA-2. Contract: the DR/DT amendment in #1835.

Tests the composition global selection → optional amortized global→local mapping → HHTL16 Cartesian projection → native fold. It is a lab probe in the workspace-excluded dr-math-binding-probe crate: no production source, ABI, planner or store is touched.

Semantics: epistemic absence

$null, NaN, SQL NULL, an unset validity bit and K3 UNKNOWN are one logical value: no TRUE/FALSE judgment has been established.

  • It does not say the entity or relationship does not exist.
  • No CausalEdge64 Epi5 state is derived from it.

How #1836 applies this:

  • One WHERE. Quack's typed WHERE (Draft::bind, three-valued through Filter::sql_where, mask-risc Keep) produces the TRUE rows. That mask is the only selection input; there is no FALSE mask as a second truth representation.
  • No complement. WHERE selects TRUE. An unselected slot is FALSE or UNKNOWN, so Admitted offers no complement: a complement would read UNKNOWN as FALSE.
  • NOT UNKNOWN is UNKNOWN. A negation is its own WHERE over the negated criteria, with its own criteria identity. Reusing one selection as the other is refused.
  • Value + validity. A three-valued property keeps the register's own form (BoundDr64::validity). selected_column_k3 returns (value, validity), with value masked by validity, so a stale payload under an UNKNOWN cell is never TRUE. The Boolean folds refuse a three-valued or bag register, the rule from the Codex finding on probe(dr-math): D-DRCA-1 HHTL16 Cartesian direct-routing projection proof #1834.
  • Physical encodings are adapter concerns. Validity planes, Arrow bitmaps and NaN payloads add no semantic category.

What is reused, and what is new

  • WHERE: Quack's, as above. No predicate evaluator was added.
  • DT: the existing ClassId-bound MethodSignature (owner class, axes, truth, population) is what a selection is projected for and re-admitted against.
  • Global→local: LocalMap (D-DRCA-1), which gains digest(); a frame carries that digest as its coordinates revision.
  • New module, src/where_dr3.rs (no dependency on either engine):
    • project: map.len() probes, no map search;
    • LocalSelection::admit: re-checks every guard; Admitted is the only readable form;
    • four folds over the borrowed rows.
  • No new store. A LocalSelection is a caller-owned value: no cache, store, sidecar or persistent mask, no dense Cartesian product, and no local ordinal promoted to a global identity.
  • Quack and mask-risc are dev-dependencies only; the workflow path filter gains both crates.

Falsifiers (13 tests, independent source-ID scalar oracle)

The oracle reads plain per-address values (class, sel: Option<i32>, live). Verdicts are a match on Option, and local positions come from position() in the frame's id list. It shares no code with Quack, mask-risc, hhtl16 or where_dr3. NULL rows carry the payload the predicate tests for.

  • Global WHERE, whole mask over 65,536 addresses. TRUE, FALSE and UNKNOWN occur in the frame; neither FALSE nor UNKNOWN is selected; most selected identities lie outside the frame.
  • Two tables with equal local ordinals: no aliasing. AxisMismatch and DifferentFrame are refused.
  • Selected Identity × Property, cell by cell, by column, by count, and through the YZ rotation.
  • UNKNOWN:
    • the negated WHERE keeps exactly the oracle's FALSE rows;
    • a NULL row is kept by neither WHERE, globally and in the frame;
    • the complement of a selection differs from its negation;
    • one selection is refused as the other;
    • the three-valued column matches the oracle in value + validity form, including with a stale payload under an UNKNOWN cell;
    • the Boolean folds refuse that register.
  • Refused, then rebound to the oracle where a rebind applies:
    • a source change after WHERE;
    • a scope or focus change with identical coordinates;
    • an FK target or referenced property change;
    • a reseal or a new coordinate assignment;
    • a foreign owner, a new codebook, other criteria, another DR method.
  • Edges: empty and full selections are exact; a malformed width and an id outside the universe are refused.
  • D-DR256-WHERE: capstone, DR64³ inventory, P2 Quack-path lab, evidence reconciliation, D-NFR-1 ownership correction #1792 negative control: a detached Keep reused after its criteria input changed answers silently, and is refused when projected under the old seal. The original control is unchanged and still prints reused R2 1032 vs fresh 31.
  • Stale seals: projection under a stale seal, a foreign owner's seal or a resealed frame is refused.
  • Allocations: projection, admission and folds make 0.

Disable runs: 16. Each was committed first, its anchor asserted and its restore checked with git diff --quiet, and every one turns at least one test red. They include the complement projected as the selection, UNKNOWN reported as known, and value not masked by validity.

Measured: single WHERE vs the previous two-program path

Back to back on the same fixture, alternating old (cbc7930, TRUE + FALSE programs) and new three times. 4-vCPU shared Xeon @ 2.10 GHz, avx512f, median of 21; the two quiet pairs are shown, and the third pair was disturbed by host load in both arms.

stage previous single WHERE
WHERE Keep, 65,536 rows 41.7 / 40.2 µs 20.1 / 20.0 µs
end-to-end fresh read 43.2 / 41.5 µs 20.6 / 20.6 µs
warm total, N = 8 42.9 / 42.4 µs 21.4 / 21.0 µs
N compatible reads (single WHERE) fresh / warm
1 1.00 / 1.02 (no gain)
2 2.01 / 2.05
4 3.96 / 3.99
8 7.96 / 7.86
64 fresh and rebind exceed 1,000 µs (failed gate); warm 24–25 µs

admit takes 76–82 ns, a warm read 84–91 ns and project about 920 ns, all with 0 allocations. Rebind costs the same as fresh. These are microbenchmarks, reported, not gates.

Open limitations

  • Producer provenance (independent gate, D-NFR S5). The seal attests the caller's claim, not the mask's provenance: a detached Keep projected under a new seal is accepted. A test pins this, so a fix turns it red. Closing it needs the producer to bind a mask to its seal; Quack's bound Query has no frame.
  • Lab stand-ins. Criteria is a caller-supplied id. The codebook revision rides in FrameRevisions::relation_map. Owner, ACL and scope are the lab FrameStore and Scope equality.
  • Negation cost. A negated selection costs its own WHERE, which is the price of NOT UNKNOWN staying UNKNOWN.
  • Scale. One 64-slot frame per table: no DR256 resident register, no scattered-mask reuse.
  • Board. Entry 2026-10-28-d-drca-2-dr256-where-dr3.md. The D-DRCA-2 STATUS_BOARD row lives in docs(D-DRDT): DR = HHTL16 Cartesian direct routing, DT = ClassId binding store #1835's file and is left untouched here to avoid overlapping edits.

Not started, as instructed: D-DRCA-3, HIRO KI, ruff OGIT.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XAqKMPWTwovjYJEUMuGPb4

…reuse

A three-valued global WHERE selection (Quack Draft::bind + Filter::sql_where,
mask-risc Keep over 65,536 addresses) is projected into one table's 64-slot
frame through the counted LocalMap, re-admitted against every guard on each
read, and folded over the bound DR#3 register. The library module takes the
TRUE and FALSE Keep masks as borrowed words and depends on neither engine.

Twelve tests against a source-ID scalar oracle: in/out-of-frame selection,
equal ordinals of two tables, YZ rotation, NULL/UNKNOWN never FALSE, source,
scope/focus, FK target, reseal/coordinate, owner/codebook/criteria/schema
changes, empty and full selections, the stale detached-Keep shape, and zero
allocations in projection, admission and folds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPWTwovjYJEUMuGPb4
The first disable pass showed both seal checks inside project() were not
load-bearing: no test projected under a stale global seal, a foreign owner's
seal, or a resealed local frame. This test does, with a silence twin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPWTwovjYJEUMuGPb4
examples/dr256_where_stages.rs measures every stage separately (cold
preparation, bind, lower, WHERE TRUE+FALSE Keep, projection, admission,
warm read, rotated read, folds) and the reuse of one projected selection
over N = 1, 2, 4, 8, 64 compatible reads against fresh evaluation and
rebind-after-invalidation. Totals above 1,000 us are printed as failed
gates without a ratio. Warm reuse pays from N = 2.

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

coderabbitai Bot commented Oct 28, 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: 7a3f9847-2d46-4cae-80cc-52bf6fc07f71
  • 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

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

The same defect Codex found in hhtl16::cooccurrence (#1834) applied to
selected_count, selected_column and selected_cell: they read payload bits as
presence and accepted rows of a three-valued register. Admitted now records
whether the register it was admitted against is two-valued and distinct,
the folds take the Admitted instead of a bare word and return None
otherwise. selected_column_k3 reads validity and serves both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPWTwovjYJEUMuGPb4
Semantic correction. Epistemic absence ($null, NaN, SQL NULL, an unset
validity bit, K3 UNKNOWN) is one logical value: no TRUE/FALSE judgment.
The projection no longer takes a second FALSE mask as a truth
representation. It takes Quack's one WHERE Keep (TRUE rows, three-valued
through sql_where); Admitted exposes TRUE only and no complement, because
the complement of a selection reads UNKNOWN as FALSE. A negation is its own
WHERE over the negated criteria, so NOT UNKNOWN stays UNKNOWN; reusing one
selection as the other is refused (CriteriaChanged). The three-valued
property read returns the register's own value + validity form, with value
masked by validity so a stale payload under an UNKNOWN cell is never TRUE.
No Epi5 state is derived from absence. The stage example drops the second
WHERE program.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPWTwovjYJEUMuGPb4
…ingle WHERE

README section and board entry rewritten for the single-WHERE contract:
UNKNOWN ($null, NaN, NULL, unset validity) is one undecided value, never
read as FALSE, no complement offered, negation is its own WHERE, no Epi5
derived from absence. Measured back to back against the previous
two-program path on the same fixture: the fresh read halves (41.5-43.2 us
to 20.6 us); reuse still pays from N = 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPWTwovjYJEUMuGPb4
@AdaWorldAPI
AdaWorldAPI changed the base branch from ccr-39105428-bcm2m2-hhtl16-dr-proof to main October 28, 2026 09:37
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 28, 2026 09:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

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-28T09:39:40.468206Z 433e7df 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.

@AdaWorldAPI
AdaWorldAPI merged commit 294863a into main Oct 28, 2026
12 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Oct 30, 2026
STATUS_BOARD: D-DRCA-1 and D-DRCA-2 marked Shipped (#1834, #1836);
D-DRCA-3 In PR. Entries index regenerated (503 rows).

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