Skip to content

Conversation

@ocots
Copy link
Member

@ocots ocots commented Jan 31, 2026

Summary

This PR enhances the ADNLPModeler and ExaModeler implementations to provide comprehensive support for all available options in their respective backends (ADNLPModels.jl and ExaModels.jl).

Background

Currently, CTModels.jl only exposes a limited subset of the available options:

  • ADNLPModeler: Only show_time and backend options
  • ExaModeler: Only base_type, minimize, and backend options

However, both backends support many more configuration options that could significantly improve performance, flexibility, and user experience.

What This PR Does

📋 Documentation

  • Complete reference document (01_complete_options_reference.md) documenting all available options
  • Performance analysis and recommendations for different use cases
  • Usage examples and troubleshooting guide

🔧 Planned Enhancements (follow-up PRs)

Based on the analysis, this documentation enables the following enhancements:

ADNLPModeler Improvements

  • Add matrix_free option for large-scale problems
  • Add name option for model identification
  • Add minimize option for optimization direction control
  • Add backend override options for advanced users
  • Implement proper validation for backend availability

ExaModeler Improvements

  • Enhanced type validation for base_type
  • Better backend type checking
  • Automatic backend detection and recommendations

Performance Impact

The documented options can provide:

  • 2-10x speedup with optimized backend selection
  • Memory reduction with matrix-free mode
  • GPU acceleration support for large-scale problems
  • Better numerical stability with appropriate type selection

Next Steps

  1. Review and merge this documentation PR
  2. Implement enhancements in follow-up PRs based on this reference
  3. Add tests for new options and validation
  4. Update examples to demonstrate best practices

Files Changed

  • .reports/2026-01-29_Options/reference/01_complete_options_reference.md (new)

References

- Complete documentation of all available options for both backends
- Detailed analysis of current CTModels.jl implementation
- Recommendations for enhancing ADNLPModeler and ExaModeler
- Performance considerations and usage examples
- Validation strategies and troubleshooting guide
@github-actions
Copy link
Contributor

github-actions bot commented Jan 31, 2026

Breakage test results
Date: 2026-01-31 21:57:44

Name Latest Stable
CTDirect compat: v0.6.10-beta compat: v0.7.1-beta.1
CTFlows compat: v0.6.10-beta compat: v0.7.1-beta.1
OptimalControl compat: v0.6.10-beta compat: v0.6.10-beta

ocots added 4 commits January 31, 2026 19:23
- Add comprehensive analysis of current ADNLPModeler and ExaModeler implementations
- Design enhanced metadata with missing high-priority options
- Implement complete validation functions for all options
- Create extensive test suite with performance benchmarks
- Provide practical examples and migration guide
- Document performance impact and best practices

Key enhancements:
- ADNLPModeler: matrix_free, name, minimize options + validation
- ExaModeler: auto_detect_gpu, gpu_preference, precision_mode
- Comprehensive validation with helpful error messages
- GPU auto-detection and backend selection
- Performance recommendations based on problem characteristics

All changes are backward compatible and ready for implementation.
Add matrix_free, name, minimize options to ADNLPModeler
Add auto_detect_gpu, gpu_preference, precision_mode to ExaModeler
Create validation module with comprehensive error checking
Maintain 100% backward compatibility
Add test suite for new functionality
- Remove duplicate validation.jl includes from modeler files
- Fix import issues in test scripts
- Add proper module imports for ADNLPModeler and ExaModeler
- Validation now works correctly with proper error messages
- All enhanced options are functional and tested
@ocots ocots closed this Jan 31, 2026
@ocots ocots reopened this Jan 31, 2026
ocots added 2 commits January 31, 2026 22:17
- Add 17 options (ADNLPModeler: 15, ExaModeler: 2)
- Implement enriched validation with IncorrectArgument exceptions
- Refactor ExaModeler architecture for consistency
- Simplify code using Strategies.filter_options
- Add comprehensive tests (63/63 passing)
- Update documentation and reports
- Add explicit agent directives in architecture, testing, documentation, exceptions, performance, and type-stability rules
- Ensure transparency when rules are applied with specific principle naming
- Standardize format across all rule files
- Improve visibility and traceability of code decisions
@ocots ocots merged commit e08eba4 into develop Feb 1, 2026
19 of 20 checks passed
@ocots ocots deleted the feature/enhance-modelers-options branch February 1, 2026 09:10
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.

2 participants