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
{{ message }}
Repository navigation
pop_clean_rawdata: Riemannian ASR emits a matrix warning on the macOS sample test #855
🤖 On the original develop data and ASR sources, tests/test_sample_data_pop_functions.py::test_pop_clean_rawdata_riemannian_asr_runs_on_sample_data_without_warning_noise raises a NumPy RuntimeWarning on macOS arm64 (divide by zero encountered in matmul, asr_process_r.py:127). The exact same test passes on jamming Linux. This was reproduced during the native reader checks and is independent of the changes to the File menu. Compare the reconstructed signals and the platform’s numerical library before changing a tolerance or suppressing the warning. See also the earlier ASR reconstruction change #832.
Earlier issue: #443, clean_rawdata: support full Riemannian ASR (currently refused)
CI green (running). EEGLAB reference run needed before merge; macOS arm64 confirmation from a human would help.
Research
asr_process_r.py:127 computes filtered @ filtered.T with a raw matmul; it is the only raw @ left in the Riemannian ASR data path. Every other clean_rawdata product goes through finite_matmul, which keeps NumPy's RuntimeWarning only when an input or the result is non-finite. NumPy 2 on macOS arm64 uses Apple Accelerate BLAS, which sets FP exception flags on finite GEMM results, so NumPy reports a spurious "divide by zero encountered in matmul"; Linux OpenBLAS does not. The reconstruction is unaffected: the same test asserts np.isfinite(cleaned["data"]).all(), and a genuine non-finite product would still warn.
Relevant code
src/eegprep/plugins/clean_rawdata/asr_process_r.py#L127 - raw covariance matmul
tests/test_sample_data_pop_functions.py#L363-L384 - existing regression test (fails on macOS)
Proposed Fix
pop_clean_rawdata → clean_asr → asr_process_r → filtered @ filtered.T emits the warning. Fix: sample_covariance = finite_matmul(filtered, filtered.T) / samples. No tolerance change. No new test: the existing test is the regression test, and the warning only shows up with Accelerate, which Linux CI does not use.
Activity
claude commentedon Nov 29, 2026
🤖 Plan:
agent/20261129-fix-855, route the covariance product throughfinite_matmulResearch
asr_process_r.py:127computesfiltered @ filtered.Twith a raw matmul; it is the only raw@left in the Riemannian ASR data path. Every other clean_rawdata product goes throughfinite_matmul, which keeps NumPy's RuntimeWarning only when an input or the result is non-finite. NumPy 2 on macOS arm64 uses Apple Accelerate BLAS, which sets FP exception flags on finite GEMM results, so NumPy reports a spurious "divide by zero encountered in matmul"; Linux OpenBLAS does not. The reconstruction is unaffected: the same test assertsnp.isfinite(cleaned["data"]).all(), and a genuine non-finite product would still warn.Relevant code
src/eegprep/plugins/clean_rawdata/asr_process_r.py#L127- raw covariance matmulsrc/eegprep/functions/miscfunc/misc.py#L42-L51-finite_matmultests/test_sample_data_pop_functions.py#L363-L384- existing regression test (fails on macOS)Proposed Fix
pop_clean_rawdata→clean_asr→asr_process_r→filtered @ filtered.Temits the warning. Fix:sample_covariance = finite_matmul(filtered, filtered.T) / samples. No tolerance change. No new test: the existing test is the regression test, and the warning only shows up with Accelerate, which Linux CI does not use.[clean_rawdata] Use finite_matmul for the Riemannian ASR chunk covari…