Repository navigation
lab(D-NFR-6): native operations over the SoaEnvelope borrow — no Table, no frame guard - #1755
Conversation
…owed view dr-validated-view-probe: a Table owns the data, the FrameStore and the focus map together; every change takes &mut. validate() runs the existing bind_dr64 once and returns a View<'t> whose count/sum/min/ max/count_gt call ndarray::simd directly, with no guard. Compile-fail doctests (pinned E0502/E0597): no advance, refocus or revoke while a view lives, no view outliving its table, no borrow escaping as 'static. Runtime falsifiers: stale, resealed and foreign frames, refocus and revocation after the borrow, scope from the grant, the shared-revocation escape (SharedView checks one epoch per op), and the typed semantic refusals. Records that bind_dr64 checks the frame, not the bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
examples/guard_cost.rs: arms A direct, B prebound, C bind_dr64 per op, C' the #1752 route guard per op, D one validate + view ops, D' shared view, E refused re-validation; the guard taken apart; allocations counted (0 everywhere). FrameStore::check is 25.7-28.3 ns of the 27-28 ns guard, and its cost is refcount traffic (six lock RMWs from Arc::downgrade temporaries), not comparisons. View ops equal direct ndarray within noise; View::sum is a tail call with no lock op. Plan d-nfr-6-validate-once-v1.md answers Q1-Q6 with the source audit; proposals (pointer-compare check, BoundDr64 borrowing its frame) are recorded, not implemented. CI workflow runs fmt, clippy, tests and the cost split (reported, not gated). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. 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. Comment |
…once-20261023 # Conflicts: # .claude/board/STATUS_BOARD.md # .claude/board/entries/README.md
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bcbcebf630
ℹ️ 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".
…once-20261023 # Conflicts: # .claude/board/STATUS_BOARD.md # .claude/board/entries/README.md
…frame guard The previous probe built a Table with its own FrameStore beside the SoA and re-checked a frame on each access. That re-derived ownership the contract already has: a NodeRowPacket is a &self borrow of the owner's rows, the owner's &mut cannot start while it is live, and the packet is not Clone. soa-view-probe: FacetFold on NodeRowPacket, one ndarray kernel per method (eq_u32_strided_to_mask, ternary_match_strided16_to_mask, masked_strided_group_sum over 12 x u8) at the 512-byte row and 16-byte facet stride. compile_fail examples pin E0502/E0597/E0599; runtime tests check packet == direct ndarray == row loop at 8 sizes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
view_cost now counts allocations around the operation loop only (the harness's own timing Vec had shown as 1/1) and reports µs per call and ns per row. Packet equals direct ndarray within noise at 64/4096/65536 rows, 0 allocations in both; asm shows the same kernel calls. D-NFR-6a (a faster FrameStore::check) is withdrawn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
…t id for superseded v1 entry) D-NFC-0 and D-NFR-0 marked Shipped (#1753). The superseded v1 entry's heading becomes D-NFR-6-v1 so the index has no duplicate D-NFR-6 row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
… index The generator carries existing rows forward by file, so renaming the heading alone left two D-NFR-6 rows and failed entries_index --check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
… board rows DECISION 2026-10-24, recorded in the plan (§5), the zero-copy law and the warden card: the cache is a cost-justified exception, scoped to foreign-key reads across several ontologies reused by many thoughts and feeding learning into live-generated ONNX. It is disposable, keyed by the full witness, and lapses where DRF-P2 does not measure a whole-run win. Also: INTEGRATION_PLANS entry, STATUS_BOARD D-DRF rows, board entry, #1755 marked merged, main merged in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
Reworked. The first version of this PR built a
Tablethat held its ownFrameStorebeside the SoA and checked a frame on each operation. That re-derived ownership thatSoaEnvelopealready carries: views are&selfborrows of the owner, the owner's&mutcannot start while a view is live, and nothing is checked at runtime. The guard protected against a mutation the borrow checker already rules out. That design is withdrawn, together with its follow-up proposal D-NFR-6a (a fasterFrameStore::check).Frame provenance and external authorization are separate questions. Whoever hands out the packet answers them once; they do not justify a per-operation check.
What it is now
Lab crate
crates/soa-view-probe(renamed fromdr-validated-view-probe), with its own workspace and its own CI workflowsoa-view-probe.yml.Vec<NodeRow>the mailbox holds; writes only through&mutNodeRowPacket<'_>fromlance-graph-contract, unchanged: 512-byte rows, notCloneFacetSlot, one of the 32 16-byte slots, in range by constructionFacetFoldon the packet. Each method is one ndarray kernel:eq_u32_strided_to_mask(classid),ternary_match_strided16_to_mask(16-byte facet),masked_strided_group_sum(12 ×u8, never widened); counts usepopcount_batch_u64The crate has no
bind_dr64, frame, epoch or dispatch, and no dependency ondr-math-binding-probe.Evidence
compile_failwith the error code checked by rustdoc): writing during a live view (E0502), a view outliving its owner (E0597), a second holder viaclone(E0599). The compiling twin: after the write, a new view sees the new bytes.examples/view_cost.rs, 3 runs, reported, not gated). Packet and direct ndarray are equal within noise at 64 / 4096 / 65536 rows, e.g. 4096 rows: classid mask + count 11.1 vs 10.5 µs, payload sum 27.0 vs 26.8 µs. Both arms make 0 allocations. The per-row cost is the strided read itself (one cache line per 512-byte row), the same in both.probe_a_*/probe_b_*pair calls the same ndarray kernels. B is 4–7 instructions longer:n_rows × 512and register moves. There is nolock,cpuidor lazy initialization.Plan:
.claude/plans/d-nfr-6-soa-borrow-v2.md; v1 is marked superseded, keeping its guard measurements as the record. Board: STATUS_BOARD D-NFR-6 (MEASURED), D-NFR-6a (WITHDRAWN), INTEGRATION_PLANS,entries/2026-10-23-d-nfr-6-soa-borrow.md.Lab only: no production ABI change and no change to the ClassId/LazyLock contract. Draft; not for autonomous merge.
🤖 Generated with Claude Code
https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg