Skip to content

Model L: structure table and NumPy oracle (CPU reference, step 1) - #91

Merged
phantoslayer21 merged 1 commit into
mainfrom
model-l/cpu-reference
Nov 13, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
model-l/cpu-reference

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

First step of Model L's CPU reference. Refs #89

  • clean/l/reference/table.py: Model L's structure as data (the encoder's op list, the decoder's channel segments and block, window offsets, block constants, map names), parameter shapes derived from it, and the matrix work per frame (computed, not measured). Entries listed in PROVISIONAL are pending confirmation and are changed only in the table.
  • clean/l/reference/oracle.py: a NumPy oracle that interprets the table (encode, decode, network), float64 with only the prescribed FP8 / FP16 roundings. The shared Swin stages call Model M's oracle. The output reconstruction is a stub that refuses until it is written.
  • clean/l/tests/test_l_reference.py: synthetic data only.

Nothing in the runtime, front end or launcher uses this yet; Model M is unchanged (no existing file touched).

Tested

  • python -m unittest discover -s clean/l/tests -t .: 17 tests pass. The main ones reduce Model L to Model M through the table and require Model M's oracle results byte for byte: the block with Model M's constants (three widths, odd sizes, five offsets), the encoder with Model M's op list, the decoder without a block, and the whole chain from the encoder to the decoder. Others: a per-window slow-loop version of the block, the encoder's parts recomputed by hand, table edits (other op orders, other levels, other quantisation), refusal of bad op lists.
  • python -m unittest discover -s clean/tests -t . -p test_reference.py: unchanged, passes.
  • python tools/ci/check_line_endings.py: 0 problems.

Not tested

  • No GPU and no kernels: this is the reference the later kernel steps are checked against.

clean/l/reference/table.py holds Model L's structure as data: the input
encoder's op list, the decoder's channel segments and block, window offsets,
block constants and map names, plus parameter shapes and the matrix work per
frame derived from it. Entries listed in PROVISIONAL are pending confirmation
and change only there.

clean/l/reference/oracle.py interprets the table: encode, decode and the whole
network chain in float64 with only the prescribed FP8 / FP16 roundings. The
shared Swin stages call Model M's oracle. The output reconstruction is a stub
that refuses until it is written.

Tests (synthetic data) reduce Model L to Model M through the table and require
Model M's oracle results byte for byte: the block with M's constants, the
encoder with M's op list, the decoder without a block, and the whole chain.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 13, 2026 21:59
@phantoslayer21
phantoslayer21 merged commit bddd680 into main Nov 13, 2026
2 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/cpu-reference branch November 13, 2026 22:00
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