Repository navigation
Conversation
…one (ITL-1464) A SpiralDBTableSource read whose table holds no source-info column and no content hash built one token per row and data column, then dropped them. On 2.2 million rows of 13 columns that was 9.3 GiB of Arrow memory for a 282 MiB table. The read now builds them only when its result shows or hashes them. Adds the memory diagnosis (docs/dev/specs/itl-1464-memory-diagnosis.md) and the scripts it was measured with. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…isk (ITL-1464) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…L-1464) An async job kept every row three times as (Tag, Data) pairs: in the orchestrator's result collectors (never read by a job), in each operator job node's output list, and in each barrier operator's gathered input, plus the pairs an ArrowTableStream caches while a barrier sends its result. Rows are now kept as Arrow tables of at most 8,192 rows (RowChunks), which build exactly the table the row list built. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…TL-1464) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…464 material Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…464 material Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…o eywalker/itl-1464-async-transport
…lts says (ITL-1464) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…o eywalker/itl-1464-node-rows
…nd slices without copying (ITL-1464) A forked child neither waits for a lock of its parent's threads nor touches its parent's files; a failed spill leaves the spool as it was; an unlocked or partly removed directory is swept. table() and slice() give rows through their mappings and outlive the spool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o eywalker/itl-1464-node-rows
…a time across threads (ITL-1464) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hunk's error to the read (ITL-1464) Review of PR 562: rows_once took the unkept path for any ArrowTableStream subclass or shadowed iter_data, and a full chunk that cannot make one table raised while a barrier was still collecting, leaving the other input's reader behind and raising where main returned no rows for an empty other input. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…emory-mapped (ITL-1464) An operator job node kept its run's rows as one Arrow table in process memory. Its kept rows now go through the row spool: in memory up to 64 MiB, beyond that in a private temporary file read back memory-mapped, on the async path chunk by chunk as rows arrive and on the sync path when the result is kept. The stream a node keeps is the same ArrowTableStream over the same values; a table read from it stays valid after the node, the job and the file are gone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…o eywalker/itl-1464-node-rows
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
…464) current_run_row_count() and read_current_run(start, length, columns) on an operator job node, over ArrowTableStream.num_rows and read_rows: the row reference a view needs, equal to as_table(...).slice(start, length). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 25, 2026
…leaves no reader behind (ITL-1464) Review of PR 562, round 2: a chunk that failed part way was built again and its rows given twice; the first row's keys were read as it arrived; after a failed chunk the pairs accumulated; a failing barrier left its sibling's reader alive. A failure is now permanent, a want of memory ends the run at once, a row is read only when its chunk is built, and the barriers end every reader on any error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merges the PR 562 round 2 fixes. Review of PR 566: the collectors relied on finalization, so a kept exception pinned the files written before it. Every spool is now closed where it was made, on any error and on cancellation; a failed spill raises at once and nothing more is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a spool (ITL-1464) Full chunks of a node's rows become Arrow data, on local disk when large, and a pair is built again when read. Only a row that reads back as exactly the pair that was held is kept that way; every other row stays the pair it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… rows in a spool (ITL-1464)" This reverts commit 1fc3ebb.
…-triggers-computation-without
…ements (ITL-1464) The design states that the cache root must be on disk, bounds the pairs of one join match, qualifies the SQLite primary-key trust, counts small results kept in memory and narrows the preview's side-effect promise. The measurement steps each use their own emptied result location, and setup runs under the memory guard. One test runs an operator over the source in a job, sync and async, in two tag orders. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The design names how a database-backed node read keeps the emitted order, runs a PolarsFilter per batch only for a predicate known to be row-wise, corrects the 1:1 join bound for inputs that share no key and fixes the arrival order of the bound's tests. The job test over the source covers the named columns as data, data-tags and tags, two table layouts and row multiplicity on the async path; the measurement scripts get docstrings. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…omputation-without' into eywalker/itl-1464-async-transport
…-triggers-computation-without
A node's reference names the stored row the run emitted (base entry id and recomputation index), the stated bound excludes steps that need their whole input, and async results are compared with sync row for row with multiplicity. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…omputation-without' into eywalker/itl-1464-async-transport
The cache is read only from closed segments and waiting rows, a preview continues one open read, the join index counts its per-key counts, and a whole-input step counts its output and conversion buffers. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…omputation-without' into eywalker/itl-1464-async-transport
…ITL-1464) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…omputation-without' into eywalker/itl-1464-async-transport
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft, for ITL-1464: a job node no longer holds a large output in process memory. Stacked on #562 (transport) and #559 (the row spool); their commits are included here until they merge.
What this does
An operator job node kept its run's rows as one Arrow table in process memory, for as long as the job lives. Its kept rows now go through
RowSpool(#559): in memory up to 64 MiB (KEPT_ROWS_MEMORY_BYTES), beyond that in a private temporary file, read back memory-mapped.RowChunks, perf(pipeline): keep async rows as Arrow chunks, not object pairs (ITL-1464) #562) is appended to the spool as it arrives, in the node's kept output and in a barrier operator's gathered input.kept_table().The node keeps the same
ArrowTableStreamover the same schema and values (only the arrays' chunking differs), so every read keeps its code path and meaning:as_table(), iteration,head(), a successor's read, the content hash. Sync: the same rows in the same order. No hash, identity, stored layout or golden value moves.A public promise changes (approved by the coordinator for the developer's review, design decision N1): "a job node holds its current run's rows in memory" becomes "a job node shows its current run's rows; a large run is read from a private temporary file". The file is in the system's temporary directory, in a directory of the process, never part of a stored path or hash, deleted when the node lets its run go or the process ends.
A table a user holds stays valid: the mapping lives as long as a table that refers to it, after
clear_cache(), after the node and the job are collected, after the file is deleted, and at interpreter shutdown (each tested).Measured (synthetic 13-column table; "own memory" is the peak physical footprint, what the system charges the process; resident memory also counts mapped file pages, which the system drops when it needs them)
map_data, asyncmap_data, asyncdrop_nulls, asyncSo a chain of row-by-row operators on the async path is now close to flat in rows: 0.60 GiB at 200,000 rows, 0.89 GiB at 1 million (the growth is the set of keys the source remembers, about 0.3 KiB per row).
What this does not bound, measured, not hidden:
group_by, asyncdrop_nulls,group_by,map_data, function pod, asyncmap_data, syncGroupBycomputes over its whole input with every source-info token (4.2 KiB per row here), and the sync path reads a source as one tokenized table. Those are the tokens (design T1) and grouping on a key index, not transport.Tests
tests/test_core/operators/test_row_chunks.py(added to #562's): spilled chunks build the row list's table (data-tags and tag-only); a table read from spilled rows outlives what wrote it; an async job node over spilled rows reads as one in memory (rows as sets, content hash) formap_data,group_by,drop_nullsthenbatch, and its table survivesclear_cache()and the job; a table held at interpreter shutdown reads and leaves no file;kept_tablereturns a small table as it is and a large one with the same schema and values; a sync job node over spilled rows equals one in memory exactly (table, order, schema, content hash, rows,head).Run locally:
tests/test_pipeline,tests/test_core/operators,tests/test_core/streams,tests/test_core/test_row_spool.py(17,301 passed, one process),ruff check,ruff format --check, basedpyright (0 errors), golden--check(no value moved).The row reference for views
An operator job node offers
current_run_row_count()andread_current_run(start, length, columns=..., all_info=...): exactlyas_table(...).slice(start, length)of the current run,Nonewithout one, touching only the pages read when the run is on disk (sort_by_tagsandcontent_hashread every row). Built onArrowTableStream.num_rowsandread_rows. Test:test_a_job_nodes_current_run_is_read_a_page_at_a_time(sync and async, in memory and on disk, four column configurations, before a run and afterclear_cache()).Function and side-effect job nodes
Their rows go through
RowSpooltoo (core/held_rows.py): full chunks of 8,192 pairs become Arrow data, and a pair is built again when read. A row is kept that way only when the pair built again is the pair that was held in every view (types, Python values, schemas, ids, meta, source info); any other row (a user class instance, an array, a subclass) stays the object it is. The rows handed downstream are untouched; a sync run still hands its successors the row list, so sync peaks are not bounded by this. An async run over stored results still reads them all at once.The holder alone, 200,000 two-column rows: own memory 0.93 GiB as pairs, 0.28 GiB as chunks. A small async job (60,000 rows, in-memory store, whole process): function pod 1.27 to 1.00 GiB; side-effect pod 0.82 to 1.00 GiB, worse. One run each, on a loaded machine. A likely cause, not verified: an in-memory source keeps the pairs it yields, so a node that passes the same pairs on saves nothing by holding a second form of them. Not measured at 1 million rows.
Reading a chunked row builds it again, so a function node's reads of many rows are slower than reads of kept pairs.
Review findings and their tests
test_a_job_that_fills_the_disk_leaves_no_file_while_its_error_is_kept,test_a_cancelled_node_leaves_no_file_while_its_cancellation_is_kept,test_a_barrier_that_fails_leaves_no_file_of_either_inputtest_a_job_never_succeeds_with_rows_twice_after_a_failed_allocationtest_rows_that_cannot_be_written_are_all_let_goFunction and side-effect nodes:
tests/test_core/test_held_rows.py.Not in this step
The row reference on function and side-effect nodes; operator nodes running
async_execute_batchesover record-batch channels (#565's joins).Mentions ITL-1464.
🤖 Generated with Claude Code