ReviewOS

home-lang/home

Port Highway SIMD source-map decoding and scoped debug logging

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

Parent: #66

Home still used the scalar-only Zig source-map mappings parser and a no-op Output.scoped facade. That meant the Bun sourcemap-simd corpus could compare scalar results, but it could not prove the native Highway decoder ran. Debug-only logger code was also dormant and had Zig 0.17 compatibility gaps.

Scope:

  • call Bun Highway delimiter counting and mappings decoding through the existing native C ABI
  • preserve exact scalar fallback state, errors, sorting, name promotion, and the disable feature flag
  • restore environment-controlled scoped debug logging in Debug builds and compile it out of ReleaseFast
  • port the formatter and std.Io compatibility needed by the activated logger cone

Acceptance:

  • the unmodified upstream js/node/module/sourcemap-simd.test.ts passes 24/24 in Debug and ReleaseFast
  • the tracked corpus copy passes 24/24 through the full native VM in Debug and ReleaseFast
  • Debug output contains simd consumed only for the SIMD child
  • ReleaseFast contains no scoped SIMD marker
  • no assertion, timeout, workload, or test source changes
10 days ago

Implemented and pushed to main:\n\n- a380b8b — feat(runtime): port SIMD source map decoding\n- 05cc558 — routes the tracked SIMD test through the full native VM automatically because it depends on Bun.spawn, Bun.stdin, and child runtime state\n\nImplementation:\n- calls the linked Bun Highway C ABI directly from the source-map parser\n- reserves and fills MultiArrayList SoA columns in place\n- restores accumulator state for byte-identical scalar tail/error handling\n- preserves name promotion and -1 name rows\n- adds BUN_FEATURE_FLAG_DISABLE_SIMD_SOURCEMAP\n- replaces the no-op scoped logger facade with Bun scoped logging in Debug builds\n- ports the activated Zig 0.17 std.Io and formatter compatibility cone\n- compiles scoped logging out of true ReleaseFast builds\n\nEvidence:\n- Debug, unmodified upstream js/node/module/sourcemap-simd.test.ts: 24 pass, 0 fail, 426 expect calls\n- Debug, tracked corpus copy with automatic routing: 24 pass, 0 fail\n- ReleaseFast, unmodified upstream: 24 pass, 0 fail\n- ReleaseFast, tracked corpus copy: 24 pass, 0 fail\n- direct Debug probe: SIMD child logged simd consumed 990/999 bytes\n- direct Debug probe with the disable flag: no simd consumed marker and identical mapping result\n- ReleaseFast binary contains no simd consumed scoped-log string\n- zig build debug -Denable_jsc=true: clean\n- zig build release-fast -Denable_jsc=true -Doptimize=ReleaseFast: clean\n- git diff --check: clean\n\nNo tests, assertions, deadlines, or workloads were changed.

Sign in to comment on this issue.