Skip to content

Develop#94

Merged
ocots merged 18 commits intomainfrom
develop
Mar 8, 2026
Merged

Develop#94
ocots merged 18 commits intomainfrom
develop

Conversation

@ocots
Copy link
Copy Markdown
Member

@ocots ocots commented Mar 8, 2026

No description provided.

ocots added 17 commits March 6, 2026 11:51
- Add test_orchestration.jl with export verification for Orchestration module
- Add test_solvers.jl with export verification for Solvers module
- Add test_strategies.jl with export verification for Strategies module
- Consolidate test_options.jl with complete Options module tests
- Update existing test files with proper export verification pattern
- Remove export tests from test_routing.jl to avoid duplication
- Add internal function verification to ensure private symbols stay private
- Total: 635 export tests covering all public API symbols across 7 modules

All modules now follow consistent export testing pattern:
- Types, constants, and functions are properly exported
- Internal functions are verified as non-exported
- Using CurrentModule pattern for robust export verification
- Add test_orchestration.jl with export verification for Orchestration module
- Add test_solvers.jl with export verification for Solvers module
- Add test_strategies.jl with export verification for Strategies module
- Consolidate test_options.jl with complete Options module tests
- Update existing test files with proper export verification pattern
- Remove export tests from test_routing.jl to avoid duplication
- Add internal function verification to ensure private symbols stay private
- Total: 635 export tests covering all public API symbols across 7 modules

All modules now follow consistent export testing pattern:
- Types, constants, and functions are properly exported
- Internal functions are verified as non-exported
- Using CurrentModule pattern for robust export verification
…tructors

- Store _default_parameter result in variable P for clarity
- Improves code readability by avoiding repeated function calls
- Maintains same functionality while making code more maintainable
- Remove duplicated deprecation warning code between constructors
- Apply delegation pattern: non-parameterized constructors delegate to parameterized ones
- Follow same pattern as Ipopt but adapted for local context (no build function needed)
- Improve documentation with complete docstrings following project standards
- Add structured sections: Arguments, Returns, Throws, Examples, See also
- All tests pass (298/298 for modelers test suite)

This makes the code more maintainable and follows DRY principles while keeping
the same public API.
Replace fragile isdefined(Main, :Enzyme) checks with Julia's extension system
and tag dispatch pattern for ADNLP backend validation.

Key changes:
- Add AbstractTag and ADNLPTag for extension-based dispatch
- Implement validate_adnlp_backend with Val{:backend} dispatch pattern
- Create CTSolversEnzyme and CTSolversZygote extensions
- Replace warnings with ExtensionError for missing extensions
- Add comprehensive 4-test strategy covering all scenarios
- Update Project.toml with new extensions and test dependencies

Benefits:
- Robust detection regardless of module loading context
- Type-safe dispatch using Julia's multiple dispatch
- Comprehensive test coverage with extension scenarios
- Consistent with existing CUDA and solver extension patterns
- Clear error messages directing users to load extensions

Tests: All 39 tests pass, covering extension loaded/unloaded scenarios
… API

Enhance documentation quality and fix test compatibility with tag dispatch pattern.

Documentation improvements:
- Add comprehensive docstrings for all validate_adnlp_backend methods
- Separate docstrings for validate_exa_base_type methods with detailed examples
- Include proper Arguments/Returns/Throws/Examples/Notes/See also sections
- Use julia-repl examples with using statements and real output
- Add cross-references with [@ref] syntax

Test updates:
- Update test_coverage_validation.jl to use new tag dispatch API
- Replace validate_adnlp_backend(:symbol) with validate_adnlp_backend(tag, Val(:symbol))
- Add local DummyTag definition for testing
- Maintain full coverage of all validation scenarios

Benefits:
- Documentation follows project standards consistently
- Tests now match actual API implementation
- Examples are safe and reproducible
- Clear separation of concerns in validation methods
Remove validate_gpu_preference and validate_precision_mode functions that were
not used anywhere in the codebase. These functions were legacy code from Exa
modeler development that is no longer relevant.

Changes:
- Remove validate_gpu_preference function and its tests
- Remove validate_precision_mode function and its tests
- Update test_modelers.jl to reflect removed functions
- Keep all actively used validation functions

Benefits:
- Cleaner codebase with no dead code
- Reduced maintenance burden
- Clearer separation between used and unused validation logic
- Better focus on currently implemented features
Update all solver constructors to use consistent parameterized type pattern:
- Extract default parameter with Strategies._default_parameter()
- Construct parameterized type directly instead of using build functions

Changes:
- Ipopt: Use Solvers.Ipopt{P}(; mode=mode, kwargs...)
- Knitro: Use Solvers.Knitro{P}(; mode=mode, kwargs...)
- MadNCL: Use Solvers.MadNCL{P}(; mode=mode, kwargs...)
- MadNLP: Use Solvers.MadNLP{P}(; mode=mode, kwargs...)

Benefits:
- Consistent constructor pattern across all solvers
- Cleaner separation between default and parameterized constructors
- More explicit parameter handling
- Better code readability and maintainability
Move the parameterized build_strategy method from end of file to be grouped
with the non-parameterized version at the beginning of the file.

Changes:
- Move build_strategy(id, parameter, family, registry) method from lines 313-324 to lines 57-84
- Keep both build_strategy overloads together for easy comparison
- Maintain all functionality and documentation

Benefits:
- Easier to understand the two overloads and their differences
- Better code organization with related functions grouped together
- Improved maintainability and readability
- Clearer API structure with main functions at the top
Add force as an alias for the bypass function to provide users with an alternative,
more intuitive name for bypassing validation.

Changes:
- Add const force = bypass in bypass.jl
- Add comprehensive docstring for force function with examples
- Update bypass docstring to mention force alias and show both syntaxes
- Export force in Strategies.jl module exports
- Add comprehensive tests in test_bypass.jl verifying force === bypass
- Add :force to exported utility functions test in test_strategies.jl

Benefits:
- Provides alternative naming for user preference (force vs bypass semantics)
- Maintains complete backward compatibility
- Clear documentation of the alias relationship with cross-references
- Full test coverage including functional equivalence and export verification
- Both functions create identical BypassValue wrappers
…onDefinition

- Replace conditional logic with multiple dispatch on default value type
- Add comprehensive docstrings for all _construct_option_definition methods
- Improve OptionDefinition constructor documentation with dispatch explanation
- Update all examples to use julia-repl blocks with proper module imports
- Enhance struct documentation with type parameter T explanation
- Ensure compliance with Control Toolbox documentation standards
- Split extract_strategy_ids into two methods using Julia dispatch
- extract_strategy_ids(::Strategies.RoutedOption, ::ResolvedMethod) handles routed options
- extract_strategy_ids(::Any, ::ResolvedMethod) returns nothing for non-routed options
- Update docstrings to follow Control Toolbox documentation standards
- Add proper type signatures and cross-references between methods
- Fix missing end statement in build_option_ownership_map function
…mproved SRP

BREAKING CHANGES: None - public API unchanged

## Summary
Refactored route_all_options from 119 lines to 28 lines by extracting 8 private helper functions, improving adherence to Single Responsibility Principle while maintaining 100% backward compatibility.

## Changes
- route_all_options: 119→28 lines, complexity 8+→1
- Added RoutingContext struct to encapsulate routing mappings
- Added 8 private helper functions with single responsibilities
- Added comprehensive tests for all internal functions (84 tests)
- Updated test_orchestration.jl to verify internal symbols are not exported
- Updated .windsurf/rules/testing.md to reflect actual testing practices

## New Functions
- _separate_action_and_strategy_options: Separate action vs strategy options
- _build_routing_context: Create RoutingContext with precomputed mappings
- _check_action_option_shadowing: Detect and report option shadowing
- _initialize_routing
BREAKING CHANGES: None - public API unchanged

## Summary
Refactored route_all_options from 1gy
## Summary
Refactored route_all_options froticRefactorefo
## Changes
- route_all_options: 119→28 lines, complexity 8+→1
- Added RoutingContext struct to encapsulate routing mappings
- Added 8 private helper functions with single responsibilities
- Add_in- route_al
- Added RoutingContext struct to encapsulate routing ra- Added 8 private helper functions with single responsibilitle- Added comprehensive tests for all internal functions (84 tesra- Updated test_orchestration.jl to verify internal symbols are nan- Updated .windsurf/rules/testing.md to reflect actual testi
…tandards

BREAKING CHANGES: None - documentation only

## Summary
Enhanced all docstrings in routing.jl to comply with Control Toolbox documentation standards, improving developer experience and API discoverability.

## Changes
- Added  for RoutingContext struct with complete # Fields section
- Added  for all 8 private helper functions
- Added structured sections: # Arguments, # Returns, # Throws, # Notes
- Documented all parameters with types and descriptions
- Added detailed notes on performance, behavior, and implementation
- Improved clarity and completeness of function descriptions

## Functions Enhanced
- RoutingContext: Complete struct documentation with field descriptions
- _separate_action_and_strategy_options: Detailed parameter and return documentation
- _build_routing_context: Performance notes and mapping explanations
- _check_action_option_shadowing: Behavior notes and source tracking

BREAKING CHANGES: None - documentation only

## Summary
Enhanced all docstrings in routing: V
## Summary
Enhanced all docstrings in rou
- Enhanced to
## Changes
- Added  for RoutingContext struct with complete # Fields section
- Added  for all 8 private helper functiont a- Added - Added  for all 8 private helper functions
- Added strung- Added structured sections: # Arguments, # Returns, # Throwec- Documented all parameters with types and descriptions
- Added detaiet- Added detailed notes on performance, behavior, and iio- Improved clarity and completeness of function descriptions

## Fon
## Functions Enhanced
- RoutingContext: Complete struct doene- Routing
- Add ComputedSource option source type for dynamic option computation
- Implement ComputedSource extraction and validation
- Add MadNLP and MadNCL solver extensions
- Update Options module with computed source support
- Add comprehensive tests for computed source functionality
- Add integration tests for new extensions
@ocots ocots merged commit c2d7f53 into main Mar 8, 2026
7 checks passed
@ocots ocots deleted the develop branch March 8, 2026 14:33
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