Skip to content

Epic: make EEGPrep browser-ready with Pyodide and ONNX ICLabel - #386

Merged
neuromechanist merged 183 commits into
developfrom
epic/324-pyodide-browser
Nov 17, 2026
Merged

neuromechanist merged 183 commits into
developfrom
epic/324-pyodide-browser

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Make EEGPrep run in the browser through Pyodide. ICLabel now classifies with ONNX Runtime instead of PyTorch, with awaitable entry points for the browser. The package ships the full-precision network for native runs and an 8-bit copy for the browser.

Breaking: ICLabel needs the iclabel extra (pip install "eegprep[iclabel]", ONNX Runtime 1.20 or newer); eegprep[torch] is now only for rebuilding the packaged networks.

Part of #324

scipy 1.15.3's _spropack extension fails to dlopen on Darwin 27
("zero-fill section type, but offset field is not zero"), which breaks
scipy.io and therefore every import that reaches it, including picard
and the ICLabel network loader. 1.16.3 ships fixed wheels and stays
inside the existing <1.17 constraint, so no constraint change is needed.

Tested: scipy.io and picard import cleanly after uv sync --group dev.
oct2py drags in octave-kernel/ipykernel/pyzmq/debugpy/tornado, and psutil
has no WebAssembly build; both now live behind new [eeglab] and [sys]
extras instead of [project].dependencies, and both are included in [all].

pyedflib has zero imports under src/; nothing but a test fixture writer
in tests/test_bids_load_frombids_helpers.py needs it, so it moves to the
dev dependency group instead of becoming an unused extra. Not tested
beyond `uv lock`/`uv sync` succeeding; behavior verified by later commits.
max_mem=None previously called psutil.virtual_memory() twice (once for
the initial default, once as a retry when the block-size check failed),
which broke unhelpfully now that psutil is optional. Resolve it once, at
the top of asr_process, to a fixed DEFAULT_MAX_MEM_MB=64, matching the
maxmem=64 default already used by asr_calibrate() and clean_asr()
elsewhere in this plugin. The now-pointless retry (re-fetching the same
value again) is removed in favor of failing fast.

Updated test_utils_asr.py: dropped the psutil mocks in
test_memory_management/test_memory_error_handling since asr_process no
longer imports psutil, and added
test_default_max_mem_works_without_psutil, which blocks the real psutil
import via sys.modules to prove max_mem=None does not need it. Tested
with `uv run pytest tests/test_utils_asr.py`.
get_eeglab('OCT') now catches the bare oct2py ImportError and re-raises
naming 'eegprep[eeglab]'. num_jobs_from_reservation's psutil ImportError
previously named a bare 'uv pip install psutil'; it now names
'eegprep[sys]' too. Verified manually with the real import blocked (and,
for the oct2py path, a stub EEGLAB checkout so get_eeglab reaches the
oct2py import at all): both raise the updated message.
Phase gate for #374: walks eegprep's base dependency closure in
uv.lock (evaluating dependency markers against a synthetic Pyodide/
Emscripten environment, so e.g. greenlet correctly self-excludes),
then checks each package against the official Pyodide package lock
and, failing that, for a pure-Python (abi=none, platform=any) wheel
on PyPI that micropip could install directly.

One pre-existing gap is tracked as non-blocking: docopt (pulled in via
pybids -> num2words) has no PyPI wheel at all. Fixing it would mean
changing pybids's or num2words's own dependency tree, which is out of
scope for this phase (no numerical/behavioral change, and pybids/mne/neo
are explicitly not to be touched here); flagged in the script output and
in the PR description for a maintainer decision.

Tested by running the script directly: 0 failing, 1 known gap, exit 0.
Add install.rst sections for the MATLAB/Octave parity helpers
(eeglab extra) and system-aware parallel job sizing (sys extra), and
mention them in the all-extras examples in install.rst and README.
Docs-only change, not separately tested beyond reading the rendered
text.
The iclabel extra provides onnxruntime, the new runtime backend for
ICLabel classification. torch now only needs to install onnx alongside
it, since it is used to regenerate iclabel.onnx from netICL.mat, not to
run classification. Package data ships plugins/**/*.onnx instead of
plugins/**/*.mat, and netICL.mat is explicitly excluded from the wheel
now that it is a dev-only export source rather than a runtime resource.

Not tested standalone; covered by the packaging and test suite runs in
later commits.
iclabel.onnx is a ~11 MB protobuf artifact; without this it fails the
5 MB large-file check that .mat files are already exempt from.

Tested: ./pre-commit.py passes with iclabel.onnx staged.
tools/iclabel/export_iclabel_onnx.py exports ICLabelNet (built from
netICL.mat) to ONNX at a pinned opset (17: supported by onnxruntime
since 1.14, and comfortably within the ops the network actually uses -
Conv2d/LeakyReLU/Softmax/Concat/Reshape, all available since opset 7-9).
The script verifies the export against torch on random inputs before
succeeding.

iclabel.onnx (11.1 MB) is the regenerated artifact, committed so the
package ships it in place of netICL.mat (10.3 MB).

iclabel_net_load_py_measures.py now resolves netICL.mat from the source
tree instead of importlib.resources, since it is a dev-only export
source and no longer a packaged runtime resource.

Tested: uv run python tools/iclabel/export_iclabel_onnx.py regenerates
iclabel.onnx deterministically and reports torch-vs-onnxruntime max abs
diff 1.00e-05 on random inputs (opset export self-check).
iclabel_net_onnx.py loads the packaged iclabel.onnx and runs it through
onnxruntime. iclabel.py's engine=None path now calls it instead of
building ICLabelNet from netICL.mat with torch; torch no longer appears
anywhere in the runtime classification path. Feature extraction, the
4-way augmentation, and the post-network averaging are unchanged.

The lite/beta NotImplementedError is unchanged in behavior; only the
artifact name in its message was updated.

Tested: iclabel(EEG, engine=None) on sample_data with torch fully
uninstalled (separate venv, eegprep[iclabel] only) reproduces the same
classification as before this change; see the ONNX-vs-torch test added
in a later commit for the numeric comparison.
test_iclabel.py: TestICLabelEngines.test_basic now requires onnxruntime
(what engine=None actually needs) instead of torch. Added
TestICLabelOnnxExport, which cross-checks the packaged iclabel.onnx
against the torch network it was exported from, on sample_data. Measured
max abs diff 1.43e-06 / max rel diff 2.59e-05, the same order of
magnitude as the existing Python-vs-MATLAB parity gap this file already
tolerates at rtol=1e-4/atol=1e-5 (float32 op-ordering noise between
eager torch and onnxruntime's fused CPU kernels), so the test reuses that
established tolerance rather than introducing a new one.

conftest.py: narrowed the matlab-file classification for test_iclabel.py
from the whole file to TestICLabelEngines:: only, since the new
TestICLabelOnnxExport class does not need MATLAB.

test_public_api_examples.py: packaging assertions and comments now
expect plugins/ICLabel/iclabel.onnx and the iclabel extra instead of
netICL.mat and the torch extra.

Tested: EEGPREP_SKIP_MATLAB=1 uv run pytest tests/test_iclabel.py
tests/test_public_api_examples.py -v (18 passed, 1 skipped for missing
MATLAB).
Updates every user-facing and developer-facing mention of netICL.mat
and the torch requirement for ICLabel classification: installation
guide (new ICLabel extra section), ICA/component and plugin user guide
pages, the pop_iclabel help resource, the public-API example comment,
the changelog, the final parity matrix rationale, and AGENTS.md's repo
map.

No behavior change; docs and comments only.
The release verification gate asserted netICL.mat shipped in the wheel;
it now asserts iclabel.onnx ships and netICL.mat does not.

Tested: uv build locally and confirmed the wheel contains
plugins/ICLabel/iclabel.onnx and not netICL.mat (the same check this
workflow step performs).
The extras split changes what a plain install provides and the ASR default
changes numerical output for direct asr_process(max_mem=None) callers, so
both need a user-facing note.
Phase 1: Move oct2py, psutil, and pyedflib out of the base install
Resolves three conflicts from the phase 1 extras split:

- changelog.rst and installation.rst: both phases appended to the same
  anchors, so both entries are kept. The extras example now names the
  iclabel extra rather than torch, since torch became export-only here.
- uv.lock: regenerated with uv lock against the merged pyproject.toml
  rather than hand-merged.

pyproject.toml auto-merged; the all extra is a superset of torch,
iclabel, gui, console, docs, eeglab, and sys.
Export ICLabel to ONNX and add the onnxruntime backend
* Add Pyodide harness and ICA benchmark gate

* Pin Node.js in Pyodide CI job

* Report native ICA iteration counts

* Publish native and Pyodide matmul timings

* Clarify Picard benchmark parameters

* Keep Node-specific test in Pyodide CI
* Add async ICLabel browser execution

* Fix async Pyodide parity harness

* Await Pyodide parity scripts explicitly

* Fix async GUI menu scheduling

* Use the active async event loop
* Add ICLabel quantization tests

* Freeze ICLabel evaluation provenance

* Add ICLabel int8 evaluation tooling

* Record ICLabel evaluation generation contract

* Record ICLabel artifact checksums

* Add OpenNeuro fallback for ICLabel data

* Retry ICLabel evaluation downloads

* Correct sub-015 evaluation checksum

* Freeze subject-disjoint ICLabel features

* Quantize ICLabel with frozen parity gate

* Make ICLabel gate test platform stable

* Harden ICLabel parity provenance

* Explain float32 parity boundary

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

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's extra usage balance is too low to start another review, so this review was not started.

An organization admin can add extra usage credits at claude.ai/admin-settings/usage.

Once credits are available, reopen this pull request to trigger a review.

@neuromechanist

Copy link
Copy Markdown
Member Author

🤖 Full project:pr-review-toolkit integration review completed for the epic branch across code, tests, errors, comments/docs, types, and simplification.

Findings

  • No actionable findings.

Validation

  • All six phase PRs are merged into epic/324-pyodide-browser.
  • The branch is 21 commits ahead of and 0 commits behind develop.
  • Changed-scope pre-commit, Ruff, focused ICLabel/quantization, async GUI/console, Pyodide harness, and runica matmul checks pass under the documented local constraints.
  • Phase CI is green, including the browser parity and benchmark job.

Residual risk

  • MATLAB/EEGLAB parity is an external-checkout gate and was not locally measurable in this review environment.
  • The universal all-dtypes BLAS gate remains intentionally false; the production change is limited to float64 runica products under Emscripten.

@arnodelorme This epic PR is ready for maintainer review and merge. I have not merged it into develop or main.

@claude

claude Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@neuromechanist

Copy link
Copy Markdown
Member Author

🤖 Correction after the requested independent review panel: the earlier inline “no actionable findings” assessment is superseded. Five fresh-context reviewers covering code, tests, errors, docs/types, and simplification found actionable blockers.

Findings

  • Critical: async ICLabel results are committed after await without a shared session freshness check. The console path can store a stale result after the selected dataset changes, and the GUI guard does not detect in-place edits to the same EEG object (src/eegprep/functions/adminfunc/console.py:263-269,474-532; src/eegprep/functions/guifunc/menu_actions.py:1342-1368). Add a revision/identity guard and concurrent regression coverage before merge.
  • Important: the live Build Documentation job fails in examples/plot_reject_artifacts.py because .github/workflows/docs.yml:42-44 installs torch, while runtime ICLabel requires the separate iclabel extra (onnxruntime).
  • Important: the documented ONNX export command installs only --extra torch, but the exporter imports onnxruntime; the documented clean-environment workflow is incomplete (tools/iclabel/export_iclabel_onnx.py:11-12,30-33; pyproject.toml:43-52).
  • Important/moderate follow-ups: the browser bridge caches rejected session initialization forever; the native parity test and quantization gate bypass the packaged runtime path; CI does not regenerate quantized candidates; browser parity supplies the source-tree model rather than asserting the exact wheel payload; and the quantization tooling duplicates production feature/post-processing logic.

Verification

The epic PR is not merge-ready and remains intentionally unmerged to develop/main. The Codex review dispatch gap is tracked separately in research-skills #97: neuromechanist/research-skills#97. @arnodelorme

* Fix epic review blockers

* Harden async dataset freshness

* Guard all async console entry points

* Address final epic review findings

* Harden async freshness and release gates

* Harden async freshness and release validation

* Harden async freshness and mutable data tracking
The epic branch was 45 commits behind develop and building on it meant
building on a stale base. Seven files conflicted.

pyproject.toml: took develop's Pyodide-bounded floors, but kept this
branch's extras split. Develop still carries oct2py in the base install
and taking its side wholesale would have undone phase/374.

docs.yml and release.yml: kept this branch's ICLabel jobs, took
develop's 3.12 pins. Four more 3.11 pins came in from this side without
conflicting, in the sdist smoke test and the Pyodide harness job, and
are bumped too.

storage.py: both sides added to the same class. This branch's mutation
tracking and develop's _BackingFile, _validate_backing_file and empty()
are all kept.

changelog.rst and ica_and_components.rst: both sides appended; kept
both, and develop's newer API entries.

uv.lock: regenerated rather than hand-merged.

Two bugs the merge exposed, neither findable on this branch alone:

MemmapData.__array_function__ returned NotImplemented for everything
except copyto and put. Defining that method opts the type into numpy's
dispatch protocol, where NotImplemented raises rather than falling
back, so every other numpy function failed on a MemmapData.
np.size(data) in pop_reref is one caller of many. Develop's #351 test
covers it and this branch never had that test. It now delegates to the
mapped array, unwrapping nested handles so np.concatenate([a, b]) does
not dispatch straight back into itself.

The tomli backport in check_pyodide_base_resolution.py is dead on a
3.12 floor and ty flagged its ignore directive.

Tested: 3196 passed, 277 skipped, 0 failed with MATLAB skipped. Ruff
check and format clean, ty clean with no diagnostics, pre-commit OK
over 1221 files.
Move the vendored EEGLAB gitlink from 8ac485f6 to d0963be9, the commit that EEGLAB_TESTS_EEGLAB_COMMIT and the test suite pin, so the MATLAB reference workflow can pass its commit guard again. Adds a fast test that fails when the gitlink and the pins disagree, and one sentence in the developer docs. Tested: the provenance tests (7 passed), the reference workflow on this branch passes the guard on every shard.
Pin the release smoke tests to the locked ONNX Runtime and record and check the full-precision network hash; scope the MATLAB license secret to the test job and bound the Pyodide job; give Intel Macs an ONNX Runtime wheel for Python 3.12 or 3.13; amend ADR 0071 for the iclabel and torch extras; correct stale release and install docs. Tested: the workflow, quantization, dependency-floor and extras tests (58 passed); each fix has a test that fails without it.
Fix the runica dgemm test's state leak; set the browser bridge thread count and pass the session a copy of the model; check the browser model digest and the output; pin Picard in the harness; check onnxruntime before the ICLabel dialog; record which network ran; keep the dataset history replayable in EEGLAB and keep history added during an async run; fix the ASR and EDF failure paths; remove the leftover ransac import shim. Tested: 300 passed in the seven touched test files and the Node tests, the Pyodide harness against native within 4.5e-06; each fix has a test that fails without it.
@neuromechanist

Copy link
Copy Markdown
Member Author

Specification and verification record, head 3fa42bc (2026-11-17)

The description above is short on purpose, because it becomes the squash commit message. This comment replaces the October record, which described an earlier design (an 8-bit network everywhere, a smaller wheel, sys and edf extras).

What changes

  • ICLabel runs on ONNX Runtime. The package ships the full-precision network iclabel.onnx, which every native run loads, and an 8-bit copy iclabel_int8.onnx, which the browser loads. netICL.mat stays in the source tree as the export source and no longer ships.
  • iclabel_async and pop_iclabel_async run the classification through ONNX Runtime Web and a host-provided bridge, keep the native post-processing and the console history, and synchronize the GUI and console session. The synchronous iclabel and pop_iclabel raise under Emscripten, and the MATLAB and Octave engines are refused there.
  • psutil and pyedflib stay in the base install and carry the marker sys_platform != 'emscripten', so the base requirements resolve under Pyodide. Their imports are lazy and raise an ImportError that names the cause.
  • A pinned Pyodide 0.29.5 harness and a new pyodide CI job install the wheel built from the working tree, run a sample-data smoke pipeline, compare browser ICLabel with native, and regenerate the 8-bit network from netICL.mat.
  • EEGPrepSession gains a dataset freshness token, so asynchronous work cannot commit a result to a dataset that changed in the meantime, and eegh(n) in eegprep-console returns an awaitable for a history entry that contains a top-level await.
  • The release workflow gates the wheel and the sdist: both networks must be present and equal their sources, netICL.mat must not ship, and the parity report must record a passing gate and the SHA-256 of both networks.

Breaking and notable changes

  • ICLabel needs the iclabel extra, pip install "eegprep[iclabel]" (ONNX Runtime 1.20 or newer). The ICLabel gate tests passed on ONNX Runtime 1.20.1, 1.23.2 and 1.32.0.
  • eegprep[torch] is now torch>=2.4 plus onnx>=1.14 and is only for rebuilding the packaged networks. eegprep[all] includes both torch and iclabel; eegprep[full] is unchanged.
  • Native ICLabel probabilities equal the PyTorch network's to about 1e-6. The browser's 8-bit network differs from the full-precision one by at most 0.01346 on the frozen 217-component evaluation set (the gate limit is 0.015).
  • The ICLabel result now stores network, the packaged file that ran, beside version. In a browser session EEG.history gets the EEGLAB form EEG = pop_iclabel(EEG, 'default');, so a saved .set replays in MATLAB; ALLCOM keeps the await form for console replay.
  • pop_iclabel and pop_iclabel_async check ONNX Runtime before the version dialog, so a plain install fails before the dialog and not after it.
  • A default uv sync works on an Intel Mac with Python 3.12 or 3.13: the lock installs ONNX Runtime 1.23.2 there, the last release with a macOS x86_64 wheel (it has none for Python 3.14).

Package sizes (measured with uv build --wheel, bytes from ls -l)

  • Wheel at the epic head on 2026-11-17, measured before the last fix pull requests (which add no packaged data): 19,072,671 bytes (19.07 MB). Wheel at develop 2736f99: 16,545,529 bytes (16.55 MB). The wheel grows by about 2.5 MB because it ships both networks and no longer ships netICL.mat.
  • iclabel.onnx: 11,626,631 bytes, SHA-256 1f16c67ebdbd8e6a30759ab628b61b693a0c4011e35a20e538acbebc1d4ebce4.
  • iclabel_int8.onnx: 2,932,897 bytes, SHA-256 8c0537d299e8776eef418d4a697547ad0b317902d656f69f64440169c564d8e3.
  • netICL.mat (source tree only): 10,815,192 bytes, SHA-256 8949a3e1faf61fee997034eca50a94475b78d58b35beb38ba48f0b208444d929.

The earlier "16.35 MB to 8.09 MB" figure was the arithmetic for an 8-bit network only and does not describe this design.

Review and the fixes it led to

Four read-only reviews of the merged epic (packaging and CI, tests and silent failures, merge resolution against develop, and numerics and safety) found no critical issue. Every finding was either fixed or declined with a reason, and every fix was reviewed again. The fixes landed as #630, #631 and #632:

  • The MATLAB reference workflow's commit guard (Move the epic's vendored EEGLAB to d0963be9 #630, see below): the vendored EEGLAB moves to the pinned commit, with a fast test that fails when the gitlink and the pins disagree.
  • CI and release (Round-1 review fixes for #386: CI, release, docs #631): the release smoke tests pin the ONNX Runtime version the lock resolves on Linux, with a test; the parity report records and the release checks the full-precision network's hash; the MATLAB license secret is scoped to the test job; the pyodide job has a read-only token, stores no Git credential, waits for lint and stops after 120 minutes; Intel Macs get an ONNX Runtime wheel; ADR 0071 is amended for the iclabel and torch extras; stale release, install and GPU documentation is corrected.
  • Runtime, bridge and tests (Round-1 review fixes for #386: runtime and tests #632): a test no longer leaves the runica matrix product out of step with its BACKEND name (reproduced with real pytest); the browser bridge sets the wasm thread count before its first session, creates sessions from a copy of the model (ONNX Runtime Web's proxy mode detaches the buffer it is given), and rejects a model whose digest differs from the packaged one or non-finite output; Picard is pinned in the harness; the history rewrite touches only one exact awaited pop_*_async statement; history added during an asynchronous run is kept; ASR and EDF failure paths fail with clear messages; the leftover ransac import shim is removed.
  • Declined: building the freshness token only when the backend can yield. The token is captured when the coroutine is created, and a test depends on that; extension pop_* functions that are coroutines can yield on native platforms too. Without it, one dataset's result would be stored as a new dataset and the current dataset would jump to it.

MATLAB reference run on this head (EEGLAB reference workflow, run 44184476871)

  • No commit-guard errors. 4,084 tests passed across the seven shards (hybrid 143, stats 257, misc 627, heavy 3, study 340, core 2,705, parity 9).
  • Two failures, and both also fail on develop with only the pin fix applied (a separate run on the branch behind [Tests] Move vendored EEGLAB submodule to the pinned commit #623, which carries the same gitlink change): test_average_reference_matches_matlab_on_64_channel_float32 (pop_reref differs from MATLAB by 0.161 uV, limit 1e-5, the same value on develop and here) and test_openneuro_edf_import_matches_matlab_pop_importbids (the ds003194 files are not present on the runner).
  • Context: since Return double-precision ANOVA F and p from statcond #513 on 2026-10-20 the vendored EEGLAB commit and the commit the tests pin disagreed, so the guard stopped every MATLAB-backed test before it compared anything. These two failures were hidden by it. They are not caused by this epic and are tracked on develop.

Known limits

  • The freshness token hashes array content; a sparse or pandas object replaced by another with the same repr is not detected (documented in contracts.rst).
  • The 8-bit browser network and the full-precision native network can differ by up to 0.01346 per probability on the frozen set, so a component near a threshold can be classified differently; the result records which network ran.
  • The macOS 3.12 CI job did not get a runner on the previous head (two attempts) and is not part of this evidence.

@neuromechanist
neuromechanist merged commit a4180ea into develop Nov 17, 2026
19 of 21 checks passed
neuromechanist added a commit to nemarOrg/nemar-process that referenced this pull request Nov 26, 2026
tests/images pins the extras: add iclabel (onnxruntime, ICLabel's
runtime since sccn/eegprep#386) and check onnxruntime is locked.
Tested: tests/images (479 passed).
neuromechanist added a commit to nemarOrg/nemar-process that referenced this pull request Nov 27, 2026
ICLabel's probabilities depend on onnxruntime since sccn/eegprep#386:
pin 1.32.0 in the runtime group (EXACT_PINS, the smoke imports it),
add it to OPTIONAL_ENGINES and nemar-ica's versions, and hold
steps.ONNXRUNTIME_VERSION to the lock. Tested: tests/images,
test_nemar_ica.
neuromechanist added a commit to nemarOrg/nemar-process that referenced this pull request Nov 27, 2026
) (#101)

* Re-pin eegprep to 871bc7f8 for eeg_mir

Adds the iclabel extra (onnxruntime), hashes the ONNX network the
classification names, follows clean_channels' seed argument and the
AMICA thresholds fix, and records the re-pin effects in upstream.md.
Tested: tests/recipes (runtime env).

* Route half-located and NaN positions past RANSAC

clean_channels at the new pin needs more than half of the channels
located and refuses a NaN coordinate; the floor's guard and the copy it
hands RANSAC follow, so neither fails a recording. Tested: test_qc,
test_locations, test_golden_decisions; both mutations fail them.

* Lift the frame_rotated withholding (#94)

eegprep at the new pin reads CTF, 4DBti and KitYokogawa as ALS
(sccn/eegprep#693), so nemar-ica writes and draws their positions as
stated; a frame with no BIDS orientation now gives no positions. The
generic Host.withheld mechanism stays for cap_exceeded. Tested:
test_nemar_ica_views, test_quality_plugins, test_nemar_ica_serving_input.

* Let a plugin say why a metric is null

PluginResult.metrics_skipped maps a null metric to a word the module
declares in METRIC_SKIP_WORDS; the plugin ran, its entry lists the
metric and word, and a fixed line is logged. Undeclared words or a word
beside a value skip the plugin. Tested: test_plugin_runner.

* nemar-quality 0.2.0: MIR via eegprep's eeg_mir

Adds nemar-quality:mutualInformationReduction (nat, fixed nbins 256
checked against MIR_NBINS; a refusal is mir_refused, a bin change
mir_bins_changed), hands it icaweights, icasphere and icachansind,
adds mir_nats to nemar-ica's table with its distribution, and pins the
new tree digest. Tested: recipes suite; three miscomputations fail.

* Regenerate the ica-views product

Made with NEMAR_ICA_VIEWS_PRODUCT=tests/fixtures/ica-views on arm64
macOS: eegprep 871bc7f8, nemar-quality 0.2.0 (MIR, mir_nats), ICLabel's
ONNX network, positions without withheld. Tested: the views e2e test
holds the copy to a fresh run.

* Hold the image to eegprep's iclabel extra

tests/images pins the extras: add iclabel (onnxruntime, ICLabel's
runtime since sccn/eegprep#386) and check onnxruntime is locked.
Tested: tests/images (479 passed).

* Pin onnxruntime and stamp it in every record

ICLabel's probabilities depend on onnxruntime since sccn/eegprep#386:
pin 1.32.0 in the runtime group (EXACT_PINS, the smoke imports it),
add it to OPTIONAL_ENGINES and nemar-ica's versions, and hold
steps.ONNXRUNTIME_VERSION to the lock. Tested: tests/images,
test_nemar_ica.

* Record ICLabel's onnxruntime threads

eegprep builds ICLabel's session with no thread count, so it runs on
onnxruntime's default pools outside the run's pin; the iclabel block
now says so (onnxruntime_threads, read from the session) and the
determinism docs no longer claim one thread. Tested:
test_nemar_ica_views.

* Check MIR's shape contract before eeg_mir

A decomposition that breaks eeg_mir's shape contract is the host's
fault (DecompositionMismatch, plugin_failed), never mir_refused; a
non-finite MIR is mir_refused. The tree digest moves (0.2.0 is not
yet merged). Tested: test_quality_plugins.

* Clear every position of a NaN-located channel

A channel the guard counts as unlocated but that gives a coordinate
now loses every position field (as the loaders give none), theta and
radius included, and the clearing persists, so _chanlocs.tsv writes
n/a for it. Tested: test_qc, test_locations, test_nemar_ica_views.

* Fail closed on frames eegprep cannot orient

A dataset directory whose coordsystem names a frame eegprep gives no
orientation ends at iclabel_locations with iclabel_frame_unoriented
(owner's ruling); position_facts keeps the stated frame. Also tests
that ICLabel needs two distinct located channels, the ONNX network
and digest, and a NaN channel's n/a layout row. Tested:
test_nemar_ica_views (mutation-checked).

* Docs: re-pin effects, MIR row, location rule

upstream.md gains #674 (closing #671), #649 and the ICLabel thread
issue to be filed, #669 merged without moving eegprep-lean's pin; the
MIR table row has no pipes; the pamica key list and the shape-contract
refusal are documented. Docs only.

* Regenerate the ica-views product again

The record now stamps onnxruntime (engine and ica versions) and
ICLabel's onnxruntime_threads, and nemar-quality's tree digest moved.
Made per the README on arm64 macOS; the copy check passes.

* Cite sccn/eegprep#763 for ICLabel's threads

The thread-count issue is filed; replace the to-be-filed references in
upstream.md, recipes.md and iclabel_threads' docstring. Docs and a
docstring only; ruff and ty pass.
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