Skip to content

Run the core package gate on Windows#158

Open
narmi924 wants to merge 1 commit into
vercel-labs:mainfrom
narmi924:fix/windows-core-package-gate
Open

Run the core package gate on Windows#158
narmi924 wants to merge 1 commit into
vercel-labs:mainfrom
narmi924:fix/windows-core-package-gate

Conversation

@narmi924

Copy link
Copy Markdown

Summary

  • link the generated core shim libraries against libc explicitly
  • decode benchmark arguments through Zig's platform-neutral process API
  • replace the macOS-only benchmark clock symbol with Zig's monotonic awake clock
  • emit and launch benchmark executables with the correct Windows suffix

Why

npm --prefix packages/core run gate could not run on Windows. Its deterministic core gate crossed several platform boundaries that had only been exercised in a Unix/macOS shape:

  1. The generated shim uses the C allocator, but both zig build-lib commands omitted -lc.
  2. The benchmark read init.minimal.args.vector as C strings, although Windows exposes a UTF-16 native argument vector.
  3. Timing linked directly to macOS clock_gettime_nsec_np.
  4. Explicit extensionless -femit-bin names produced PE files that Node could not launch on Windows.

Implementation

The gate now links libc consistently for ReleaseSafe and ReleaseFast. The benchmark uses args.toSlice for UTF-8 arguments and std.Io.Timestamp.now(io, .awake) for monotonic timing; .awake retains the existing CLOCK_UPTIME_RAW mapping on macOS. A shared helper supplies .exe to both emitted and executed benchmark names on Windows while leaving Unix names unchanged.

The oracle digest and benchmark workloads are unchanged.

Validation

  • npm --prefix packages/core run gate
    • ReleaseSafe and ReleaseFast builds passed
    • run1k digest matched 4e1140c16ba5569ab73db860894f4eba
    • both 10k benchmarks completed
  • zig build test-ts-core-e2e
  • scripts/gate.sh fast origin/main with PR Make build validation portable on Windows #157 temporarily applied in a detached validation worktree
    • root tests
    • manifest validation
    • frontend examples
    • native examples
    • mobile examples

The temporary application of #157 was needed only because current main has the Windows CRLF root-gate failure addressed there. This branch does not contain #157 and remains an independent two-file package-gate change.

No changelog fragment is included because this changes test infrastructure only.

@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

@narmi924 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@narmi924
narmi924 marked this pull request as ready for review July 19, 2026 11:06
Comment thread packages/core/test/fixtures/bench.zig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant