feat(solver): Phase 1b — SolverRegistry and plugin loading #293
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement the SolverRegistry — runtime discovery, loading, and management of solver plugins.
Parent: #287 (Phase 1)
Depends on: #292 (1a — API types)
Blocks: #294 (1c), #295 (1d)
Scope
Files
SolverRegistry.cpp implementation
Plugin discovery via
scan():plugin_dirfor shared libraries (.so/.dll/.dylib)dlopen()/LoadLibrary()each candidatekcsolve_api_version()symbol — verify major version compatibilitykcsolve_create()to instantiate the solverIKCSolver*by itsid()Base::Console()Plugin entry points (exported by each solver .so):
Discovery paths (scanned in order):
<install_prefix>/lib/kcsolve/— system-installed solversKCSOLVE_PLUGIN_PATHenv var — development overridesManual registration:
register_solver(std::unique_ptr<IKCSolver>)— for built-in solvers (OndselAdapter will use this)id()Lookup:
get(solver_id)— returnsIKCSolver*or nullptravailable()— list of registered solver IDsget_default()/set_default()— global default solver selectionjoints_for(BaseJointKind)— which registered solvers support a given joint kindLifecycle:
SolverRegistryis a singleton owned by the Assembly module (or App-level if needed for server)CMakeLists.txt
Upgrade from header-only INTERFACE to a proper shared library target:
Platform-specific: link
dlon Linux, nothing extra on Windows/macOS.Acceptance criteria
SolverRegistry::scan()discovers and loads.soplugins from a directorykcsolve_api_version()check rejects incompatible plugins with a clear error messageregister_solver()works for manual (built-in) registrationget(),available(),get_default()work correctlyjoints_for()aggregates supported joints across all registered solversdlopenfailure = warning + skip (don't crash)libKCSolve.soand links into Assembly moduleReferences
docs/INTER_SOLVER.md§4.3 (SolverRegistry), §4.4 (Plugin Loading)src/App/Application.cpp