ReviewOS

home-lang/home

Port node:perf_hooks histogram matrix

#132
Closed chris opened this 11 days ago ·
11 days ago

Scope

Activate Bun’s byte-identical js/bun/perf_hooks/histogram.test.ts corpus and provide reusable node:perf_hooks / perf_hooks histogram behavior in the Home corpus runtime.

Baseline

  • exact corpus: 0 passed, 0 failed, 0 unsupported, 1 native todo
  • corpus matches ~/Code/bun byte-for-byte
  • Home’s native runtime already exposes createHistogram; the corpus harness lacks the module surface

Acceptance criteria

  • implement option validation and Node-style error codes
  • support number/BigInt records and getters, min/max/count/mean/stddev, bounds/exceeds, percentile and percentileBigInt, percentile maps, add/reset, recordDelta, toJSON, and inspect output
  • activate the unchanged 38-test matrix with no fabricated per-test results
  • add permanent regression coverage
  • exact corpus passes 38/38 with 0 failures/unsupported/todo
  • full home_test gate passes
  • commit/push as Chris Breuer without coauthors and update #66
11 days ago

Implemented and pushed in 207cb52 (feat: port Node histogram hooks).

What landed:

  • activated the byte-identical upstream js/bun/perf_hooks/histogram.test.ts
  • registered reusable perf_hooks and node:perf_hooks module surfaces
  • implemented Node-style option/type/range validation and error codes
  • implemented number/BigInt recording and getters, min/max/count/mean/stddev, bounds/exceeds, percentile/percentileBigInt and maps, add/reset, real elapsed recordDelta, toJSON, and Histogram inspection
  • brands histogram objects through a private WeakSet, so inspect never reads arbitrary user properties or triggers hostile getters/proxy traps
  • added a permanent regression requiring all 38 upstream tests and zero todo/unsupported

Validation:

  • corpus verified byte-identical with ~/Code/bun
  • ./pantry/.bin/zig build debug --summary failures — pass
  • exact histogram corpus — 38 passed, 0 failed, 0 unsupported, 0 todo
  • exact internal-inspect regression — 2 passed, 0 failed, 0 unsupported, 0 todo
  • initial full gate caught the proxy-unsafe brand lookup; after the WeakSet correction, the complete home_test gate passes

Closing as complete. Tracking continues in #66.

Sign in to comment on this issue.