Skip to content

fix!: make strict preparation the default#799

Merged
gdalle merged 5 commits intomainfrom
gd/strictdefault
May 12, 2025
Merged

fix!: make strict preparation the default#799
gdalle merged 5 commits intomainfrom
gd/strictdefault

Conversation

@gdalle
Copy link
Copy Markdown
Member

@gdalle gdalle commented May 12, 2025

Warning

Breaking change for DifferentiationInterface

This PR makes strict=Val(true) the default setting in preparation functions DI.prepare_something. From now on, when the signature at execution differs from the signature at preparation (e.g. a gradient prepared on Vector{Float64} and executed on Vector{Float32}), an informative error will be thrown. Indeed, only the case where the types match is actually supported.

Tip

If this change causes your code to error, a temporary fix is to manually set strict=Val(false) in every call to DI.prepare_something. The right fix however is to figure out why types differ, and resolve that.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2025

Codecov Report

Attention: Patch coverage is 81.25000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 97.93%. Comparing base (4f0e496) to head (36f5a4a).

Files with missing lines Patch % Lines
...tiationInterfaceTest/src/tests/correctness_eval.jl 81.25% 12 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #799   +/-   ##
=======================================
  Coverage   97.93%   97.93%           
=======================================
  Files         128      128           
  Lines        7693     7693           
=======================================
  Hits         7534     7534           
  Misses        159      159           
Flag Coverage Δ
DI 98.81% <ø> (ø)
DIT 95.61% <81.25%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gdalle gdalle marked this pull request as ready for review May 12, 2025 11:31
@gdalle gdalle added the skipci Don't run CI tests and docs label May 12, 2025
@gdalle gdalle merged commit ef77d13 into main May 12, 2025
4 checks passed
@gdalle gdalle deleted the gd/strictdefault branch May 12, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skipci Don't run CI tests and docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant