Skip to content

Runtime: one model table for model selection; model=L refused by name - #93

Merged
phantoslayer21 merged 1 commit into
mainfrom
model-l/runtime-model-id
Nov 13, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
model-l/runtime-model-id

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

The runtime's model selection now goes through one model table instead of comparisons against Model M by hand.
ModelId gains L, and the runtime option model=L is recognised and refused by name until Model L's network exists.
Nothing changes for Model M or model K: same defaults, same file names and folders, same messages.

What changes

  • New header-only clean/runtime/model_select.h: the model table (name, converter map file, folder under the model
    directory, native D3D12 support), model_info(id), model_from_name, last_model_option (the parser of
    model=<name>, the last one wins, as before) and native_d3d12_models(). Header only, so every runtime build
    (with and without model K, and the native D3D12 test builds that list their sources) gets it without a new source
    file.
  • clean/k/runtime/model_k.h: enum class ModelId { M, K, L }.
  • model_from_options in clean/k/runtime/model_k.cpp and clean/runtime/no_model_k.cpp: both use the shared parser
    (the two copies of the loop are gone). model=L now gives "Model L is not part of this build yet (runtime option
    model=L); remove the option to use Model M" in both builds. The messages for an unknown value and for model K are
    word for word the old ones.
  • clean/runtime/runtime.cpp: the backend-3 gates ask the table whether the model runs on native D3D12. The messages
    are built from it and read exactly as before ("native D3D12 supports Model M only", "... backend 3 and Model M").
    runtime_model() returns the table's name.
  • clean/runtime/interop/backend.cpp: the preset-M / preset-K map names and model K's folder under the model directory
    come from the table (the same strings).

The only behaviour change: model=L, which used to be refused as an unknown model, is now refused by name. As for K, the
last model= decides, so model=L;model=M selects Model M.

Refs #89

Tested

  • New clean/tests/test_model_select.py (CI runs it): builds clean/tests/test_model_select.cpp twice, with model K
    (model_k.cpp) and without (no_model_k.cpp, -DWG_NO_MODEL_K), and runs both. It checks the table rows (M first,
    the old map names and folder, native D3D12 for M only) and model_from_options for the default, model=M/m, the
    last-one-wins rule, model=K (selected, or the exact no-K-build refusal) and an unknown or empty value (the exact old
    messages, known: M, K / known: M). It also checks model=L and model=l. Result: both builds, 0 failures.
  • python clean/runner/build.py --runtime-only --no-embed with the HIP SDK 7.2 clang++, with model K and with --no-model-k: both libraries build, 0 warnings.
  • clean.tests.test_model_select and clean.tests.test_no_model_k locally: 5 tests, OK (2 skipped: they need a --no-model-k build folder). The full CPU Python test set runs in CI.

Not tested

  • No GPU run (the runtime's frame path is not touched; only the create-time selection and its messages).

…refused by name

clean/runtime/model_select.h (header only) holds the model table (name, converter map, folder under
the model directory, native D3D12 support) and the parser of the runtime option model=<name>.
ModelId gains L. model_from_options in both runtime builds uses the shared parser; model=L is refused
as "not part of this build yet" until its network exists. The backend-3 gates, runtime_model() and
the interop's map names and model K folder come from the table. Model M and model K: same defaults,
names, folders and messages.

test_model_select builds a C++ check twice (with and without model K) and checks the table and the
exact messages.

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:09
@phantoslayer21
phantoslayer21 merged commit deed188 into main Nov 13, 2026
2 checks passed
@phantoslayer21
phantoslayer21 deleted the model-l/runtime-model-id branch November 13, 2026 22:11
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