You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evidence points to the known EEGLAB zero-width calibration fit, now reached after automatic reference selection. This wrapper defaults to BurstCriterionRefTolerances=[-inf,5.5]; the saved two-channel case retains 124 samples at indices 1:87, 390:392, and 825:858 (1-based), giving three 64-sample calibration windows. EEGLAB's fit then includes m=0 and indexes X(m,:), while clean_artifacts catches the error and returns the input; comparing Python's actual output with the unchanged input exactly reproduces max abs 75.94912439477761, max rel 74.75205289909022, and index 703.
harness.py:1370: current classifier only covers reference selection off.
Proposed Fix
Extend oracle-defect triage using the selected reference length and captured exception stack, preserving numerical checks and metadata checks. Do not enlarge tolerances or make EEGPrep return uncleaned data to imitate a caught oracle failure. Verdict is provisional pending MATLAB intermediates on jamming, which is currently unreachable; the reference mask and output metrics above were measured in Python, and the MATLAB path is source-based evidence.
MATLAB and Python select bit-identical reference data: 124 samples at 1:87, 390:392, 825:858 (1-based). MATLAB forms three RMS windows, then fails at asr_calibrate>fit_eeg_distribution:395, where m=0 indexes X(m,:); the wrapper catches the error and returns data bit-identical to its input. The captured output reproduces the reported maximum error 75.94912439477761 exactly.
Verdict is now confirmed: EEGLAB defect, missed by the harness's reference-selection-off classifier. Preserve EEGPrep's behavior and tolerances; classify this using the selected reference and captured failure. Failing fit, caught failure.
End-to-end max abs 74.79348223853694, max rel 2048.468151541101, at finite index 8042.
Repro:
uv run python -m tests.fuzz reproduce /mnt/v1/arno/suraj3/pr640/fuzz-out-wide/repros/pop_clean_rawdata-numeric-data.json
The repro JSON is on jamming at that path. Replaying the saved case on the same machine reproduced the same numbers.
The same bids preset on a start=0, length=1024 crop of all 32 channels matched (max abs 3.45e-12), so the failure is crop-dependent.
A staged rerun of the start=1202 case under flock, calling clean_flatlines, then clean_drifts (highpass 0.25/0.75), then clean_channels, then clean_asr, found:
clean_flatlines matched exactly (max abs 0, both 32 by 1024).
highpass was the first numeric difference, but only max abs 1.8474111129762605e-13 and max rel 4.0370608813542764e-11, with identical shapes. That residual is far smaller than 74.8.
clean_channels then agreed on the channel drop (both 30 by 1024) and kept that same 1.85e-13 residual.
A direct clean_asr call (cutoff 5, ref_maxbadchannels 0.075, ref_tolerances (-inf, 5.5)) succeeded in Python and failed in MATLAB at asr_calibrate>fit_eeg_distribution (line 395) with "Index in position 1 is invalid. Array indices must be positive integers or logical values." That is the same stack as this issue.
Unverified hypothesis: the 74.8 end-to-end error is Python's repaired ASR output compared with MATLAB clean_artifacts catching that calibration failure and leaving the pre-ASR (post-channel) data, as already confirmed here for an ASR-only call. The 1.85e-13 highpass residual is a separate float64 filter difference and does not explain the 74.8.
I am commenting here instead of filing a new issue because the large error and the MATLAB stack match this report.
Activity
suraj-ranganath commentedon Nov 11, 2026
🤖
Research
Evidence points to the known EEGLAB zero-width calibration fit, now reached after automatic reference selection. This wrapper defaults to
BurstCriterionRefTolerances=[-inf,5.5]; the saved two-channel case retains 124 samples at indices1:87,390:392, and825:858(1-based), giving three 64-sample calibration windows. EEGLAB's fit then includesm=0and indexesX(m,:), whileclean_artifactscatches the error and returns the input; comparing Python's actual output with the unchanged input exactly reproduces max abs75.94912439477761, max rel74.75205289909022, and index703.Proposed Fix
Extend oracle-defect triage using the selected reference length and captured exception stack, preserving numerical checks and metadata checks. Do not enlarge tolerances or make EEGPrep return uncleaned data to imitate a caught oracle failure. Verdict is provisional pending MATLAB intermediates on
jamming, which is currently unreachable; the reference mask and output metrics above were measured in Python, and the MATLAB path is source-based evidence.suraj-ranganath commentedon Nov 11, 2026
🤖 Confirmed on
jamming, MATLAB R2025b Update 7, EEGLABd0963be9, clean_rawdata85eab7d2.MATLAB and Python select bit-identical reference data: 124 samples at
1:87,390:392,825:858(1-based). MATLAB forms three RMS windows, then fails atasr_calibrate>fit_eeg_distribution:395, wherem=0indexesX(m,:); the wrapper catches the error and returns data bit-identical to its input. The captured output reproduces the reported maximum error75.94912439477761exactly.Verdict is now confirmed: EEGLAB defect, missed by the harness's reference-selection-off classifier. Preserve EEGPrep's behavior and tolerances; classify this using the selected reference and captured failure. Failing fit, caught failure.
suraj-ranganath commentedon Nov 18, 2026
A later case from the #640 validation on jamming looks like the same EEGLAB defect, reached through the bids pop_clean_rawdata preset.
The run used PR #640 at eaad381 with MATLAB R2025b Update 7. Wide survey seed 20261012, 20 examples.
Params: BurstCriterion 5.0, BurstRejection off, ChannelCriterion 0.8, ChannelCriterionMaxBadTime 0.5, Distance euclidian, FlatlineCriterion 5.0, Highpass [0.25, 0.75], LineNoiseCriterion 4.0, WindowCriterion 0.25, WindowCriterionTolerances [-inf, 7.0], entry clean_rawdata.
Spec: channels 0 through 31, start 1202, length 1024, decimate 1.
End-to-end max abs 74.79348223853694, max rel 2048.468151541101, at finite index 8042.
Repro:
The repro JSON is on jamming at that path. Replaying the saved case on the same machine reproduced the same numbers.
The same bids preset on a start=0, length=1024 crop of all 32 channels matched (max abs 3.45e-12), so the failure is crop-dependent.
A staged rerun of the start=1202 case under flock, calling clean_flatlines, then clean_drifts (highpass 0.25/0.75), then clean_channels, then clean_asr, found:
Unverified hypothesis: the 74.8 end-to-end error is Python's repaired ASR output compared with MATLAB clean_artifacts catching that calibration failure and leaving the pre-ASR (post-channel) data, as already confirmed here for an ASR-only call. The 1.85e-13 highpass residual is a separate float64 filter difference and does not explain the 74.8.
I am commenting here instead of filing a new issue because the large error and the MATLAB stack match this report.