Stage1Model / Stage2OneShot / Stage2Autoregressive duplicate ~80 lines of scaffolding #39

Open
opened 2026-08-13 15:07:08 +02:00 by lars · 0 comments
Owner

Stage1Model, Stage2OneShot and Stage2Autoregressive each independently
implement: build-or-share cond_enc, has_timetime_emb,
merged_cond_dim, in_dim selection, build_trunk, n_sec_head,
type_head, particle_type_cfg normalisation. That's ~80 near-identical lines
across three classes, and it's why the objective/trunk/conditioning-injection
issues each have "×3" in their edit count.

Proposal: a StageModel base owning all of it, with the subclass supplying
only its conditioning assembly (_cond_embed vs _base_cond/_token_cond)
and its output width. Do this after the trunk registry, conditioning
injection registry, and heads-factory issues, when what belongs in the base is
settled — otherwise the base gets refactored twice.


Migrated from issues.md (v0.3.0 branch review, 2026-08-13), Issue 14.

`Stage1Model`, `Stage2OneShot` and `Stage2Autoregressive` each independently implement: build-or-share `cond_enc`, `has_time` → `time_emb`, `merged_cond_dim`, `in_dim` selection, `build_trunk`, `n_sec_head`, `type_head`, `particle_type_cfg` normalisation. That's ~80 near-identical lines across three classes, and it's why the objective/trunk/conditioning-injection issues each have "×3" in their edit count. **Proposal:** a `StageModel` base owning all of it, with the subclass supplying only its conditioning assembly (`_cond_embed` vs `_base_cond`/`_token_cond`) and its output width. Do this *after* the trunk registry, conditioning injection registry, and heads-factory issues, when what belongs in the base is settled — otherwise the base gets refactored twice. --- Migrated from `issues.md` (v0.3.0 branch review, 2026-08-13), Issue 14.
lars added the modularity label 2026-08-13 15:07:08 +02:00
lars added a new dependency 2026-08-13 15:23:29 +02:00
lars added a new dependency 2026-08-13 15:23:29 +02:00
Sign in to join this conversation.