Skip to content

Bump Functors compat to 0.5 and fix Zygote 0.7 compatibility#125

Merged
ChrisRackauckas merged 1 commit intoSciML:mainfrom
ChrisRackauckas-Claude:compat-functors-0.5
Feb 20, 2026
Merged

Bump Functors compat to 0.5 and fix Zygote 0.7 compatibility#125
ChrisRackauckas merged 1 commit intoSciML:mainfrom
ChrisRackauckas-Claude:compat-functors-0.5

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

Summary

  • Bumps Functors compat from "0.4.11" to "0.4.11, 0.5" — the only dependency requiring a major compat bump
  • Fixes DeepBSDE solver to avoid tuple construction in gradient-traced code paths, which breaks with Zygote 0.7 (resolved alongside Functors 0.5). Zygote 0.7 returns ChainRulesCore.Tangent instead of plain tuples, causing gradtuple1 errors
  • Updates NNStopping to use bare @functor (from Functors.jl) instead of the deprecated Flux.@functor

Changes

  • Project.toml: Functors = "0.4.11"Functors = "0.4.11, 0.5"
  • src/DeepBSDE.jl: neural_sde now returns full column vectors instead of (X, u) tuples; loss_n_sde uses array indexing instead of tuple destructuring
  • src/NNStopping.jl: Flux.@functor NNStoppingModelArray@functor NNStoppingModelArray

Test plan

  • Ran full test suite on Julia 1.11.9 with Functors 0.5.2, Flux 0.16.9, Zygote 0.7.10
  • 219/220 tests passed — the single failure is in NNStopping (stochastic convergence: 0.833 < 0.7 threshold), which is a pre-existing flaky test unrelated to these changes
  • All 6 DeepBSDE tests passed
  • All DeepSplitting, MLP, MCSample, NNKolmogorov, NNParamKolmogorov tests passed

🤖 Generated with Claude Code

Adding Functors 0.5 allows the resolver to pick Zygote 0.7 + Flux 0.16,
which changes gradient backward passes to return ChainRulesCore.Tangent
instead of plain tuples. This fixes the DeepBSDE solver to use array-based
returns instead of tuple construction in the gradient-traced code path,
and updates NNStopping to use bare @functor (from Functors.jl) instead
of the deprecated Flux.@functor.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas ChrisRackauckas merged commit f172791 into SciML:main Feb 20, 2026
3 checks passed
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