Skip to content

Release 0.2.41: iEEG Brain panel with live Activity - #565

Merged
neuromechanist merged 60 commits into
mainfrom
staging
Nov 19, 2026
Merged

neuromechanist merged 60 commits into
mainfrom
staging

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Promotes staging to main for 0.2.41. The signal viewer gets a spatial "Brain" panel for intracranial EEG (iEEG) recordings, with a live Activity overlay, and the EEG topomap says where its electrode positions came from.

What reaches production

Testing

nemar-bot and others added 30 commits November 14, 2026 03:04
…544)

The EEG viewer reads the store's electrode provenance (whether the positions come from a subject's electrodes file or one dataset-wide file, and which file), names it in the scalp topomap toggle's tooltip, says declared and never measured in its own wording, and draws BIDS's three ALS coordinate frames (EEGLAB-HJ, 4DBti, KitYokogawa) the right way up. A path from a store is shown only when it is a short single-line repository-relative path. A store converted before these attributes existed renders exactly as before. Reviewed by a Sonnet review and one fix round; tests, typecheck, lint and CI green.
* test: add on006136 level-0 slice and SciPy reference

* feat: per-channel iEEG activity metrics

* fix: enforce unit dimension, analyzed span, native rate
* feat: orbit camera and view presets for iEEG

* feat: brain-mesh v1 reader, icosphere, normals

* feat: WebGL2 brain mesh and contact renderer

* test: pin quantization range and pick bounds

* fix: tolerate a gone pointer on capture

* fix: recolor in place, detect lost context

* feat: rescale camera fit for canvas shape

* fix: rank picks, sort translucent, rescale fit

* test: floor-only pick ranking needs two floor hits

* test: guard floor ranking in both orders
* test: add real iEEG geometry fixtures

* feat: resolve and join iEEG contacts

* fix: strip a byte order mark by code unit

* refactor: let trim drop a leading byte order mark

* docs: say how no_coordsystem is carried

* test: cover inherited file precedence

* test: cover duplicate and ambiguous joins

* docs: state origin and transient read caveats

* docs: note the license of the pinned appendix
* feat: declare the RAVE credit once (IS-K1)

* style: credit link class for spatial panels

* docs: third-party notices, required and acknowledged

* docs: use the bare TemplateFlow address

* test: SVG credit link keeps noopener

* fix: review round 1 for the credit card

* test: paintCredit measures at the scaled size

* fix: credit target size, notices without the sentence
* docs: ADR 0033 for the iEEG spatial view

* docs: address review of ADR 0033
* feat: add template brain build script

* feat: vendor MNI152 template brain surface

* test: pin vendored template brain

* fix: rewrite default folder, tighten pins

* chore: rebuild template brain folder

* feat: record resolved build env, state scope

* chore: rebuild template brain folder

* test: pin build env, tighten winding checks
* feat: iEEG spatial panel state machine and views

* feat: list unlocated channels, close off iEEG

* feat: Brain toggle and panel in the signal viewer

* test: headless check of the iEEG Brain panel

* fix: announce panel text once, clear read timer

* feat: retry passing failures of electrode reads

* test: superseded retries do not wait

* test: tolerate passing failures in panel check

* fix: IS-V1 review round 1 (panel, viewer, tests)

* test: aborted plans read nothing

* test: Escape, lazy code and stacked floor checks
* feat: add iEEG geometry census script (IS-A1)

* docs: add iEEG geometry census note

* test: cover census classification and fetch rules

Also timeout, Accept header, 404/410-only absence, arg validation, note provenance.
* feat: cited template placement affines (IS-V2)

* refactor: placeOnTemplate always applies the row

* feat: draw the template surface for placed frames

* fix: the Brain panel scrolls instead of shrinking

* refactor: compute drawn positions only on change

* test: template anatomy in a real browser

* test: widen the surface and contacts ink bounds

* docs: Talairach row is approximate by construction

* feat: exhaustive template registry with pending families

* refactor: keep the pending table out of the bundle

* docs: Talairach residuals are per-package

* feat: place fsaverageSym on the MNI305 row

* docs: IXI549Space is a documented exception
* feat: three-view 2D geometry for iEEG contacts

* feat: 2D switch and PNG/SVG exports with credit

* test: e2e for saved figures and 2D views

* feat: orientation letters, XML-safe text, doiUrl

* feat: recorded location, measure and band in figures

* test: e2e for letters, measure and XML parse

* fix: inset letters, frames, cache test, honest wording
* test: real recordings for channel-name tests

153 public files and Zarr label excerpts from 24 recordings of 23 datasets, with dataset, version, path, URL and SHA-256 in SOURCES.json, and the loader the next tests share.

* feat: join channel names to contacts by tier

Ordered tiers (exact, normalized, suffix, close) as a table of named rules read from the survey, ambiguous_name for two readings, claims so an exact name keeps its contact, and the file's own coordinate cells carried through the parser. close has no rule: the one candidate is right in one dataset and wrong in another. Tests read the committed real recordings; each of the card's six mutations fails its test.

* feat: show how a channel met its contact

Rows, titles, the Selected lines, notes and the status line name the contact as recorded, the channel beside it and the kind of match; the recorded line is the file's own text with its unit word and frame; an approximate match is drawn half transparent. Unit, provenance and headless e2e tests; on005415 now has a Brain toggle.

* docs: survey of iEEG channel names

Counts per pattern over 328 recordings of 93 datasets, each rule's rows, and the pending patterns with the reason.

* fix: tighten name rules, claim pairs, guard zeros

Near-miss names (A1-2, A1-AVG, pol A3, A1-Reference and more) are pinned unlocated so a loosened rule anchor fails a test; zero padding never carries a name across a shaft (L01 does not join L1 beside L0); bipolar pairs are claimed like contacts (POL A1-A2 does not take A1-A2); the -AV and -REF sentences say what the name does, not what it means; P3 evidence corrected (CH0 to CH31 plus four state_* channels); the close marker's opacity limit is documented; the alpha test uses a literal. Each new test fails under its mutation.

* feat: rerunnable iEEG channel-name survey

scripts/ieeg-channel-survey.ts re-derives the note's counts (name-resolved and located, the _channels.tsv corroboration, per dataset) over the committed list of 338 recordings; --sample draws a fresh list. Three runs the same day agree.

* docs: channel-name survey reproducibility

How to re-derive the counts, what channels and located mean, the _channels.tsv corroboration by rule and dataset, and the corrected P3 evidence.

* test: pin opposite-polarity pair claims

Non-exact POL A1-A2 and POL A2-A1 both refuse (duplicate_contact) while exact A1-A2 and A2-A1 both stay; the reason is documented at settleClaims. Behavior unchanged. The sorted-key mutation now fails this test.
* test: validate iEEG panel on real datasets

* docs: iEEG validation note and budgets

* test: literal credit text, preflight, allowance

* docs: state the full long-task range and caveats

* test: judge long-task budget on Zarr evidence

* docs: long-task measurement method and range

* test: allow validation spec's credit literals
* test: page watch for a stalled 2D views click

Installs a 10 ms timer and animation-frame heartbeat, a console
beat that reaches Node while the page is blocked, and request
timing for views.json, the mesh files and the Zarr host in the
export test. A run that does not pass leaves them in the
annotations. Lint clean; the export test passes with it.

* test: settle the scope before long-task phases

The scope's own render after the panel opens or a window step
lands whenever the data plane delivers it; with a slow plane it
fell inside a later phase and was blamed on the recompute. A
Chromium trace shows it is the scope's WebGL frame read back in
a software-GL browser, not decode or compute. Wait for a quiet
Zarr host before each phase and judge the budget in every regime.

* feat: list both name sets when names close a panel

A recording whose channel names join no contact (nm000377,
on004624) kept a disabled toggle and one sentence, and its
names were shown nowhere. The toggle now opens a refusal that
states the cause in the notes' words, lists the first 12
channel names beside the first 12 contact names as recorded,
with counts, and says no rule joined them and nothing was
guessed. Missing-coordinates refusals stay disabled.
Unit tests on real fixtures; e2e on both datasets.

* feat: units banner for converted units far out

on004100 declares meters over millimeter-sized numbers, so its
contacts land tens of meters out and nothing was visible. When
a declared non-mm unit is converted and every drawn contact is
then over 300 mm from the origin, a banner on the stage and in
the SVG and PNG says so. Positions stay as declared, no
template is placed, and the stage is the flat views (the 3D
spheres are true-size mm, sub-pixel here). Nothing is rescaled
or inferred. The fsaverage affine tests use a head-scale input.

* test: leave evidence when an embed shows nothing

A full run met the embed page showing neither its viewer nor a
notice for 90 s (on004624), the symptom IS-QA1 saw once. Record
the page's load state, words and the requests it was waiting for
when openViewer gives up. The EEG test reloads on the embed's own
notice as the others do, and the electrodes file read in the
closed-by-names test is retried like the panel's.

* test: replay seam for the long-task test

QA1_ZARR_HAR replays the Zarr host's real responses from an
HTTP archive (QA1_ZARR_HAR_RECORD=1 records one), so the fast
regime can be measured on a day the data plane is slow. Unset
in a normal run. A 300 ms busy loop in the recompute fails the
test under replay (325 ms); dropping the quiet waits fails it
under the 3.5 s seam (272 ms, the scope's late render).

* docs: IS-Q2 trace, hang evidence and budgets

Updates the validation note: the Chromium trace of the long task
(decode and compute never reach 10 ms per task; every block is the
scope's WebGL frame read back at commit), the budget measured in the
fast and slow regimes, the closed-by-names and banner rows, 111 plain
repeats and 40 repeats of the export test with no stall at the 2D
views click, the host's sleep log, and new findings for the viewer,
the embed and the panel's owner.

* test: recognize the embed's client notice

The embed writes a second notice when the Zarr index fails to
load, and the spec helpers waited only for the server-rendered
one, so a page already saying 'could not load' counted as
silent for 90 s. A snapshot of one failure shows it; IS-QA1's
silent embed and the other silent failures here match it by
symptom. Both specs wait for either notice and reload as they
do for the first. The note's finding 12 says what is and is not
shown.

* docs: IS-Q2 chunk sizes in the budget table

* docs: IS-Q2 all-green run and live fast regime

* fix: read the located rows once per window

Activity read the located rows in slices of 16 channels, one
read per slice, and a chunk of the store holds many channels:
nm000485 fetched the same 3 byte ranges nine times (27 requests,
11.8 MB for 1.3 MB of samples) and took 25 to 47 s on a slow
route. The window is now read once (a span per sample bound),
then computed in slices capped by channels and by samples, with
a yield after the read and after every slice. After: 3 requests,
1.31 MB, 4.4 s under the 3.5 s seam. A test through the viewer's
own reader counts chunk requests against distinct chunks.

* feat: banner reason, scale line and origin rule

Under the units banner the reason the 3D switch is off is now a
visible line beside it (with aria-describedby), not only a
tooltip on a disabled button. The flat views have no scale bar,
so a line in the stage and the figures says their extent (the
widest span of the drawn contacts). A contact at exactly 0 0 0
is left out of the 300 mm test: IS-C1 returns a placeholder as
written, and one must not hide a file whose real contacts are
tens of meters out. e2e covers the line, the description link
and the stage's order.

* feat: show names as written, flag what hides

The names lists write a character that does not display (a
control, a zero-width or bidi control, a soft hyphen, a no-break
space) as a visible escape, flag a name with characters beyond
ASCII (a Cyrillic A is not a Latin one and never joins), isolate
each name as its own bidirectional run, and name each list by
its heading for a screen reader. Tests use control, right-to-left
and lookalike names built on a real contact of on005522.

* docs: ADR 0033 template row and the units banner

MNI305 and fsaverage are placed only when the values are in
millimeters; under the units banner they never are, which holds
for both committed fsaverage datasets (on004100, on006253).

* test: settle the scope before the first Activity read

The panel spec's first test asserted one read right after ready,
but the scope's own render after the panel opens or a step lands
whenever its Zarr data does, and its window report re-plans a
read. With a 2.5 s late route the original test failed 4 of 4 on
the epic base and 1 of 4 on this branch; with the quiet wait it
passed 4 of 4. Also corrects the repeat count in a spec comment.

* docs: IS-Q2 review round 1 in the note

Single read per window (before and after: requests, distinct
responses, bytes, ready time, per-task trace), the 1,000,000
sample slice cap and its benchmark, which runs ran on which head
and when, the panel spec's pre-existing race, the scale line,
and the new chunk sizes.
feat: iEEG spatial view in the signal viewer
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6035592
Status: ✅  Deploy successful!
Preview URL: https://2c9d5d40.nemar-website.pages.dev
Branch Preview URL: https://staging.nemar-website.pages.dev

View logs

@neuromechanist
neuromechanist merged commit 7d4f2d9 into main Nov 19, 2026
9 checks passed
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