Repository navigation
Round-1 review fixes for #386: runtime and tests - #632
Conversation
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.
|
Claude finished @neuromechanist's task in 1m 30s —— View job Code review
BlockingNone. ImportantNone. NitsNone. Test gapsNone. EEGLAB parity notesNone. The new What I checked
As the PR body says, the MATLAB-gated |
Fixes the round-1 review items of #386 that live in runtime code, the browser bridge and their tests; the CI, release, dependency and documentation items are in a separate pull request.
MonkeyPatch.context()that is undone before the reload), and the newtest_runica_backend_callable_matches_its_labelfails if the leak returns.test_runica_blas_backend_matches_numpy_backendnow compares all four runica training loops (bias on and off, logistic and extended) at the same tolerances.ort.env.wasm.numThreads(default 1, overridable with thenumThreadsoption) before its first session instead of a session option that onnxruntime-web ignores; measured with the real library, the thread count was 4 on a 10-core machine before and is 1 now.modelBytes, and the Python adapter compares its SHA-256 with the packagediclabel_int8.onnxon every call and raisesRuntimeErrornaming both digests when they differ.RuntimeErrorwhen the bridge returns a NaN or infinite probability, whicheeg_icflagwould otherwise keep silently.python-picard==0.8.2, theuv.lockversion, and a test checks the pin againstuv.lockand the extra's range.pop_iclabelandpop_iclabel_asyncreport a missing ONNX Runtime before the version dialog, and the subprocess test covers both pop functions.dispatch_gui_asyncfall-through for a non-ICLabel action, and a MATLAB-gated test comparesiclabel_async(engine='matlab')withiclabel.MaxMemas well asmaxmem, and tests cover the too-low budget fallback ofasr_processandasr_process_rwithout psutil.reprlimitation for sparse matrices.pop_writeeegprobes pyedflib before creating the output directory, and the test asserts that no directory is left behind.ransac.pyis byte-identical todevelopagain (theget_eeglabshim was a leftover; importing runica loads the EEGLAB bridge but notmne), the matchingAGENTS.mdcarve-out is gone, and the test that pinned the shim is deleted.network, the packaged file that ran (iclabel.onnxnatively,iclabel_int8.onnxin the browser), next toversion; the engine path removes a stalenetwork, and a saved dataset keeps it. This adds a field to saved.setfiles that MATLAB EEGLAB ignores, so reverting the single "Record which ICLabel network ran" commit drops it.historyrecords the EEGLAB formEEG = pop_iclabel(EEG, 'default');, whileALLCOMandLASTCOMkeep theawaitform thatawait eegh(n)replays.AGENTS.mdline):uv sync --group devis the documented command, because thedevgroup carries ONNX Runtime.F27 is declined as a false positive: the console captures the token when the coroutine is created, so user code can run between creating it and awaiting it on native platforms too, and
test_console_pop_iclabel_async_captures_the_selection_when_called(native, no gate) passes; if the token were built only under Emscripten, dataset 1's labeled result would be stored as a new dataset 3 andCURRENTSETwould jump to it (the test fails withDID NOT RAISE), andConsolePopFunctionwraps every coroutinepop_*, including extension ones that can really yield on native platforms, so no cheaper correct generic design exists (the cost is two hash passes, as the token's docstring says).F7 reproduction on the base with pytest 9.0.3: after
test_runica_runs_its_training_products_through_dgemm_on_emscripten, a probe printedplatform=darwin BACKEND=numpy.matmul callable=_blas_matmul; alone it printed_numpy_matmul.Tested:
ruff check .(All checks passed!),ruff format --check .(966 files already formatted),./pre-commit.py --changed-from origin/epic/324-pyodide-browser(OK), andty check(9 diagnostics, all unresolved imports oftorch,onnxandpamicafrom extras that are not installed; none in a changed file).Tested: 13 test files (runica, ransac, ICLabel, Pyodide harness, optional extras, session contracts, GUI ICLabel, console, main window, help, public API) end with
300 passed, 3 skipped, 1 deselected, 198 warningsfor the first seven and85 passed, 3 deselected, 146 subtests passedfor the other six.Tested: the local Pyodide harness end to end (wheel built from this branch, real Pyodide 0.29.5 and onnxruntime-web 1.30.0 under Node.js) ran
iclabel_parity.py, andcompare_iclabel.pyexited 0 with"allclose": trueand"max_absolute_difference": 4.5299530029296875e-06.Review round 2 added separate commits: the bridge creates its session from a copy of the model (a transferred buffer would detach
modelBytesand fail the next digest check) and keeps a thread count the host already set; the adapter fails closed on amodelBytesthat is not a byte buffer;eeglab_history_commandrewrites only one single-line statement; the ONNX Runtime check order ofpop_iclabeland the scope of the 0.01346 bound are documented.Every code fix has a test that fails without it; each was checked by reverting the fix.
Not run: Tests (pull requests into the epic run no test.yml; they run on #386 after this merges), the MATLAB-gated F17 case, the EEGLAB reference workflow.
Refs #386
Card FIX-386b of the NEMAR portable-compute program.