Styxis
Company
Knowledge

An empty weighted bincount: zero sums and a float64 handoff are separate conditions

Even a no-data batch must retain the approved weighted-aggregate dtype and input-length contract.

An empty batch is still a handoff

Even a no-data batch must retain the approved weighted-aggregate dtype and input-length contract. Truthound can check the extracted final dtype at handoff. Skipping empty results would leave a consumer changing behavior only when records happen to appear. [1, 2, 3]

Two effects of the early return

NumPy #33203 reports empty weighted bincount returning an integer dtype and bypassing a weight-length check in the empty-input path. Float weights are present in the control. The reporter asks whether this boundary behavior is intended, so the report does not establish an adopted correction. [1]

Record the actual returned dtype

Record bin definitions, weight presence, input lengths and the actual output dtype. If an empty batch differs from the approved float64 contract, validate an explicit conversion or separate empty-result path. Check value and weight lengths even for empty input, and do not substitute the weights dtype for the returned dtype. [1, 3]

Three bins and a separate type reference

The illustrative contract hands off a float-weight aggregate with 3 bins and dtype float64, including empty input. float64 meets that type condition; int64 fails. Whether all 3 values are 0 and whether the bin count is correct are separate checks. [1, 3]

Compare dtype signatures

Truthound Core Python SDK 3.3.2 can compare prepared required_weighted_count_dtype and actual_weighted_count_dtype using ColumnPairValidator with relationship="==". The operator extracts non-missing dtype names from the actual array. The SDK does not execute bincount; dtype equality does not establish weighted sums, bin length or value accuracy. [1, 2, 3]

Alternatives for constructing an empty result

An explicit float64 empty table or verified cast still needs a separate weight-length check. Where the same empty boundary and consumer dtype are already verified, reuse that evidence instead of adding redundant comparison. Filling a no-data result with numeric 0 alone does not preserve the complete handoff contract. [1, 3]

Application conditions

Check value and weight lengths even for empty input and define the bin count and dtype beforehand.

Alternatives

Create an explicit float64 empty result or use a verified cast while retaining independent length checks.

Limitations

  • Core compares externally extracted dtype names, does not run bincount and cannot prove sums or bin lengths from dtype equality.

Evidence

Event checked
Subject checked
Modified