Skip to content

dt64: LaneBinding::borrow_all — one check for every bound lane - #1988

Merged
AdaWorldAPI merged 2 commits into
mainfrom
ccr-8062bcc7-l7lkz9-dt64-borrow-all
Nov 10, 2026
Merged

AdaWorldAPI merged 2 commits into
mainfrom
ccr-8062bcc7-l7lkz9-dt64-borrow-all

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

LaneBinding::lane re-runs check on every call, and check walks every bound lane. Reading all N bound lanes therefore costs N² source lookups. #1987's lab measured this at 256 fields: 155 µs to resolve through lane per field, against 14 µs for one check followed by N borrows.

Change

LaneBinding::borrow_all(store, view, frames, source) calls check once. It then returns BoundLanes, an ExactSizeIterator of Result<(field, S::Lane), LaneRefusal> in ascending field order.

  • A refusal comes back before any lane is borrowed. The one check covers every bound lane, so frame, route, basis, mapping, scope or row-order failures all stop it first.
  • A vanished lane is reported in place. If the source no longer holds a lane, the iterator yields Err(Vanished { field }) at that position and still hands out the other lanes.
  • Nothing is allocated. The iterator walks the binding's own address list.
  • Existing behaviour is unchanged. lane stays as it was; BoundLanes is re-exported from the crate root.

Tests

Four new tests in tests/lane_socket.rs:

Test What it checks
borrow_all_yields_every_bound_lane_in_place_in_field_order Lanes are the source's own slices, in field order, and match what lane returns
borrow_all_checks_once_where_lane_per_field_checks_each_time Exactly 2 lane_of lookups for 2 bound lanes, against 4 for lane per field
a_refused_borrow_all_borrows_nothing A stale frame is refused with 0 borrows
a_vanished_lane_is_reported_in_place [Ok(0, …), Err(Vanished { field: 1 })]

Disable runs, each restored from the committed state afterwards:

Disabled Failed
The check call in borrow_all a_refused_borrow_all_borrows_nothing and borrow_all_checks_once_…
Iteration stops at a vanished lane a_vanished_lane_is_reported_in_place

cargo fmt, cargo clippy -p lance-graph-dt64 --all-targets -D warnings and cargo test -p lance-graph-dt64 are clean (59 + 33 + 15 + 2 tests).

The board entry is .claude/board/entries/2026-11-10-dt64-lane-borrow-all.md. Once this lands, #1987's lab can switch from its hand-rolled check + addr + borrow to borrow_all.


Generated by Claude Code

LaneBinding::lane re-checks every bound lane on each call, so reading all
N lanes cost N^2 source lookups (155 us at 256 fields in #1987's lab,
against 14 us for one check). borrow_all checks once and returns
BoundLanes, an ExactSizeIterator over the bound lanes in ascending field
order. Refusals return before any borrow; a vanished lane is reported at
its position. No allocation.

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

coderabbitai Bot commented Nov 10, 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: c93ccc15-445d-4e86-a34a-badc3aa32da9
  • 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 10, 2026 16:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 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-10T16:35:14.753182Z 4278d0c 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.

…t64-borrow-all

# Conflicts:
#	.claude/board/entries/README.md
@AdaWorldAPI
AdaWorldAPI merged commit c907a33 into main Nov 10, 2026
13 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