Skip to content

Move CTSolvers core infrastructure to CTBase#455

Merged
ocots merged 3 commits into
mainfrom
move-ctsolvers-to-ctbase
Jun 22, 2026
Merged

Move CTSolvers core infrastructure to CTBase#455
ocots merged 3 commits into
mainfrom
move-ctsolvers-to-ctbase

Conversation

@ocots

@ocots ocots commented Jun 21, 2026

Copy link
Copy Markdown
Member

This PR moves the core infrastructure from CTSolvers to CTBase to establish a shared foundation for solver-related functionality across the control-toolbox ecosystem.

Changes Overview

New Modules

Options System (src/Options/)

  • Type-safe option definitions with validation
  • OptionDefinition for declaring solver options with types, defaults, and constraints
  • OptionValue wrapper for handling provided vs. not-provided values
  • NotProvided singleton for distinguishing explicit nothing from missing options
  • Extraction API for accessing option values with computed sources
  • Comprehensive test coverage (47 test files)

Orchestration Module (src/Orchestration/)

  • Solver routing and execution framework
  • Method builders for constructing solver calls
  • Disambiguation system for resolving ambiguous solver choices
  • Routing logic for selecting appropriate solvers based on problem characteristics
  • Comprehensive test coverage (10 test files)

Strategies Module (src/Strategies/)

  • Strategy pattern implementation for solver interfaces
  • AbstractStrategy contract with metadata, parameters, and options
  • Registry system for strategy discovery and management
  • Builders API for strategy construction
  • Configuration and introspection utilities
  • Disambiguation support for strategy selection
  • Comprehensive test coverage (18 test files)

Documentation

Added four new guide documents:

  • implementing-a-strategy.md - Guide for implementing custom strategies
  • options-system.md - Documentation of the options system
  • orchestration-and-routing.md - Orchestration and routing framework
  • strategy-parameters.md - Strategy parameter system

Project Updates

  • Updated Project.toml with new dependencies
  • Updated docs/api_reference.jl with new module exports
  • Updated docs/make.jl for documentation build configuration
  • Updated src/CTBase.jl to include new submodules
  • Updated src/Exceptions/display.jl for improved error display

Testing

All new modules have comprehensive test coverage:

  • Options: 7 test files covering all functionality
  • Orchestration: 10 test files covering routing, builders, and disambiguation
  • Strategies: 18 test files covering registry, builders, parameters, and contract

Motivation

This refactoring establishes CTBase as the foundation for solver infrastructure, enabling:

  • Code reuse across multiple solver packages (CTDirect, CTIndirect, etc.)
  • Consistent option handling across the ecosystem
  • Unified strategy pattern for solver interfaces
  • Shared orchestration and routing logic

Breaking Changes

None - this is purely additive functionality.

- Add Options system with type-safe option definitions and validation
- Add Orchestration module for solver routing and execution
- Add Strategies module for strategy pattern implementation
- Add comprehensive guide documentation for options, orchestration, and strategies
- Update Project.toml with new dependencies
- Update API reference and documentation build configuration
- Add test suites for options, orchestration, and strategies
ocots added 2 commits June 22, 2026 00:22
- Add _typos.toml with custom ignore rules for codebase-specific terms
- Ignore 'strat'/'Strat' as common variable names
- Ignore 'adnlp_backen'/'ipopt_backen' test fixtures
- Update SpellCheck workflow to use custom config
- Update guide documentation with clearer explanations and examples
- Enhance strategy metadata and describe_registry implementations
- Improve error display formatting in Exceptions
- Update parameter contract helpers and coverage tests
- Refine registry API for better introspection
@ocots

ocots commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

Added improvements to documentation and code quality:

  • Enhanced guide documentation with clearer explanations and practical examples
  • Improved strategy metadata and describe_registry implementations for better introspection
  • Refined error display formatting in Exceptions module
  • Updated parameter contract helpers and coverage tests
  • Improved registry API for better type-level introspection

All documentation builds successfully with julia docs/make.jl.

@ocots
ocots merged commit 81909d2 into main Jun 22, 2026
4 checks passed
@ocots
ocots deleted the move-ctsolvers-to-ctbase branch June 22, 2026 11:23
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