Skip to content

fix(core): AD-friendly to_out_of_place buffers + harmonise changelog filenames#486

Merged
ocots merged 1 commit into
mainfrom
feat/to-out-of-place-ad-buffer
Jul 10, 2026
Merged

fix(core): AD-friendly to_out_of_place buffers + harmonise changelog filenames#486
ocots merged 1 commit into
mainfrom
feat/to-out-of-place-ad-buffer

Conversation

@ocots

@ocots ocots commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

Core.to_out_of_place allocated a hard-coded Float64 output buffer, so functors it produces (e.g. constraint-by-label functors in CTModels) threw MethodError: Float64(::Dual) when differentiated through — which surfaced when differentiating a labelled path constraint through a constrained CTFlows :total Hamiltonian flow.

  • The buffer element type now widens from the call arguments: promote_type(T, <args' eltypes>). The T keyword remains a floor (default Float64), so plain Float64/Int calls are unchanged.
  • Added a ForwardDiff regression test in test_function_utils.jl.

Housekeeping

  • Renamed CHANGELOGS.mdCHANGELOG.md and BREAKINGS.mdBREAKING.md to 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 CTFlows 0.11.0-beta. Version bumped to 0.27.4-beta. No breaking changes (purely additive widening).

🤖 Generated with Claude Code

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>
@ocots
ocots merged commit 30a4339 into main Jul 10, 2026
6 checks passed
@ocots
ocots deleted the feat/to-out-of-place-ad-buffer branch July 10, 2026 11:37
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