Skip to content

Dev#602

Merged
gviejo merged 8 commits into
mainfrom
dev
May 13, 2026
Merged

Dev#602
gviejo merged 8 commits into
mainfrom
dev

Conversation

@gviejo

@gviejo gviejo commented May 13, 2026

Copy link
Copy Markdown
Contributor

This pull request addresses several edge-case bugs and improves robustness in the jitted core functions, especially when handling empty input arrays or single-element cases. It also adds comprehensive tests to cover these cases and documents the fixes in the release notes.

Bug fixes in jitted core functions:

  • Fixed out-of-bounds memory access and crashes in jitrestrict, jitrestrict_with_count, jitin_interval, jitremove_nan, jitthreshold, and jitunion_isets when called with empty time arrays or empty epoch sets. These previously led to random crashes or segfaults with Numba JIT enabled, or IndexError with JIT disabled. Now, these functions return appropriate empty outputs. [1] [2] [3] [4] [5] [6]
  • Added missing bounds checks to prevent out-of-bounds reads in jitrestrict_with_count and jitin_interval when all epoch ends are before the first timestamp. [1] [2]
  • Fixed jitthreshold to correctly handle single-element input arrays, preventing out-of-bounds access.
  • Fixed undefined nan_cond variable in jitvaluefrom for epochs containing exactly one target timestamp and mode is before or closest, ensuring correct NaN results instead of silent errors.
  • Fixed compute_perievent (via jitvaluefrom) crash on TsGroup inputs when any event has no spikes within the requested window.

Testing improvements:

  • Added extensive edge-case tests for all affected jitted functions, covering empty arrays, empty epochs, single-element cases, and the specific bugs fixed above. [1] [2]

Documentation:

  • Updated the release notes in doc/releases.md to summarize all the bug fixes and improvements included in this patch.

@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gviejo gviejo merged commit 856ff51 into main May 13, 2026
17 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