Skip to content

Support offset feature/sample axes in merge functions - #58

Merged
timholy merged 1 commit into
mainfrom
teh/offsets
Jun 28, 2026
Merged

timholy merged 1 commit into
mainfrom
teh/offsets

Conversation

@timholy

@timholy timholy commented Jun 28, 2026

Copy link
Copy Markdown
Member

colnormalize, merge_pq, and merge_replay now accept inputs with
offset feature (rows of W) and sample (columns of H) axes and carry those
axes through to their outputs. The component axis (columns of W, rows of H)
is plain enumeration, so it must be one-based and is checked by
check_component_axis, which throws on a shared/one-based violation.

The merge core is axis-generic: components live in a one-based stack with an
alive mask (rather than empty-vector tombstones), remix_enact combines
columns by broadcasting, and results are assembled with stack, which
preserves the data axes. This keeps the column stack a concrete element type
so the outputs are type-stable for both plain and offset inputs.

Add OffsetArrays as a test dependency and a "generic axes" test set that
wraps inputs in OffsetArrays and views, asserts value- and axis-correctness,
and uses @inferred to lock the output types.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

`colnormalize`, `merge_pq`, and `merge_replay` now accept inputs with
offset feature (rows of W) and sample (columns of H) axes and carry those
axes through to their outputs. The component axis (columns of W, rows of H)
is plain enumeration, so it must be one-based and is checked by
`check_component_axis`, which throws on a shared/one-based violation.

The merge core is axis-generic: components live in a one-based stack with an
`alive` mask (rather than empty-vector tombstones), `remix_enact` combines
columns by broadcasting, and results are assembled with `stack`, which
preserves the data axes. This keeps the column stack a concrete element type
so the outputs are type-stable for both plain and offset inputs.

Add OffsetArrays as a test dependency and a "generic axes" test set that
wraps inputs in OffsetArrays and views, asserts value- and axis-correctness,
and uses `@inferred` to lock the output types.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@timholy
timholy merged commit 45fced0 into main Jun 28, 2026
3 of 4 checks passed
@timholy
timholy deleted the teh/offsets branch June 28, 2026 20:38
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