Repository navigation
docs: REVE sparse-feature intervention tutorial with optional SAE Lens - #1120
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bruAristimunha
left a comment
There was a problem hiding this comment.
Thanks for putting together the public-data experiment. I reviewed the notebook as a Braindecode contribution and against the workflow it cites. This needs a redesign before it is mergeable, so I am moving it back to draft.
The blocking issues are:
-
Braindecode's authored tutorials are Sphinx-Gallery Python scripts under
examples/; the docs workflow generates notebooks from those scripts. A 1.27 MB executed Kaggle notebook underbraindecode/mech-interp/is neither an importable package module nor the project tutorial format. It contains 454 output objects, Papermill/Kaggle/widget metadata, and no Markdown cells. Please move the narrative to a gallery example and strip generated outputs and environment metadata. -
The example cannot be part of the normal docs execution path as written. It installs Python and system packages, downloads and extracts the 13.4 GB NMT archive, deletes caches/directories, and defaults
FORCE_REBUILD = True. Library documentation must not mutate the environment or delete user data. Use existing Braindecode dataset/download APIs, explicit user-controlled paths and opt-in cleanup, and make the documented data/runtime cost clear. The CI-facing example needs a small bounded or synthetic path; the full experiment can be an explicitly opt-in external reproduction script. -
The experiment fails its own stated gate (
0.6696 < 0.75) but only prints a warning and continues into SAE training and faithfulness analysis. The downstream interpretation therefore violates the notebook's own precondition. A gate must actually stop/skip the dependent stages. -
Do not use held-out test performance to decide whether to continue the analysis. Select architecture, preprocessing, checkpoint, and any performance threshold from training/validation only, then evaluate the test set once. The text says recording-level AUROC is clinically meaningful, but the checkpoint is selected using window-level validation AUROC; use and justify one validation target consistently. Data-dependent scaling constants must also be estimated from the training split only.
-
Extract reusable behavior (activation capture/substitution and, if this belongs in Braindecode's public API, the Top-K SAE) into normal modules with focused unit tests. The current notebook duplicates capture helpers and leaves core correctness, hook cleanup, checkpoint round-trips, top-k bounds, dead-feature resampling, grouped splitting, and substitution behavior untested.
-
Record clean-room provenance precisely. The cited companion repository says it is not end-to-end reproducible and is PolyForm Noncommercial, while Braindecode is BSD-3-Clause. Please identify the paper/method sources used for each independently implemented component and confirm that no code was copied or adapted from the noncommercial repository. This is a provenance requirement, not an accusation.
-
Current pre-commit failures are real: the repository's JSON hook rewrites the entire notebook, and Ruff cannot parse cells 2/3 because of unexpected indentation. A changelog entry is also required.
The useful mergeable shape is: tested reusable code (if an API addition is intended) + a compact Sphinx-Gallery tutorial that runs on a bounded input + a separate, clearly documented opt-in full NMT reproduction path. Please also report results only after the validation gate passes; the current below-gate run should be described as a failed pilot, not evidence that the method reproduces the cited workflow.
|
Hi @bruAristimunha, The notebook was just for my own runs. I had used Kaggle for prototyping. It’s temporary and not something I’m proposing to merge. The temporary For the library code, I’ve moved the SAE implementation under The example under
To validate the method against the paper’s setup (
Window-level test AUROC; baseline 0.774. The random-SAE column is a same-shape untrained dictionary, i.e. the control. The main observation here is that faithfulness stays essentially unchanged across an 8× range of dictionary sizes, even though reconstruction R² increases substantially. I haven’t added |
Adds SparseAutoencoder, fit_sparse_autoencoder and sae_diagnostics, plus the forward-hook primitives capture_activations and run_with_activation_substitution for measuring whether a dictionary kept what the model actually uses. Includes tests, a gallery example on the published BCI IV 2a checkpoint, and the LaBraM validation script.
|
Thanks for replacing the executed notebook with reviewable Python and focused tests. I re-reviewed the current exact head The paper-result gate is not met. The least-cost LaBraM-specific target I could freeze from the cited paper is Figure 2's last transformer block (zero-based layer 11), The NMT run is a useful exploratory pilot toward external validation, but it cannot satisfy that reproduction gate. It changes the cohort, windows, preprocessing, split, checkpoint lineage, and metric protocol. I am therefore not requesting an NMT download or Iceberg run from this PR. A future NMT experiment needs its own immutable inclusion/split/preprocessing/checkpoint manifest and must be labelled external validation. There are also exact-head blockers independent of the unavailable paper artifacts:
Please split this maximally instead of expanding it further:
Please also replace the stale PR body: it still describes a removed notebook and an older below-gate run. The current state should be recorded as a draft prototype/external-validation pilot, not a paper reproduction. No spectral decoding, TCAV, steering, or TransformerLens scope should be added while these foundations remain unresolved. |
|
Exact-head paper/scope audit (
Under the current paper-result-before-merge policy, exact replication is unavailable because the paper data/checkpoints/caches are not released. The draft should remain blocked even if CI is green. |
|
the activations PR as requested - #1138 |
|
The top-k mechanism is Makhzani & Frey (ICLR 2014), which the paper cites as [17]. I'd implement a minimal TopK SAE from those two: encode, decode, config round-trip, decoder normalisation, strict input contracts, and focused tests, with no optimizer, resampling, diagnostics, splitter, or data runner. It would cite neither the reference paper nor its companion code, and would make no claim about that paper's results. Is that an acceptable plan? An SAE is a trained |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1120 +/- ##
==========================================
+ Coverage 87.52% 87.71% +0.18%
==========================================
Files 148 149 +1
Lines 17080 17433 +353
==========================================
+ Hits 14950 15292 +342
- Misses 2130 2141 +11 🚀 New features to boost your workflow:
|
Replace the synthetic windows and random two-block LaBraM with subject 3 of BCI IV 2a (MOABBDataset, LaBraM preprocessing, session split) and the pretrained braindecode/labram-pretrained weights, fine-tuned for ten epochs on the training session. A training-session check shows which blocks' patch tokens can reach the CLS head; the Top-K SAE is fitted to block-6 patch tokens and evaluated on the test session with reconstruction substitution, untrained-SAE and mean-token controls, per-channel feature maps and error-preserving removal of class-selective features against random feature sets.
Rename plot_sae_labram.py to plot_sae_reve.py and rewrite it around braindecode.models.REVE with brain-bzh/reve-base (from_pretrained, chs_info for the position bank, 200 Hz, 4-s windows = 88 tokens). Same data: BNCI2014_001 subject 3, session 0 for fitting, session 1 for testing, now with REVE's preprocessing (0.5-99.5 Hz, per-recording z-score clipped at 15 SD) and per-session Euclidean alignment. The encoder is frozen and only REVE's flattening head is trained on the first four runs of session 0; the last two runs are a validation split. Model setup, SAE block (18) and size (2048 features, k=32) were chosen on that split before the test session was used; the tutorial states the validation numbers behind each choice. It shows a skip-one-block check of which blocks influence the prediction, a Top-K SAE on block-18 tokens with trained/untrained/mean-token substitution controls, per-channel feature maps, and error-preserving removal of class-selective features against random feature sets and the other classes' sets.
Add the docs-only `sae` extra (sae-lens==6.51.3) and append it to DOCS_EXTRAS in the docs workflow. It is not a core dependency, not in the `docs` extra and not in `all`. docs/conf.py keeps rendering the SAE tutorials without executing them when sae_lens is not importable. The hunks are identical to those in braindecode#1152 so the two PRs merge cleanly.
Append the docs-only `sae` extra (sae-lens==6.51.3) to DOCS_EXTRAS in the docs workflow. It stays out of core dependencies, the `docs` extra and `all`. docs/conf.py keeps rendering the SAE tutorials without executing them when sae_lens is not importable. The hunk is identical to the one in braindecode#1120 so the two PRs merge cleanly.
The build_docs job installs the `sae` extra through DOCS_EXTRAS, so the SAE tutorials always execute there and the filename_pattern fallback is not needed. docs/conf.py is back to the merge base.
Review follow-up: - plain SAE Lens imports; the optional install is mentioned in prose only - REVE's per-recording z-score/clip via Preprocessor(sklearn scale, channel_wise=True) and np.clip (bitwise identical to the old helper) - MOABB EuclideanAlignment(estimator="scm"), fitted per session on that session's windows; the head and SAE see the training session only - skorch SliceDataset/to_tensor for the arrays, window metadata for labels, EEGClassifier for the linear head instead of a hand-written loop - scikit-learn for evaluation: balanced_accuracy_score, agreement as accuracy_score(native, edited), FVU as 1 - r2_score(variance_weighted), ConfusionMatrixDisplay, r_regression for class selectivity - narrative and a schematic of REVE's residual stream: streams 0-22, where tokens are read (block 18), SAE edits, run_blocks through 19-22 and the head, and why forward hooks cannot reach the stream - interventions reuse the cached test codes; fewer helpers - cite He & Wu (2020) and Junqueira et al. (2024) for EA With the MOABB alignment the session-0 validation selection was re-run (session 1 dropped before any model output). Setup and block are unchanged; the dictionary-size rule now picks 4096 features (79% vs 73% validation agreement), which the tutorial states.
- One narrated rcParams cell at the top, shared with the SAE activation tutorial: orange for the result, warm grey for controls, blue for the pretrained blocks that finish an edited forward pass, left-aligned titles computed from the numbers they report, monospace numbers, no legend boxes or colorbars. Fonts fall back to DejaVu on CI. - Token-stream schematic kept and restyled; the block panel now marks the update a submodule returns and the "+ x" skip that carries the stream. - Block check shows the share of validation decisions that change, with value labels and the SAE block in orange. - Confusion matrices restyled; the title compares the trained SAE's agreement with both controls. - Scalp maps: diverging orange/blue maps, peak channel and scale under each map instead of four colorbars, and a footnote that the channels are aligned virtual channels, not a source map. - Feature removal: every random set and every other-class set is drawn, not only a mean and maximum; the 4x4 matrix outlines the own-set cells. The thumbnail is this figure. No computation that produces the printed results changed; all printed numbers are identical to the previous head.
- Pose the question in the first paragraph (can a sparse dictionary on a frozen pretrained EEG transformer expose features its classifier uses?) and split it into two tests: the reconstruction must preserve the decisions, and removing a class's features must beat random sets and the other classes' sets. The close answers in the same words, then states four bounds and one take-home. - Claim headings backed by computed titles; purpose-clause openers; the controls sit next to each claim; association vs use, the feet caveat and the transductive test alignment are stated where they apply. - New Test 1 figure: FVU, balanced accuracy and agreement for the native model, the trained SAE and both controls, with the single-class collapse of the controls annotated. The confusion figure now answers which decisions change. - Schematic: brackets for what token_streams (once) and run_blocks (per edit) compute, and the two edits of the two tests. - Scalp maps: the title names the hemisphere of each hand feature's peak; the caveat reads "an association, not a source map". - Removal figure (thumbnail): specificity contrast (own minus best control) per class, and the other class's set that beats the feet set is named. - End figure cells with plt.show() so no Text repr is printed. Printed numbers are unchanged (checked line by line against 89ac394).
…ts styling Brand blue for the result, ink for the native model, muted slate for controls and amber for the rerun blocks and the other classes' feature sets, from docs/_static/landing.css. The cosmetic rcParams block is trimmed and moved into a sphinx-gallery ignore block. Less ink: no bar tracks, one value label on the block chart, no sensor dots on the scalp maps, and cell labels that switch to white only on dark cells. Printed outputs are unchanged.
Bruno asked for red. #b5332e has about the brand blue's lightness (L* 42 vs 44), 6.0:1 contrast on white, and stays separable from the blue under simulated protan, deutan and tritan vision, so the blue-red diverging maps keep their meaning. Printed outputs are unchanged.
* Add a Top-K sparse autoencoder over model activations Encodes an activation into n_inputs * expansion features, keeps the k largest rectified outputs, and decodes back. No optimizer, resampling or diagnostics. * Fix sparse autoencoder API formatting * docs: replace in-tree SAE with optional activation-analysis tutorial * docs: avoid upstream changelog insertion conflict * docs: separate SAE entry from concurrent template changelog * docs: run SAE activation tutorial on real BNCI2014_001 EEG Replace the synthetic windows and random model with subject 3 of BCI IV 2a loaded through MOABBDataset, the standard trial-wise preprocessing and a session split. A ShallowFBCSPNet is trained for 30 epochs on the training session; the SAE, scaling statistics and feature selection are fitted on training activations only and evaluated once on the test session (FVU, accuracy/agreement under substitution with untrained-SAE and mean-ablation controls, class selectivity and feature time courses). * docs: keep the SAE module repr out of the rendered tutorial * ci: install SAE Lens for the docs build so the SAE tutorials execute Append the docs-only `sae` extra (sae-lens==6.51.3) to DOCS_EXTRAS in the docs workflow. It stays out of core dependencies, the `docs` extra and `all`. docs/conf.py keeps rendering the SAE tutorials without executing them when sae_lens is not importable. The hunk is identical to the one in #1120 so the two PRs merge cleanly. * docs: drop the SAE Lens conf.py guard; docs CI installs the sae extra The build_docs job installs the `sae` extra through DOCS_EXTRAS, so the SAE tutorials always execute there and the filename_pattern fallback is not needed. docs/conf.py is back to the merge base. * docs: use library functions in the SAE activation tutorial Review follow-up: - plain SAE Lens imports; the optional install is mentioned in prose only - skorch SliceDataset/to_tensor for the hook inputs, window metadata for labels, EEGClassifier.predict for the native predictions - scikit-learn for evaluation: balanced_accuracy_score, agreement as accuracy_score(native, substituted), FVU as 1 - r2_score(..., variance_weighted), ConfusionMatrixDisplay for true/native and native/substituted decisions, r_regression (point-biserial) for class selectivity (same ranking and the same selected features as before) - einops patterns instead of the reshape helpers - references in the footnote style of the other tutorials Every printed number is unchanged on BNCI2014_001 subject 3. * docs: restyle the SAE activation tutorial figures - One narrated rcParams cell at the top: orange for the trained SAE, near-black for the native decoder, warm grey for every control, left-aligned titles computed from the numbers they report, monospace numbers, no legend boxes. Fonts fall back to DejaVu on CI. - New first figure (and gallery thumbnail): FVU, balanced accuracy and agreement for the native decoder, the trained SAE and both controls. - Confusion matrices restyled; the title counts the changed decisions. - Selectivity heatmap: annotated cells, an inset outline on the class each feature was picked for, class groups separated, no colorbar. - The time-course figure becomes one feature card per hand feature: trial-mean codes, code when active, time course with s.e.m., the most active test trials shaded by the code, and the channel-power association (labelled as an association, not a source map). No computation that produces the printed results changed; all printed numbers are identical to the previous head. * docs: end SAE tutorial figure cells with plt.show() The suptitle calls were the last expression in three cells, so sphinx-gallery printed their Text(...) repr under the figures. * docs: use the Braindecode palette and simplify the SAE tutorial figures Brand blue for the trained SAE and the picked class, ink for the native decoder, muted slate for controls, amber outlines, from docs/_static/landing.css. The feature card drops the redundant code histogram and the per-class time courses (now target vs other classes, labelled at the line ends), moves the EEG 'most active trials' panel to the full width, and replaces the topomap's text legend with a colorbar. Bar tracks are removed, and cell labels switch to white only on dark cells. Printed outputs are unchanged. * docs: hide the SAE tutorial's matplotlib styling and trim it The rcParams block is cosmetic, so it now sits in a sphinx-gallery ignore block: it still runs, but readers only see the four palette colors the plotting code uses. Settings whose defaults look the same are dropped, fonts fall back to matplotlib's DejaVu (what CI renders with), and the channel-power panel title is shortened so it no longer clips. * docs: use red instead of amber for the SAE tutorial's secondary accent Bruno asked for red. #b5332e has about the brand blue's lightness (L* 42 vs 44), 6.0:1 contrast on white, and stays separable from the blue under simulated protan, deutan and tritan vision, so the blue-red diverging maps keep their meaning. Printed outputs are unchanged. --------- Co-authored-by: Bruno Aristimunha <[email protected]>
Scope
A standalone Sphinx-Gallery tutorial on sparse-feature interventions in a frozen pretrained REVE (
braindecode.models.REVE,brain-bzh/reve-base), using SAE Lens 6.51.3. It adds no SAE implementation, trainer, callback or core dependency to Braindecode. File:examples/advanced_training/plot_sae_reve.py, which replaced the earlier LaBraM version.MOABBDataset("BNCI2014_001")). No synthetic or random EEG.Preprocessor(sklearn.preprocessing.scale, channel_wise=True)) clipped at 15 SD (np.clip).EuclideanAlignment(estimator="scm"), fitted once per session on that session's windows, without labels. The head and the SAE are fitted on the training session only, so no test-session statistic enters their fitting. For the test session the alignment is transductive, as in REVE's evaluation; the tutorial says so.0train; validation = runs 4–5 of0train; test =1test.REVE.from_pretrained("brain-bzh/reve-base", n_outputs=4, n_chans=22, n_times=800, sfreq=200, chs_info=...). The encoder is frozen; only REVE's flattening head (final_layer) is trained, withEEGClassifieron cached last-block tokens (full-batch AdamW, 300 epochs).capture_activations/run_with_activation_substitutionhook a submodule's output. In REVE,TransformerBackbone.forwardcomputesx = attn(x) + x; x = ff(x) + x, so no submodule returns the stream. A hook onffsees the update, and a pre-hook on the next block would leave the original tokens in its skip connection. The tutorial therefore uses:token_streams:model(x, return_output=True), batched;run_blocks: resume from a stream through the remaining pretrained blocks and the head. It is checked againstmodel(x): max abs diff 2.2e-05.run_blocksthrough blocks 19–22 and the head, and why hooks cannot reach the stream. Brackets mark whattoken_streamscomputes once and whatrun_blocksrecomputes per edit, and the SAE card names the edit of each test (substitute the reconstruction; subtract the decoded removed features).sae = ["sae-lens==6.51.3"]extra andsaeappended toDOCS_EXTRAS; both hunks are byte-identical to docs: tutorial on SAE activation analysis with optional SAE Lens #1152's.saeis not a core dependency, not indocsand not inall. Nodocs/conf.pychange any more: thefind_specguard was removed (review), anddocs/conf.pyis identical to the merge base.Review follow-up (this push)
sae_lensimports; notry/except ImportError. The optional install is in the prose only. The prose also states that MOABB ≥ 1.6 is needed forEuclideanAlignment; docs CI resolves 1.7.2, and themoabbextra floor was not changed.standardize_and_clip→Preprocessor(standard_scale, channel_wise=True)(as inplot_relative_positioning.py/plot_transfer_learning.py) +np.clip. On session 0 the output is bitwise identical to the old helper, and no sample reaches ±15 SD.np.clipsits in a lambda because MNE'sapply_functioncallsgetfullargspec, which rejects numpy 2's dispatcher object.plot_tuh_eeg_corpus.pydoes the same.to_tensors→ skorchSliceDataset+skorch.utils.to_tensor; labels and runs come fromget_metadata().euclidean_alignment→moabb.datasets.preprocessing.EuclideanAlignment(MOABB ≥ 1.6, from MOABB docs(dance): show the published checkpoint result in the tutorial #1109; also on MOABBdevelop).estimator="scm"is the sample covariance of He & Wu. MOABB's default Ledoit–Wolf shrinkage targets short or noisy trials, and it moved the aligned data 12% (relative), against 0.7% forscm. The remaining difference is window centring.balanced_accuracy_score(equal to accuracy here, since the splits are balanced);accuracy_score(native, edited);1 - r2_score(..., multioutput="variance_weighted");ConfusionMatrixDisplay;r_regression(point-biserial; same ranking as the previous standardized mean difference).accuracyhelper, the manual head-training loop,skip_block_predictions,standardize,reconstruct_with,edited_logitsandremove_featuresare gone.Remaining helpers and why:
token_streams/run_blocks: see the token-stream note above. REVE's stream cannot be read or replaced through a module hook, and no library function resumes a REVE forward pass from an intermediate stream.activation_batches: SAE Lens'sSAETrainertakes any iterator of tensor batches, and itsActivationsStoreneeds a language model. This 3-line generator samples fit tokens with replacement.probability_drops: the removal intervention itself. It zeroes a feature set in the codes, subtracts the decoded contribution, runsrun_blocksand returns p and the per-class drops. It is called 24 times.How the settings were chosen (session 0 only, before any test-session output)
The alignment changed (MOABB EA, which centres each window), so I re-ran the whole selection on the session-0 validation runs. Session 1 was dropped right after loading, and the choices were recorded (20:05 UTC) before any session-1 output of this pipeline existed.
Disclosure. The pre-stated rule was "larger only if more than 2 points better". Previously 4096 was 2.08 points ahead, and I had kept 2048 on secondary grounds. Now 4096 is 6.25 points ahead (6 of 96 windows), so the rule selects it, and the tutorial now uses 4096 features. Its secondary costs are stated in the tutorial:
The 32 features per class and the 20 random sets were fixed in advance. The random sets now come from
np.random.default_rng(0)instead of a torch generator, so they are different draws.Numbers from this run (laptop CPU, one seed); previous head in brackets
How to read this:
Validation (head 89ac394)
sandbox-exec) andHF_HUB_OFFLINE=1; Python 3.12, PyTorch 2.14.0, SAE Lens 6.51.3, MOABB 1.7.2, CPU, 10 threads.reve_positions.json) and the reve-base cache were unchanged (mtime and size).EEGClassifier.predictequals the torch argmax;sphinx-build -W), with no guard: executed 1/1 in 58.6 s, build succeeded, 0 warnings.finetune-foundation-model,load-pretrained-models) were stubbed; both exist in the docs.torch.randintfor SAE batches anddefault_rng(0)for the random feature-set control;try:/ImportError;find_spec/importlib;git merge-tree): master + this PR, master + docs: tutorial on SAE activation analysis with optional SAE Lens #1152, docs: tutorial on SAE activation analysis with optional SAE Lens #1152 + this PR, and master + both in either order are all clean. Both orders give the same tree:saeline and both changelog entries;docs/conf.pybyte-identical to master.fsspec2026.9.0 → 2026.6.0, capped bydatasets), and 42 packages are added.braindecode[all]does not pull sae-lens.brain-bzh/reve-baseis public: the HF API reportsgated: false,private: falseat sha dc2a075c (checked today). Fork PRs have noHF_TOKEN, so CI execution relies on it staying public. The weights are under the REVE Responsible Use License, which the tutorial mentions.Not run: GPU execution, the full gallery, the full test suite, and multiple subjects or seeds.
CI
build_docsrun 36616525126 was still in "Create Docs" when this push was made (20:43 UTC) and was cancelled at 20:44:44 UTC by the workflow's per-PRcancel-in-progress. No log of it is available, so it gives no evidence either way.Relationship to #1152
#1152 fits an SAE to a ShallowFBCSPNet trained from scratch and uses the activation hooks. This PR covers a frozen pretrained transformer: which blocks influence the prediction, token features as scalp maps, and error-preserving feature removal with random-feature and other-class controls. Neither tutorial imports or references the other. The CI/extra hunks are identical in both PRs, and neither touches
docs/conf.pyany more.Figures (commit 38dbfe2)
One additive commit,
plot_sae_reve.pyonly, restyling the figures as requested in review, with the same style cell as #1152. The PR head is now 911c345, a later merge of master on top of it. That merge does not touch the tutorial,docs/conf.py,pyproject.tomlor the workflows.+ xskip that carries the stream.sphinx-build -W: executed 1/1 in 59.4 s with 0 warnings and no matplotlib/mne warnings. I also rendered it with DejaVu only, as CI does. Pre-commit passed.Narrative and figures (commit a759d59)
One additive commit,
plot_sae_reve.pyonly, on top of 911c345. Text and figures only; no computation changed.Story. The first paragraph now poses the question: can a sparse dictionary fitted to a frozen pretrained EEG transformer expose features that its classifier actually uses? It splits the question into two tests, and the close answers in the same words: yes, for three of the four classes of this subject and seed.
The tutorial ends on one take-home: read the substitution test first, and call a feature set used for a class only when removing it lowers that class more than random sets and the other classes' sets do.
Structure.
Figures. Each figure answers one question. Every title is computed from the numbers it shows. Colors follow the Braindecode documentation (
docs/_static/landing.css): brand blue for the result, ink for the native model, muted slate for controls, red (#b5332e) for the rerun blocks, the other classes' feature sets and negative values in the diverging maps. The cosmeticrcParamsblock runs inside a sphinx-gallery ignore block.token_streams(once) andrun_blocks(per edit); the edit of each testFigure cells now end with
plt.show(), so the gallery no longer prints aText(…)repr under five figures.Checks.
sphinx-build -W, outbound network blocked (sandbox-exec) andHF_HUB_OFFLINE=1: executed 1/1 in 56.6 s, build succeeded, 0 warnings, peak RSS 5.7 GB.validate.py --mode strict), with the 89ac394 prose as the fact list: ACCEPTED, with no fact dropped and none added beyond two printed values (FVU 0.376, 72%). The structure check gave no warning.