Skip to content

[Sad Catapella N4][Scientific integrity] Duplicate plane_id rows are accepted and silently double-counted in normalization #43

Closed

Description

@guijacquemet

Audit basis

Normalization Batch 4, commit f784c95e3049483f87466150ffc5764375fa631d. Confirmed missing uniqueness enforcement, with deterministic counterexample; no package test execution.

Evidence

Counterexample

Construct one source plane A and another plane B with different histograms but the same group; write [A, B, B] as the CSV or pass them to scope_groups/fit. Every row is individually valid. Repeating B weights its pixels twice, so pooled mean, percentiles and normalization scales can change although the physical source had only two planes. In the case of an identical duplicate row, the table is still scientifically invalid even if some normalized parameters are unchanged.

Fix / acceptance

Enforce unique plane_id within a statistics table/read and within each public grouping/fit entry path at a clearly specified trust boundary; report source path, z/t and first/duplicate row indexes. For a streaming reader, keep bounded identity tracking (O(number of planes) keys) and reject prior to parameter publication; do not silently deduplicate since that changes the user's data. Include exact duplicates, conflicting duplicate histograms, same image at different t/z (valid), same basename in different folders (valid), and multiple channels in one XYC row (valid). Document ownership with preprocessing's run manifest and do not imply an input tamper can always be detected by this library alone. Benchmark N=1k–100k records; no Numba needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions