Skip to content

Add tests for execution ordering and cancellation invariants for EventList#3353

Merged
quaquel merged 9 commits intomesa:mainfrom
souro26:test-eventlist-invariants
Feb 23, 2026
Merged

Add tests for execution ordering and cancellation invariants for EventList#3353
quaquel merged 9 commits intomesa:mainfrom
souro26:test-eventlist-invariants

Conversation

@souro26
Copy link
Copy Markdown
Contributor

@souro26 souro26 commented Feb 20, 2026

This PR adds explicit tests covering EventList execution semantics:

  • FIFO ordering for events with identical timestamp and priority
  • Execution of events scheduled at the same timestamp during execution
  • Skipping of canceled events during popping/execution

These tests document and protect behavior already relied upon by the event engine

@github-actions
Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +3.4% [+2.9%, +3.9%] 🔵 -0.4% [-0.6%, -0.2%]
BoltzmannWealth large 🔵 +1.5% [+1.3%, +1.8%] 🔵 +0.1% [-0.1%, +0.4%]
Schelling small 🔵 +2.0% [+1.8%, +2.2%] 🔵 -0.8% [-0.9%, -0.7%]
Schelling large 🔵 +0.2% [-0.7%, +1.2%] 🔵 +1.3% [-0.5%, +3.2%]
WolfSheep small 🔵 +2.2% [+1.7%, +2.6%] 🔵 +1.4% [+1.2%, +1.7%]
WolfSheep large 🔵 +3.2% [+2.3%, +4.3%] 🔴 +4.2% [+3.2%, +5.3%]
BoidFlockers small 🔵 -2.1% [-2.5%, -1.8%] 🔵 -0.4% [-0.5%, -0.2%]
BoidFlockers large 🔵 -1.5% [-1.9%, -1.0%] 🔵 -0.3% [-0.6%, -0.0%]



def test_eventlist_fifo_same_time_same_priority_execution():
"""Events with identical time and priority execute in insertion order."""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not true, they execute on event id order

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change the function name and docstring to reflect that, thanks.

@souro26 souro26 force-pushed the test-eventlist-invariants branch from 8c031b0 to 6d2f408 Compare February 22, 2026 12:34
@quaquel quaquel merged commit 379069e into mesa:main Feb 23, 2026
14 checks passed
@quaquel quaquel added the testing Release notes label label Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants