Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7091585
feat(identity): compute structure, source and name chains
eywalker Nov 28, 2026
a629f2b
Merge remote-tracking branch 'origin/main' into eywalker/itl-1559-thr…
eywalker Nov 28, 2026
4b21055
fix(identity): preserve chains across binding and persistence
eywalker Nov 28, 2026
5da977a
Merge remote-tracking branch 'origin/main' into eywalker/itl-1559-thr…
eywalker Nov 28, 2026
f393077
fix(identity): address three-chain review findings
eywalker Nov 28, 2026
bd7ac08
chore: merge origin/main into three-chain step 1
eywalker Nov 28, 2026
12c6d38
fix(identity): preserve saved job bytes and chain inputs
eywalker Nov 28, 2026
3bb81bf
fix(identity): reject combined hashes for collapsed symmetry
eywalker Nov 28, 2026
a3e9a92
fix(identity): resolve live bindings and canonical chain order
eywalker Nov 28, 2026
d7512fa
fix(identity): guard row reads and unbound derived origins
eywalker Nov 28, 2026
c49e36e
fix(identity): preserve safe polling and loaded Index chains
eywalker Nov 28, 2026
0d2bb9a
fix(identity): keep step-one chain reads callback-free
eywalker Nov 28, 2026
3e4f03e
fix(identity): reuse polling digests through source wrappers
eywalker Nov 28, 2026
060f54a
fix(identity): restore chains for saved single-input built-ins
eywalker Nov 28, 2026
6c4accb
docs(identity): clarify saved single-input operator chains
eywalker Nov 28, 2026
824f370
chore(pipeline): merge main into three-chain step 1
eywalker Nov 28, 2026
31136af
docs(identity): clarify step-one hash limits and review coverage
eywalker Nov 28, 2026
86a8a43
chore(pipeline): merge main after declared provenance fixes
eywalker Nov 28, 2026
54692cd
chore(pipeline): merge main after context hashing and job resave fixes
eywalker Nov 28, 2026
58b3c87
feat(identity): hash typed source and name entries at every node
eywalker Nov 29, 2026
1318293
chore(identity): merge main with the three-chain specification
eywalker Nov 29, 2026
558d3b5
docs(identity): record typed chain tree decisions
eywalker Nov 29, 2026
560edb8
fix(identity): preserve explicit empty source slot names
eywalker Nov 29, 2026
88642ae
chore(identity): merge main after step one
eywalker Nov 29, 2026
d5c6832
chore(identity): merge main after step 1 landed
eywalker Nov 29, 2026
641765c
fix(identity): retain commutative inputs and canonicalize tied Join rows
eywalker Nov 29, 2026
95a84a3
chore(identity): incorporate the current step 1b branch
eywalker Nov 29, 2026
e9dc5fa
test(join): update tied declaration and entry ID pins
eywalker Nov 29, 2026
2f83829
fix(pipeline): route every commutative join edge position
eywalker Nov 29, 2026
acd5473
fix(join): keep tied schema prediction on the memoized walk
eywalker Nov 29, 2026
857ab12
fix(join): address commutative identity review findings
eywalker Nov 29, 2026
becd9b9
chore(identity): merge main after step 1b landed
eywalker Nov 29, 2026
0368829
fix(pipeline): refuse captures told apart only by a commutative repea…
eywalker Nov 29, 2026
262759a
docs(join): name ITL-1690 as the follow-up of the tied-tag type refusal
eywalker Nov 29, 2026
5eb1208
fix(pipeline): memoize iterative capture key traversal
eywalker Nov 29, 2026
ad7ba5a
chore: merge main into step 2b
eywalker Nov 29, 2026
1a57e41
fix(pipeline): invalidate capture keys when inputs are rewired
eywalker Nov 29, 2026
d9de9d9
fix(pipeline): keep compiled job content hashes lazy
eywalker Nov 29, 2026
ba32202
fix(pipeline): release coalesced streams from the capture memo
eywalker Nov 29, 2026
7472866
fix(pipeline): accept staged capture keys as a mapping
eywalker Nov 29, 2026
f4c6298
Merge remote-tracking branch 'origin/main' into eywalker/itl-1590-ste…
eywalker Nov 29, 2026
c8a6da0
fix(join): sort tied operands by provenance IDs before custom tags
eywalker Nov 29, 2026
d65cb14
chore(merge): integrate main and regenerate tied Join golden additions
eywalker Nov 29, 2026
20d862f
fix(join): derive tied provenance roles from system tag names
eywalker Nov 29, 2026
8d51046
chore(merge): integrate current main into step 2b
eywalker Nov 29, 2026
6d5c4fb
fix(join): preserve legacy ordering for ambiguous provenance
eywalker Nov 29, 2026
910b097
fix(join): preserve row validation in ambiguous ties
eywalker Nov 29, 2026
d19e331
Merge remote-tracking branch 'origin/main' into eywalker/itl-1590-ste…
eywalker Nov 29, 2026
b145b92
fix(join): limit tied bundle ordering to generated provenance
eywalker Nov 29, 2026
3fd705a
fix(join): preserve legacy ordering for imported record IDs
eywalker Nov 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .zed/rules
Original file line number Diff line number Diff line change
Expand Up @@ -1293,9 +1293,10 @@ these preimages anywhere else.

1. Name-preserving — single-stream ops. Column name/value pass through unchanged.
2. Name-extending — multi-input ops. System tag column name gets
::{pipeline_hash}:{canonical_position} appended. Commutative operators sort by
pipeline_hash and sort system tag values per row. MergeJoin is ordered (ITL-1281): the
position is the argument index and nothing is sorted.
::{pipeline_hash}:{canonical_position} appended. Commutative operators sort by pipeline
hash. Join sorts each tied operand as a complete bundle when all tied inputs carry
only certified library provenance. Other ties use the historical per-path sort.
MergeJoin uses argument positions (ITL-1281).
3. Reducing — many→one ops (Batch, GroupBy). Data columns become list[T]; Batch makes every
user tag list[T] and keeps it a tag, while GroupBy keeps its scalar keys and drops every
other user tag (ITL-1070). No tag ever moves to the data group. Source-info columns become
Expand All @@ -1318,7 +1319,10 @@ these preimages anywhere else.
else: blocks) only for a module `import orcapod` never loads (networkx, deltalake,
pyarrow.fs, pyarrow.dataset, git) and the optional extras (psycopg, ray, spiral);
tests/test_utils/test_lazy_module_use.py checks it.
- Argument symmetry — operators return frozenset (commutative) or tuple (ordered).
- Argument symmetry — operators return SymmetricGroup (commutative) or tuple (ordered).
Preserve every occurrence in the pipeline hash and chains. Sort a commutative group by
upstream pipeline hash, and order tied members in each chain by that chain's own values.
The legacy content hash keeps its set preimage.
- StaticOutputPod.process() → DynamicPodStream — wraps static_process() with staleness
detection and automatic recomputation.
- Source delegation — CSVSource, DictSource, etc. create an internal ArrowTableSource.
Expand Down Expand Up @@ -1502,12 +1506,12 @@ data. The rules:
building the source. This restriction is a stopgap pending ITL-1561. System-tag fields on
a raw ArrowTableStream keep their metadata. DataFrameSource uses an explicit schema for
custom system-tag nullability and validates the raw values, types and metadata before casting.
Join's sync and batch sort pairs source and record IDs within each printed
provenance path. The rebuilt ID field can hold nulls when any corresponding
input field can hold nulls or an input lacks that field. Custom tags keep their
input positions in these tables. Standalone row channels sort the custom tags
of a tied path with its IDs at every link. Join rows infer tied system-tag
fields from values. Non-tied system-tag fields keep their Arrow declarations.
Join sorts complete bundles by source and record IDs when tied operands carry only
certified library provenance (ITL-1590). Other ties keep the historical per-path
sorting and row inference. A shared system tag with incompatible normalized Arrow
types raises `InputValidationError` (ITL-1690). A job refuses two captures told apart
only by a commutative input’s repeat count (`Join()(a, b)` beside `Join()(a, b, b)`)
until node identity counts repeats (ITL-1559 steps 3, 5).
A raw `ArrowTableStream` preserves the system-tag fields in its table and
rows, including the Arrow Null type (ITL-1543).
Streams, rows and record batches declare every `_source_*` token field nullable (ITL-1557).
Expand Down
21 changes: 12 additions & 9 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1326,8 +1326,9 @@ are defined in one module, `core/row_ids.py`; never build one of these preimages
through unchanged.
2. **Name-extending** — multi-input ops (join, merge join). Each input's system tag column
name gets `::{pipeline_hash}:{canonical_position}` appended. Commutative operators
canonically order inputs by `pipeline_hash` and sort system tag values per row. `MergeJoin`
is ordered (ITL-1281): the position is the argument index and nothing is sorted.
canonically order inputs by pipeline hash. Join sorts each tied operand as a complete
bundle when all tied inputs carry only certified library provenance. Other ties use
the historical per-path sort. `MergeJoin` uses argument positions (ITL-1281).
3. **Reducing** — many→one ops (`Batch`, `GroupBy`). Data columns become `list[T]`; `Batch`
makes every user tag `list[T]` and keeps it a tag, while `GroupBy` keeps its scalar keys and
drops every other user tag (ITL-1070). No tag ever moves to the data group. Source-info
Expand Down Expand Up @@ -1365,7 +1366,9 @@ and `as_table()` methods. `all_info=True` sets everything to True.
and for the optional extras (psycopg, ray, spiral).
`tests/test_utils/test_lazy_module_use.py` checks it.
- **Argument symmetry** — each operator declares `argument_symmetry(streams)` returning
`frozenset` (commutative) or `tuple` (ordered). Determines how upstream hashes combine.
`SymmetricGroup` (commutative) or `tuple` (ordered). Each occurrence enters the pipeline
hash and both chains. A commutative group is sorted by upstream pipeline hash, and each
chain orders tied members by its own values. The legacy content hash keeps its set preimage.
- **`StaticOutputPod.process()` → `DynamicPodStream`** — wraps `static_process()` output
with timestamp-based staleness detection and automatic recomputation.
- **Source delegation** — CSVSource, DictSource, etc. all create an internal
Expand Down Expand Up @@ -1550,12 +1553,12 @@ data. The rules:
building the source. This restriction is a stopgap pending ITL-1561. System-tag fields on
a raw ArrowTableStream keep their metadata. DataFrameSource uses an explicit schema for
custom system-tag nullability and validates the raw values, types and metadata before casting.
Join's sync and batch sort pairs source and record IDs within each printed
provenance path. The rebuilt ID field can hold nulls when any corresponding
input field can hold nulls or an input lacks that field. Custom tags keep their
input positions in these tables. Standalone row channels sort the custom tags
of a tied path with its IDs at every link. Join rows infer tied system-tag
fields from values. Non-tied system-tag fields keep their Arrow declarations.
Join sorts complete bundles by source and record IDs when tied operands carry only
certified library provenance (ITL-1590). Other ties keep the historical per-path
sorting and row inference. A shared system tag with incompatible normalized Arrow
types raises `InputValidationError` (ITL-1690). A job refuses two captures told apart
only by a commutative input’s repeat count (`Join()(a, b)` beside `Join()(a, b, b)`)
until node identity counts repeats (ITL-1559 steps 3, 5).
A raw `ArrowTableStream` preserves the system-tag fields in its table and
rows, including the Arrow Null type (ITL-1543).
Streams, rows and record batches declare every `_source_*` token field nullable (ITL-1557).
Expand Down
24 changes: 24 additions & 0 deletions changelog.d/ITL-1590.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Breaking changes and migration

- A commutative operator's pipeline hash now counts every input occurrence. Rebuild jobs
with content-equal Join inputs to use the corrected pipeline identity. Custom operators
can declare interchangeable occurrences with `SymmetricGroup`, including nested groups.
- A tied Join refuses inputs whose shared custom system tag differs in type: when
Join inputs have one pipeline hash, a custom system tag they share must have one
Arrow type, or the Join raises `InputValidationError` naming the column and both
types, at graph build and on every execution path. Non-tied inputs are unchanged.
Accepted for 0.4.0; ITL-1690 revisits it.
- A job or pipeline refuses two captures that differ only in how many times an input of
a commutative operator is repeated, such as `Join()(a, b)` beside `Join()(a, b, b)`,
or `Join()(a, a)` beside `Join()(a, a, a)`. Such a pair used to run as one node, so one
read the other's rows. Build them in separate jobs.
- Joins of tied, multi-source operands now keep each branch's provenance together. For
branches `(0,a,z)` and `(0,b,c)`, the old `(0,a,c)` and `(0,b,z)` bundles become
`(0,a,z)` and `(0,b,c)`. Rows whose bundles change have new entry IDs. A fresh run
against a store written by the old implementation can add new pipeline records
alongside the old records at the same path.

### Fixed

- A repeated Join inside another Join, such as `Join()(Join()(a, a), b)`, records and
compiles with one pipeline hash and runs on the sync and the async path.
11 changes: 11 additions & 0 deletions docs/concepts/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ order, so `Join()(a, b)` and `Join()(b, a)` have the same columns in the same or
ordered operators such as `SemiJoin` and `MergeJoin` keep operand order; either way, address
columns by name rather than by position.

When tied inputs carry only matching library provenance pairs, Join orders their
complete bundles by source and record IDs. Ties with custom system tags or raw
provenance names use the historical ordering for their execution path. A system
tag shared by tied inputs must have one Arrow type after normalizing layouts
such as `string` to `large_string`. Join raises `InputValidationError` if the
types differ (ITL-1690).

A job or pipeline cannot yet hold two Joins that differ only in how many times an
input is repeated, such as `Join()(a, b)` and `Join()(a, b, b)`: capturing the
second raises `ValueError`. Build them in separate jobs.

```python
from orcapod.sources import DictSource
from orcapod.operators import Join
Expand Down
9 changes: 4 additions & 5 deletions docs/dev/design_issues/ITL-1559-TC1.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ It also cannot follow a slot through a rebind while identifying the same computa

Step 1 computes separate structure, source and name chains. The new node hash is
available even when no source is bound. The graph and persistence still use their
existing hashes. ITL-1590 tracks the remaining structural dependency on source equality
when a commutative operator receives equal-structure inputs.
existing content hashes. Step 2b decouples commutative pipeline hashes from whether
input streams compare equal by content (ITL-1590).

The step 1 follow-up serializes binding and chain reads. Saved jobs retain the
existing file format. An unavailable built-in with one input uses its saved structure
and hashes that input's chains. An unavailable operator with multiple inputs needs its input
symmetry to report the new chains. Schema-less polling sources report a node hash
before their first batch, including when wrapped in a cache.

**Fix:** The execution protocols require both combined identity accessors. The
combined hashes raise when the legacy commutative grouping drops content-equal
arguments, including in downstream nodes. Recovering the lost order remains ITL-1590.
**Fix:** The execution protocols require both combined identity accessors.
A commutative declaration retains all argument occurrences for the three chains.
Source chains follow rebindings inside composite bindings and source wrappers.
Downstream chain reads never poll for a missing schema. Mixed nested input groups
use the pipeline hash's canonical ordering.
Expand Down
18 changes: 18 additions & 0 deletions docs/dev/design_issues/ITL-1590-CS1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Pipeline identity

### CS1 — Commutative pipeline hashes lost equal input occurrences
**Status:** resolved
**Severity:** high
**Issue:** ITL-1590

Join's set of streams could collapse operands that compared equal by content.
The resulting pipeline hash depended on source equality and lost an argument.

**Fix:** Carry every argument occurrence through the pipeline, source and name
chains. A commutative structural preimage sorts its input hashes and keeps repeats.
The capture registry keeps repeated occurrences and computes keys bottom-up,
reusing upstream keys across captures. Compilation preserves each recorded
operand. Execution maps still compare compiled nodes by legacy
content identity, which drops repeats, so a capture that differs from a recorded
one only in a repeat count is refused until the graph-key and content-identity
migrations (steps 3 and 5) land; those steps lift the refusal.
9 changes: 9 additions & 0 deletions docs/dev/design_issues/ITL-1628-CJ1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## `src/orcapod/core/operators/join.py` — tied inputs

### CJ1 — Custom system tags could follow the wrong input
**Status:** open
**Severity:** high
**Issue:** ITL-1628

Sorting only the source and record IDs of structurally tied inputs left custom
system tags in the original argument positions.
9 changes: 9 additions & 0 deletions docs/dev/design_issues/ITL-1629-CJ2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## `src/orcapod/core/operators/join.py` — tied inputs

### CJ2 — Pairwise row joins diverged from tables on sparse system tags
**Status:** open
**Severity:** high
**Issue:** ITL-1629

A custom system tag missing from one tied operand could appear at different
positions on row channels and tables.
9 changes: 9 additions & 0 deletions docs/dev/design_issues/ITL-1631-CJ3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## `src/orcapod/core/operators/join.py` — tied inputs

### CJ3 — Tied Join rows narrowed record ID declarations
**Status:** open
**Severity:** high
**Issue:** ITL-1631

Row channels and table iteration inferred tied record ID fields from individual
values, even when the table declared those fields nullable.
Loading
Loading