feat(demon-client): emit DEFAULT_CONFIG value facts from the config generator#301
Draft
ryanontheinside wants to merge 1 commit into
Draft
feat(demon-client): emit DEFAULT_CONFIG value facts from the config generator#301ryanontheinside wants to merge 1 commit into
ryanontheinside wants to merge 1 commit into
Conversation
…enerator genConfigTypes.mjs now projects DEFAULT_CONFIG's VALUES, not just its keys: - configContract.gen.hpp gains demon::config::defaults: typed constexpr constants (bool/double/const char* by runtime type) for engine scalars, prompts a/b/blend, every control default, and the top-level seed/swap_source_mode, plus two constexpr POD tables (the ordered controls values and the channel_ranges min/max/reverse rows) for consumers that iterate the fact set. - new types/configDefaults.gen.json: exactly JSON.stringify(serializeConfig(DEFAULT_CONFIG)) + newline, one machine-readable artifact for JS/TS consumers, which downstream repos can also use as a byte-exact serialization fixture. The existing key/enum constant surface is unchanged (additive header), so C++ consumers of the vendored copy keep compiling; they can now consume the default VALUES instead of re-declaring them (rtmg-vst vendors both artifacts next to the existing .gen.hpp contracts). configContractDrift.test.ts byte-guards the new artifact and asserts the new coverage: a typed constant + table row for every control, every channel_ranges row with its numeric facts, and artifact == serializeConfig(DEFAULT_CONFIG).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
genConfigTypes.mjsnow projects DEFAULT_CONFIG's VALUES, not just its keys, so downstream C++/JS hosts consume the defaults instead of re-declaring them (rtmg-vst plan section 7.3: kill the 4-way copy of param defaults across VST, M4L, webui, and the SDK).What
configContract.gen.hppgainsdemon::config::defaults: typed constexpr constants (bool/double/const char*by runtime type) for the engine scalars, prompts a/b/blend, every control default, and the top-level seed/swap_source_mode, plus two constexpr POD tables (the ordered controls values and the channel_ranges min/max/reverse rows) for consumers that iterate the fact set.types/configDefaults.gen.json: exactlyJSON.stringify(serializeConfig(DEFAULT_CONFIG))+ newline, one machine-readable artifact for JS/TS consumers, also usable downstream as a byte-exact serialization fixture (rtmg-vst's existing fixture was already byte-identical to it).configContractDrift.test.tsbyte-guards the new artifact and asserts the new coverage: a typed constant and a table row for every control, every channel_ranges row with its numeric facts, and artifact ==serializeConfig(DEFAULT_CONFIG).The existing key/enum constant surface is unchanged (purely additive header), so current consumers of the vendored copy keep compiling.
Cross-repo merge order
Companion PR: daydreamlive/rtmg-vst#133 vendors these artifacts and makes the VST/M4L hosts consume the generated facts.
mainand byte-compares the vendored copies, so it can only go green once this PR is onmain.Verification
demos/realtime_motion_graph_web/web: unit suite 70/70 (including the extendedconfigContractDrift.test.ts),tsc --noEmitclean.pytest tests/unit/test_wire_contract.py tests/unit/test_client_sdk.py: 19 passed.npm ci && npm run build && npm run gen:config).