Avoid ambiguous reverse promotion in DiffCache - #201
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
Current-master revalidation update (upstream
Current-master |
|
A fresh SciMLBase integration run on current dependency heads reproduces this exact downstream failure twice in This matches the current-master standalone reproduction and is additional evidence that the focused promotion fix in this PR is still needed. CI job: https://github.com/SciML/SciMLBase.jl/actions/runs/32365988822/job/96415493078 |
|
Fresh full-source NonlinearSolve integration CI reproduces the same ambiguity through BoundaryValueDiffEq BigFloat tests: 3 passed / 2 errored, both at |
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