Styxis
Company
Knowledge

Preserve the kind of nonfinite value after ClickHouse rounding

A finite check cannot distinguish NaN from infinity after rounding. Retain input and output class tags to preserve the difference between an indeterminate calculation and an infinite magnitude.

Nonfinite classes retain different meaning

NaN and infinity are both nonfinite, but they carry different information. A rounding contract may require the special-value class itself to survive. Truthound Core can compare prepared input and output classifications without pretending numeric NaN equality works normally. [1, 2, 3]

A mantissa-rounding report

ClickHouse issue #128784 reports roundToExp2 clearing NaN mantissa bits and returning infinity, with signed NaN yielding -inf. The source identifies a correction PR and a containing master version. Verify deployment separately; this article does not claim an upgrade was performed. [1]

Record function and classification

Exercise ordinary and signed NaN plus finite controls. Export isNaN, isInfinite, sign, function, and server version before and after rounding. A generic finite check rejects both classes and therefore cannot prove that their distinction was preserved. [1, 3]

The expected class tag

Under the declared NaN-preserving rounding policy, the expected class tag is nan. An output tag nan passes. infinity fails because it introduces an infinite-magnitude state absent from the input. These tags describe numerical classes, not literal stored NaN strings. [1, 3]

Classification is an external input

ColumnPairValidator in Truthound Core Python SDK 3.3.2 can compare the operator-prepared non-null class tags. The classification extractor and function policy must be supplied independently. The SDK does not upgrade a server or change mantissa handling. [1, 2, 3]

Verify the actual function

Use the reported round and floor controls and verify the correction-containing version for the function actually used. A policy that quarantines all nonfinite values may remain useful, but it does not establish rounding equivalence. [1, 3]

Keep the original class in quarantine

Preserve the original class in diagnostics even when both outcomes enter one quarantine queue. Otherwise a changed arithmetic state becomes invisible precisely where investigators need to distinguish missing computation from unbounded magnitude. [1, 3]

Application conditions

Prepare function/version and input/output isNaN, isInfinite, and sign classifications.

Alternatives

Check the reported round/floor controls and correction-containing version for the actual function.

Limitations

  • Quarantining all nonfinite values does not establish NaN-class preservation.

Evidence

Event checked
Subject checked
Modified