Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
69125e7
fix(identity)!: data-tag and raw-stream identities free of column and…
Nov 18, 2026
47499a1
chore(golden): script comparing the union of golden entries with a ba…
Nov 18, 2026
a2d9305
fix(merge_join): take an input's canonical position by place, not by …
Nov 19, 2026
60c567c
Merge remote-tracking branch 'origin/main' into eywalker/itl-1246-fun…
Nov 19, 2026
8dd637d
Merge remote-tracking branch 'origin/main' into eywalker/itl-1246-fun…
Nov 19, 2026
c9cc372
test: drop the ITL-1246 xfail and compare raw-stream content hashes i…
Nov 19, 2026
35f4356
Merge remote-tracking branch 'origin/main' into eywalker/itl-1246-fun…
Nov 19, 2026
09c5d7e
test(golden): re-pin the seven raw-stream identity entries (ITL-1227)
Nov 19, 2026
2850060
Merge remote-tracking branch 'origin/main' into eywalker/itl-1246-fun…
Nov 19, 2026
54a31d4
test(golden): re-pin the seven approved raw-stream entries on main af…
Nov 19, 2026
8a15c83
test(struct_layout): re-pin the three raw-stream content hashes moved…
Nov 19, 2026
5294c45
fix(identity): a raw stream hashes its whole table in a canonical row…
Nov 19, 2026
50201b3
Merge remote-tracking branch 'origin/main' into eywalker/itl-1246-fun…
Nov 19, 2026
16ade52
Merge remote-tracking branch 'origin/main' into eywalker/itl-1246-fun…
Nov 19, 2026
a1b086d
chore(scripts): measure value-order ties with the sort's own comparis…
Nov 19, 2026
aaf484d
Merge origin/main (abd238df) into eywalker/itl-1246-function-pod-over…
Nov 19, 2026
f84aa09
Merge remote-tracking branch 'origin/main' into eywalker/itl-1246-fun…
Nov 19, 2026
111fba7
Merge remote-tracking branch 'origin/main' into eywalker/itl-1246-fun…
Nov 20, 2026
79ce0d4
test(function_pod): remove the ITL-1246 xfail from the output_keys ar…
Nov 20, 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
18 changes: 18 additions & 0 deletions .zed/rules
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,24 @@ Base case: RootSource.pipeline_identity_structure() returns (tag_schema, data_sc
Each downstream node's pipeline hash commits to its own identity plus upstream pipeline
hashes, forming a Merkle chain.

No identity follows column order (developer, November 18, 2026, ITL-1246, ITL-1227): "it
shouldn't depend on tag order -- generally nothing should depend on tag order". A list of tag
or data-tag names enters an identity as a set of sorted names (FallThroughPod's
fall_through_tags, also in its config and a saved job; a raw stream's tag columns and
data-tags). A raw ArrowTableStream (no producer) hashes its whole identity
table once (every column group but _content_hash; hash_table covers the schema, so a stream
with no rows still commits to its columns) with its rows in the canonical row order of an
identity table (arrow_utils.canonical_identity_row_order, developer, November 19, 2026,
"option 2"; the specification is in docs/reference/hashing.md): a pyarrow value sort, ascending
and nulls last, over the user tags in name order then every other column in name order, each
only when its type is on the closed list arrow_utils.canonically_sortable (decided from the
type, never by trying a sort; no extension, list, struct, float16 or decimal256), and rows
still tied ordered by their own one-row hash_table digest (prefixed bytes), computed for tie
groups only. Outputs still list the
data-tags first in the input's tag order: column order is presentation. An operation whose
result could depend on a column order takes that order as an explicit argument that is part
of its identity (GroupBy's member_order), never the input's column order.

### Column naming conventions

__ prefix — System metadata (ColumnConfig meta)
Expand Down
18 changes: 18 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,24 @@ its upstreams, forming a Merkle chain.
The pipeline hash uses a **resolver pattern** — `PipelineElementProtocol` objects route through
`pipeline_hash()`, other `ContentIdentifiable` objects route through `content_hash()`.

**No identity follows column order** (developer, November 18, 2026, ITL-1246, ITL-1227): "it
shouldn't depend on tag order -- generally nothing should depend on tag order". A list of tag
or data-tag names enters an identity as a set of sorted names (`FallThroughPod`'s
`fall_through_tags`, also in its config and a saved job; a raw stream's tag columns and
data-tags). A raw `ArrowTableStream` (no producer) hashes its whole identity
table once (every column group but `_content_hash`; `hash_table` covers the schema, so a stream
with no rows still commits to its columns) with its rows in the canonical row order of an
identity table (`arrow_utils.canonical_identity_row_order`, developer, November 19, 2026,
"option 2"; the specification is in `docs/reference/hashing.md`): a pyarrow value sort, ascending
and nulls last, over the user tags in name order then every other column in name order, each
only when its type is on the closed list `arrow_utils.canonically_sortable` (decided from the
type, never by trying a sort; no extension, list, struct, `float16` or `decimal256`), and rows
still tied ordered by their own one-row `hash_table` digest (prefixed bytes), computed for tie
groups only. Outputs still list the
data-tags first in the input's tag order: column order is presentation. An operation whose
result could depend on a column order takes that order as an explicit argument that is part
of its identity (GroupBy's `member_order`), never the input's column order.

### Column naming conventions

| Prefix | Meaning | Example | Controlled by |
Expand Down
35 changes: 35 additions & 0 deletions changelog.d/ITL-1246.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### Breaking changes and migration

- No identity depends on the order of a stream's columns (ITL-1246, ITL-1227; developer,
November 18, 2026: "nothing should depend on tag order"). The identities of streams with
data-tags are now settled and freeze with data context v1 at the 0.4.0 release. This
replaces the "may still change" note of the data-tag entries.
- A function pod called on a stream with data-tags (`pod(stream)`, a `FallThroughPod`)
holds its data-tags as a set of sorted names. Before, it held them in the input's tag
order, which came from `tag_columns` or, after an operator, from the table's physical
layout. Now its content and pipeline hash, its job node's hashes and its pipeline table
path are the same for every order. `FallThroughPod.fall_through_tags`, the pod's config
and a saved job's `fall_through_tags` list the names sorted. The output still lists the
data-tags first, in the input's tag order. A fall-through node whose input listed two
or more data-tags out of name order gets a new pipeline table path. Its results are the
plain pod's and are not recomputed.
- A raw `ArrowTableStream` (one with no producer) hashes its whole identity table once,
with its rows in a canonical order, and holds its tag columns and data-tags as sorted
names. The table covers every column group but `_content_hash`.
- The canonical order is a value sort: the user tags in name order, then every other
column in name order, each only when its type is on a closed list. Rows still tied are
ordered by their own row hash. The specification is in `docs/reference/hashing.md`.
- So the same rows in any order, under any order of `tag_columns`, `data_tags` or
system-tag columns, have one content hash. A duplicated row counts twice, and a stream
with no rows still commits to its columns.
- Before, the rows were sorted by the tags in tag order and the system tags in column
order. A stream with no tag and no system tag could not be hashed. Rows tied on every
tag, or with a list tag, hashed in their given order.
- A raw stream's content hash moves only where that order differed. Among the pinned
values, only `pipeline:list_tag_producerless_stream.as_given` moves. Sources, operator
results and node outputs hash as before.

### Fixed

- A raw `ArrowTableStream` with no tag column and no system-tag column has a content hash.
Before, it raised `ArrowInvalid` (nothing to sort by).
29 changes: 25 additions & 4 deletions docs/concepts/data-tags.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Data-tags

!!! warning "Integration branch (ITL-1023)"
Data-tags are the first slice of Orcapod v0.4, on an integration branch. The
identities (content and pipeline hashes) of streams with data-tags are **not
frozen yet** and may change before the release. Streams whose tags are all plain
!!! note "Settled identities (ITL-1246)"
Data-tags are the first slice of Orcapod v0.4. The identities (content and pipeline
hashes) of streams with data-tags are settled (developer, November 18, 2026) and are
frozen with data context v1 at the 0.4.0 release. Streams whose tags are all plain
(`tag_only_columns`) keep their v0.3 identities exactly.

A tag is either **plain** (it carries its own value, as every tag did in v0.3) or
Expand Down Expand Up @@ -79,6 +79,27 @@ A function output named like a tag is an error when the pipeline is built. A fun
that does not read a data-tag column keeps its result identity: retagging a source
does not make it compute again.

The data-tags that fall through are a **set of names**: the pod's identity holds them
sorted by name. The order of the input's tag columns never changes the pod's content or
pipeline hash, nor the table paths of its node in a job. The output lists the data-tags
first, in the input's own tag order: column order is presentation only. Below, the same
spikes are given with `time` before `unit`, a different tag order and table layout:

```python
by_time = op.sources.DictSource(
[{"time": r["time"], "unit": r["unit"], "amp": r["amp"]} for r in rows],
tag_columns=["time", "unit"],
source_id="spikes",
)
scaled_by_time = scale.pod(by_time)
print(scaled_by_time.keys())
# (('time', 'unit'), ('time', 'unit', 'scaled'))
print(scaled_by_time.content_hash() == scaled.content_hash())
# True
print(scaled_by_time.pipeline_hash() == scaled.pipeline_hash())
# True
```

## Moving a column between roles

A data-tag is one column in two roles, a tag and a data column. Four steps move a
Expand Down
85 changes: 85 additions & 0 deletions docs/dev/scripts/golden_union_diff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
"""Compare the union of golden entries at a git revision with the working tree.

Every golden file of the current data context (``tests/test_hashing/golden/data/<folder>/``)
is a flat JSON object of ``entry: value``. This script reads every file at ``BASE`` (a git
revision) and in the working tree, keys each entry by ``<group>:<entry>`` (the group is the
file name before ``-NN.json``), and prints the entries that changed, were added or were
removed. Used in the pull request of ITL-1246 / ITL-1227 to show that exactly the approved
entries changed and every other entry is byte-identical.

Usage::

uv run python docs/dev/scripts/golden_union_diff.py [BASE] # default: origin/main
"""

from __future__ import annotations

import json
import subprocess
import sys
from pathlib import Path

GOLDEN = Path("tests/test_hashing/golden/data")


def _group(name: str) -> str:
return name.rsplit("-", 1)[0]


def entries_at(revision: str) -> dict[str, str]:
"""The union of golden entries in the files at ``revision``."""
listing = subprocess.run(
["git", "ls-tree", "-r", "--name-only", revision, str(GOLDEN)],
check=True,
capture_output=True,
text=True,
).stdout.split()
union: dict[str, str] = {}
for path in listing:
if not path.endswith(".json"):
continue
text = subprocess.run(
["git", "show", f"{revision}:{path}"],
check=True,
capture_output=True,
text=True,
).stdout
group = _group(Path(path).stem)
for key, value in json.loads(text).items():

Check warning on line 48 in docs/dev/scripts/golden_union_diff.py

View workflow job for this annotation

GitHub Actions / Ruff and basedpyright

Type of "items" is Any (reportAny)

Check warning on line 48 in docs/dev/scripts/golden_union_diff.py

View workflow job for this annotation

GitHub Actions / Ruff and basedpyright

Type of "value" is Any (reportAny)

Check warning on line 48 in docs/dev/scripts/golden_union_diff.py

View workflow job for this annotation

GitHub Actions / Ruff and basedpyright

Type of "key" is Any (reportAny)
union[f"{group}:{key}"] = json.dumps(value, sort_keys=True)
return union


def entries_in_tree() -> dict[str, str]:
"""The union of golden entries in the working tree's files."""
union: dict[str, str] = {}
for path in sorted(GOLDEN.rglob("*.json")):
group = _group(path.stem)
for key, value in json.loads(path.read_text()).items():

Check warning on line 58 in docs/dev/scripts/golden_union_diff.py

View workflow job for this annotation

GitHub Actions / Ruff and basedpyright

Type of "items" is Any (reportAny)

Check warning on line 58 in docs/dev/scripts/golden_union_diff.py

View workflow job for this annotation

GitHub Actions / Ruff and basedpyright

Type of "value" is Any (reportAny)

Check warning on line 58 in docs/dev/scripts/golden_union_diff.py

View workflow job for this annotation

GitHub Actions / Ruff and basedpyright

Type of "key" is Any (reportAny)
union[f"{group}:{key}"] = json.dumps(value, sort_keys=True)
return union


def main() -> None:
base = sys.argv[1] if len(sys.argv) > 1 else "origin/main"
before = entries_at(base)
after = entries_in_tree()
changed = sorted(k for k in before.keys() & after.keys() if before[k] != after[k])
added = sorted(after.keys() - before.keys())
removed = sorted(before.keys() - after.keys())
same = len(before.keys() & after.keys()) - len(changed)
print(f"base {base}: {len(before)} entries; working tree: {len(after)} entries")
print(f"unchanged (byte-identical values): {same}")
print(f"changed: {len(changed)}")
for key in changed:
print(f" {key}\n before {before[key]}\n after {after[key]}")
print(f"added: {len(added)}")
for key in added:
print(f" {key}")
print(f"removed: {len(removed)}")
for key in removed:
print(f" {key}")


if __name__ == "__main__":
main()
Loading
Loading