Skip to content

v0.21.1

Choose a tag to compare

@Andste82 Andste82 released this 29 Jul 06:12
· 182 commits to main since this release
9c71fde

Two decode defects found by Crucible against the
0.21.0 / corelib 0.9.0 family. Both are generated-code fixes; no corelib change is needed,
and 0.21.1 works with the same corelib 0.9.0.

#235 — TypeScript quieted an fp32 signaling NaN

Generated TypeScript round-tripped an fp32 through a JS number (a 64-bit double), which turns
0x7F800001 into 0x7FC00001 — a violation of MESSAGE_SPEC §4.6, which requires a bit-for-bit
float round-trip with no normalization. It was the last of the thirteen drivers still doing this.

Decode now reads the wire bytes through corelib-ts's raw channel and keeps them beside the
convenience number; encode re-emits them verbatim while a hand-set value always wins.

Generated-API note: each fp32 scalar and native fp32[] gains a companion
<name>Fp32Raw: Uint8Array | null, non-null only when the decoded value was a NaN. The value API
is unchanged, presence (§2) still reads the value alone, and the JSON harness is byte-identical —
a NaN renders as null there, which is exactly why JSON could not catch this.

Known limit: an fp32 row nested inside a wrapper array (array<array<fp32>>) still widens; a
row has no field of its own to carry the companion.

#254 — java and csharp sized a skipped array from its own header

A native array field whose header carries the wrong array wire type must be skipped under §7.3.
Both backends skipped the elements but still resized the declared field from the skipped header's
count, so the field ended up holding a one-element array the wire never carried — the length
leaked, not the element. Eleven of thirteen implementations were already correct.

Two causes, both fixed: the skip arm folded UNSIGNED and SIGNED into one case, so a mistyped
header disarmed the discard counter instead of arming it; and the allocation block ran regardless
of the wire kind. The kind check now also precedes the schema-count bound, so an over-count
mistyped array is no longer a false INVALID — §7.3 applies the bound only to a field that
survives it.

Verification

Both fixes reproduce the defect on the pristine 0.21.0 tree first, with real bytes through the
generated harnesses, and both add a conformance leg that was independently shown to fail before
the fix — neither defect had anything exercising it, which is why they survived.

What's Changed

  • fix(typescript): fp32 signaling NaN survives a round-trip (#235) by @Andste82 in #255
  • fix(java,csharp): a §7.3-mistyped array must not size the declared field (#254) by @Andste82 in #256

Full Changelog: v0.21.0...v0.21.1