Skip to content

build.py: optional models as a table (Model M and K unchanged) - #95

Merged
phantoslayer21 merged 1 commit into
mainfrom
model-l/build-model-switch
Nov 13, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
model-l/build-model-switch

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

The build script's --no-model-k switch is now a table of optional models. A further model of the runtime library
can be switched in and out by adding a row instead of a second copy of the switch. Nothing changes for Model M or
model K: same source lists, built-in files, compiler commands, copied maps, kernel builds and options.

What changes (clean/runner/build.py)

  • OPTIONAL_MODELS: one row per optional model with its runtime sources, built-in files, map file, the define and
    stand-in source of a build without it, its kernel build function, and its option text. Model K's row points at the
    existing K_RUNTIME_SOURCES, K_EMBED_FILES, K_MAP_FILE, WG_NO_MODEL_K, no_model_k.cpp,
    k_build.build_device and the old help text.
  • set_model(name, on) and model_built(name). set_model_k(on) and the MODEL_K flag stay as names for model K
    (the existing scripts and tests use them).
  • These now come from the table: the --no-model-<name> options, the -DWG_NO_MODEL_<name> defines of the runtime
    command, the maps copied next to the library, the optional models' kernel builds, and the options passed on to the
    extra-architecture child builds.

Refs #89

Tested

  • Identity for Model M and model K: a script recorded what build.py produces, on main (d9c697e) and on this branch,
    for model K on, off and on again. It covers RUNTIME_SOURCES, EMBED_FILES, the full runtime compiler command, the
    map files build_runtime copies, and the whole --help text. The two outputs are identical.
  • New clean/tests/test_build_models.py (3 tests, CI runs it): model K's row is the old switch (same lists by either
    name, same define, map and stand-in), and a synthetic second optional model gets its own option, define, sources and
    built-in files without changing model K's or Model M's. It also checks which maps are copied with and without
    model K.
  • With the existing build tests: test_build_models, test_no_model_k, test_build_targets,
    test_build_motion_define, test_build_cuid: 17 tests, OK (2 skipped: they need a --no-model-k build folder).
    Also run in the reverse order: OK.

Not tested

  • No device build or GPU run. The kernel build calls are reached through the table, but no code object was compiled
    here.

…M and K unchanged)

The runtime library's optional models are one table, OPTIONAL_MODELS: each row names the model's
runtime sources, built-in files, map, the define and stand-in source of a build without it, its
kernel build and its option text. --no-model-<name> options, the -DWG_NO_MODEL_<name> defines, the
copied maps, the kernel builds and the extra-architecture child commands come from it. Model K's row
is the former --no-model-k code; set_model_k and MODEL_K keep working.

test_build_models checks model K's row against the old switch and plugs in a synthetic second
optional model.

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:13
@phantoslayer21
phantoslayer21 merged commit c253345 into main Nov 13, 2026
2 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/build-model-switch branch November 13, 2026 22:14
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