Skip to content

Signed zero: a plane holding -0.0 and +0.0 can record a different pixel_min/max on different platforms #105

Closed

Description

@guijacquemet

Observation

Found during #104 (D6) and confirmed in its independent review on v0.7.0 (c6a9f9d). A float plane that holds both -0.0 and +0.0 gets a pixel_min (or pixel_max) of -0.0 or +0.0 depending on NumPy's min/max, which depends on the element order and, in practice, on the platform. The CI of #104's first head failed on Windows and macOS only, on such planes. So for the same pixels, plane_histograms.csv can say -0.0 on one OS and 0.0 on another. This is a byte-identity break across platforms.

The integer path is not affected, and #104 did not change the float path.

Decision needed (owner)

Choose a canonical rule. For example:

  1. -0.0 whenever the plane holds a negative zero (sign-aware min), and +0.0 whenever it holds a positive zero for the max; or
  2. canonicalise both to 0.0 in the recorded extrema.

Either rule is a behaviour change for some files, so it gets its own CHANGELOG entry and a cross-platform test with planes that mix signed zeros in several orders.

Activity

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