Skip to content

test(writer): property-based lossless round-trip for ALP (f32/f64)#88

Merged
dfa1 merged 1 commit into
mainfrom
test/alp-property-roundtrip
Jun 20, 2026
Merged

test(writer): property-based lossless round-trip for ALP (f32/f64)#88
dfa1 merged 1 commit into
mainfrom
test/alp-property-roundtrip

Conversation

@dfa1

@dfa1 dfa1 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Seeded @MethodSource generators feed ~100 random arrays per width — ALP-friendly
decimals (clean exponent path), fully-random bit patterns (patch path), and a
curated edge array (±0, subnormals, MIN/MAX, NaN, ±Inf) — through
encode → decode and assert the result is bit-identical to the input. Far stronger
than the existing isCloseTo example tests.

Surfaced one documented edge: ALP collapses -0.0 → +0.0 (its round-trip check
treats -0.0 == 0.0, so signed zero isn't patched; matches the Rust reference).
Value-lossless, not bit-lossless for signed zero — the assertion canonicalizes ±0
and the class doc explains why; everything else must be bit-exact.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Seeded @MethodSource generators feed ~100 random arrays per width — ALP-friendly
decimals (clean exponent path), fully-random bit patterns (patch path), and a
curated edge array (±0, subnormals, MIN/MAX, NaN, ±Inf) — through
encode → decode and assert the result is bit-identical to the input. Far stronger
than the existing isCloseTo example tests.

Surfaced one documented edge: ALP collapses -0.0 → +0.0 (its round-trip check
treats -0.0 == 0.0, so signed zero isn't patched; matches the Rust reference).
Value-lossless, not bit-lossless for signed zero — the assertion canonicalizes ±0
and the class doc explains why; everything else must be bit-exact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit dbe44aa into main Jun 20, 2026
6 checks passed
@dfa1 dfa1 deleted the test/alp-property-roundtrip branch June 20, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant