Repository navigation
Revert the float64 average reference of #606 to restore EEGLAB parity - #833
arnodelorme wants to merge 3 commits into
Conversation
Average reference of float32 data is computed again as EEGLAB's single-precision matrix product, in the column-major order of the transpose fix of #232. The float64 sum of #606 moved the result up to 0.15625 uV away from EEGLAB on ds003061 and changed the number of samples clean_artifacts keeps for every subject of sccn/eegprep_parity_test. The Picard tolerance changes of #606 and the current fuzz-harness test are kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
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.
|
Review of this pull request, asked by Arno on November 28, 2026. It had only the skip notice of the automated review.
What I checked in the diff
Both sides in double precision: measured on the 13 recordings of sccn/eegprep_parity_testMATLAB R2025b with
So EEGLAB and EEGPrep stay as close to each other as today for the 12 subjects of the table, but every sample count of the table changes. Steps 4 to 7 were not run. — orchestrator |
|
Closed without merging. Arno chose double precision on both sides (November 28, 2026): EEGLAB's reref.m now averages in double precision like EEGPrep since #606 (sccn/eeglab#998), and the parity test's reference table is regenerated. — orchestrator |
This reverts the average reference change of #606 ("Sum average reference in float64 before casting to the input dtype", merged November 18, 2026), because changing Python alone broke numerical parity with EEGLAB.
float32average reference again computes EEGLAB's single-precision product in the transposed order(block @ refmatrix).Tof Match MATLAB column-major average reference (float32 parity) #232 required bysccn/eegprep_parity_test(docs/PROVENANCE.md).arm64Python (NumPy with Apple Accelerate) against MATLAB R2025b (maca64),pop_rerefdiffers from EEGLAB by0µV (0 differing values across all 160 million samples of all 13ds003061recordings, invariant to thread count), compared with0.156µV under Sum average reference in float64 before casting to the input dtype #606. An earlier draft of this description reported0.002to0.031µV on this Mac because that check ran inside anx86_64Rosetta Python environment, which invoked thex86_64SSE4.2 slice of Accelerate againstarm64MATLAB.arm64Python against MATLAB R2025b (clean_rawdataAdd EEGLAB-style cart2topo, pop_reref, and pop_interp parity workflows #52), all 13 of 13 recordings (sub-001throughsub-013) match EEGLAB's exact channel count and kept sample count, reproducing every size of the certifiede8b11d5parity table (max_abs1.9e-6to1.4e-5µV, RMS~2e-7µV). Under Sum average reference in float64 before casting to the input dtype #606, 0 of the 12 table subjects kept the same sample count as EEGLAB.tests/test_ds003061_stage_parity.pyand the current fuzz-harness test (159passed,9MATLAB tests skipped).ds003061have DC offsets around259,350µV (1float32ULP is0.015625µV), so single-precisionsgemmdiffers across mismatched CPU/BLAS families (for examplex86_64OpenBLAS versus Intel MKL on Linux). Makingpop_rerefbit-identical across every BLAS family would require changing both EEGLABreref.mand EEGPrepreref.pytogether to subtract the mean infloat64before casting once tofloat32.End-to-end step 3 (ASR) comparison on all 13 recordings
MATLAB R2025b (
maca64) with EEGLAB andclean_rawdata(#52) versusdevelop(with #606) and this branch (with #832) in nativearm64Python (NumPy 2.3.5, Apple Accelerate):develop(with #606)arm64Python)Step 2 BLAS and architecture comparison against MATLAB R2025b
sub-001sub-002sub-012arm64Accelerate orarm64OpenBLAS 0.3.34,(block @ refmatrix).T(1 or 8 threads)x86_64Accelerate,(block @ refmatrix).Tx86_64Accelerate,refmatrix @ datafloat64mean cast tofloat32(#606) against single-precision EEGLAB