Skip to content

[FEATURE] Extensible version support#256

Merged
sdatkinson merged 3 commits intomainfrom
version-support
Apr 26, 2026
Merged

[FEATURE] Extensible version support#256
sdatkinson merged 3 commits intomainfrom
version-support

Conversation

@sdatkinson
Copy link
Copy Markdown
Owner

Depending projects can define extensions to supported "version"s in .nam files. As demonstrated int eh test, one could for example develop an extension to this repo, develop .nam files with a version "DEMO::1.0.0" (and also register their respective DSP subclasses), and still use get_dsp() from this repo without worrying that it'll think that it doesn't know how to use the model you point it at. Also allows for different extensions to Core to be developed with independent versioning.

AI PR Description:

Summary

  • Refactors model version validation in get_dsp to use a pluggable checker interface (IVersionSupportChecker) and a support-level enum (Supported: NO/PARTIAL/YES).
  • Adds a thread-safe global registry with register_version_support_checker(...), and routes version decisions through is_version_supported(...) so core and custom checkers can coexist.
  • Preserves current behavior for built-in semver NAM model versions via a default core checker, including partial-support handling and rejection of unsupported versions.
  • Adds test coverage for both core support classification and custom checker registration, and wires the new tests into run_tests.

Why

  • Enables external/custom architecture ecosystems to define their own version compatibility policies without forking the core loader logic.
  • Centralizes support classification so future version logic changes are easier to extend and test.

Changes

  • NAM/get_dsp.h
    • Introduces Supported enum.
    • Introduces IVersionSupportChecker interface.
    • Adds register_version_support_checker(...) and is_version_supported(...) APIs.
  • NAM/get_dsp.cpp
    • Implements a default CoreVersionSupportChecker.
    • Adds registry + mutex for checker registration/lookups.
    • Refactors verify_config_version(...) to use is_version_supported(...).
  • tools/test/test_get_dsp.cpp
    • Adds test_is_version_supported_core_behavior.
    • Adds test_register_custom_version_support_checker.
  • tools/run_tests.cpp
    • Executes the two new tests in the test runner.

Test Plan

  • Build tests: cmake --build build --target run_tests
  • Run suite: ./build/tools/run_tests
  • Verify success output (Success!)
  • Confirm new test_get_dsp cases execute in run_tests

Introduce a pluggable version-support checker registry and route config version validation through it, so downstream projects can register scoped version policies without editing get_dsp directly.

Made-with: Cursor
Simplify the version support checker contract to a single support(version) call, with checker-specific pattern filtering handled internally by returning NO for non-applicable formats.

Made-with: Cursor
Add tests for core version support classification and custom checker registration so the extensible version support path is validated end-to-end in the test runner.

Made-with: Cursor
@sdatkinson sdatkinson merged commit 2316d6f into main Apr 26, 2026
3 checks passed
@sdatkinson sdatkinson deleted the version-support branch April 26, 2026 01:04
synchu pushed a commit to synchu/NeuralAmpModelerCore that referenced this pull request Apr 29, 2026
* [FEATURE] Add extensible model version support registry

Introduce a pluggable version-support checker registry and route config version validation through it, so downstream projects can register scoped version policies without editing get_dsp directly.

Made-with: Cursor

* [REFACTOR] Remove version checker matches() API

Simplify the version support checker contract to a single support(version) call, with checker-specific pattern filtering handled internally by returning NO for non-applicable formats.

Made-with: Cursor

* [TEST] Add version support coverage for get_dsp

Add tests for core version support classification and custom checker registration so the extensible version support path is validated end-to-end in the test runner.

Made-with: Cursor
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