fix(core): AD-friendly to_out_of_place buffers + harmonise changelog filenames#486
Merged
Conversation
Widen the out-of-place buffer element type from the call arguments (promote_type with a Float64 floor) so functors produced by `to_out_of_place` — e.g. constraint-by-label functors in CTModels — can be differentiated through (ForwardDiff.Dual), instead of throwing `Float64(::Dual)`. The `T` keyword still acts as a floor, so plain Float64/Int calls keep their previous behaviour. Add a ForwardDiff regression test. Also rename CHANGELOGS.md/BREAKINGS.md to the singular CHANGELOG.md/ BREAKING.md to match the ecosystem convention. Bump to 0.27.4-beta. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Core.to_out_of_placeallocated a hard-codedFloat64output buffer, so functors it produces (e.g. constraint-by-label functors in CTModels) threwMethodError: Float64(::Dual)when differentiated through — which surfaced when differentiating a labelled path constraint through a constrained CTFlows:totalHamiltonian flow.promote_type(T, <args' eltypes>). TheTkeyword remains a floor (defaultFloat64), so plainFloat64/Intcalls are unchanged.test_function_utils.jl.Housekeeping
CHANGELOGS.md→CHANGELOG.mdandBREAKINGS.md→BREAKING.mdto match the singular naming used across the ecosystem (CTModels, CTFlows, CTSolvers). Internal links updated.Release / coordination
Part of a 3-package coordinated change. Register this beta first, then CTModels
0.15.2-beta, then CTFlows0.11.0-beta. Version bumped to0.27.4-beta. No breaking changes (purely additive widening).🤖 Generated with Claude Code