Skip to content

Fix VR_FRM initialize: use u_modified!(true) #558

Merged
isaacsas merged 2 commits intoSciML:masterfrom
isaacsas:vrm_init_fix
Feb 24, 2026
Merged

Fix VR_FRM initialize: use u_modified!(true) #558
isaacsas merged 2 commits intoSciML:masterfrom
isaacsas:vrm_init_fix

Conversation

@isaacsas
Copy link
Copy Markdown
Member

The VR_FRM callback initialization sets jump_u = -randexp(), which modifies part of the ODE state vector. Previously this used u_modified!(false) with manual uprev sync as a workaround for a spurious save at t=0. The correct fix is u_modified!(true) and updating tests to handle the initialization save point.

  • Remove manual uprev.jump_u sync (OrdinaryDiffEqCore handles it)
  • Update first_jump_time helpers to use findfirst(>) for robustness
  • Add missing using Test to thread_safety.jl

isaacsas and others added 2 commits February 24, 2026 08:15
…rator

The VR_FRM callback initialization sets jump_u = -randexp(), which
modifies part of the ODE state vector. Previously this used
u_modified!(false) with manual uprev sync as a workaround for a
spurious save at t=0. The correct fix is u_modified!(true) and
updating tests to handle the initialization save point.

- Remove manual uprev.jump_u sync (OrdinaryDiffEqCore handles it)
- Update first_jump_time helpers to use findfirst(>) for robustness
- Add missing `using Test` to thread_safety.jl

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The u_modified!(true) change causes an extra save at t=0, so skip all
t=0 entries when checking post-jump values instead of hardcoding u[3:end].

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@isaacsas isaacsas merged commit ea26bc5 into SciML:master Feb 24, 2026
11 checks passed
@isaacsas isaacsas deleted the vrm_init_fix branch February 24, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant