Skip to content

Propose general runtime re-architecture from Octane diagnostics - #12

Draft
Qard wants to merge 62 commits into
mainfrom
perf/general-runtime
Draft

Qard wants to merge 62 commits into
mainfrom
perf/general-runtime

Conversation

@Qard

@Qard Qard commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Re-architects the general (untyped) runtime path toward V8 parity, in the order of the design. Semantics stay exactly JavaScript: types and observed shapes only select guarded fast paths with full fallbacks, and explicit annotations remain TypeError contracts.

Status

  • Step 1 · inline primitive operations (accepted). == null and its branch take 4 instructions; numeric operations use shadowed unboxed values and FJCVTZS on Darwin. Octane paired against origin/main: Richards −4.6 ms, NavierStokes −37.5 ms, RayTrace −33.4 ms per operation. Report
  • Step 2 · shapes, inline property caches and block layout. Ordinary objects keep their shape first and their first eight cells in place; a new property-cell IR instruction reads a site's own or immediate-prototype entry inline (own read 8 instructions; inherited method 13 against a budget of 12); megamorphic sites use the shared stub cache; a block layout pass makes each block fall through to its preferred successor. Octane against step 1: Richards 10.5 → 4.4 ms/op, DeltaBlue 34.0 → 23.7, RayTrace 353 → 284, NavierStokes within noise; frozen self-compile 5–7% fewer cycles. Report
  • Step 2b · in-object values, store caches and fused misses. Fast-mode objects keep property values in the object (accessors and symbols included; prototypes get private shapes and a global epoch guards cached transitions). New IR property-load/property-store read and store values inline, including the transition that adds a property; a miss branches straight to the slow path. A warm two-property constructor executes 151 instructions (11,963 at step 2), p.x 99, p.x = v 109; Octane against step 2: RayTrace 253.6 → 212.3 ms/op, DeltaBlue 21.8 → 19.4; map.get on a builtin-created Map 245 → 100 ns. Report
  • After the report: cached transitions also cover keys the prototype holds as writable data (RayTrace declares field defaults on its prototypes), about 255 → 160 ms/op for RayTrace in a rough run.
  • Step 3 · call and construct ABI (in progress).
    • The step 2 regression is fixed (67f7031): slot copy chains resolve to their root, so inlined global reads no longer make copy propagation refuse whole functions (269 refusals → 0 on the generality kernels) and loop counters stay unboxed.
    • Activation records (6875080): a native script entry links a 32-byte record into its frame (previous, frame pointer and kind, callee) instead of writing heap bookkeeping per call; stack traces and legacy caller/arguments merge records with the remaining heap frames (design).
    • Native entries by default on aarch64 (cc81835, ce43707): direct register calls with a shared execution-context check, native [[Construct]] for ordinary constructors (cached prototype read), proper tail calls that replace the frame (bounded fallbacks otherwise), f.apply(thisArg, arguments) forwarding without creating arguments, and one active-context read per activation (design).
    • Warm calls (probe, 501st call): two-argument call 928 → 383 instructions, method call 926 → 334, strict tail call 1,151 → 371, new 3,767 → 1,203. Generality kernels (18 paired rounds, ns/iteration): mixedCall 41.4 → 21.2, objectRoundTrip 38.9 → 18.7, mutableCapture 34.0 → 15.8, arguments3 45.9 → 23.8, receivers2 55.3 → 34.1; call/loop kernels unchanged and still ahead of Node. Octane and frozen v7 paired runs are queued on the shared timing lock. Report
    • Remaining for step 3: the call-site guard and frame setup (~70 and ~50 instructions of a 334-instruction method call), builtin native entries (after the step 5a inline builtins), and the x86-64 entry ABI (x86-64 keeps the register/list entries until then).
  • Landing bar: parity with Node 26.13.1 on everything this PR touches. The route to parity plans step 3 (call/construct ABI, apply(arguments) forwarding, builtin entries), step 4 (allocation and inlining), step 5 (elements, deep ICs, builtin intrinsics, open regressions), step 6 (speculative typing through the typed pipeline) and, if needed, step 7 (feedback-directed recompilation): about 10–18 weeks of one stream. Draft until then.

Extension points for record-backed views (PR #17)

Typed class instances are to appear to untyped code as fast objects of this shape model (docs/design-typed-classes.md, "Plan for step 4" on perf/typed-codegen). Nothing here implements that; these are the places it plugs in:

  • Kinds (packages/js-runtime/src/objects/operations.ts, propertyWritable … propertyAccessor): an open bit set; transitions key on (key, kind), so recordField, checked and maybeAbsent bits give distinct shapes without format changes. propertyNotInlineData is the one mask that site caches, cached stores and cached transitions consult: new kinds join it and stay on the ordinary path until generated code has their hit sequences. Non-configurable keys already work (no propertyConfigurable bit: delete refuses, accessor redefinition is rejected).
  • Value location: storedValue / setFastValue are the only functions that map a shape position to storage (8 in-object general slots, then internalValues). A record-backed shape (per-key field words and representations, a record descriptor) routes there; fastDescriptor and getProperty/setProperty go through them.
  • Shape roots: rootPropertyShape keeps one shared root per prototype (internalChildShape); a createRecordShape root for a prototype view is a second root of the same prototype, so "a receiver shape implies its prototype" still holds and expandos transition from it with transitionPropertyShape.
  • Prototype changes: noteStructureChange (every structural change, bumping propertyEpoch for prototypes) and markPrototype are where a class validity word is cleared; value stores to a prototype (setFastValue on an internalUsedAsPrototype object) are the one more hook a method-store invalidation needs.
  • Dictionary demotion: useDictionaryProperties builds descriptors from fast storage; record fields would become internalDataAliases entries (the arguments-object alias mechanism) instead of copied values.
  • IR and sites: property-load / property-store and the site fields they read (ScriptPropertyCache: shape, raw-bit word index, holder, transition, epoch) assume a general value in the object's own slots; the verifier checks that layout. A record field needs either a site representation word with per-representation hit sequences or a separate instruction; until then such keys miss to lookupCachedScriptProperty, which can read them through the value-location functions.

The [[IsHTMLDDA]] host capability

Lowering x == null as a tag test without the Annex B brand check is valid only when no [[IsHTMLDDA]] object exists, an environment property. It is an explicit, documented option: htmlDDAObjects on GeneralLoweringOptions and ScriptLoweringOptions (docs).

  • The Test262 host declares it (test262ScriptHost, which creates $262.IsHTMLDDA). General programs and the benchmark host (benchmarkScriptHost) do not. Script and eval lowering keep the check by default.
  • Code lowered without the capability calls excludeHTMLDDAObjects when it initializes. The runtime makes that and markHTMLDDAObject mutually exclusive, so a mismatched image fails instead of changing ==.
  • tools/native-script-cases.test.ts (one Script-runtime image shared with the native call cases) runs Scripts lowered both ways beside the Test262 host's marked object: the declared Script completes, and the mismatched one's refusal escapes the entry uncaught (exit status 70).

🤖 Generated with Claude Code

Qard and others added 28 commits November 22, 2026 11:18
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Historical captures now strip scriptIsHTMLDDA and looselyEqualOrThrow with
the other fast paths, so their vocabulary stays at 136 entries while the
current capture has 149.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run at 4ce51c7 on the Linux dev machine without TINT_FUNCTION_FALLBACK.
Its 200 outcomes match general-calls-numeric-loop-dev-v2, the last run
with the same setting, exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Annex B [[IsHTMLDDA]] objects are host-defined. Script and module lowering
takes htmlDDAObjects (default true); without it, x == null is the fused
nullish tag test with no call. The lowered Script or module then calls
excludeHTMLDDAObjects before its code runs, and markHTMLDDAObject, now the
only way to create such an object, fails afterwards (and vice versa), so an
inconsistent image fails instead of changing == semantics.

General program hosts and Octane benchmark hosts opt in; Test262 hosts keep
$262.IsHTMLDDA and the checks. Runtime-compiled code keeps its checking
helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new scalar pass, shadow-general-numbers, gives a general slot whose
loads are tested or read as numbers a boolean presence slot and a number
slot. Every store to the general slot also writes both (a wrapped scalar
number directly, other values through one tag test and an unchecked
payload read), so general-is number on a load becomes a register read.
A forward must-analysis over stores of wrapped numbers and number tests
proves where the slot holds a Number; there general-value number reads the
number shadow without a tag check, and a test becomes constant. The general
slot is unchanged for every other reader, stack map and exception path.
Slots with record, cell or exception writes keep their representation, and
loop-weighted tests must outweigh the extra store work.

general-value gains an unchecked flag (codec flag 2) for the payload read.
General tag operations use only x9..x12, so they no longer evict FP and
pointer temporaries, and general-is sets its result's home directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Script image compiles the lowering and optimizer natively for live
evaluation. Append the IsHTMLDDA exclusion without array spreads and spell
out instruction spans in the number shadow pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every Apple silicon core implements FEAT_JSCVT. Darwin arm64 builds set
the jsConvert emission option, and an operand of a bitwise operation or
other ToInt32/ToUint32 use that is not proven integral converts in one
FJCVTZS (truncation modulo 2^32, NaN and infinities to 0) instead of the
six-instruction int64 round trip with its helper fallback. Linux arm64
keeps the portable sequence. The general number fixture now checks the
bitwise operators on fractions, -0, 2^31 to 2^63, NaN, infinities and
non-numbers against Node.

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 IsHTMLDDA object is created on the same lines as before and marked
through markHTMLDDAObject; benchmark hosts omit it. Pinned host hashes are
updated, and the immutable top-level-await baseline normalizes the import and
the marking call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Test262 linked-unit host compiles against the Script runtime surface,
which requires explicit type arguments on generic calls; its unchanged
markHTMLDDAObject(htmlDDA) call failed that check and crashed the smoke.
The function only ever marks Script objects, so it now takes one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paired Octane, call-loop and generality rounds against origin/main and Node
26.13.1, warm-call instruction traces, frozen self-compile rows and the dev
ledger, with the LLDB command that counts one warm call's instructions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Layouts were discarded after every property definition and rebuilt with a
new shape record unless they matched one expected key list, so receivers of
one constructor rarely shared a shape identity. Shapes now form a transition
tree rooted on the [[Prototype]] object: equal key orders from one prototype
reach one shared shape, and a layout is extended in place when a key is added
or its descriptor replaced. Deletions and prototype changes still rebuild it,
now to the canonical shape. Null-prototype objects, shapes past 64 keys and
shapes with 32 successors stay private, bounding dictionary-like use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
general-is, general-record-is and general-value are pure inline sequences
(a mismatched checked view traps), so callees using them, such as the
native viewObjectValue binding that starts every generated property access,
now inline: 310 call sites in a small property probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
record-slot-read loads field field+index of a non-null record whose fields
field..field+count-1 share one type: an index check (integer in [0, count)),
a scaled add and one load on arm64 and x86-64. It joins operand visiting,
substitution, effects, the storage codec (opcode 85), reachability, record
flow and the inliner, so property storage can address in-object slots from
cached data instead of list reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generated property cache read its cell from the layout's cell list,
a list read of about 116 instructions per access. A layout now also keeps
its first eight cells in record fields (slot0..7), and the cache reads
cell n < 8 with readPropertyLayoutSlot, which native builds bind as a
slot-read record operation: one record-slot-read (checked index, one load).
Bindings carry the first slot field and the slot count; general programs
and Test262 hosts request it beside viewObjectValue.

Shape successors are linked through the shapes themselves instead of a map,
and the layout update is one generic function, so the Script runtime's
generic specializations stay at their previous count (8,130 of 8,192).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A sloppy function that observes this converted every receiver through
sloppyCallReceiver, which boxes primitives with toObjectValue: about 320
instructions on each Richards method call whose receiver was already an
object. An ordinary object is its own ToObject, so the inlined object view
selects it directly; nullish and primitive receivers keep the conversion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cached global read called getIdentifierValue, which checked its cache
through cachedGlobalCell and cachedPropertyCell: about 160 instructions per
read of a global constant such as Richards' STATE_HELD. The cache check is
now cachedGlobalIdentifierCell, small enough to inline, and generated code
reads the cell's value directly on a hit, calling getIdentifierValue only
when the cache is cold or stale. Runtime-compiled entries keep one fused
lookup per site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whether a host creates Annex B [[IsHTMLDDA]] objects is now an explicit,
documented capability: `htmlDDAObjects` on GeneralLoweringOptions (general
programs do not declare it) and ScriptLoweringOptions, and the native
Script hosts declare theirs (test262ScriptHost declares it,
benchmarkScriptHost does not). A native fixture runs Scripts lowered both
ways beside the Test262 host's marked object: the mismatched Script's
refusal escapes the entry (status 70) instead of changing `==`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An ordinary object now holds its shape as its first field and its first
eight descriptor cells in place (internalSlot0..7), with later cells in
internalCells, instead of in a separate layout record. Shapes also record
each key's kind (accessor, writable or read-only data), so a matching shape
proves what a cached hit relies on; a redefinition that changes the kind
moves the object to a rebuilt shape. Empty cache entries hold a shape no
object has, so a receiver without a shape never matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first sample's function reads the global `v`. Since warm cached
global bindings are read inline (43ff994), the entry imports
cachedGlobalIdentifierCell, whose signature is new, and reads the
returned descriptor cell's value, which adds the descriptor record: 21
signatures and records and 50 managed imports. Without that fast path
the entry has the previous 20 and 48.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new IR instruction, property-cell, reads a site's inline cache entry:
it tests the object tag, compares the receiver's first word (its shape)
with the site's shape and loads the cell at the site's word index, from
the receiver or, at a method-call site, from its immediate prototype once
that prototype's shape matches too. AArch64 and x86-64 emit it inline
(the own form uses x9..x12 only); record bindings bind the runtime's
cachedOwnPropertyCell and cachedInheritedPropertyCell to it, and
propertySlotWord to the in-place cells' word index.

Sites now record whether they serve method calls, and fill their inline
fields only for an entry of that kind. In-place slots accept only cells
of the canonical descriptor layout (propertyCellLayout, bound to a header
test), so a present cell's value read needs no header check. Bound bodies
keep only their parameter slots and their debug bindings, so they inline.

Warm readX(p) { return p.x } executes 125 instructions, down from 233.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A final IR pass, layout-blocks, orders each function's blocks in chains
from the entry: a block is followed by its jump target, the success edge
of a record or cell access, or a branch's earlier non-cold successor, and
blocks ending in a trap or throw move to the end. Blocks are renumbered
in that order, so the emitter elides the branch of each such edge. The
`x != null` loop test of the step 1 probe now takes four instructions with
no unconditional branch on either edge, and its warm call executes 259
instructions (532 at step 1, which also predates the inline property
caches).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The native checker does not widen `let holder = object` (with a literal
`const object = 9`) to number, so the inherited-cell emission failed when
the Script service compiled the code generator natively. Annotate the
register variables, guard loop elements and bind the cell record to a
const before narrowing. The native cache fixture gains a megamorphic
section: a site seeing twelve shapes, mutated midway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lowering imports cachedOwnPropertyCell and cachedInheritedPropertyCell
where it imported readPropertySlot, so the current Script runtime request
holds 153 values. propertySlotWord is not a lowering import (only the
runtime calls it), so the historical capture's fast-path list drops it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qard and others added 2 commits November 23, 2026 12:49
[[Set]] of a key the receiver lacks adds a writable data property to the
receiver when the first object on the chain holding the key holds it as a
writable data property, as when a class declares field defaults on its
prototype (RayTrace's `Color.prototype = { red: 0.0, ... }`). The store
cache only cached transitions when no prototype had the key, so those
constructors took the full [[Set]] path on every store. Read-only and
accessor properties still take it; changing a prototype's property kind
bumps the property epoch, as before.

RayTrace (one rough run each, not paired): 255 to 160 ms/op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qard added a commit that referenced this pull request Nov 23, 2026
Classes whose constructors (or field initializers) call their own methods
no longer fall back: the initialization checker analyzes each `this.m()`
call during construction in place. The method may read fields assigned
before the call, and the fields it definitely assigns count as assigned
after it (loops, switch, try and labels are handled conservatively). The
analysis applies while no code writes through a `prototype`, so the calls
reach the defined methods; recursion and own overrides escape as before.
Classes that may genuinely read a field before assignment still fall back
(interim, recorded in the design).

docs/design-typed-classes.md now plans step 4 on PR #12's object model:
record-backed fast views whose fixed-layout shapes address the instance
record, prototype views with method callable views, the compiler-side
seam, and the runtime interface needed from #12.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Site caches, cached stores and cached transitions test one mask of kinds
without a plain in-place value (accessors today), so kinds added later for
values held elsewhere or checked stores (record-backed views of typed
class instances) stay on the ordinary path until generated code handles
them. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qard and others added 16 commits November 23, 2026 20:39
…rows)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inlined calls chain parameter copies (C = B, B = A). Copy propagation
rewrote each load one hop, so a descriptor check could read B while the
record read it guards read A's copy; the read lost its verifier proof and
the whole function's rewrite was discarded, losing numeric shadows of
loop counters (the step 2 generality regression).

Process each copy before its source and treat a load rewritten to read B
as a load of B for B's own rewrite, so equal values resolve to the
chain's root wherever every hop is valid. On the generality kernels the
pass now refuses 0 functions (269 before) and rewrites 39,317 loads
(27,244); the warm mixedCall call drops from 3,835 to 3,588 instructions
(step 1: 3,719).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stack traces and legacy caller and arguments reflection need the active
source functions. Register and list entries kept two heap chains, so every
call wrote heap memory behind remembered-set barriers (about 260
instructions per call). A native script entry now links a 32-byte record
into its own frame: the previous record, its frame pointer with the entry
kind (actual operands or a materialized list), its callee and, after it,
its actual count and register actuals. The innermost record is a new
hosted context word (nativeActivationTopOffset, before the domain, which
stays last). The prologue links the record; the epilogue unlinks it on
every return, normal or exceptional.

The runtime reads records through activation* declarations in
js-runtime/src/objects/activations.ts, bound to a new IR activation-read
(record binding operations, both code generators). Heap frames remain for
list and register entries, builtins and barriers; each records the
innermost native record when pushed, so the readers merge both chains by
stack position. The callee's register entry supplies its trace name and
caller policy. Native entry bodies no longer call enterExecutionName or
enterNativeSourceCall, and the frame argument reader is gone.

With native script calls, a two-argument call (probe, 501st call) falls
from 928 to 443 instructions and a method call from 926 to 392, with no
runtime calls. tools/native-general-activations.test.ts checks traces,
caller and arguments reflection across native, list, construct, builtin
and exceptional paths, with and without native entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rding

Native script entries are now the default on aarch64 targets
(TINT_NATIVE_SCRIPT_CALLS=0 or 1 overrides; x86-64 keeps the register
and list entries until its code generator implements the entry ABI).

- Call sites compare the callee's execution context record with the
  active one. Functions share the record they were created in, modules
  share one record between linking and evaluation and built-ins reuse
  the caller's, so identity usually decides; an equal record of another
  identity compares realm and Script or module.
- `new F(...)` of an ordinary base constructor in the caller's context
  creates the object from F's cached "prototype" and runs F's entry with
  it as receiver and F as new.target; class and derived constructors keep
  the general [[Construct]].
- Strict functions with tail calls get native entries. A tail call from
  an entry called with actual operands to a native callee in the same
  context with register actuals pops the frame and jumps to the callee
  (IR call-indirect with `tail`); other tail calls request from a list
  invocation's trampoline or call ordinarily once, so the stack stays
  bounded.
- A function whose `arguments` only feed `f.apply(thisArg, arguments)`
  forwards its actuals to f's entry when apply is the intrinsic, creating
  the arguments object only for other uses (RayTrace's class wrappers).
- The frame argument reader and its IR forms (script-argument-area, the
  script-argument frame variant) are removed.

Warm calls in the probe (501st call): a two-argument call 928 -> 385
instructions, a method call 926 -> 336, a strict tail call 1,149 -> 373
and `new` 3,767 -> 2,200 (measured before the cached "prototype" read,
which removes most of the remaining generic property lookup). Fixtures: native-general-tail-calls (bounded
stack across every path, both modes), native-general-forwarding (Node
observations) and the activation fixture in both modes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Native call sites compare the callee's execution context with the
active one. Callees restore the active context before they return, so it
cannot change within a synchronous activation: a function body now reads
`$errors.agent.activeContext` once, on entry, when one of its native call
sites needs it (suspending bodies keep the per-site read). Call sites in
loops no longer repeat three checked record reads per call.

With the cached "prototype" read of the previous commit, `new` of an
ordinary constructor (probe, 501st call) takes 1,203 instructions
(3,767 at step 2b).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The macOS gate's native batch exceeded its 3,600 s watchdog on ce43707:
the three new fixtures built five full Script-runtime images while
holding the gate's single memory slot, and other workers waited 17 and
27 minutes for it. tools/native-general-calls.test.ts now runs the
activation, tail-call and forwarding sections as nine cases of one image
with native entries. The heap-bookkeeping-only images are dropped: list
invocations (apply, call, construct) and builtins still interleave heap
frames with activation records in the activation sections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The macOS gate's native batch still exceeded its 3,600 s watchdog with
the consolidated call fixture: like the IsHTMLDDA fixture it built a full
Script-runtime image, and each such build holds the gate's single memory
slot for about 16 minutes on the runner. tools/native-script-cases.test.ts
builds one image for both: the IsHTMLDDA cases and the native call cases
(activation records, tail calls, forwarding) run as cases of it, so the
batch builds as many Script-runtime images as before step 3.

docs/results/general-runtime-step3-darwin-arm64-v1.md reports step 3 so
far: warm-call traces, the paired generality (18 rounds) and call/loop
(20 rounds) kernels, and that the Octane and frozen v7 sets have not run
(queued on the shared lock).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 paired rounds each against 67f7031: RayTrace 158.2 -> 32.0 ms/op,
Richards 4.05 -> 2.54, DeltaBlue 19.9 -> 16.2, NavierStokes 67.8 -> 69.5
(+1.1%, open); the frozen v7 self-compile (--runtime-tree) is unchanged.
The report also records why the first Octane request never ran: the
combined lock acquisition lost every hand-off to blocking launch-lock
waiters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cached property access's miss test sorted first in source order, so
every IC hit jumped over the inline miss path. Block layout now follows
the hit edge (true of a property-store result, false of the absent test
of a property-load value, which only a miss produces) and leaves the
miss for a later chain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For an old object, a cached property store that set no transition
shape, or a record write of a general field, remembers the object only
when the stored value's tag carries a reference (3, 5, 6, 7). The test
runs after the inline nursery check, so young-object stores are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shadowGeneralNumbers wrote shadows directly only for wrapped numbers
and absent values; a stored wrap of a boolean (such as a comparison
result), string or reference was tested and extracted at run time.
Those now store false and 0, and count as direct stores in the cost
model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AOT general code completed every checked runtime value (binary and
unary operators, property gets and sets, key conversion, calls) with a
result record and two inline error comparisons. It now calls the same
fused <op>OrThrow helpers runtime-compiled entries use, importing the
ones it calls, while keeping its inline fast paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
record-new loaded every field word from its argument's frame word, so a
constant-filled record (allocateObject's 96 words) first materialized
each reference-none, general-none, false and +0 in the frame. Arguments
whose words are all zero (and absent numbers) now fold into the record
store: zero words are written last, adjacent pairs with STP XZR, XZR,
and the folded values are neither materialized nor listed in stack maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sample's `+` slow path calls binaryObjectValueOperationOrThrow, so
the entry no longer reads or imports the operator result record and its
variants: 10 fewer records and managed imports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qard added a commit that referenced this pull request Nov 24, 2026
Exact integer constants held as int64 are no longer written to their
home where they are defined. A use with an immediate form reads the
value instead:

- int64 addition and subtraction of a 12-bit magnitude, optionally
  shifted by 12 (negative addends flip ADD and SUB);
- int64 multiplication by 2^k (LSL) or 2^k + 1 (ADD, shifted);
- int64 comparisons against such a magnitude on the right (CMN for
  negative constants);
- 32-bit `&`, `|` and `^` with a logical immediate (new AND, ORR, EOR
  and ANDS immediate encodings), or the identities `| 0`, `^ 0` and
  `& -1` as a W move;
- Math.imul by 2^k, 2^k + 1 or 2^k - 1 (LSL, shifted ADD, LSL + SUB);
- stores to integer slots, built directly in the slot's home.

Every other use writes the constant to its home just before that use.
value() rejects a home access to a constant still deferred, so a path
that misses the materialization fails compilation instead of reading an
unwritten home; type queries use typeOf().

In main's typedArrays loops each constant cost `mov x9, #k; mov xN, x9`
plus a register operand per iteration; they now compile to forms such
as `cmp x28, #1, lsl #12`, `add x20, x28, #1` and `and w21, w19, #0xff`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qard and others added 2 commits November 24, 2026 09:10
Counting absent values and other-category wraps as cheap stores made
slots that are mostly initialized with undefined (operator result
temporaries) newly shadowed, adding maintenance stores on hot paths
(Vec.prototype.dot +4 instructions). Those stores still write the
shadows directly, but the cost model weighs them as before, so the
shadowing decisions match the earlier pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qard added a commit that referenced this pull request Nov 24, 2026
Exact integer constants held as int64 are no longer written to their
home where they are defined. A use with an immediate form reads the
value instead:

- int64 addition and subtraction of a 12-bit magnitude, optionally
  shifted by 12 (negative addends flip ADD and SUB);
- int64 multiplication by 2^k (LSL) or 2^k + 1 (ADD, shifted);
- int64 comparisons against such a magnitude on the right (CMN for
  negative constants);
- 32-bit `&`, `|` and `^` with a logical immediate (new AND, ORR, EOR
  and ANDS immediate encodings), or the identities `| 0`, `^ 0` and
  `& -1` as a W move;
- Math.imul by 2^k, 2^k + 1 or 2^k - 1 (LSL, shifted ADD, LSL + SUB);
- stores to integer slots, built directly in the slot's home.

Every other use writes the constant to its home just before that use.
value() rejects a home access to a constant still deferred, so a path
that misses the materialization fails compilation instead of reading an
unwritten home; type queries use typeOf().

In main's typedArrays loops each constant cost `mov x9, #k; mov xN, x9`
plus a register operand per iteration; they now compile to forms such
as `cmp x28, #1, lsl #12`, `add x20, x28, #1` and `and w21, w19, #0xff`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qard and others added 3 commits November 24, 2026 10:35
Since native script calls became the aarch64 default, lowered Scripts
import createNativeSourceFunction, createSourceInstance,
sourceArgumentCount and sourceArgument, but the complete vocabulary
(declarations "all") that the Script surface publishes left them out.
Every linked Script unit failed with "managed surface export is
missing: createNativeSourceFunction" and fell back to a whole-program
batch: the macOS gate's smoke-units and the unit-linked native fixtures
compiled the runtime per batch (209 s instead of 2 s locally) and ran
out of time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A linked Script unit's indirect calls must each name a signature class
the host's Script surface publishes; native script entries have none
(their entry ABI is not a checked callback type), so with native calls
on by default every unit failed its profile ("call-indirect without a
semantic witness") and the runner built a whole-program batch instead.
The units runner now lowers Scripts for test262UnitScriptHost, which
calls through register entries; program and suite linking keep native
entries. Locally the smoke batch compiles in 1.7 s again (218 s).

A test checks that lowered Test262 Scripts import only the published
Script surface, and the macOS gate's units smoke now fails when a batch
falls back to program linking instead of passing slowly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The complete Script vocabulary now names the four native-call helpers;
a captured runtime from before native script entries does not export
them, so they join the fast paths a capture's request omits when its
objects module lacks them. The historical-capture test removes them from
its simulated capture and counts them in the current request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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