Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions docs/dev/design_issues/ITL-1357-JRO1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## `src/orcapod/core/operators/` — join row order

### JRO1 — Sync `Join`, `MergeJoin` and `Rejoin` take their row order from Polars' unspecified inner-join order
**Status:** open
**Severity:** low
**Issue:** ITL-1357

The sync paths of `Join` (`join._inner_join`, `join.py:94`, which `MergeJoin` shares) and
`Rejoin` (`_rejoin_pair`, `rejoin.py:376`) pair rows with a Polars inner join on a key frame
of prepared keys and row numbers, without `maintain_order`, then take every value from the
Arrow inputs by row number. Polars does not guarantee the row order of such a join, so a
Polars upgrade or a different thread count could reorder a join node's rows, and its stored
operator table, on the sync path. Values and hashes would not move: hashes are per row.
`SemiJoin` already sets `maintain_order="left"` (`semijoin.py:242`).

The developer has said row order is not critical (2026-11-22), so this is low priority.
Found while writing the ITL-1347 spec (`docs/dev/specs/itl-1347-job-table-transport.md`,
question 10).

What to do: measure whether `maintain_order="left_right"` gives exactly today's row order on
the test suite and on the ITL-1347 differential, at one Polars thread and at the default
(stage 0 of ITL-1347 reports it). If it does, set it explicitly in every key-frame join. If
it does not, report the differences for a decision: a change of stored row order needs one.
27 changes: 27 additions & 0 deletions docs/dev/design_issues/ITL-1358-VST1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## `src/orcapod/core/operators/` — Async execution

### VST1 — Operators keep state written at validation: one operator object on two streams can use the other stream's values
**Status:** open
**Severity:** medium
**Issue:** ITL-1358

Some operators store values computed while validating an input on the operator object
itself and read them later on the async path, where no stream is at hand:

- `SemiJoin._validated_common_keys` (`semijoin.py:287`, read at `:306` and `:381`);
- `Index._element_arrow_type_fallback` (`index.py:82`, `:126`).

One operator object applied to two streams can then use the shared keys or the fallback
type of the stream validated last (ITL-858 inventory, section 1.2). Found again while
writing the ITL-1347 spec (`docs/dev/specs/itl-1347-job-table-transport.md`, difference e6).
It is not yet confirmed by a reproducer.

What to do:

- Write a reproducer: one `SemiJoin` instance validated on stream B, then run async over
stream A with other shared tag keys; likewise for `Index`. It fails on `main` if the bug is
real.
- Inventory every operator that writes instance state during validation.
- Derive such values from each input's description when they are used, with no state
written at validation. Stage 5 of ITL-1347 does this as part of reading descriptions; the
reproducers then pass, and sync results are unchanged.
Loading
Loading