ReviewOS

home-lang/home

Bun parity: port WHATWG legacy TextDecoder indexes

#333
Closed chris opened this 10 days ago ·
10 days ago

Tracks the copied Bun corpus gap at position 4101: js/web/encoding/text-decoder-wpt.test.ts.

The first failure is IBM866 byte 0x80: Home currently returns U+0080, while the WHATWG index requires U+0410. The fix should port the legacy single-byte decoder indexes and label normalization through the shared TextDecoder compatibility path, preserving fatal/BOM/streaming behavior and producing structured invalid-data errors rather than per-test substitutions.

Contiguous corpus before this issue: 441 files, 3,691 passed, 0 failed, 0 unsupported through position 4100.

10 days ago

Completed in ff059ff (fix(encoding): port WHATWG single-byte decoders) and pushed directly to main as Chris Breuer.

What landed:

  • corpus TextDecoder label canonicalization now delegates to Home’s production WHATWG EncodingLabel map
  • legacy single-byte decoding now delegates to Home’s linked WebKit/Bun TextCodecSingleByte registry
  • Windows-1252 follows Home’s dedicated production CP1252 conversion path
  • the JSC bridge now creates length-aware UTF-16 strings, preserving embedded U+0000 and every decoded code unit
  • native decode failures expose code, operation, encoding, cause, and chained stack context
  • js/web/encoding/text-decoder-wpt.test.ts is pinned in the permanent HTTP/web tail queue

Verification:

  • focused corpus position 4101: 2,207 passed, 0 failed, 0 todo, 0 unsupported
  • permanent HTTP/web tail queue: passed
  • clean zig build --cache-dir /private/tmp/home-zig-abi-cache: passed

Cumulative contiguous corpus through position 4101: 442 files, 5,898 passed, 270 todo, 172 allowed-empty, 0 failed, 0 unsupported.

Sign in to comment on this issue.