Skip to content

Converter tests: an L-shaped synthetic map from preset M's layout - #98

Merged
phantoslayer21 merged 1 commit into
mainfrom
model-l/converter-l-shaped-tests
Nov 13, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
model-l/converter-l-shaped-tests

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

#94's preset-L test uses a minimal synthetic map. This adds an L-shaped one: preset M's real map layout, turned into
the shape Model L's map is described to have, filled with our own random data. That way the converter is exercised at L's
record kinds and sizes before the real preset-L map exists. Tests only; no converter source changes.

  • clean/converter/tests/cases.py l_shaped_map(m_map): starts from the shipped preset-M map's layout and makes:

    • the input encoder's output linear (enc0 W) 64 x 128 (M: 64 x 80);
    • a new stage enc0_pre before enc0: two linears, 20 -> 32 and 32 -> 32, with biases, then a C = 32 Swin block
      (the usual record set: gamma1, gamma2, Wqk, Wv, B, Wp, bp, W1, b1, W2, b2; 2 heads, 16 x 16 position bias, MLP 128);
    • a new stage dec0_pre before dec0: a C = 32 Swin block;
    • "preset": "L", map version 1, no source F (whether L has the output-filter group is open).

    The new records are appended after M's block in W. The stage names, order and placement are stand-ins: the real
    preset-L map defines its own. Only the record kinds and shapes follow L's description.

  • clean/converter/tests/run_tests.py test_l_shaped: the map is filled with random data by the existing
    shipped_like_case at two placements (W at an even offset and at one shifted by 2 bytes). For each, every tensor of
    every stage is checked against the reference, together with the offsets, all stage digests, the 64 x 128 encoder
    linear and the 11 records of each C = 32 block. A file with another block of the same layout gives preset L's
    message (exit 12). It runs with the other large cases (not under --quick).

  • clean/converter/README.md: a short paragraph. It also records one open point found here: a map of versions 1-4
    must have the sources W, D and K. Should preset L turn out to have no dither table or constants, that rule becomes per
    preset; it is not changed on a guess.

Refs #89

Tested

Run locally on Windows, CPU only, Ninja Release /MT with MSVC, on main 3a6d9e7 plus this commit.

  • Converter ctest (unit, decompression-vectors, synthetic, synthetic5): 4/4 passed.
  • run_tests.py: 4481 checks passed, 0 failed (main: 3757; the 724 more are test_l_shaped).
  • Existing outputs unchanged: every output file outside the two new test folders was hashed: 1615 files, SHA-256
    identical to main's.
  • python tools/ci/check_line_endings.py: 1150 files, 0 problems. Public gates (secrets, personal data, licence,
    chunks) pass.

Not tested

  • The real preset-L map and a real DLL (none in this change); no GPU, no game.

cases.l_shaped_map turns the preset-M map's layout into an L-shaped one: the input
encoder's output linear 64 x 128, a stage with two linears and a C = 32 Swin block
before enc0, a C = 32 Swin block before dec0, "preset": "L". run_tests.py fills it
with random data (shipped_like_case) and checks every tensor at two placements, and
preset L's message for a file without the block. Stage names and placement are
stand-ins until the real preset-L map exists. No converter source changes.

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 22:27
@phantoslayer21
phantoslayer21 merged commit d075d6e into main Nov 13, 2026
2 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/converter-l-shaped-tests branch November 13, 2026 22:30
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