Skip to content

Events: merge new executions into the queue in time order (v0.9.6) - #11

Merged
jcschaff merged 1 commit into
masterfrom
fix/event-queue-order
Oct 1, 2026
Merged

jcschaff merged 1 commit into
masterfrom
fix/event-queue-order

Conversation

@jcschaff

@jcschaff jcschaff commented Oct 1, 2026

Copy link
Copy Markdown
Member

VCell's SBML test-suite regression failed on 10 delayed-event models with vcell-ode 0.9.5:

SOLVER_ABORTED: missed Event 'event1' with trigger (__D_B_0 == 1), scheduled time = 0.52, current time = 1.70

Cause

  • testEventTriggers sorted the newly triggered executions and appended them to eventExeList (splice(end, …)).
  • executeEvents only looks at the front of that list. An event triggered with a short delay, due before one already waiting, therefore sat behind it. When it finally reached the front it was overdue, and the run threw "missed Event".
  • The legacy solver (vcell-solvers) inserted each execution at its sorted position. The 2026-05 refactor lost that.

Fix

  • stable_sort the new executions, then merge them into the list.
  • Equal times keep the legacy order: executions already waiting come first, then the new ones in event order.

Test

New tests/reference/cvode_delayed_events, added to every reference loop (archives, image, SIF):

  • event late triggers at t=0.1 with delay 1.0;
  • event early triggers at t=0.2 with delay 0.3.

0.9.5 aborts: missed Event 'early' … scheduled time = 0.5, current time = 1.1. The reference output is the legacy v0.0.44-dev4 binary's: early at 0.5, late at 1.1.

Version bumped to 0.9.6.

🤖 Generated with Claude Code

testEventTriggers sorted the newly triggered executions and appended them
to eventExeList. executeEvents only looks at the front, so an event
triggered with a short delay, due before one already waiting, was found
overdue later and the run aborted with "missed Event". The legacy solver
inserted each one at its sorted position; this merges them (stable, so
equal times keep the legacy order).

Found by VCell's SBML test-suite regression (10 delayed-event cases).
tests/reference/cvode_delayed_events reproduces it: 0.9.5 aborts with
'missed Event early ... scheduled time = 0.5, current time = 1.1'; the
reference is the legacy v0.0.44-dev4 output (early at 0.5, late at 1.1).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jcschaff
jcschaff merged commit 3d28941 into master Oct 1, 2026
19 checks passed
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