Skip to content

Migrate to CTBase 0.28 parameter contract#172

Merged
ocots merged 2 commits into
mainfrom
migrate/parameter-contract
Jul 13, 2026
Merged

Migrate to CTBase 0.28 parameter contract#172
ocots merged 2 commits into
mainfrom
migrate/parameter-contract

Conversation

@ocots

@ocots ocots commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

This PR migrates all CTSolvers strategies to the breaking changes introduced in CTBase.jl v0.28.0-beta.

Closes #171.

Changes

Source code (8 strategy files)

  • Renamed Strategies._default_parameterStrategies.default_parameter in all 7 parameterized strategies (ADNLP, Exa, Ipopt, Knitro, MadNLP, MadNCL, Uno) and all their call sites (constructors, metadata fallbacks).
  • Added Strategies.parameter(::Type{<:S{P}}) where {P<:Bound} = P for each of the 7 parameterized strategies, with the appropriate type bound (CPU for CPU-only, Union{CPU,GPU} for GPU-capable).
  • Added Strategies.parameter(::Type{<:SciML}) = nothing for the non-parameterized SciML integrator.
  • Added docstrings for every parameter method, following the Handbook docstring templates ($(TYPEDSIGNATURES), one-sentence summary, # Returns, See also: with cross-references).

Tests (11 files)

  • Replaced all _default_parameter calls with default_parameter.
  • Replaced all get_parameter_type calls with parameter.
  • Added parameter (and default_parameter where needed) to fake test strategies in test_backward_compatibility.jl, test_integration_parameters.jl, test_alias_integration.jl, and test_mode_propagation.jl.
  • Updated test_parameter_contract.jl to test the parameter fallback (in addition to default_parameter), with assertions matching CTBase's actual error message format.
  • Updated commented-out type-stability tests to use the new method names.

Documentation (3 guide files)

  • implementing_a_solver.md: Updated contract list, code examples, and summary checklist to reference parameter and default_parameter instead of _default_parameter.
  • implementing_a_modeler.md: Same updates, including Exa example with Union{CPU,GPU} parameter method.
  • architecture.md: Updated tag-dispatch example and parameter resolution description.

Historical files

  • BREAKING.md: Rewrote v0.4.0-beta entries to use parameter/default_parameter instead of _supported_parameters/_default_parameter.
  • CHANGELOG.md: Same updates for the v0.4.0-beta section.

Project.toml

  • Bumped CTBase compat from 0.26, 0.27 to 0.28.
  • Bumped CTModels compat from 0.14, 0.15 to 0.15.
  • Bumped version to 0.4.27-beta.
  • Updated docs/Project.toml CTBase compat accordingly.

Verification

All 393 strategy tests pass:

Test Summary:                                              | Pass  Total  Time
CTSolvers tests                                            |  393    393  30.8s

Adapt all strategies to the CTBase.jl v0.28.0-beta breaking changes:
- Rename `_default_parameter` → `default_parameter` in all strategies and tests
- Implement `Strategies.parameter(::Type{<:S{P}})` for all 7 parameterized
  strategies (ADNLP, Exa, Ipopt, Knitro, MadNLP, MadNCL, Uno)
- Implement `Strategies.parameter(::Type{<:SciML}) = nothing` for the
  non-parameterized SciML integrator
- Replace all `get_parameter_type` calls with `parameter` in tests
- Add `parameter` and `default_parameter` to fake test strategies
- Update docs guides (implementing_a_solver, implementing_a_modeler,
  architecture) with the new contract names
- Rewrite historical BREAKING.md and CHANGELOG.md entries
- Add docstrings for all `parameter` methods following Handbook templates
- Bump CTBase compat to 0.28 and CTModels to 0.15

Closes #171
@ocots

ocots commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

Closes #171.

@ocots
ocots merged commit 25b9010 into main Jul 13, 2026
5 checks passed
@ocots
ocots deleted the migrate/parameter-contract branch July 13, 2026 21:50
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.

Migration: implement parameter contract method for all strategies (CTBase v0.28.0-beta)

1 participant