Styxis
Company
Knowledge

A 10-byte varint for negative Go INT32: the exchange boundary hidden by positive tests

Check wire width and readback separately for each sign.

Preserve the input sign

Check wire width and readback separately for each sign. Positive success cannot approve exchange of negative sentinels or measurements. Preserve sign in the byte reconciliation supplied to Truthound; dropping rejected negative values as missing would erase part of the source population. [1, 2, 3]

A failure condition distinct from INT16

Beam #40159 reports Go encoding negative INT32 values as a 64-bit varint rejected by Java and Python. Positive values are unaffected, and Go already reads the 5-byte form. Although found alongside the INT16 investigation, this report concerns a separate width-and-sign condition rather than byte order. [1]

Retain a negative control

Cross-read -1 and positive controls through multiple SDKs, withholding the ten-byte negative representation from the approved INT32 exchange path. Separate value bytes and row framing and retain decode status and restored value. An all-positive fixture does not exercise the negative boundary. [1, 3]

An independent 32-bit representation

The illustrative INT32 -1 uses the unsigned 32-bit value 4294967295 in the varint contract: ffffffff0f. That passes. The sign-extended 64-bit form ffffffffffffffffff01 fails this exchange contract. Byte equality is only the wire condition; do not truncate bytes to manufacture it, and verify actual readback as -1. [1, 3]

Two obligations: bytes and readback

Truthound Core Python SDK 3.3.2 can compare prepared int32_unsigned_form_hex and encoded_minus_one_hex using ColumnPairValidator with relationship="==". The operator decodes value boundaries and supplies exact hex. The SDK does not repair decoder overflow or resend rejected rows; successful decode and value preservation still need separate evidence. [1, 2, 3]

Preserve what the negative value means

Cross-test corrected width handling and consider an explicit migration reader for stored negative Go values. If the business accepts only positives, document that scope rather than treating the negative as an ordinary operating input. Replacing a negative with 0 would not preserve the original observation. [1, 3]

Application conditions

Preserve raw negative integers and extract value bytes, framing and decode status separately.

Alternatives

Cross-test the width correction and use an explicit migration reader for existing negative Go rows.

Limitations

  • The SDK does not repair decoding or resend rows; equal byte length does not establish equal values.

Evidence

Event checked
Subject checked
Modified