Skip to content

[fuzz] Match filtered out-of-range pop_epoch eventindices with EEGLAB - #806

Merged
arnodelorme merged 1 commit into
developfrom
agent/20261128-fix-795
Nov 28, 2026
Merged

arnodelorme merged 1 commit into
developfrom
agent/20261128-fix-795

Conversation

@claude

@claude claude Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

With a type filter and every eventindices value past the end, EEGPrep names the valid index range while pop_epoch.m reports an empty epoch range. The fuzz harness now counts that pair as the same failure. Unfiltered and mixed valid/invalid selections are still reported. Documents the order of validation and adds harness tests.

Fixes #687
Part of #795

🤖 Generated with Claude Code

@claude claude Bot left a comment

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.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @claude[bot]'s task in 54s —— View job


Code review

  • Overall assessment: Looks good. The new equivalence is narrow and matches pop_epoch.m.
  • Highest-risk area: _same_pop_epoch_filtered_eventindices in tests/fuzz/harness.py. A rule that is too broad here would hide real fuzz divergences.
  • Merge recommendation: Safe to merge.

Blocking

None.

Important

None.

Nits

  • docs/source/development.rst:967: the new sentence "valid, EEGLAB may still return epochs, so the mismatch is reported. Numeric event types compare as numbers," is joined onto one long line, which breaks the paragraph's ~78-column wrapping. You could reflow it, but it has no effect on the rendered output.

Test gaps

None. The three cases in the parametrized test (filtered and all out of range, unfiltered, and filtered with mixed valid and invalid indices) cover every branch of the new predicate through the public judge entry point.

EEGLAB parity notes

None. I checked these points:

  • In upstream pop_epoch.m, line 274 runs Ievent = sort(intersect(Ievent, Ieventtmp)), where Ieventtmp holds the indices of events that match the type. With a type filter, intersect silently drops indices past the end. Line 283 then raises empty epoch range when nothing is left. The line numbers cited in the docstring and docs are correct.
  • Without a type filter, MATLAB indexes tmpeventlatency(Ievent) directly and raises an index error. The existing _same_pop_epoch_eventindices already handles that case, so it is right that the new predicate requires params.get("types") to be truthy.
  • The regex matches the message that _normalise_eventindices raises in pop_epoch.py:344 (pop_epoch: eventindices [...] are outside 1..N.). params["eventindices"] is only read after that message has matched, so a missing key can't raise KeyError.
  • Mixed lists: in the [1, 1000000] + filter case, EEGLAB drops only the bad index, so it can still return epochs. Reporting that case as a mismatch keeps EEGPrep's strict out-of-range check visible to the harness instead of hiding it.
  • _same_failure has one caller (_judge_pair), and the new case argument is passed there.

Also checked: correctness of the predicate, the call sites of the changed signature, and AGENTS.md compliance. The docs are updated, the tests check behavior rather than implementation details, there are no mocks, and no tolerances changed. The PR changes only the test harness, so no MATLAB reference run is needed.

@arnodelorme
arnodelorme merged commit 0e64e36 into develop Nov 28, 2026
12 of 16 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.

[fuzz][exception-mismatch] exception-mismatch:ValueError/MatlabExecutionError in pop_epoch

1 participant