Repository navigation
Migrate community callback test off removed VectorContinuousCallback 4-arg form - #3943
Merged
ChrisRackauckas merged 2 commits intoAug 3, 2026
Conversation
…4-arg form SciMLBase v3.10.0 (SciML/SciMLBase.jl@ba118add) intentionally removed the 4-positional-arg VectorContinuousCallback(condition, affect!, affect_neg!, len) constructor: affect_neg! was a silent footgun since DiffEqBase v7's apply_callback! for VectorContinuousCallback never calls it (SciML#3613). The Downstream2 community_callback_tests.jl still used the removed form, so the group fails with a MethodError once the downstream env resolves SciMLBase >= 3.10 (3.36.0 today). Use the supported 3-arg form and update the expected termination time from 3pi/2 to pi/2: affect! now fires on every crossing of u[3] = cos(t), while the old affect_neg! = nothing suppressed the downcrossing at pi/2 during event detection. The point of this SciML#1528 regression test -- callback handling must not error when a condition element is constantly zero -- is preserved. Co-Authored-By: Claude Fable 5 <[email protected]> Co-Authored-By: Chris Rackauckas <[email protected]>
Member
Author
|
Local verification (Julia 1.12, SciMLBase 3.36.0, monorepo libs dev'd at this branch): Before: confirming After this PR, the full previously-failing file passes: |
3 of 4 tasks
ChrisRackauckas
marked this pull request as ready for review
August 3, 2026 10:11
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.
Note
This PR should be ignored until reviewed by @ChrisRackauckas.
Problem
lib/DiffEqBase's[Downstream2]test group fails on master intest/downstream/community_callback_tests.jl:Root cause
The test still used the SciMLBase v2 4-positional-arg form
VectorContinuousCallback(condition, affect!, affect_neg!, len). SciMLBase intentionally removed that form (and theaffect_neg!keyword) in v3.10.0 — commit SciML/SciMLBase.jl@ba118ad ("Removeaffect_neg!fromVectorContinuousCallbackconstructor") — becauseVectorContinuousCallbacknever honoredaffect_neg!: itsapply_callback!dispatch always invokesaffect!(integrator, event_idx)and ignored the field, so accepting it was a silent footgun (see #3613). The current SciMLBase docstring states "VectorContinuousCallbackintentionally does not have anaffect_neg!callback."The downstream env only recently started resolving a SciMLBase new enough to drop the method (3.36.0 today), which is why this surfaced now (registry drift, first seen on #3692's CI, reproduces on unmodified master).
Fix
Update the test to the supported 3-arg form
VectorContinuousCallback(cond!, terminate_affect!, 1), and update the expected termination time from3pi/2topi/2:affect_neg! = nothingmade event detection skip downcrossings, so the conditionu[3] = cos(t)first triggered at the upcrossing3pi/2.affect!fires on every crossing (the struct'saffect_neg!field is alwaysaffect!and DiffEqBase v7'sapply_callback!forVectorContinuousCallbacknever callsaffect_neg!), so the solve terminates at the first zero ofcos(t), i.e.pi/2. Observed locally:soln.t[end] = 1.5707927986with the sameatol = 1e-4as before.The point of this #1528 regression test — callback handling must not error when one condition element is constantly zero — is preserved; only the API form and the crossing-direction expectation change, matching the documented upstream behavior.
Verified locally:
lib/DiffEqBase/test/downstream/community_callback_tests.jlpasses with SciMLBase 3.36.0 (output in the PR conversation).This resolves the red
lib/DiffEqBase [Downstream2]lane seen on #3692 (which merely surfaced the pre-existing master failure).🤖 Generated with Claude Code