Skip to content

Expand Node parity test coverage - #1315

Merged
TheHypnoo merged 2 commits into
mainfrom
feat/node-suite-parity-coverage
May 22, 2026
Merged

Expand Node parity test coverage#1315
TheHypnoo merged 2 commits into
mainfrom
feat/node-suite-parity-coverage

Conversation

@TheHypnoo

Copy link
Copy Markdown
Member

Summary

Expands the curated test-parity/node-suite coverage for the modules that were already under test, without introducing new modules and without expanding object.

This PR adds 184 new Node parity tests across existing module directories:

  • assert
  • buffer
  • console
  • diagnostics_channel
  • events
  • os
  • path
  • querystring
  • string_decoder
  • timers
  • tty
  • url
  • util

The suite grows from 611 to 795 tests.

What changed

Added focused edge-case coverage for:

  • assertion matching, rejection/throw validation, deep equality, sparse arrays, Map/Set, typed arrays, circular references, symbols, and error causes
  • Buffer coercion, allocation, encodings, concat bounds, fill/write behavior, SharedArrayBuffer, inspection, ranges, swaps, and numeric edge cases
  • console formatting, Console instances, object labels, grouping, tables, getters, proxy-like shapes, private fields, error causes, and circular/BigInt formatters
  • diagnostics channel subscriber behavior, tracing, reentrant publish, import identity, and store shape
  • events abort/error handling, capture rejections, listener mutation, symbols, once/on, static listener helpers, and max listener behavior
  • OS constants, user info, network interface shape, platform/cpu/load/memory methods, and path-like values
  • path POSIX/win32 edge cases, type validation, parsing/formatting, namespaces, glob matching, and normalization
  • querystring parsing/stringifying, malformed escapes, custom encoders/decoders, legacy separators, prototype-like keys, and primitive values
  • string decoder chunk boundaries, invalid sequences, encoding aliases, stateful writes, and utf16/base64/hex boundaries
  • timers promises, abort behavior, object handles, ordering, disposal/refresh/close, clear behavior, and callback arguments
  • tty stream/class/isatty shape and coercion cases
  • URL, URLSearchParams, file URL helpers, mutation, static parse/canParse, legacy formatting, and encoding behavior
  • util formatting, inspect, parseArgs, promisify/callbackify/deprecate, and util.types predicates

Validation performed

New tests were validated against Node 22.15.0 with:

node --experimental-strip-types <new-test-file>

Repository checks run locally:

git diff --check
cargo check -p perry-api-manifest -p perry-hir -p perry-stdlib
cargo build --release -p perry -p perry-runtime -p perry-stdlib

Full node-suite parity run against Perry:

./run_parity_tests.sh --suite=node-suite

Result:

Parity Pass:   679
Parity Fail:   113
Compile Fail:  3
Skipped:       0
Parity Rate:   85.7%

Gaps surfaced by the expanded suite

The expanded suite identifies 116 total parity gaps:

  • 113 output/behavior mismatches
  • 3 compile failures

By module:

Module Total tests Pass Failures Rate
util 51 30 21 58.8%
buffer 114 98 16 86.0%
timers 58 45 13 77.6%
console 117 106 11 90.6%
url 48 37 11 77.1%
events 51 41 10 80.4%
assert 63 54 9 85.7%
path 77 68 9 88.3%
os 38 31 7 81.6%
querystring 55 52 3 94.5%
diagnostics_channel 57 55 2 96.5%
string_decoder 34 32 2 94.1%
tty 31 29 2 93.5%
object 1 1 0 100%

Main behavior buckets found:

  • util: inspect rendering, util.types predicates, parseArgs, promisify/callbackify/deprecate, format/formatWithOptions options
  • buffer: Buffer.from coercion, ArrayBuffer offsets, SharedArrayBuffer, encodings, concat length handling, fill/write validation, inspect constants
  • timers: timers/promises abort behavior, interval async iterator, scheduler aborts, timer object methods/disposal, callback this, ordering, one segfault in a promises timeout case
  • console: custom Console streams, object label coercion, getter/sorted inspect, class private field output, circular/BigInt formatting
  • url: URL mutation/escaping, URLSearchParams constructors and thisArg, file URL Unicode/errors, legacy format/parse edge cases
  • events: abort/error behavior, captureRejections, errorMonitor, addAbortListener, symbol/eventNames, once/on semantics
  • assert: deep equality for Error cause, Map/Set, partial deep equality, typed arrays, throws/rejects failure behavior
  • path: win32/UNC behavior, type validation, normalization, parse, toNamespacedPath, matchesGlob
  • os: priority methods, networkInterfaces/loadavg/cpus/userInfo/devNull shapes, dynamic namespace dispatch compile guard
  • querystring: custom decoder, missing values, symbol/non-enumerable keys
  • diagnostics_channel: subscriber error ordering and traceCallback error-first behavior
  • string_decoder: encoding normalization and utf16le compile path
  • tty: TTY constructor and color/class shape

Compile failures surfaced:

node-suite/buffer/search/ucs2-and-buffer-needle
node-suite/os/methods/modern-methods
node-suite/string_decoder/utf16le/surrogate-boundaries

Known root causes from local run:

  • buffer/search/ucs2-and-buffer-needle: utf16le is not recognized in that Buffer encoding lowering path.
  • string_decoder/utf16le/surrogate-boundaries: same utf16le encoding path issue.
  • os/methods/modern-methods: dynamic stdlib namespace dispatch (os[name]()) is intentionally blocked by Perry's safety guard.

Suggested follow-up work

This PR intentionally keeps the scope to test coverage. Follow-up implementation work can be split by root cause/module:

  1. Quick wins:
    • static-call rewrite or explicit allow comment for os/methods/modern-methods
    • URLSearchParams.forEach(thisArg)
    • console object label coercion
    • Buffer allocation/write/concat validation edge cases
  2. High-impact modules:
    • util
    • buffer
    • timers
  3. Medium-impact modules:
    • url
    • events
    • console
    • assert
    • path
    • os

Notes

This is opened as a draft because the expanded node-suite intentionally exposes current Perry parity gaps. The PR is intended as a coverage/visibility step before implementation-focused PRs.

@TheHypnoo
TheHypnoo marked this pull request as ready for review May 22, 2026 09:07
@TheHypnoo
TheHypnoo merged commit 4428ff5 into main May 22, 2026
9 checks passed
@TheHypnoo
TheHypnoo deleted the feat/node-suite-parity-coverage branch May 22, 2026 09:07
proggeramlug added a commit that referenced this pull request May 22, 2026
…sweep (#1414)

Rolls up 26 PRs that merged to main post-v0.5.1023 without version
bumps:

- node:crypto gap-fixes (#1386 #1393 #1394 #1402 #1405): randomInt,
  timingSafeEqual, getHashes/getCiphers, sha224/sha384, base64 digest,
  Buffer hash input, no-arg digest() → Buffer, pbkdf2Sync digest arg,
  scryptSync.
- node:perf_hooks (#1321 + #1328 #1342 coverage): performance + User
  Timing + PerformanceObserver native impl, granular node-suite +
  edge-case coverage.
- #1090 GC checkpoint runtime work (#1324).
- #1311 geisterhand on iOS (#1316 #1383 #1384 #1385).
- #1312 process.env.X (unset) is nullish undefined (#1314).
- #1319 thread-safety hardening for cross-thread runtime statics.
- #1322 exact-head GC evidence packet.
- #1323 wasm timers dispatch through mem_call bridge (#1329).
- #1317 node:timers/promises shadow-segfault fix (#1326).
- #1330 node:process suite (#1331).
- #1292 bcrypt.hash() returns String (#1307).
- #1293 fastify .json()/.body external-fastify dispatch (#1308).
- #1296 app pattern performance gaps.
- #1297 diagnostics_channel parity.
- #1301 iOS App Groups capability (#1313).
- #1318 #1325 os/methods/modern-methods static dispatch.
- #1315 expanded Node parity test coverage.
- #1382 ui-ios stdlib pump for async fetch.
- #1392 ui-wasm reactive state + setText (#1404).
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