Skip to content

fix(csr): stream high-degree expansion in bounded chunks - #31

Merged
prrao87 merged 4 commits into
mainfrom
codex/issue-11-inline-local-cursors
Oct 26, 2026
Merged

prrao87 merged 4 commits into
mainfrom
codex/issue-11-inline-local-cursors

Conversation

@stugorf

@stugorf stugorf commented Oct 26, 2026

Copy link
Copy Markdown
Member

Problem and change

Resolves #11. CSR expansion emits bounded output chunks while retaining a resumable neighbour position, rather than collecting the complete fan-out and output. Deleted occurrences use snapshot offsets; duplicates, self-loops, missing targets, filtering, errors and existing-reader snapshots preserve their semantics.

The cursor borrows adjacency slices at the saved offset. Counters stay local until a chunk returns, and the three tiny live-neighbour constructors inline at the traversal boundary. This removes the measured per-edge abstraction overhead without changing deletion semantics. Deletion refresh still scans affected sources to resolve immutable offsets.

Validation

Head d7ad39819d04acf44907213ba7532df5e93d8869; frozen parent 54e02307a48e467a98d9da2183f5adcb767e7c99. Focused checks and regression details record commands, results, documentation and compatibility. The release receipt pins wheel/archive identity and 110 installed tests.

Both complete workloads pass unchanged goldens in memory and lazy modes. Retained first-pass geometric mean speedups are below (greater than one is faster). Per-query results and paired investigations remain in the audit archive.

Workload/mode Main Actual parent
Q30 memory 1.054 1.054
Q30 lazy 1.004 1.004
IC memory 0.998 0.998
IC lazy 1.003 1.003

Measurements use the same Apple M4 Max (16 cores, 128 GiB), macOS 26.6.2 arm64 and Python 3.13.17, with Q30 revision 6260689 and IC revision c185123. Reproduction instructions pin settings, data checksums, locks and commands. The frozen main baseline is code-identical to current main 90114f3; the equivalence check also verifies clean prospective main-target merges.

Individual review gates pass under the recorded repeat/controlled-investigation rules. Initial failed measurements remain intact in the audit record.

User impact

Expansion yields bounded chunks; deletion refresh resolves occurrence offsets by scanning affected sources. CSR docs describe per-partition memory bounds and the wide-property benchmark. Python signatures are unchanged.

Review ledger · Current contribution guide

Audit archive: 47,675,190 bytes; SHA-256 b3486fb30a34639c830b5d49353b3838f96369f95df959ac35f85511f7f8b2de. The small current-main supplement preserves the documentation update. Original absolute paths in receipts map to included records through the archive index.

Submitted by David Hughes (@stugorf), with AI Collaboration.

stugorf and others added 4 commits October 25, 2026 09:59
Resolve #11 by resuming neighbor traversal between output batches and storing immutable deletion occurrence offsets. Add focused traversal/snapshot tests, a reusable hub memory scenario, and documentation. Assisted by Codex.
@prrao87
prrao87 marked this pull request as ready for review October 26, 2026 16:14
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4af666a
Status: ✅  Deploy successful!
Preview URL: https://6fc05a63.lance-csr.pages.dev
Branch Preview URL: https://codex-issue-11-inline-local.lance-csr.pages.dev

View logs

@prrao87
prrao87 merged commit 2686f8f into main Oct 26, 2026
8 checks passed
@prrao87
prrao87 deleted the codex/issue-11-inline-local-cursors branch October 26, 2026 16:31
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.

Bound CSR expansion memory when streaming query batches

2 participants