Memberships refuse an object whose events are in another order or another partition - #59
Open
david-priest wants to merge 1 commit into
Open
david-priest wants to merge 1 commit into
david-priest wants to merge 1 commit into
Conversation
…ther partition The stored bitsets are positional, and the only guard was the column count, so an SCE with the same number of events in a different order, or partitioned into different samples, read the wrong events as members while the documentation said reordering was refused. An explicit save now stores a fingerprint of the column names and of the sample partition it packed against, and the read compares both; a record written before the fingerprint existed keeps the column-count check alone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stored population memberships are one packed bitset per population, positional over the SCE's columns, and the only guard on reading them back was the column count. An SCE with the same number of events in a different order, or partitioned into different samples, read the wrong events as members — while
gatelabPopulations()'s documentation said reordering was refused.An explicit "Save to SCE" now stores a fingerprint beside the record: an xxhash64 digest of
colnames(sce)and one of the sample partition it packed against (with the column the partition used, so the read recomputes the same one).gatelabPopulations(),gatelabLeafPopulation()and the hierarchy readers compare both and refuse a mismatch with a message that says what differed and to press Save to SCE on this object. A record written before the fingerprint existed keeps the column-count check alone, so nothing already saved stops reading.Tests: a reordered SCE and a re-partitioned one are refused; the object the memberships were saved on still reads; a record without a fingerprint still reads.
Finding 13 of the 2026-09-11 review of the wsp-testing PRs.
🤖 Generated with Claude Code