require("path"); // <-- delete this line and perry matches node
const o = [];
process.nextTick(() => o.push("nextTick"));
Promise.resolve().then(() => o.push("p1"));
(async () => { await null; o.push("await"); })();
setTimeout(() => console.log(JSON.stringify(o)), 20);
// node: ["nextTick","p1","await"]
// perry: ["p1","await","nextTick"]
process.nextTick callbacks must run before promise microtasks. After any require() of a builtin, perry runs them after.
Deterministic: 5/5 with the require, 3/3 matching node without it.
Why no fixture caught it
Every real bundle requires builtins, and every minimal fixture doesn't — so the ordering is correct in exactly the programs a test suite contains and wrong in exactly the programs users run.
Excluded from this report
setTimeout-vs-setImmediate ordering also differed, but node is itself nondeterministic there, so it is not filed as a bug.
Found by a differential stress-test of claude-code under perry.
process.nextTickcallbacks must run before promise microtasks. After anyrequire()of a builtin, perry runs them after.Deterministic: 5/5 with the
require, 3/3 matching node without it.Why no fixture caught it
Every real bundle requires builtins, and every minimal fixture doesn't — so the ordering is correct in exactly the programs a test suite contains and wrong in exactly the programs users run.
Excluded from this report
setTimeout-vs-setImmediateordering also differed, but node is itself nondeterministic there, so it is not filed as a bug.Found by a differential stress-test of claude-code under perry.