ReviewOS

zig-utils/zig-js

ABI: implement exact WTF parsing, CPU, allocator, and HTTP-date helpers

#214
Closed chris opened this 9 days ago ·
9 days ago

Parent: #134 Profiles: #163, #164

Implement the five pinned WTF.zig native imports:

  • WTF__parseDouble
  • WTF__parseES5Date
  • WTF__numberOfProcessorCores
  • WTF__releaseFastMallocFreeMemoryForThisThread
  • Bun__writeHTTPDate

Acceptance criteria:

  • Match WebKit FastFloat prefix parsing: no leading whitespace, optional sign, decimal/fraction/exponent grammar, exact consumed-byte count, no Infinity/NaN spelling.
  • Match the pinned WebKit ES5 date grammar, validation, fractional milliseconds, leap-second handling, timezone forms, and NaN failures without accepting legacy date text.
  • Report at least one online processor and clamp safely to the C ABI range.
  • Define the FastMalloc-release operation correctly for zig-js allocator ownership (no retained per-thread FastMalloc cache).
  • Write exact RFC 7231 IMF-fixdate bytes, honor timestamp-zero and bounded snprintf-style output semantics, and avoid buffer overrun.
  • Add focused boundary tests and link/runtime fixture coverage for all five symbols.
  • Refresh Home/Bun inventories, README/docs, and parent issues with exact evidence.

Backward compatibility remains out of scope for the pre-release tool.

Implementation: d0a951c4 Documentation/inventories: 2eb274e5

9 days ago

Completed on origin/main.

Evidence:

  • focused WTF harness: 3/3 selected tests passed, 0 leaked;
  • compile-link-runtime fixture: 189/189 symbols linked and runtime matrix passed;
  • Home audit: 190/431 implemented, 241 pending;
  • Bun audit: 184/421 implemented, 237 pending;
  • public audit: 117/117 public, 19 extensions, 194 private/support exports;
  • combined verification batch: 15/15 steps succeeded.

The README continues to publish the latest July 17 isolated 1,540-sample JSC benchmark artifact unchanged because these private stateless helpers do not affect the benchmarked execution paths.

Sign in to comment on this issue.