Skip to content

state ownership refactor: per-class narrow/merge_ row semantics (StateRowMixin)#519

Draft
ElmoPA wants to merge 1 commit into
elmo/gmm-baseline8-encdecfrom
elmo/gmm-state-refactor
Draft

state ownership refactor: per-class narrow/merge_ row semantics (StateRowMixin)#519
ElmoPA wants to merge 1 commit into
elmo/gmm-baseline8-encdecfrom
elmo/gmm-state-refactor

Conversation

@ElmoPA

@ElmoPA ElmoPA commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Every stage-state dataclass owns its row slice/write-back (generic
dataclasses.fields walk; materialize-on-merge; always-on post-merge
invariant; loud failures on unhandled fields). The ~270-line central
slice/scatter switchboard in stages.py becomes thin delegation.

Fixes (audit-confirmed): grab_prev_end prev_x silently dropped at every
slice/scatter boundary -> nested chunkers rolled out with no_prev on EVERY
chunk (eval-only train/inference mismatch). Now eager prev_x/prev_x_valid,
in-place carry updates, per-row validity read. Also: msublatent_state
allocated, reg_trunk_state gate widened to down_interface=register.

Training path untouched. tests_state_roundtrip.py: 15/15.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01CjuZ3zwWaCeQQigxiNuzGw

…eRowMixin)

Every stage-state dataclass owns its row slice/write-back (generic
dataclasses.fields walk; materialize-on-merge; always-on post-merge
invariant; loud failures on unhandled fields). The ~270-line central
_slice_*/_scatter_* switchboard in stages.py becomes thin delegation.

Fixes (audit-confirmed): grab_prev_end prev_x silently dropped at every
slice/scatter boundary -> nested chunkers rolled out with no_prev on EVERY
chunk (eval-only train/inference mismatch). Now eager prev_x/prev_x_valid,
in-place carry updates, per-row validity read. Also: msublatent_state
allocated, reg_trunk_state gate widened to down_interface=register.

Training path untouched. tests_state_roundtrip.py: 15/15.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CjuZ3zwWaCeQQigxiNuzGw

ElmoPA commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

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