Skip to content

Converter: the preset-L map, and --preset to name a map's preset - #106

Merged
phantoslayer21 merged 2 commits into
mainfrom
model-l/converter-l-map
Nov 13, 2026
Merged

phantoslayer21 merged 2 commits into
mainfrom
model-l/converter-l-map

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Model L (#89): the converter map for preset L is in, and the converter can now be told which preset it loads a map for.

  • data/preset-L.v1.map.json: the spec side's preset-L map, byte for byte as delivered (map version 1; sources
    W, D and K; the stages of M plus enc0_block and dec0_block, and the input encoder's wider linear). It keeps the
    CR LF line endings it was delivered with, so tools/ci/check_line_endings.py lists it as the one CR LF exception.
    data/README.md names it.
  • Because the map has the sources W, D and K, the rule "versions 1-4 need W, D and K" stays as it is. No per-preset
    source rule is needed.
  • The delivered map has no "preset" field. Read as-is, a version-1 map is preset M (the message for a file
    without the block would name preset M). So the caller names the preset:
    • wronggpu-convert ... --preset M|K|F|L (clean/converter/src/main.cpp), and
      load_map_bytes(bytes, out, log, expected_preset) (api.h / api.cpp; map.h load_map overload);
    • a map without the field is read as the named preset when that preset uses the map's version;
    • a map with the field must name the same preset;
    • anything else (a preset that doesn't use the version, another name) is converter data damaged, and an unknown
      --preset is a usage error (exit 1);
    • without --preset nothing changes (M, K and F maps, their messages and their log lines);
    • the launcher passes "L" when it loads this map (the launcher's model choice is separate Model L work).
  • clean/converter/README.md: the map, the option and its rules.

Refs #89

Tested

Run locally on Windows, CPU only, Ninja Release /MT with MSVC, on main e6500a8 plus these two commits.

  • Converter ctest (unit, decompression-vectors, synthetic, synthetic5): 4/4 passed.
  • run_tests.py: 5207 checks passed, 0 failed (main: 4481). The new test_l_real_map:
    • the real map validates;
    • our own random file gives preset L's message with --preset L, and preset M's without it;
    • --preset K, --preset F are converter data damaged, and an unknown preset is a usage error;
    • nothing is written on failure;
    • the map's exact layout converts our own random data at two placements (W at an even offset and 6 bytes on),
      with every tensor of every stage, the offsets and all stage digests checked against the reference.
  • New unit checks (tests/unit_tests.cpp): the caller's preset on the version-1 and version-4 unit maps; a map
    with the field and a matching or mismatching caller; unknown and version-mismatched names refused, with the reasons
    logged.
  • M, K and F outputs byte-identical: every output file of the existing synthetic cases (outside the preset-L test
    folders) was hashed: 1615 files, SHA-256 identical to main's.
  • CI "launcher" step (the launcher links the converter library and calls load_map_bytes with the default):
    5/5 passed.
  • python tools/ci/check_line_endings.py: 1160 files, 0 problems. Public gates (secrets, personal data, licence,
    chunks) pass.

Not tested

  • A real DLL with preset L (the tests use synthetic files only); the launcher and runtime with L (separate work); no
    GPU, no game.

data/preset-L.v1.map.json is the spec side's map as delivered (byte for byte; map
version 1, sources W, D and K, no "preset" field). The caller can name the preset a
map is loaded for (wronggpu-convert --preset, load_map_bytes expected_preset): a map
without the field is read as that preset when the preset uses its version; a map
with the field must agree; otherwise converter data damaged, and an unknown
--preset is a usage error. Tests: the real map validates, gives preset L's message
with --preset L, refuses mismatches, and converts our own random data in its exact
layout at two placements; unit checks for the caller's preset.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
data/preset-L.v1.map.json is kept byte for byte as delivered (data/ is spec-side
output); it is the one listed CR LF exception.

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 23:18
@phantoslayer21
phantoslayer21 merged commit d09e377 into main Nov 13, 2026
2 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/converter-l-map branch November 13, 2026 23:20
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