Skip to content

Value sign: entropy is labelled NonNegative but a single-item entropy is -0.0 under the sign-bit definition #1271

Open

Description

@zzylol

Example

entropy over a group with a single distinct item: the exact value is −Σ p·log p with p = 1, i.e. −(1·0.0) = −0.0 in IEEE arithmetic. The memo labels every frequency-entropy value NonNegative, but under the sign-bit definition of ValueSign (#1230: NonNegative = every non-NaN value has its sign bit clear) −0.0 has its sign bit set, so the label is wrong for this value. A UnivMon entropy estimate has the same label; whether its estimator can return a value below zero (it sums signed terms without a clamp) is not verified.

Where

crates/types/src/stages/logical/column_properties.rs on the #1230 branch:

  • measure_sign: FrequencyEntropy { .. } → NonNegative (exact aggregate).
  • the SummaryEstimate readout: SketchStatistic::FrequencyEntropy → NonNegative (sketch estimate).

Any other measure labelled NonNegative whose computation can end in a negated zero or a rounding error below zero should be checked the same way (for example a variance computed as E[x²] − E[x]²).

Options

  1. Label entropy Unknown (simplest, conservative).
  2. Keep NonNegative and make the executor's entropy readouts return +0.0 for a zero result (clamp −0.0, and clamp a negative estimate to 0 if the estimator can produce one), with a test per readout.

Found in the review of #1230 (part of #1207).

Done when

  • The entropy sign rule and the executor agree under the sign-bit definition, with a test for the single-item case.
  • The other NonNegative measures are checked for −0.0 / rounding below zero, and fixed or listed.

Activity

  1. added
    accuracyAccuracy requirements, guarantees, and propagation
    bugSomething isn't working
    irPre-ASAP or post-ASAP intermediate representation
    on Nov 10, 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

    accuracyAccuracy requirements, guarantees, and propagationbugSomething isn't workingirPre-ASAP or post-ASAP intermediate representation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions