Skip to content

[Audit/Correctness] same_objects counts many-to-one IoU overlaps as one-to-one matches #67

Closed

Description

@guijacquemet

Evidence (Sad Catapella, Batch 1; main d7a538e)

  • pair_counts, lines 317–320 sets children_matched_one_to_one and parents_matched_one_to_one by taking separate unique IDs from all edges exceeding IoU. It never constructs a one-to-one matching or checks degrees.
  • _relation, lines 484–489 treats those counts as evidence of same_objects.
  • Contract §15.1 expressly requires one-to-one matching.

Deterministic counterexample (code-path proof; not executed)

A parent mask has one four-pixel object labelled 1. A child mask partitions the same four pixels into two disjoint two-pixel objects labelled 10 and 11. Each child's intersection with the parent is 2, union 4, IoU = 0.5. The implementation counts 2/2 children and 1/1 parents as matched and returns same_objects, despite a 2:1 relationship. Lowering the configurable IoU threshold makes this error more prevalent.

Impact

Misleading segmentation-equivalence suggestions and incorrect same_objects evidence in mask_relationships.json, potentially interpreted by downstream bricks as equivalent object identities.

Fix / acceptance

Build a bipartite matching of child and parent instances (per plane) from IoU-eligible edges, maximising cardinality with deterministic tie-breaking; count only matched endpoints. Consider sparse matching to avoid dense K×K matrices. Add regression for the 2-child/1-parent example at IoU=0.5 and a configurable lower threshold; preserve existing genuine 1:1 tests. Benchmark sparse/dense masks separately; no benchmark has yet been run.

Classification: confirmed source-level semantic defect, with analytic counterexample. No repository tests executed.

Activity

  1. added a commit that references this issue on Nov 2, 2026
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