Skip to content

Add a fast test for the disentangled spatiotemporal SSM - #2624

Merged
akenmorris merged 1 commit into
masterfrom
fix-disentangled-test
Aug 9, 2026
Merged

Add a fast test for the disentangled spatiotemporal SSM#2624
akenmorris merged 1 commit into
masterfrom
fix-disentangled-test

Conversation

@akenmorris

@akenmorris akenmorris commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Supersedes #2128 (for #2122), picking up @nawazishkhan1-nk's stalled test, which now conflicts with master.

The test took over an hour: 8x8 shapes at 512 particles, 1000 iterations per split. It now runs 128 particles for 300 iterations in about 11 seconds, at the same model quality.

Absolute eigenvalue thresholds are replaced by one grounded in the fixture. Each subject is an ellipsoid with a fixed X radius and a shared Y-radius trajectory, so within a time point the subjects differ by exactly one linear mode. The first PCA mode's variance fraction is then a scale-free measure of correspondence — ~0.99 here, below 0.2 when it is lost. It also asserts the mode is DisentagledEnsembleEntropy, so the feature can't silently fall back.

Also fixes a crash: ComputeCovarianceMatrices() sizes the per-subject matrix by subject count but fills it by time point count, so more time points than subjects aborts. The 8x8 fixture hid it; a second test uses 4x8.

The fixture is now a .swproj rather than a binary .xlsx, minus 128 regenerated particle files.

The test added in #2128 took over an hour: 8 subjects x 8 time points at 512
particles with 1000 iterations per split. It now runs 128 particles for 300
iterations and finishes in about 11 seconds while reaching the same model
quality as the original.

Instead of asserting absolute eigenvalues, the test uses the structure of the
fixture: each subject is an ellipsoid whose X radius is fixed per subject and
whose Y radius follows a trajectory shared by every subject, so within a time
point the subjects differ by a single linear mode. The first PCA mode explaining
nearly all of the across-subject variance is therefore a direct measure of
correspondence, and it is scale free. It reaches ~0.99 here and falls below 0.2
when correspondence is lost.

The per-subject objective matrix was also sized by the number of subjects rather
than the number of time points, so any dataset with more time points than
subjects aborted. The original fixture is 8x8, which hid it. Fixed, and covered
by a second test with a deliberately unequal dataset.

The project fixture is now a .swproj rather than a binary .xlsx, and the 128
checked-in particle files that the run regenerates anyway have been dropped.

Co-authored-by: Nawazish Khan <nawazishkhan1.nk@gmail.com>
@akenmorris
akenmorris merged commit 84e7876 into master Aug 9, 2026
5 checks passed
@akenmorris
akenmorris deleted the fix-disentangled-test branch August 9, 2026 21:39
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