Skip to content

perf(core): token lists on the row spool; grouping millions of rows; IPC refuses recipes (ITL-1464) - #573

Merged
eywalker merged 7 commits into
eywalker/itl-1464-integrationfrom
eywalker/itl-1464-tokens-spool
Nov 25, 2026
Merged

eywalker merged 7 commits into
eywalker/itl-1464-integrationfrom
eywalker/itl-1464-tokens-spool

Conversation

@eywalker

Copy link
Copy Markdown
Contributor

Draft, on the integration branch (#569), since it joins the token work (#563, #564, #568) with the row spool and its users (#559, #566). Mentions ITL-1464; the issue stays open.

What

  1. Row spool and recipes. A column of one token a row is not written. Token lists whose members' ids are equal share one ids column per file, whose dictionaries hold only the ids that file's rows read; rows kept in memory are trimmed the same way. kept_table cuts by bytes. The exemptions for list tokens in kept_table and BatchSpool are gone.
  2. Grouping millions of rows. GroupBy sorts by the record ids only when rows tie on every tag before them, reads keys and system tags in one chunk, copies no one-chunk column.
  3. Arrow IPC refuses a recipe column with rows (files, streams, messages, Feather, the C stream), and pandas does. The hash and store guards look inside nested values.

Measured

Spill: 200,000 members, 300 groups, 9 token columns: 16.1 MiB in one file, 16.4 MiB in 150 files of 2 groups (0.11 MiB a file; before 96 MiB); as text 125.5 MiB. The reviewer's probe: 12.0 MB against 61.5 MB as text (before 355 MB).

Grouping a synthetic event table of about 8 million rows (8 columns, 100 groups), peak footprint:

Step before after
group_by, outside a job 10.5 GiB, 411 s 4.9 GiB, 148 s
with a function per group, outside a job 5.3 GiB, 155 s
in a job, sync / async 4.5 / 5.8 GiB
with a function per group, in a job, sync / async 10.9 / 6.1 GiB

The source's read is 3.5 GiB of each. The grouped values are 0.09 GiB; the members' record ids are 1.7 GiB. Sync with a function: the function node holds every input row as objects.

Review findings -> tests

Finding Test
A recipe nested in another value is hashed and stored test_a_nested_derived_column_is_refused
Segmented aggregates spill at 5.78 times the text test_a_spool_writes_a_groups_own_ids_once, test_a_spilled_list_pins_nothing_of_the_tables_ids

Also: test_a_spooled_table_keeps_its_recipes (real RowSpool, three limits, three segmentations, six shapes), test_arrow_ipc_refuses_a_derived_column, test_discarded_lists_are_counted_as_they_were_held, test_members_that_tie_on_every_tag_are_ordered_by_record_id.

🤖 Generated with Claude Code

eywalker and others added 5 commits November 25, 2026 02:48
…rrow IPC refuses a recipe column (ITL-1464)

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

GroupBy sorts the record ids only when the tags tie; nested recipes are refused too.

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

BatchSpool spools derived token lists too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 25, 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

eywalker and others added 2 commits November 25, 2026 04:32
@eywalker
eywalker merged commit 07f0398 into eywalker/itl-1464-integration Nov 25, 2026
13 checks passed
@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.98990% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/orcapod/core/operators/static_output_pod.py 81.81% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/orcapod/core/operators/group_by.py 100.00% <100.00%> (ø)
src/orcapod/core/row_spool.py 97.21% <100.00%> (+0.21%) ⬆️
src/orcapod/utils/source_tokens.py 99.33% <100.00%> (+0.33%) ⬆️
src/orcapod/core/operators/static_output_pod.py 95.38% <81.81%> (+0.06%) ⬆️

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

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