Skip to content

Launcher: convert Model L by preset name with the preset-L map - #125

Merged
phantoslayer21 merged 1 commit into
mainfrom
model-l/convert-by-preset-name
Nov 14, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
model-l/convert-by-preset-name

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

The launcher can convert Model L by its preset name. model convert --preset=L and model status --preset=L use
Model L's converter map, data/preset-L.v1.map.json (the spec side's revision v1.1, from #116), all the way through. The
model goes to the folder where the runtime looks for model=L. A file without Model L's data is refused clearly, and
Model M stays as it was. This is the first step of the selection path for #89. The window's model choice and the
runtime settings for Model L come in a follow-up.

What changes

  • Build: the launcher embeds Model L's map (CMake WRONGGPU_MAP_L, default data/preset-L.v1.map.json;
    make_payload.py --map-l, resource 903; empty: a build without Model L). EmbeddedData gains lMapId /
    lMapSha256, added at the end so the existing initialisers stay valid.
  • wg_core/context: Context::presetL and SelectPreset(ctx, name). The name is M, L, or K in a build with Preset K,
    in either case. An unknown name, or L in a build without its map, is refused, and nothing changes. Choosing another
    model drops the loaded map.
    • LoadEmbeddedMap loads Model L's map with the expected preset "L", so a map that names another preset is
      "converter data damaged". Models M and K load as before, with no expected preset.
    • ModelDir: %LOCALAPPDATA%\WrongGPU\model\L, the runtime's folder for model=L (clean/runtime/model_select.h).
  • wg_core/model.cpp: when no file has Model L's data, the message names Model L and gives the converter's reason for
    the file the player chose: "Model L can't be prepared: no DLSS model file with Model L's data was found. The file you
    chose (...): This DLSS file has no preset-L model. ..." (exit 5). Model M's messages are unchanged.
  • app/cli.cpp: model status|convert --preset=M|L. An unknown or empty name is a bad command line (exit 10). The
    JSON result names the model (preset) and the converter map in use (model.map_sha256, model.map_error).
  • README: "Model L by name".

Model M: without --preset the code path is the same as before. A Model L conversion never touches Model M's folder.
The tests below check both, including the same Model M bytes from a launcher built from main.

Refs #89

Tested

All runs are on Windows, CPU only, with 1 compile job.

Run Result
CI launcher step (wg-core, launcher-core, coexist-core, convert-ignore, source-size, wording) 6/6 passed
tests/run_model_l_tests.py: a WRONGGPU_TESTING launcher built with the shipped preset-L map, one built with a test map in its exact layout (--write-test-map), and a launcher built from main (750a530) with the same payload and test map 25 passed, 0 failed
Line-ending check 0 problems

run_model_l_tests.py checks:

  • Shipped map:
    • The map file is v1.1 ("preset": "L", a 13-entry dec0_values).
    • status --preset=L reports the shipped map's SHA-256 and model\L\model.wgcm.
    • Lower case works. Without --preset, Model M with its own map.
    • A file smaller than Model L's parameter block and a random file larger than it are both refused (exit 5) with the
      converter's reason: "not a DLSS model file", and "This DLSS file has no preset-L model".
    • Nothing is written for L, and Model M's files are unchanged byte for byte.
    • --preset=Q, ML, an empty name and K (a build without Preset K) give exit 10.
  • Test map:
    • Model L converts into model\L\model.wgcm, bit-exact with the reference (every stage, digest and tensor), with
      its own model-source.txt (file, map SHA-256, no filter line).
    • Status says ready. Reuse leaves the file unchanged.
    • Model M is untouched throughout, and the Model M file is the same bytes as main's launcher writes from the same
      file.
  • launcher-core: selection by name, folders, refusals, dropping the earlier map state.

Not tested

  • A real DLSS file carrying preset L: that is the next lane item (a real-DLL conversion check).
  • The window, the elevated worker and the install flow do not choose Model L yet (the follow-up).

`model convert --preset=L` and `model status --preset=L` select Model L
by its name: the launcher embeds data/preset-L.v1.map.json (the spec
side's revision v1.1; CMake WRONGGPU_MAP_L, make_payload.py --map-l,
resource 903) and loads it as preset L, so a map that names another
preset is "converter data damaged". The model goes to
%LOCALAPPDATA%\WrongGPU\model\L\model.wgcm with its own
model-source.txt, the folder where the runtime looks for model=L
(model_select.h).

- Context::presetL and SelectPreset(ctx, name): M, L (and K in a build
  with Preset K), either case; an unknown name, or L in a build without
  its map, is refused and nothing changes. A different model drops the
  loaded map.
- A file without Model L's data is refused with Model L's words and the
  converter's reason for the file the player chose (exit 5). An unknown
  name is a bad command line (exit 10).
- The JSON result names the model (`preset`) and the converter map in
  use (`model.map_sha256`, `model.map_error`).
- Model M is unchanged: without --preset the map is loaded as before
  (no expected preset), and Model M's folder is never touched by a
  Model L conversion.

Tests: launcher-core (selection by name, the folders, refusals);
tests/run_model_l_tests.py end to end with a build of the shipped map
(status, the map's SHA-256, refusals, Model M untouched) and a build of a
test map in the shipped map's exact layout (--write-test-map: the
conversion bit-exact, model-source.txt, reuse, Model M byte for byte, and
the same Model M bytes as a launcher built from main).

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21 phantoslayer21 added this to the 0.7.0 milestone Nov 14, 2026
@phantoslayer21
phantoslayer21 marked this pull request as draft November 14, 2026 01:51
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 14, 2026 02:10
@phantoslayer21
phantoslayer21 merged commit 613f293 into main Nov 14, 2026
9 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/convert-by-preset-name branch November 14, 2026 02:24
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