Skip to content

model_specs: fix declarations that accept or reject the wrong requests - #405

Closed
CryptVenture wants to merge 1 commit into
0xShug0:mainfrom
CryptVenture:pr/spec-contract-fixes
Closed

model_specs: fix declarations that accept or reject the wrong requests#405
CryptVenture wants to merge 1 commit into
0xShug0:mainfrom
CryptVenture:pr/spec-contract-fixes

Conversation

@CryptVenture

Copy link
Copy Markdown
Contributor

Split out of #372 as requested. This PR holds only the changes that alter which requests validate; the description-only fixes, the VoxCPM1 defaults, the ASR/aligner/codec declarations and the MiniMax declarations are separate PRs.

Each change is listed with the exact parser that reads the option.

The changes

midashenglm_gen.seed: min -1 → 0. src/models/midashenglm_gen/session.cpp:176 reads the seed through runtime::parse_u32_option, and parse_u32_value (src/framework/runtime/options.cpp:36-39) throws "seed must be an unsigned integer" on any leading minus. A spec-legal -1 was therefore a guaranteed runtime error, and the "-1 selects a random seed" description promised behaviour that could not happen.

heartmula.lyrics, heartmula.tags: required false → true. src/models/heartmula/session.cpp throws "HeartMuLa requires non-empty tags" and "HeartMuLa requires non-empty lyrics". The engine already rejected what the spec described as valid, so a client could not learn the constraint until the request failed.

irodori_tts.text_chunk_mode: default and tag_aware added to the enum. The session takes the shared override (src/models/irodori_tts/session.cpp:453-454text::parse_text_chunk_mode_override), and src/framework/text/chunking.cpp:572-586 accepts default, word_budget, tag_aware, japanese, endline. Two working modes were undeclared and so unreachable from a spec-driven client.

granite5asr.language: removed. The session never reads a language option — it hard-codes "en" (src/community_models/granite5asr/session.cpp:137, 174, 252, 270, 277). The declaration invited a value that could not have an effect.

firered_audio session option helper_graph_arena_mb: removed. The only key that exists is fireredtts3.helper_graph_arena_mb (src/models/fireredtts3/session.cpp:251). FireRedAudio validates session options strictly, so sending the declared name failed the request outright.

Validation

python3 tools/check_loader_catalog_sync.py
# ok: runtime loaders, model_specs, and model_manager_v2 are in sync

audiocpp_model_manager list --repository-root .        # exit 0
# parses every on-disk spec through the C++ schema loader

Verified by reading the parser that consumes each option, with the file and line above. None of these five families has a package installed on this machine, so they were not exercised end to end; the sibling ASR PR carries a live request check for the one family that is installed here.

Scope

Five spec files, 6 insertions / 19 deletions. The generated WebUI bundle is deliberately excluded: catalog.ts inlines model_specs/*.json at frontend build time and the bundle is not byte-reproducible, so regenerating it in every PR of this split would make the PRs conflict with each other. Happy to send one bundle-regeneration PR once the series lands.

Each change alters which requests validate, and each was checked against the
parser that reads the option.

  - midashenglm_gen.seed: min -1 -> 0. session.cpp:176 reads the seed through
    runtime::parse_u32_option, and parse_u32_value (framework/runtime/
    options.cpp:36-39) throws on any leading minus. A spec-legal -1 was a
    guaranteed runtime error, and the "-1 selects a random seed" description
    went with it.
  - heartmula.lyrics, heartmula.tags: required false -> true.
    heartmula/session.cpp throws "HeartMuLa requires non-empty tags" and
    "HeartMuLa requires non-empty lyrics", so the engine already rejected the
    requests the spec described as valid.
  - irodori_tts.text_chunk_mode: values widened to include "default" and
    "tag_aware". The session takes the shared override
    (irodori_tts/session.cpp:453-454 -> text::parse_text_chunk_mode_override),
    and framework/text/chunking.cpp:572-586 accepts default, word_budget,
    tag_aware, japanese and endline. Two working modes were undeclared.
  - granite5asr.language: removed. The session never reads a language option;
    it hard-codes "en" (granite5asr/session.cpp:137, 174, 252, 270, 277), so
    the declaration invited a value that could not have an effect.
  - firered_audio session option helper_graph_arena_mb: removed. The only key
    that exists is fireredtts3.helper_graph_arena_mb (fireredtts3/session.cpp:
    251), and FireRedAudio validates session options strictly, so passing the
    declared name failed the request outright.
@CryptVenture
CryptVenture force-pushed the pr/spec-contract-fixes branch from ddd693b to c9dc492 Compare September 3, 2026 00:26
@CryptVenture

Copy link
Copy Markdown
Contributor Author

Closing for now to stay inside the 3-concurrent-PR policy (see the discussion on #422). Nothing is wrong with the change and CI is green on it; I will reopen it as review slots free.

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