Skip to content

D-DR-FOLD lab: A/B/C comparison — gated Arm L, amortized binding, vector×tile - #1945

Merged
AdaWorldAPI merged 2 commits into
mainfrom
ccr-85acaff0-oszq40-dr-fold-bench
Nov 3, 2026
Merged

AdaWorldAPI merged 2 commits into
mainfrom
ccr-85acaff0-oszq40-dr-fold-bench

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Lab only. No production change. This PR adds the benchmark that was held back from #1941 (the map, docs only, now merged). It is one commit, cherry-picked from fresh main.

Files, all under .claude/probes/2026-11-03-d-dr-fold/:

  • REPORT-BENCH.md
  • bench/: its own [workspace], so the root workspace never builds it.

mask-risc, dt64 and ndarray are used unchanged. EXO-140 and EXO-46 are unchanged. No storage I/O is measured.

Arms

All three arms use one coordinate space, bound by the existing dt64::dr::{LocalMap, MapTable}. Every arm answers the same query: for a root a, count the distinct d with ∃b,c. R(a,b) ∧ S(b,c) ∧ T(c,d).

  • A (gated Arm L): one mask-risc program with two Gathers, ending in Count.
  • B (amortized binding): A's hot fold, with the binding and the presence witness paid once per generation. Two lifetimes are compared:
    • retire: re-mint the pointers on every presence change.
    • split: pointers survive presence changes; only the witness is re-checked.
  • C (top-down vector×tile): a frontier fold built from existing ndarray::simd words (mask_or_assign, popcount_batch_u64). No composed relation is formed or stored.

Results

Checks: 43 passed, 0 failed. Re-run on current main (71af59798) before opening.

  • A = C = an independent nested-loop oracle for every root.
  • Presence deletion, a stale witness, a stale frame and a duplicate global are each refused.
  • Duplicate paths: A refuses to mint (NotFunctional); C keeps set semantics (64 distinct vs 85 as a bag).
  • Disable runs: A without the second Gather, and C with the T hop skipped, both give wrong answers, as required.

Sweep, 54 cells: C beats A in every cell, by 2.6× to 490×.

  • C expands only the live frontier from a.
  • A starts from the d level and pays whole-lane passes proportional to all rows, not to the query.

Falsifier: A wins (0.67–0.85×) only with dense R and S over a sparse T (about 1 % present) and a whole-table candidate range. With 16 roots, A is behind again (4.1×).

B: retiring the pointers on every presence change is FAILED-GATE (≥ 1 ms at 37k rows). The split policy reaches near-hot cost at about 256 queries per generation.

Noise: timings moved a median of 45 % between runs, so the absolute µs values are indicative only. The A/C ordering and the exact operation counts were identical across runs, and only those are relied on.

Recommendation

From the report:

  1. Use the existing ndarray tile algebra for this fold first. The missing piece is a lowering that chooses the evaluation direction (top-down frontier vs d-anchored gather) from presence density.
  2. No new mask-risc op is justified yet.
  3. The DR → Lance physical I/O planner stays a separate track.

No merge requested.


Generated by Claude Code

…ctor×tile

Lab-only probe (own workspace) over one coordinate space bound by the
existing dt64 LocalMap/MapTable. 43/43 checks: oracle parity for every
root on ordered and shuffled layouts, deletions with the binding reused,
stale/bypass presence refused, duplicate paths (A refuses, C equals the
set oracle), scope change refused, disables red.

Sweep: vector×tile (ndarray::simd, outside mask-risc) beats candidate-
gated Arm L in 54/54 cells; the cause is evaluation direction plus A's
whole-lane term, measured by exact load/OR counts. Falsifier: A wins
only with a sparse T under dense R/S and a whole-table candidate range.
Split-lifetime amortization reaches near-hot cost at ~256 queries per
generation. No production change; mask-risc unchanged; no storage I/O.

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

coderabbitai Bot commented Nov 3, 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: 486ea6d2-0a71-4f3c-a31f-159ab25a133f
  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 3, 2026 20:52

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

ℹ️ 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".

@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-11-03T20:54:25.047678Z a1d8565 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.

The b frontier's touched list was cleared before the sum, so C_tiles covered
only the c and d frontiers. Ordered 64-root f=16 90%: 36 -> 49 tiles;
shuffled: 1,183 -> 1,196. Timings, answers and the 43/43 checks are unchanged
(the counter is not read by the fold). Report figures updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF
@AdaWorldAPI
AdaWorldAPI merged commit 9ee2652 into main Nov 3, 2026
1 check passed
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