Skip to content

chore: ITL-1464 integration, do not merge - #569

Closed
eywalker wants to merge 130 commits into
mainfrom
eywalker/itl-1464-integration
Closed

eywalker wants to merge 130 commits into
mainfrom
eywalker/itl-1464-integration

Conversation

@eywalker

@eywalker eywalker commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Integration, do not merge. This branch puts the ITL-1464 tracks together so CI runs them as a whole; each track is reviewed and merged through its own pull request.

Merged: #558, #559, #562, #566, #563, #564, #565, #567, #568, #560, #571, #572, #570, #573. Conflicts keep both sides' tests. A commit of #566 that keeps function nodes' rows in a spool is reverted here (not reviewed yet).

On top: an async job's edges carry record batches and operator nodes run async_execute_batches (core/job_edges.py), token recipes travel between nodes on both paths. Design and limits: docs/dev/specs/itl-1464-integration.md.

Measured

docs/dev/specs/itl-1464/chain.py: 8.1 million events and 2.2 million series rows at 100%,
read by the real source over the fake client. Peak physical footprint / peak resident memory
in GB, and seconds. Memory beyond the footprint is memory-mapped pages of local files.

Async:

Step 25% 50% 100%
events semi-joined with the kept items 0.4 / 1.1, 15 s 0.5 / 1.8, 32 s 0.7 / 3.2, 66 s
then filtered by time 0.5 / 1.6, 15 s 0.7 / 2.9, 32 s 0.8 / 5.3, 68 s
then joined with a lookup table 0.6 / 2.8, 17 s 0.8 / 5.2, 34 s 1.0 / 10.0, 85 s
filtered events grouped by item 2.1 / 3.5, 27 s 3.9 / 6.8, 55 s 4.6 / 9.4, 115 s
series filtered, grouped, one function 1.4 / 2.1, 8 s 2.6 / 3.7, 15 s 4.5 / 8.2, 33 s
the whole job 3.0 / 4.4, 38 s 5.3 / 8.2, 78 s 7.4 / 20.0, 164 s

The 100% column includes the aggregation step that sorts text by rank and spools token
lists (#573); the 25% and 50% columns were measured before it. It lowers the footprint and
raises resident memory (mapped pages).

Sync:

Step 25% 50% 100%
semi-join 1.8 / 2.6, 14 s 3.2 / 4.6, 32 s 6.0 / 8.9, 67 s
filter 1.8 / 3.0, 15 s 3.2 / 5.5, 33 s 6.0 / 10.6, 69 s
lookup join 2.3 / 5.0, 15 s 4.2 / 9.3, 32 s 7.5 / 18.6, 72 s
group by 2.5 / 4.2, 25 s 4.4 / 7.8, 55 s 6.0 / 12.0, 115 s
series and function 1.9 / 2.7, 7 s 3.9 / 5.0, 14 s 5.8 / 10.8, 30 s
the whole job 4.8 / 7.1, 37 s 8.7 / 13.3, 71 s above 24 GB, killed

main at 25%: the semi-join takes 10.7 / 10.9, 12 s on sync; the semi-join on async, and
the lookup join and the whole job on both paths, pass 24 GB and are killed.

Row-by-row steps are slower on sync than on main (12 s to 14 s here): the source's rows go
through a local file.

What is bounded, and what is not

Bounded on async: sources, row-by-row operators, joins with a small or certified side. They
grow by the digests of the keys read (16 bytes a row), and by file pages the system can drop.
Whether a container that counts mapped pages drops them in time is not tested.

Not bounded, in the order of their cost in the whole job at 100%:

  1. Writing a function node's stored rows (the peak of the whole job when profiled, before perf(core): token lists on the row spool; grouping millions of rows; IPC refuses recipes (ITL-1464) #573): a row holds the source-info text
    of its inputs' token lists, millions of tokens in one row, and the Delta writer holds
    copies. The stored layout decides the text.
  2. GroupBy over its whole input (4.6 GB for 5.7 million member rows): the sort of its members
    and the copies of what it takes. The members' data it keeps is 64 MB; the rest is ids.
  3. A function's input row that is one large group: its token text, then Python lists.
  4. On sync, each operator's own whole result while it is moved to local disk.

Gates

The ITL-1347 differential against main (both fixtures, all modes, one and default Polars
threads): sync exact and async as sets, all equal. At the final head: equal, and 24,560 tests pass. Every operator node's rows, system tags
and tokens in the job above, at 0.5%, have main's digests on both paths.

Mentions ITL-1464.

🤖 Generated with Claude Code

eywalker and others added 30 commits November 25, 2026 00:56
…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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…isk (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws, with bounded output batches (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…needed (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…geJoin and SemiJoin streaming on record-batch channels (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
…s (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <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>
…lts says (ITL-1464)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ents (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a time across threads (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eywalker and others added 13 commits November 25, 2026 04:21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r their column is called (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e's id is never taken for another (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
…nor a SemiJoin's unused input (ITL-1464)

A DerivedSource previewed through its own as_table(), which read the origin
whole: a CachedSource origin wrote its cache table, a PollingSource origin
was polled, and the derived rows were kept. It now takes its origin's first
rows through the origin's own preview (which refuses what would poll or
write) or, with compute_all, a job node's stored rows, and keeps nothing.

A SemiJoin whose inputs share no tag gives back its left input; preview
computed both inputs first and so called a function the full read never
calls. An operator now says which input it gives back unchanged, from the
schemas (input_given_back), and preview reads only that input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eywalker and others added 2 commits November 26, 2026 02:42
…1464-integration (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <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>
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.44387% with 74 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/orcapod/core/operators/static_output_pod.py 93.95% 22 Missing ⚠️
src/orcapod/core/row_spool.py 97.21% 9 Missing ⚠️
src/orcapod/core/streams/view.py 97.12% 5 Missing ⚠️
src/orcapod/core/job_edges.py 97.83% 4 Missing ⚠️
src/orcapod/core/nodes/source_node.py 94.11% 4 Missing ⚠️
src/orcapod/core/operators/streaming_joins.py 99.04% 4 Missing ⚠️
src/orcapod/core/function_pod.py 95.23% 3 Missing ⚠️
src/orcapod/core/nodes/operator_node.py 97.60% 3 Missing ⚠️
src/orcapod/core/cached_function_pod.py 87.50% 2 Missing ⚠️
src/orcapod/core/sources/derived_source.py 92.85% 2 Missing ⚠️
... and 13 more
Files with missing lines Coverage Δ
src/orcapod/core/nodes/function_node.py 95.42% <100.00%> (+0.01%) ⬆️
src/orcapod/core/operators/add_tags.py 100.00% <100.00%> (ø)
src/orcapod/core/operators/base.py 93.27% <100.00%> (-0.06%) ⬇️
src/orcapod/core/operators/batch.py 100.00% <100.00%> (ø)
src/orcapod/core/operators/column_selection.py 99.39% <100.00%> (+0.04%) ⬆️
src/orcapod/core/operators/drop_nulls.py 99.05% <100.00%> (+0.04%) ⬆️
src/orcapod/core/operators/filter.py 100.00% <100.00%> (ø)
src/orcapod/core/operators/group_by.py 100.00% <100.00%> (ø)
src/orcapod/core/operators/join.py 98.66% <100.00%> (+0.09%) ⬆️
src/orcapod/core/operators/mappers.py 99.37% <100.00%> (+0.03%) ⬆️
... and 52 more

... and 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.

eywalker and others added 10 commits November 26, 2026 03:14
…omputation-without' into HEAD

# Conflicts:
#	tests/test_core/sources/test_spiraldb_table_source_tokens.py
…L-1464)

Below a step that may drop rows (a filter, drop_nulls, a function over
them) no limit reaches the derived source, and it read and concatenated
every batch of its origin before giving a row. Each origin batch is now
derived as it comes, so the origin's scan is closed as soon as the step
above has its rows. The builder takes the position of a batch's first row
and the keys of the earlier batches, so positional record ids continue
across batches and a key repeated in a later batch is refused when reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1464-integration (ITL-1464)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
…ITL-1464)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@eywalker

eywalker commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing as part of the ITL-1464 draft group. The async-route work continues as ITL-1347 stage 5 (ITL-1845). The SpiralDB read work landed in #687 and #679, and continues in #683.

Posted by a Claude Code agent on behalf of @eywalker.

@eywalker eywalker closed this Dec 2, 2026
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