Skip to content

Add cross-version serialization tests#4636

Open
h-mayorquin wants to merge 9 commits into
SpikeInterface:mainfrom
h-mayorquin:backwards_comptability_testing
Open

Add cross-version serialization tests#4636
h-mayorquin wants to merge 9 commits into
SpikeInterface:mainfrom
h-mayorquin:backwards_comptability_testing

Conversation

@h-mayorquin

@h-mayorquin h-mayorquin commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

SpikeInterface has no test that loads an object serialized by an older release with the current code, even though that is exactly the path that breaks users. We only round-trip within a single version, which never exercises a class move, a renamed constructor argument, or a change in how something is written to disk. Two recent cases make the gap concrete. On #4588, Sam pointed out that moving NoiseGeneratorRecording out of core could break any old JSON or pickle that stored its fully qualified class path. The probe refactor in #4465 changes how a probe is written to disk (contact_vector property to a ProbeGroup object), which risks old saved recordings either failing to load or, worse, silently mis-mapping channels to locations. Nothing in continuous integration would catch either today.

This adds a harness that generates a small battery of canonical objects under an old release and loads them with the branch, asserting content rather than only that they load. Fixtures are regenerated from a real old install each run in an isolated uv environment, so nothing is committed to the repository. The battery covers both failure axes: JSON recipes catch moved classes and changed signatures (the #4588 case, where the fixture records the old core.generate.NoiseGeneratorRecording path and loading exercises the redirect), while folder and zarr fixtures catch on-disk encoding changes. Those include a single-probe and an interleaved multi-probe recording that assert exact per-channel locations, so a silent channel-to-location scramble (the case that motivated _global_contact_order in #4465) fails the test instead of passing on shape alone. It runs against the previous release on every pull request touching core, and the full version matrix weekly.

I set the version floor at 0.102 because 0.100 and 0.101 no longer install cleanly on the continuous-integration Python (numcodecs dependency rot). This makes "testable floor equals support floor" a deliberate choice worth confirming with the team rather than an accident.

h-mayorquin and others added 4 commits July 1, 2026 15:46
Generate a battery of canonical objects (recordings, a preprocessing chain,
a probe recording including an interleaved multi-probe case, and a sorting)
under an old spikeinterface release, then load them with the current code and
assert their content. Catches changes that silently break loading of old saved
files: moved classes, changed constructor signatures, and changed on-disk
encodings, across json/pickle recipes and folder/zarr materialized state.

Live generation via an isolated uv environment (nothing committed): per-PR runs
against the previous release, a weekly matrix covers 0.102-0.104. The version
floor is the oldest release that installs cleanly on the CI Python.
Add workflow_dispatch for post-merge manual runs, and temporarily let the
weekly matrix run on pull_request to exercise it once in CI. The pull_request
trigger on the matrix job must be removed before merge.
…ger)

The full version matrix passed once in CI on this PR; remove the temporary
pull_request trigger so it no longer runs the heavy matrix on every push. It
now runs weekly and via manual workflow_dispatch (available post-merge).
@alejoe91 alejoe91 added the continuous integration Related to CI label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants