Skip to content

lab(dr256): slab planes read as 256 borrowed selections (D-DRDT-SPLIT-1 S2) - #2019

Merged
AdaWorldAPI merged 1 commit into
mainfrom
ccr-ca0562e7-hudvlz-s2-selection
Nov 11, 2026
Merged

AdaWorldAPI merged 1 commit into
mainfrom
ccr-ca0562e7-hudvlz-s2-selection

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

S2 of dr-widefieldmask-dt-classview-v1.md §5: each 256-row band of a slab plane is readable as a borrowed Selection in the same chunk layout as WideFieldMask::words, without copying or allocating. The plane stays one contiguous word slice for mask-RISC.

What changed

  • crates/dr256-ternlog-lab/src/lib.rs: MASK_BITS, MASK_WORDS, SLAB_MASKS; Plane::{masks, mask, selections}; Selection<'p> { space, row, words } with has, count, is_empty, same_bits(&WideFieldMask).
  • tests/lab.rs: four tests (T1–T4).
  • examples/selection_forms.rs: six arms, each checked against a row-at-a-time oracle before timing.

Existing behaviour changed: none (additive).

Evidence

  • cargo test -p dr256-ternlog-lab: 19 passed. clippy -D warnings and fmt clean.
  • Disable runs, each turned its test red, file restored byte-exact afterwards (anchor asserted to occur once before applying):
    • T1: row * MASK_WORDS + 1; n % 32
    • T2: lo > len; row as u8
    • T3: .min instead of .max in same_bits
    • T4: zeroed space
  • Release timing (cargo run --release --example selection_forms), median of 31:
n contiguous words fold (count_and3) borrowed view, per row owned WideFieldMask, per row build owned
65 536 259 ns 328 ns 3.51 µs 1.74 µs 32.66 µs
1 000 000 3.27 µs 5.24 µs 28.87 µs 14.50 µs 394.44 µs

Reading of the numbers

Reading the planes row by row is 9–14× slower than one pass over the contiguous words. Owned per-row masks are faster to scan than the borrowed view, but building them costs 120× a contiguous pass. So the per-row Selection is an addressing view (which rows a reader names, compare against a WideFieldMask). Folds keep reading the contiguous plane. Why the borrowed per-row loop is slower than the owned one (three mask() calls with bounds checks per row is the likely cost) is not measured.

Not verified

Only this crate was built and tested. Nothing outside the lab reads Selection yet.


Generated by Claude Code

Plane::masks / mask / selections expose each 256-row band of a slab plane
as a borrowed Selection (coordinate space, row, four words) in the same
chunk layout as WideFieldMask::words, without copying or allocating. The
plane stays one contiguous word slice for mask-RISC. selection_forms
example measures the contiguous, borrowed and owned-WideFieldMask forms.

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

coderabbitai Bot commented Nov 11, 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: 9d5f1df5-e786-4237-bb9c-fff1494c755d
  • 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

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 11, 2026 19:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 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-11T19:58:38.484842Z b1bbc6e 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 5c1b251 into main Nov 11, 2026
8 checks 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