Wave icon indicating copy to clipboard operation
Wave copied to clipboard

Extend fixed-width byte codecs to all supported Wave integer widths

Open LunaStev opened this issue 2 months ago • 0 comments

Motivation

Wave provides integer types beyond 64 bits, while fixed-width binary byte codecs stop at 64 bits. Users of 128–1024-bit protocol fields cannot use the same checked API family. Textual integer I/O in #726/#727 is a separate feature.

Starting points: std/bytes/endian.wave, std/bytes/read.wave, std/bytes/write.wave.

Scope

Extend BE/LE raw and checked binary codecs across every supported integer width. Preserve signed bit patterns and existing smaller-width APIs. Do not add new language types or arbitrary-precision allocation.

Difficulty: hard.

Completion criteria

  • [ ] Cover every supported width rather than completing only u128.
  • [ ] Test zero, signed minima/maxima, unsigned maxima and alternating bit patterns.
  • [ ] Verify unaligned access, bounds and output preservation.
  • [ ] Run native and WebAssembly O0/O2 round-trips.

Design decision needed: Agree on per-width versus generic public APIs and the signed/unsigned codec surface.

Please mention @LunaStev to discuss the design before starting implementation.

LunaStev avatar Sep 25 '26 12:09 LunaStev