Skip to content

docs(dev): design for memory-bounded reads and runs (ITL-1464) - #603

Draft
eywalker wants to merge 1 commit into
mainfrom
eywalker/itl-1464-design-document
Draft

eywalker wants to merge 1 commit into
mainfrom
eywalker/itl-1464-design-document

Conversation

@eywalker

Copy link
Copy Markdown
Contributor

This draft proposes memory-bounded reads and runs for developer approval. It covers batch transport, storage-backed run views, previews, key certificates, joins, and deferred source-info tokens. This PR implements nothing. The measurement report and scripts stay with the SpiralDB memory fix.

Open decisions

  • N1 — Have a job node page through its run's rows in the database or local cache.
  • N2 — Back the view with the cache to preserve its methods and avoid recomputation.
  • N3 — Let run() on a source that holds no rows keep a cache file for its read.
  • L1 — Default to a configurable system temporary directory and warn when it is memory-backed, where the memory bound cannot hold.
  • L2 — Keep up to 64 MiB per stream and 512 MiB per process in memory.
  • P1 — Require compute_all=True to preview a step that needs its whole input.
  • P2 — Allow previews to call user functions.
  • P3 — Leave preview results unstored and initially omit previews on job nodes.
  • P4 — Return the first n rows in sync order.
  • B1 — Run PolarsFilter in batches for a closed list of known row-wise expressions and use the whole input for other expressions.
  • J1 — Start with keys in the join index and measure before considering 128-bit hashes.
  • J2 — Defer an in-tag-order certificate for streaming merges.
  • J3 — Limit each join match range to 1,048,576 pairs (16 MiB).
  • C1 — Represent a uniqueness certificate as a set of unique keys.
  • C2 — Omit the earlier row's position from the duplicate-key error.
  • C3 — Reuse a job node's key certificate for a DerivedSource over its records and verify it on read.
  • T1 — Derive source-info tokens on demand after the transport work.
  • T2 — Measure before extending deferred tokens to GroupBy and Batch lists after T1.
  • U1 — Keep no row objects between iterations and preserve row equality.
  • M1 — Set the workshop target at 4 GiB peak on the async path for the tables in scope.

The document records delegated coordinator approval for N1 and T1 (direction only), both for the developer's review. It also records delegated approval of the interim transport step in #562.

Mentions ITL-1464

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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.

1 participant