ReviewOS

zig-utils/zig-js

ABI: implement exact JSC Math.pow operation

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

Parent: #134 Related: #140, #163, #164

Implement the shared raw numeric helper declared by pinned Home/Bun jsc.zig and defined as a direct JavaScriptCore operationMathPow call.

Acceptance:

  • Export Bun__JSC__operationMathPow(f64, f64) f64 with the exact C signature.
  • Share one implementation with JavaScript Math.pow so the private ABI and language builtin cannot drift.
  • Match ECMAScript/JSC edge behavior for NaN, infinities, signed zero, negative finite bases, fractional exponents, and odd/even integer exponents.
  • Add focused engine and compiled Home/Bun consumer evidence in Debug and ReleaseSafe.
  • Refresh inventories/docs and parent issue evidence.
9 days ago

Completed in 3e96dde2 and pushed directly to main.

Evidence:

  • exact Bun__JSC__operationMathPow(f64, f64) f64 C export;
  • the export and JavaScript Math.pow share builtins.operationMathPow;
  • focused matrix covers ordinary powers, NaN exponent/base, ±1 with infinite exponent, negative fractional bases, odd/even negative bases, signed zero, and signed infinities;
  • focused engine test: 3/3 pass, zero skips/failures/leaks in Debug and ReleaseSafe;
  • pinned Home consumer: 349/349 symbols linked and runtime matrix passed in Debug and ReleaseSafe;
  • Bun-profiled compiled consumer passes in Debug and ReleaseSafe;
  • inventories: Home 362/471 implemented (109 pending), Bun 354/461 (107 pending), zero unclassified;
  • ABI parser unit tests: 4/4 pass;
  • ABI/API/Home integration documentation carries the new counts and shared-operation semantics.

The root README benchmark block remains unchanged because this raw compatibility export does not regenerate benchmark results.

Sign in to comment on this issue.