Skip to content

plan: singleton-to-snapshot-nudge-v1 — nudge every shared-mutable singleton onto per-owner SoA + Arc-swap snapshot#478

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/singleton-snapshot-nudge-v1
Jun 7, 2026
Merged

plan: singleton-to-snapshot-nudge-v1 — nudge every shared-mutable singleton onto per-owner SoA + Arc-swap snapshot#478
AdaWorldAPI merged 3 commits into
mainfrom
claude/singleton-snapshot-nudge-v1

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

A workspace-wide integration plan that nudges every singleton-shaped construct onto the ratified architecture: per-owner MailboxSoA<N> read via cycle-coherent Arc-swap COW snapshots. Design-spec + audit only (D-SNGL-1..7); no code in this PR beyond the board hygiene.

The mechanical distinction (the whole game)

The grep for LazyLock / OnceLock / static / Arc<RwLock> returns two fundamentally different shapes. Only one is a target:

  • NOT a target — read-only immutable codebooks. Role keys (SUBJECT_KEY…), DataFusion UDFs (VECTOR_DISTANCE_*_UDF), simd_caps(). Built once, never mutated. A LazyLock here is a const table, blessed by data-flow.md §2. Leave as-is.
  • IS a target — shared-mutable runtime state. ShaderDriver.bindspace: Arc<BindSpace>, AttentionMatrix.gestalt (drifts via the deprecated unbundle_from), burn matmul caches (pending audit). Nudge to per-owner SoA + snapshot.

The test is mechanical: mutated-after-init → nudge; never-mutated → codebook, keep.

Deliverables

  • D-SNGL-1/2 — singleton census + classification gate (audit)
  • D-SNGL-3AttentionMatrix.gestalt correctness (TD-UNBUNDLE-FROM-1); unbundle_from already deprecated on branch claude/stoic-turing-M0Eiq
  • D-SNGL-4ndarray/crates/burn cache audit (JIT-kernel cache = keep; runtime belief = nudge)
  • D-SNGL-5/6SnapshotProvider adoption checklist + no-cross-cycle-lag falsification per nudged crate (reuses cycle-coherent-soa-snapshot-v1)
  • D-SNGL-7 — board hygiene + candidate epiphany E-SINGLETON-IS-CODEBOOK-OR-SOA

Relationship to other plans

Ties together bindspace-singleton-to-mailbox-soa-v1 (BindSpace dissolution — referenced, not duplicated) and cycle-coherent-soa-snapshot-v1 (the snapshot mechanism reused here). Anchored epiphanies: E-MAILBOX-IS-BINDSPACE, E-BATON-1, E-DEINTERLACE-TWO-SCALES.

Board hygiene (same commit)

.claude/board/INTEGRATION_PLANS.md prepend + .claude/board/STATUS_BOARD.md rows.

Note: the AttentionMatrix unbundle_from deprecation + the PR #477 review fixes (ColumnOutOfBounds, doc corrections, TD-UNBUNDLE-FROM-1 entry) live on branch claude/stoic-turing-M0Eiq (PR #477), not in this PR.

https://claude.ai/code/session_0147hSzjmWZDuy2MSQNrhEK5


Generated by Claude Code

…gleton onto per-owner SoA + Arc-swap snapshot

Workspace-wide audit plan (D-SNGL-1..7). The mechanical distinction:
read-only LazyLock codebooks (role keys, UDFs, simd_caps) are NOT targets;
only shared-mutable runtime state is. Test: mutated-after-init -> nudge;
never-mutated -> codebook, keep.

Ties together bindspace-singleton-to-mailbox-soa-v1 (BindSpace dissolution)
and cycle-coherent-soa-snapshot-v1 (the snapshot mechanism). Names concrete
targets: ShaderDriver.bindspace, AttentionMatrix.gestalt, burn matmul caches.

Board hygiene: INTEGRATION_PLANS prepend + STATUS_BOARD rows in same commit.

https://claude.ai/code/session_0147hSzjmWZDuy2MSQNrhEK5
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AdaWorldAPI, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 39 minutes and 10 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b4195fa-59c8-43fb-91b6-9bd2e1165502

📥 Commits

Reviewing files that changed from the base of the PR and between 094f06d and f5a3f8a.

📒 Files selected for processing (3)
  • .claude/board/INTEGRATION_PLANS.md
  • .claude/board/STATUS_BOARD.md
  • .claude/plans/singleton-to-snapshot-nudge-v1.md

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 and usage tips.

@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: 2e54385208

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

| Construct | Home | Nudge | Owning plan |
|---|---|---|---|
| `ShaderDriver.bindspace: Arc<BindSpace>` | cognitive-shader-driver | Dissolve into per-mailbox `MailboxSoA<N>`; driver holds a sea-star of mailboxes | `bindspace-singleton-to-mailbox-soa-v1` (D-MBX-3/5) |
| `BindSpace::zeros(4096)` in `bin/serve.rs` | cognitive-shader-driver | Delete; mailboxes allocate their own SoA | `bindspace-singleton-to-mailbox-soa-v1` (D-MBX-5) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the gRPC debug server in the BindSpace nudge

The target list only calls out bin/serve.rs, but the same repo-wide search for BindSpace::zeros(4096) also finds crates/cognitive-shader-driver/src/bin/grpc.rs:29, which builds an identical Arc<BindSpace> for the gRPC debug server. If the migration follows this audit as written, the REST debug server would be moved to per-mailbox SoA while the gRPC server keeps the shared BindSpace singleton, leaving one of the documented singleton targets behind.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered — the plan's "IS a target" table already has a dedicated row for bin/grpc.rs:29:

Arc::new(BindSpace::zeros(4096)) in bin/grpc.rs:29 (gRPC debug server) — Delete; same nudge as serve.rs — both debug-server entry points must move together or one singleton is left behind → bindspace-singleton-to-mailbox-soa-v1 (D-MBX-5)

The thread is marked outdated because the plan was updated to include this entry after the comment was posted. Both debug-server entry points (serve.rs and grpc.rs) are explicitly listed as a pair with the note that they must move together.


Generated by Claude Code

claude added 2 commits June 7, 2026 13:04
…t list

Codex P2: the repo-wide BindSpace::zeros(4096) search also finds
bin/grpc.rs:29 (gRPC debug server), identical to bin/serve.rs:29 (REST).
Both must move to per-mailbox SoA together; the audit previously named
only serve.rs, which would leave the gRPC singleton behind.

https://claude.ai/code/session_0147hSzjmWZDuy2MSQNrhEK5
@AdaWorldAPI AdaWorldAPI merged commit efdb3b1 into main Jun 7, 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