Skip to content

[codex] Align Atomics wait/notify receivers#4423

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-atomics-wait-notify-receiver
Jun 4, 2026
Merged

[codex] Align Atomics wait/notify receivers#4423
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-atomics-wait-notify-receiver

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

  • Track typed-array views created from SharedArrayBuffer so Atomics wait/notify validation can distinguish shared and non-shared receivers.
  • Accept BigInt64Array receivers for Atomics.wait and Atomics.notify, while continuing to reject BigUint64Array and other typed-array kinds.
  • Make Atomics.wait throw on non-shared Int32/BigInt64 views, and make Atomics.notify return 0 for non-shared views after kind/index validation.
  • Add a focused globals parity fixture for Int32/BigInt64/BigUint64 wait/notify receiver behavior.

Validation

  • Pre-fix reproduction with the new fixture: Perry returned timed-out for Atomics.wait(new Int32Array(new ArrayBuffer(...))) and then aborted on the first BigInt64Array wait with TypeError: Atomics wait/notify requires an Int32Array; Node 26 produced the expected TypeError/BigInt64 wait-notify outputs.
  • npm exec --yes --package=node@26 -- node --experimental-strip-types test-parity/node-suite/globals/atomics-wait-notify-receivers.ts
  • Direct Perry compile/run of atomics-wait-notify-receivers.ts with PERRY_NO_AUTO_OPTIMIZE=1 PERRY_ALLOW_UNIMPLEMENTED=1; Node/Perry diff empty.
  • Direct Node/Perry diff for existing test-parity/node-suite/globals/atomics-wait-notify.ts; diff empty.
  • CARGO_TARGET_DIR=/root/perry-worktrees/perry-node-webcrypto-cryptokey-property-exposure-20260604/target cargo check -q -p perry-runtime --lib
  • RUSTFLAGS="-Awarnings" CARGO_TARGET_DIR=/root/perry-worktrees/perry-node-webcrypto-cryptokey-property-exposure-20260604/target cargo build -q -p perry-runtime
  • RUSTFLAGS="-Awarnings" CARGO_TARGET_DIR=/root/perry-worktrees/perry-node-webcrypto-cryptokey-property-exposure-20260604/target cargo build -q -p perry
  • cargo fmt --all -- --check
  • git diff --check HEAD~1..HEAD
  • ./scripts/check_file_size.sh

Note: the full run_parity_tests.sh harness was not used because it builds/uses release target/release/perry; this cut was validated with direct Node/Perry fixture comparisons using the rebuilt debug CLI and runtime archive.

@proggeramlug proggeramlug marked this pull request as ready for review June 4, 2026 18:04
@proggeramlug proggeramlug merged commit 906cfcd into PerryTS:main Jun 4, 2026
13 checks passed
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.

2 participants