Avoid ambiguous reverse promotion in DiffCache - #201
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Avoid ambiguous reverse promotion in DiffCache#201ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.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.
Ignore until reviewed by @ChrisRackauckas.
What changed
get_tmpnow asks the requested element type's publicBase.promote_rulefirst. When that type has no rule, it falls back to the existing symmetricpromote_typecheck. This preserves the primal buffer selection for ordinary inputs while avoiding an ambiguous reverse promotion rule forBigFloatandSparseConnectivityTracer.Dual.The regression test covers both
DiffCacheandFixedSizeDiffCachethrough SparseConnectivityTracer's publicjacobian_eltypeAPI. No SparseConnectivityTracer dependency or internal API is added.Root cause
PreallocationTools v1.5.0 moved sparse-tracer handling into the generic cache path.
promote_type(BigFloat, SparseConnectivityTracer.Dual{BigFloat, ...})asks both promotion directions; its reverse query is ambiguous between Base'sBigFloatrule and SparseConnectivityTracer'sDualrule.The boundary bisects to a032da6 (the merge of #198). PreallocationTools v1.4.1 passes the standalone control; v1.5.0 fails.
Failing before
The unmodified BoundaryValueDiffEq master
Miscgroup reproduces the downstream failure with PreallocationTools v1.5.0 and SparseConnectivityTracer v1.2.2:Passing after
The full Core group also passed Developer Interface (16/16), DiffCache Dispatch (82 pass, 10 existing broken), ODE (7/7), Resizing (64/64), Nested Duals (4/4), Sparsity Support (4/4), LazyBufferCache (2/2), GeneralLazyBufferCache (11/11), and Zero/Copy/Fill Dispatches (66/66).
The same full downstream group passes with the branch developed into BoundaryValueDiffEq:
Initial Guess (6/6), Scalar BVP (4/4), Default Solvers (2/2), Public API Package Splits (12/12), and the zero-assertion Type Stability run also completed successfully.
Other checks
Runic, typos, and
git diff --checkexit successfully with no output.Documentation was not built because this changes no public API, docstring, or documentation. GPU-specific paths were not run. The BoundaryValueDiffEq
Miscgroup is the downstream integration coverage.CI context