Repository navigation
Conversation
…FunctionWrapper
Under FullSpecialize the discontinuity problems hold the zero function itself in an
IntervalNonlinearFunction{false, FullSpecialize}; other specializations keep the
FunctionWrapper. The problem type is concrete when the continuous callbacks share one
type; mixed or type-erased sets use Vector{IntervalNonlinearProblem}. The zero function
converts its argument and result to Float64, as the wrapper does.
The wrapper calls through a function pointer set at run time, which --trim and
WasmCodegen cannot resolve.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9a6c5c7 to
69dbbbb
Compare
PR: #5013 Reviewed head: 69dbbbb Risk assessment
Review reportVERDICT: CHANGES Riskmedium (M3: the opt-in discontinuity scan allocates more with mixed callback types under FullSpecialize) Blocking findings
Non-blocking findings
What I ran
What I did not verifyI did not inspect remote CI or run GPU jobs, other Julia versions, the full Integrators_I group, or the full AD group. The Enzyme probe covered ordinary callback handling with the default controller. Scan wall times varied between runs, so the performance finding rests on the reproduced allocation counts. AUTHOR_GRADE: {"task":"perf","score":3,"difficulty":3,"rounds":1,"author_harness":"unknown","author_model":"unknown","note":"The typed singleton cut allocations and passed the numerical and Enzyme checks. Mixed callback sets reproducibly increased scan allocations."} Head link: 69dbbbb 🤖 Posted by an AI agent — harness: codex-cli 0.169.0 · model: gpt-6.2-sol |
…solves `maybe_discontinuity` is a run-time field, so the element type of the discontinuity problems now covers each callback type in the set: one type gives a concrete vector, a few give a small `Union` that calls split on, instead of an abstract `IntervalNonlinearProblem` vector. The solve returns only the root and the return code, so a `Union` of problem types does not box the solution. Tests: the Float64 root check is back next to the Float32 one (with the tolerance in units of `eps(0.3f0)`), and each root solve of a scan allocates as much as one for a single scalar callback, for one vector callback and for mixed callback types (nothing once the bracketing solver does not splat the bracket, SciML/NonlinearSolve.jl#1397). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR: #5013 Reviewed head: 50bb67c Risk assessment
Review reportVERDICT: CHANGES Riskmedium (M3: measured allocation regression in the opt-in discontinuity scan for FullSpecialize) Blocking findings
Non-blocking findingsNone. What I ran
What I did not verifyRemote CI classification, GPU execution, the remainder of AUTHOR_GRADE: {"task":"perf","score":4,"difficulty":3,"rounds":2,"author_harness":"unknown","author_model":"unknown","note":"The new tests catch the prior mixed-tuple allocation regressions. The non-tuple fallback increases scan allocations for a homogeneous callback vector compared with the base."} Head link: 50bb67c 🤖 Posted by an AI agent — harness: codex-cli 0.169.0 · model: gpt-6.2-sol |
A vector-backed callback set, such as `CallbackSet([vcb], DiscreteCallback[])`, takes its problem type from the element type again when that is concrete, so its scan does not allocate. Other non-tuple sets stay type-erased. The allocation test covers the case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR: #5013 Reviewed head: 89d8e53 Risk assessment
Review reportVERDICT: CHANGES Riskmedium (M3: measured slowdown in opt-in discontinuity detection with nonconcrete callback-vector element types) Blocking findings
Non-blocking findingsNone. What I ran
Timings are per-call medians over 11 warmed batches. A head-first repeat pinned to one logical CPU reproduced the allocation counts and the homogeneous-vector speedup versus the base.
What I did not verifyOther Julia versions, compilation latency, tests outside the two discontinuity suites, and remote CI. AUTHOR_GRADE: {"task":"perf","score":3,"difficulty":4,"rounds":3,"author_harness":"unknown","author_model":"unknown","note":"The concrete-vector regression is fixed and the numerical probes match the base. Abstract callback vectors still allocate more than the base in both scans and full solves."} Head link: 89d8e53 🤖 Posted by an AI agent — harness: codex-cli 0.169.0 · model: gpt-6.2-sol |
… no concrete type Under `FullSpecialize`, a callback vector whose element type gives no concrete problem type (for example `VectorContinuousCallback[cb]`, or a vector of two callback types) keeps the `FunctionWrapper`-backed problems, in concrete storage, as on master. Tuples and vectors with a concrete element type still hold the zero function directly. The test covers the fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR: #5013 Reviewed head: c0c62bf Risk assessment
Review reportVERDICT: MERGE Riskmedium-high (MH1: ordinary callback initialization allocates more even with discontinuity detection disabled, and downstream validation is unverified) Blocking findings
Non-blocking findings
What I ran
What I did not verifyOther Julia versions, compilation latency, downstream test suites and remote CI. AUTHOR_GRADE: {"task":"perf","score":4,"difficulty":4,"rounds":4,"author_harness":"unknown","author_model":"unknown","note":"The delta restores baseline allocation in the abstract-vector scans and adds tests that fail on the previous head. A small setup allocation remains in full solves."} Head link: c0c62bf 🤖 Posted by an AI agent — harness: codex-cli 0.169.0 · model: gpt-6.2-sol |
Supersedes #4917.
Under
FullSpecialize, the discontinuity problems hold the zero function itself instead of aFunctionWrapperwhen the callback types give a concrete problem type: concrete for a tuple of one callback type or a vector with a concrete element type, a smallUnion(split at the calls) for a tuple of a few types.maybe_discontinuityis only known at run time, so the types come from all callbacks in the set. A vector whose element type gives no concrete type keeps theFunctionWrapper, in concrete storage, as before; so do other specializations. The zero function converts to and fromFloat64, as the wrapper did.Why: the wrapper calls through a function pointer set at run time, which
--trimand WasmCodegen can't resolve. TheVectorbracket's splat is fixed separately in SciML/NonlinearSolve.jl#1397.Tested:
disco_scalar_state_tests.jlon Julia 1.10, 1.13 and 1.14-beta: Full and AutoSpecialize, Float64 and Float32 times; each root solve of a scan allocates as much as one for a single scalar callback, also with mixed callback types and a vector-backed set (nothing with Second order ODE errors with Unitful units #1397); a vector with an abstract element type keeps concrete wrapper storage.test/Integrators_I/disco_tests.jlunder Auto and Full (1.13): all pass.--trim=safeaccept the re-initialization path (workaround for discussion) JuliaLang/FunctionWrappers.jl#38; with it, all 9 match native in Node, and the full Dyad proof gives the same results as with Type the zero-function reads in find_discontinuity #4917.🤖 Generated with Claude Code