Repository navigation
test: property-based fuzz testing for js->zig->js roundtrip - #41
Open
nazarhussain wants to merge 17 commits into
Open
nazarhussain wants to merge 17 commits into
nazarhussain wants to merge 17 commits into
Conversation
wemeetagain
reviewed
Jul 24, 2026
| - name: Test | ||
| run: pnpm test:js | ||
|
|
||
| test-fuzz: |
Member
There was a problem hiding this comment.
seems a little strange to fuzz in CI
wemeetagain
reviewed
Jul 24, 2026
wemeetagain
left a comment
Member
There was a problem hiding this comment.
I think the API changes and additional comments are good
nazarhussain
force-pushed
the
nh/fuzz-testing
branch
2 times, most recently
from
October 19, 2026 10:11
4b09223 to
e3384ed
Compare
nazarhussain
changed the base branch from
main
to
nh/bigint-exact-conversions
October 19, 2026 10:11
nazarhussain
force-pushed
the
nh/fuzz-testing
branch
from
October 19, 2026 10:20
e3384ed to
959d16d
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Round-trips JS BigInt → i128 → JS BigInt via toI128 and fromWords. Property test covers the i128 boundary plus out-of-range truncation via BigInt.asIntN(128, ·). Oracle test adds deterministic boundary cases for zero, I128_MIN/MAX (exact), just-out-of-range ±1, and oversized values whose low 128 bits are all zero (expected result: 0n).
The seeds-workflow doc claimed NaN/Infinity could be persisted via a
{"__special": ...} encoding, but no corresponding reviver exists in
fuzz.test.ts — following the README literally would silently corrupt
test input. NaN/Infinity are already in edgeNumbers and exercised every
run, so persisting them adds nothing. Trim the README to match reality.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nazarhussain
force-pushed
the
nh/bigint-exact-conversions
branch
from
October 19, 2026 10:31
0773d1c to
0dcc598
Compare
nazarhussain
force-pushed
the
nh/fuzz-testing
branch
from
October 19, 2026 10:31
959d16d to
17080db
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a property-based fuzz harness for zapi
Number,BigIntandUint8Arrayconverters (vitest + fast-check, driven through a dedicatedtest_fuzz_numeric.nodeaddon). The harness surfaced several latent bugs and an API sharp edge.Changes
tests/fuzz/: round-trip fuzz targets and fast-check properties forNumber,BigIntandUint8Array, with oracle tests and a seeds workflow (seetests/fuzz/README.md).tests/build.zig.zon/tests/build.zig: a separate Zig package for the fuzz addon, mirroringexamples/and consuming zapi via--fork=... It installs to the rootzig-out/.package.json:build:zignow runsbuild:zig:examplesandbuild:zig:tests; addstest:fuzz:round_tripand thefast-checkdev dependency.test-fuzzjob.🤖 Generated with Claude Code