Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The macOS CI child spent 65 seconds waiting for a gate memory slot before its build started. Count active preparation and execution against the existing ten-minute deadline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve the identity and receiver of Node FFI exports in standalone typed programs. Project primitive typed callbacks and select shared owner storage for local byte arrays and their aliases when they cross a realm call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qard
marked this pull request as ready for review
November 21, 2026 02:49
Qard
marked this pull request as draft
November 21, 2026 02:50
Classify both literal and runtime signatures once. Keep reusable argument cells and result cells over each call frame, and format validation errors only on failure. Interleave benchmark engines with matching warmups and record the exact parity outcome. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/ir/src/optimization/licm.ts # packages/ts-native/src/scalar.ts # tools/gate-lock.test.ts # tools/gate/watchdog.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # tools/check-test-files.json
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the complete runs the previous delegate left uncommitted as immutable observations. Later paired reports supersede each of them. - Benchmarks v4 and v5 at 8cf9a93: nine rotated rounds, all checksums verified, every native launch exited 42 under LLDB. They predate the typed paths and measured only untyped definitions. - Conformance v4 at a9fce40: complete 26-fixture inventory, superseded by the v5 and split-frame reruns. - Ledgers at 7e964bb, a9fce40 and 8cf9a93, and the integrated ledger at 5e989d2, all on Linux arm64 without source replay. The 8cf9a93 and 5e989d2 ledgers match main's non-replay ledger (general-calls-numeric-loop-dev-v2) in path and outcome for all 200 forms. They are not comparable with main's latest replay-mode ledger. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each benchmark case now has a JavaScript twin with the same call shape: the same arity and integer arguments, a Buffer argument, or a callback passed through a JavaScript caller. Subtracting the twin in the same round and engine isolates the FFI boundary from the engine's general call cost. Reports carry the twin time, the paired FFI cost versus Node and an own-cost parity flag next to the existing control overhead. The Buffer twin returns a constant, so the C read stays in the FFI cost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`typeof x === "number"`, "boolean" and "string" called the realm typeof classifier in modules that use it, producing a string per test. The classifier differs from the value tag only for object-tagged values (callable and [[IsHTMLDDA]] objects, symbols and BigInts), so these comparisons now emit the same `general-is` tag test as other modules. "undefined" still uses the classifier because [[IsHTMLDDA]] objects report it. Typed-only programs have no realm typeof modules and are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Wrappers created in a Script or module get a positional register entry, so same-context calls with up to six arguments skip the argument list, realm thunk and call result record. One argument list per wrapper is reused outside reentrant calls and cleared afterwards. - The owner invariant tests that the identity slot is live instead of comparing objects, which realm error views made costly on every call. The slot only ever names the owner or is cleared after collection. - The call context's same-realm test moves into `runRealmBoundCall` in the general runtime, avoiding the same identity exposure. - Integer bounds come from constant-foldable functions instead of module tables, and pointer arguments test for a BigInt view instead of calling the realm typeof classifier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
General callers of a unary pointer binding with a Number result now use the typed leaf entry, which lends stable Buffer backing directly. Calls shaped `(pointer, i32) => i32` with callbacks registered use the typed callback trampoline entry when the integer operand is already valid and the pointer projects; other operands take the ordinary adapter, so errors still follow argument order. Document the general call entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Static number entries and the generic marshaler test an exact int32 first and fall back to the full check otherwise. Register words keep the bits the general path writes: zero-extended unless the ABI sign-extends. Stack operands still write four bytes. Add a general-caller fixture, checked against Node 26.13.1, for argument counts and validation on positional entries, reentrant calls through a callback, error order on the callback entry and the Buffer leaf entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Node and the untyped Tint images also call a built-in twin of each shape: `Number()`, `Math.max` over the same arguments, `ArrayBuffer.isView` on the Buffer and `Reflect.apply` of the callback. An FFI wrapper is a built-in function, so the FFI cost over this twin separates the binding from the engine's call protocol for built-ins. Reports carry the twin time and the paired comparison with Node when both engines ran it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Paired benchmark: 15 rotated rounds at one-minute load near 2. All 60 native launches exited 42 under LLDB, and 1,830 checksums verified. Typed paths beat Node in 8 of 9 cases; zero arguments is +1.35 ns. General callers beat Node in 8 of 9 (literal definitions) and 6 of 9 (runtime definitions) cases, measured over a built-in twin that shares their call protocol. - Pinned Node FFI suite: 26 fixtures (25 in test/ffi plus one control file) and 122 case records: 94 passed, 25 diagnosed limits, 3 upstream skips, none failed. Each case matches the previous inventory. - Ledger on Linux arm64 with source replay and function fallback: no regressions against general-calls-deep-prototype-dev-v1. One untyped form moved from build-failed to run-failed, and a focused rerun shows current main 3d10cb5 does the same. - Budgets: the leaf-call image is byte-identical to main's, and the frozen v7 compiler's code sections are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inliner now accepts a callee's general-record-is test and its reference payload read when the callee tests a record, as bound record views do. They neither allocate nor throw. Typed fixed-arity FFI entries then resolve the wrapper and its typed record without calling viewTypeofObject or viewTypedFfiCall. A typed zero-argument call probe went from 12.4 to 10.7 ns per call (five paired runs). Numeric fixed-arity entries move the mode and frame path out of line, so the entry holds only the direct checks. Functions without a record test inline exactly as before. The leaf-call image is byte-identical to main's, as are the frozen v7 compiler's code, unwind and data sections. A per-call-site cache was not possible: generated realm helpers cannot hold module instance state, and an optional `unknown` field on the internal methods record has no native representation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A wrapper's call step runs the binding in the context the ordinary entry would select, so callObject skips the context thunk, the realm check frame and the action closure. The execution context stays for GetFunctionRealm. The same-realm test is `activeInRealm` in the general runtime, where it costs no error-view exposure. - General calls read the maintained callback activity flags instead of calling `callbacks.active()` and scanning the native registry. - Typed-only numeric plans (the i32 prototypes compiled for the program's call arities) also get the general wrapper. A binding whose runtime signature has the same key, including runtime definitions, calls the compiled entry instead of the generic frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Internal methods may carry `typedView`, an optional record holding the general view that `typedRecord` returns, for records that never change. FFI wrappers set it, and the typed fixed-arity entries read it with plain loads. With record views inlined, a direct typed call makes no calls before the C function. A typed zero-argument call probe went from 10.4 to 9.0 ns per call (five paired runs), and from 12.4 ns in all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner liveness test captures nothing, so it moves to module level where calls can inline, and the general call path tests the library handle directly instead of calling requireOpen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Paired benchmark: 15 rotated rounds, all 60 native launches exited 42 under LLDB, 1,830 checksums verified. Typed paths are at or below Node in all 18 comparisons; a zero-argument typed call takes 9.08 ns. General paths are at or below Node in all 18 comparisons over the built-in twin. Intermediate runs at 8364a39 and e9e58c1 are kept. - Pinned Node FFI suite: 26 fixtures and 122 case records; 94 passed, 25 diagnosed limits, 3 upstream skips, none failed, matching the previous inventory case for case. - Budgets: the leaf-call image is byte-identical to main 3d10cb5's, and the frozen v7 compiler's code sections and emitted image are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since e9e58c1 the generated fixed-arity entries read `typedView` instead of calling `typedRecord`; the static module test still expected the closure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linux arm64 with source replay and function fallback, against general-calls-deep-prototype-dev-v1: 200 forms, no regressions, and every path and outcome identical to the a45f40e ledger. The untyped explicit-binding-contract form remains run-failed, as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Implementation
typeof x === "number" | "boolean" | "string"to a tag test.Status and acceptance
Draft. This PR lands after PR #12 (the general runtime re-architecture). It will then merge main and rerun the paired benchmark on a quiet host.
Number(),Math.max,ArrayBuffer.isView,Reflect.apply), which isolates the binding from the engine's built-in call protocol.Paired performance
Fifteen rotated rounds at
ca6306f2dunder the shared timing and launch locks, one-minute load median 4.9. All 60 native launches reached LLDB entry and exited 42, and 1,830 checksums verified. Report · Per-round dataValidation
test/ffiplus one control file) and 122 case records atca6306f2d: 94 passed, 25 diagnosed limits (Node CLI, permissions, VFS, libuv and V8 fast-API internals) and 3 upstream skips; none failed. Every fixture reached LLDB entry and exited 42, and each case matches the previous inventory. Reportgeneral-calls-deep-prototype-dev-v1: 200 forms, no regressions. The only change from that baseline is the untypedexplicit-binding-contractform, which current main shows as well. Ledger · Main recheck3d10cb5c0's. The frozen v7 compiler's code, unwind and data sections are identical. Under LLDB, both compilers' emitted frozen v7 images are byte-identical (SHA-25668c11052…). Budgetstools/node-ffi.test.tspass under LLDB with Node 26.13.1 oracles, including the general-caller fixture added here.mac-gate.sh(including the Test262 smoke in both linking modes) andlinux-gate.shon macOS arm64, Linux x86-64 and Linux arm64; all three must be green at the final head.Known gaps found
Typed code that passes a realm typed array (for example
Buffer.from(...)) to aUint8Arrayparameter fails, in two ways:Both belong to typed lowering, not
node:ffi, and are recorded with reproductions in the unified-pipeline gap table.🤖 Generated with Claude Code