Commit Graph
4473 Commits
Author SHA1 Message Date
Chris Tate e4079abd41 Keep swap under the test memory cap and continue past OOM kills 2026-10-23 21:39:03 -05:00
Chris Tate 7cdfe16c9b Cap the Linux test step's memory and spread memory-heavy side files
The Linux test shards run their suites in a transient systemd scope with
MemoryMax=13G and no swap, below the runner's 16 GB. A process tree that
grows past the cap loses its largest process to the kernel, and the job
log names the failing test, where the runner itself ran out of memory
and left no log. Hosts without systemd run the suites directly.

The side-queue balancer also takes a table of memory-heavy files, with
their measured peak. They run whole in the cost-balanced task, and each
goes to the shard with the least memory-heavy work so far, after the
time-balanced files. decl-boundary.test.ts, which peaks at about 1.8 GB
alone and had no time measurement, so vitest's file sharding put it in
shard 11, is the first entry. It now runs in shard 1 (plain) and 6 (san).
2026-10-23 14:24:38 -05:00
Chris Tate cd48b2b926 Prepare v0.4.3 release (#2019) 2026-10-23 14:18:34 -05:00
Chris Tate 3a5f563e70 Iterate untyped arrays without the generic iterator protocol (#2027) 2026-10-23 14:18:14 -05:00
Chris Tate 47636f2fa5 Implement the identity TransformStream natively (#2009) 2026-10-23 13:51:52 -05:00
Chris Tate 6fbac8a9a3 Run typed arrays that the checker types any on their native bytes (#2023) 2026-10-23 13:46:39 -05:00
Chris Tate 40de8bf974 Freeze records that other references still hold (#1963) 2026-10-23 13:39:48 -05:00
Malte UblandClaude Opus 5.5 26d2c8bae1 Iterate untyped arrays without the generic iterator protocol
for...of, spread and destructuring over an untyped array opened the
iterator by calling the builtin values() function through scr_dyn_call
with the array as `this`, and stepped it through the general element
path: retain the source, compute the live length, read the element with
hole handling, release the source.

An array whose iterator method is the builtin values() now gets the
native iterator that call returns directly. A step over a plain array
whose index is an own element, or past the end, answers without the
general path; no getter can run there. Holes, keys(), entries(), typed
array capsules and every other source keep the general path.

zod 3, z.array(Order).parse over 500 orders: 187.3M -> 182.2M
instructions per round (-2.7%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 11:33:28 -07:00
Chris Tate 9f4e654e7a Evaluate an element assignment's receiver and index before its value (#2018) 2026-10-23 13:32:38 -05:00
Chris Tate 47b2dec523 Version two-counter loops over typed arrays (#2021) 2026-10-23 13:28:16 -05:00
Chris Tate 285a92354e Wake TransformStream pulls waiting on a static fetch body 2026-10-23 13:21:29 -05:00
Chris Tate 8b6d3329f4 Hold an element assignment's receiver against its index's effects
When the index assigns the receiver's binding (`a[(a = b, 0)] = c[0]!`),
holding the index alone left the receiver read at the store, after the
index ran, so the value landed in the replacement array. The receiver is
now held whenever the index or the value could change what it reads.
2026-10-23 13:00:50 -05:00
Chris Tate c7fd9dcdf0 Merge main 2026-10-23 12:59:08 -05:00
Chris Tate 0af86e2e3e Version two-counter loops over typed arrays
A loop with two counters closing in on each other, such as
`for (let i = lo, j = hi; i < j; i++, j--)`, checked the bounds of every
typed-array element it read or wrote at either counter. Within the body
the low counter only rises and stays below the high one, which only
falls, so every such index lies between the two starts.

Typed-array loop versions now cover these loops. The guard tests that
both starts are exact integers, that the low start is at least 0, and
that the high start is below the length of each view the loop indexes at
a counter. The fast copy then reads and writes those elements without
checks, and the checked copy runs whenever the guard fails. In the fast
copy the guard also stands for the loop's own start test.

The exact-integer test of a start is now one function, shared by the
typed-array version guards and the dense array two-counter guard. The
dense guard, which compared the round trip with `fcmp oeq`, now also
leaves a -0 start to the checked loop.
2026-10-23 12:58:05 -05:00
Chris Tate 49e35b6755 Answer untyped property reads of plain values without the class tables (#2013) 2026-10-23 12:38:38 -05:00
Chris Tate 0aae517c07 docs: render the compatibility matrix's tooltips on demand (#2020) 2026-10-23 12:33:40 -05:00
Malte UblandClaude Opus 5.5 cda584260f Run typed arrays that the checker types any on their native bytes
A JavaScript binding referenced by its own initializer's inference
collapses to `any` in the checker while it still lowers to a Uint8Array:
hono's etag digest declares `const nextChunk = new Uint8Array(new
ArrayBuffer(f(chunk)))` beside `chunk = nextChunk`. The typed-array
lowerings key on the checker type and declined such a receiver, and the
dynamic paths required a dyn value, so `nextChunk.set(...)` and
`nextChunk.byteLength` threw SC1090/SC2020 at run time and multi-chunk
etag digests failed.

Method calls and property reads on such a receiver now box it by
reference (the box shares the native storage, so writes stay visible) and
dispatch on the runtime kind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:33:05 -07:00
Chris Tate 4d70630229 Keep a keyboard-focused badge's tooltip open when the pointer leaves
Hover and keyboard focus now open the tooltip separately, as the
CSS-only tooltip's hover and focus-visible rules did, so moving the
pointer off a focused badge no longer unmounts its tooltip or drops
aria-describedby. Escape still dismisses it.
2026-10-23 12:30:31 -05:00
Chris Tate dbbefae54c Mark typed-array header loads invariant (#2016) 2026-10-23 12:21:01 -05:00
Chris Tateandjonbaldie efa797382e Render the compatibility matrix's tooltips on demand
The matrix mounted every badge's tooltip up front, hidden by CSS, and
re-rendered every row on each keystroke. Tooltips now mount while their
badge is hovered or has keyboard focus, are named by aria-describedby
and close on Escape. Badges and rows are memoized, each row's search
text is built once, the filter makes one pass for its rows and its
count, and the table follows deferred search and status values, with
expand all and collapse all as transitions, so input stays responsive.

The tree and filter passes move to src/lib/compatibility-tree.ts, with
unit tests that also render the badges on the server (pnpm test:unit,
part of pnpm check).

Closes #601

Co-authored-by: jonbaldie <8376953+jonbaldie@users.noreply.github.com>
2026-10-23 12:20:28 -05:00
Chris Tate d891a245ab Clone Response and Request bodies by teeing their streams (#2008) 2026-10-23 12:16:46 -05:00
Chris Tate a36ef0b4ca Settle aborts and pull TransformStream uploads as Node does 2026-10-23 12:11:48 -05:00
Chris Tate 4dcb83c418 Free a typed teardown's blocks in the order it met them (#1849) 2026-10-23 12:09:37 -05:00
Chris Tate 849fad0ab6 Prepare v0.4.3 release 2026-10-23 12:08:08 -05:00
Chris Tate d8816b4731 Evaluate an element assignment's receiver and index before its value
An element assignment whose value is an optional element read or call,
such as `out[n++] = src[n]!`, held the value in a temporary and then
evaluated the receiver and index inside the store, after the value. So
`n++` ran after `src[n]` was read, and `src[0]` was stored where Node
stores `src[1]`. The receiver and index are now evaluated first whenever
the value could change what they read: when it assigns a binding they
read, or runs code that can assign their `let` and `var` bindings or
fields. A literal, or a binding the value cannot change, is still read
at the store.
2026-10-23 12:05:34 -05:00
Malte Ubl 00fc647ca1 Merge remote-tracking branch 'origin/main' into perf/dyn-plain-property-reads 2026-10-23 10:05:34 -07:00
Chris Tate 029554fbf5 Decide an untyped property write with one own-property lookup (#2014) 2026-10-23 12:04:52 -05:00
Chris Tate 75c210a472 Update tsc-ts to 0.0.9 and reuse bundled declaration diagnostics (#2005) 2026-10-23 12:04:00 -05:00
Chris Tate dc1d99835d Merge main 2026-10-23 11:54:20 -05:00
Chris Tate bcb697ada3 Give the tsgo/tsc-ts IR parity job 60 minutes (#1879) 2026-10-23 11:51:09 -05:00
Chris Tate b92fb63043 Mark typed-array header loads invariant
A typed array's length, data pointer and shared backing are fixed when
the view is constructed. Each element access loads the data pointer
beside the length, ahead of its bounds branch. LLVM then sinks the data
pointer load into the in-bounds block, and LICM refuses to hoist a load
that runs only on some iterations. A loop whose body branches or stores
an element therefore reloaded the data pointer for every access.

Header loads now carry `!invariant.load` next to their alias tag, so
the data pointer and length leave such loops. Debug builds emit neither.
2026-10-23 11:49:45 -05:00
Chris Tate 7eb90051a2 Give corpus scratch paths a per-process name (#2010) 2026-10-23 11:42:17 -05:00
Chris Tate 891a1a46a9 Keep fixed layouts for JavaScript classes next to freezes and unrelated accessors (#2012) 2026-10-23 11:26:42 -05:00
Malte UblandClaude Opus 5.5 a77fe8c21c Decide an untyped property write with one own-property lookup
scr_dyn_object_key_set, behind every untyped property write and every
member of an untyped object literal, looked the key up as many as five
times: a linear scan for an own accessor or read-only entry, a lookup
before the prototype walk, one before the non-extensible check, one to
know whether the key was created, and one more inside the store.

The own property is now looked up once. An own data property is written
in place (an own setter still runs; a read-only or getter-only property
still refuses), and an absent key walks the prototype chain as before
and is then added by scr_dyn_obj_set, which is unchanged.

zod 3, z.array(Order).parse over 500 orders: 199.8M -> 194.1M
instructions per round (-2.8%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:24:47 -07:00
Chris Tate 6828c23b50 Error tee branches when the source errors with no read pending
The tee learned a source error only through a pending read's error
steps, so a source that errored while both branches held buffered
chunks and no read was pending left the branches readable: the next read
returned a chunk where Node rejects. The tee now watches its source's
error, as the streams spec reacts to the source reader's closed promise,
and errors both branches in a microtask (resolving the cancel promise
unless both branches were canceled). A read's error steps only end the
read, and a clone of an already errored body errors both branches the
same way.
2026-10-23 11:20:05 -05:00
Malte UblandClaude Sonnet 5.5 fab4b403e9 Give corpus scratch paths a per-process name
The differential and LLVM differential suites can run the same corpus
program's Node oracle at the same time in one shard. Programs whose
scratch directory or file was derived only from argv[1] collided, and
one oracle removed the paths under the other. Their names now include
the pid, as 1403 and 5567 already do. Printed output never carries the
name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-23 09:07:41 -07:00
Malte Ubl ce06a3377d Merge remote-tracking branch 'origin/main' into ci/tsgo-timeout 2026-10-23 09:01:36 -07:00
Chris Tate 5f22ee7146 Run two-counter loops and element copies over number arrays without per-element checks (#1991) 2026-10-23 11:00:35 -05:00
Chris Tate 6e849eeaef Read string-keyed record entries without allocating under ?? and ! (#2007) 2026-10-23 11:00:10 -05:00
Chris Tate 2d4aac0976 Read Web Headers pairs without copying them, and cache their sorted list (#2000) 2026-10-23 10:50:13 -05:00
Malte UblandClaude Opus 5.5 3c2911ccad Implement the identity TransformStream natively
'new TransformStream()' had no lowering, so hono's stream() and
streamSSE() helpers failed to compile their checked-dynamic paths. The
constructor without arguments now builds a native handle: its readable
side is a native ReadableStream with a zero high-water mark, and its
writable side runs the streams spec's WritableStream state machine
(getWriter, abort, close, locked; the writer's write, close, abort,
releaseLock, ready, closed and desiredSize). A write completes when the
readable side reads its chunk, close/abort/cancel propagate across the
pair, and deferred reactions take as many microtask turns as in Node.
Web ReadableStreams can also be weak collection keys (hono keys a
WeakMap by the response stream). A transformer, queuing strategies and
the WritableStream constructor keep the SC2020 refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:47:47 -07:00
Malte UblandClaude Opus 5.5 e84f656172 Clone Response and Request bodies by teeing their streams
Response.clone() and Request.clone() on checked-dynamic handles answered
'res.clone is not a function' (hono's etag middleware hashes
res.clone().body). The runtime now implements the streams spec's
ReadableStreamDefaultTee over native streams and clones the body with it,
so the original and the clone each read every chunk. A used or locked body
throws undici's TypeErrors, the clone's headers are a copy with the same
guard, and a cloned Request's signal follows the original's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:47:43 -07:00
Chris Tate 998a385bde Mark constructed headers canonical only when every value is trimmed
The Headers and Response constructors combine duplicate entries (a: x,
a: "") into one value with the separator, which can end in its space
("x, "). They marked the pairs canonical anyway, so a copy took them
unchanged where Node trims the copied value ("x,"). The constructors
now mark the pairs canonical only when every value is already trimmed;
otherwise copies normalize them pair by pair.
2026-10-23 10:45:26 -05:00
Chris Tate ecbfa766ef Store number arrays of proven int32s in 4-byte slots across direct calls (#1960) 2026-10-23 10:42:51 -05:00
Chris Tate c11253b228 Reject other classes' capsules inline in class-table brand probes (#2001) 2026-10-23 10:35:30 -05:00
Chris Tate 5fd47eac77 Search proven-ASCII strings backwards by byte in lastIndexOf (#2002) 2026-10-23 10:34:16 -05:00
Chris Tate d3c8155c85 Reuse the bundled declaration files' diagnostics across builds 2026-10-23 10:32:15 -05:00
Chris Tate 14678cf4eb Keep arrays a present-undefined store may reach out of the dense fast copy
A present undefined that the fast copy stores leaves its slot out of the
hole-free prefix the entry test read. The matcher left out only the array
named by the store, so a store through another name for the same array,
such as `const b = a` followed by `(b as (number | undefined)[])[i] =
undefined`, kept `a` covered, and the fast copy read the slot as a number.

Such a store now leaves out every covered array it may reach: its own, and
every other array unless that array or the store's binding is a local
array no other binding holds. A store into a field reaches every array
except those local ones.
2026-10-23 10:29:35 -05:00
Malte UblandClaude Opus 5.5 1f7677d246 Answer untyped property reads of plain values without the class tables
Every untyped property read or write in a program with dynamic-tier
classes calls a generated helper (%dyn.class.property.N). For a value that
is not a class instance, the helper still called the normalization, the
instance-bag and the static-bag tables, each of which returns the value
itself, then compared the bag with the value and finally read the key.

When every class branch of a helper tests a capsule key or a class key,
its fallthrough is still the access it was created with, and every table
that fallthrough calls has its kind exit, a value that is neither a class
capsule nor a function now gets the same access on itself at the top of
the helper. Helpers for `constructor` and `toString`, which answer
primitives and errors specially, keep their full body.

zod 3, z.array(Order).parse over 500 orders: 235.8M -> 199.8M
instructions per round (-15.3%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:26:28 -07:00
Chris Tate 11426b4fc2 Read string-keyed record entries as stack unions under projections
A keyed read of a string-indexed record whose values are numbers or
booleans (`counts[key]` on a `Record<string, number>`, typed
`number | undefined`) allocated a heap union for every read, also when
the only consumer was `??`, `!` or a comparison with undefined. The
runtime already returns the entry's value and whether it is present;
the box came from wrapping that result.

Such a read is now a stack union source: under a projection, the read
writes the tag and bits of the declared field or index-signature entry
the key names, or the undefined arm for a missing key, into a private
stack box, and allocates nothing. This applies when every hit is a
number or boolean arm of the result union, or an inline field of the
same union, and also to an argument a callee only projects (the helper
that `x!` lowers to). Other consumers keep the heap union.

dictionary-walks allocates no union instead of 363,359 and runs 14.6%
faster; no other runtime benchmark's code changes.

Corpus 7390.
2026-10-23 10:26:22 -05:00