Commit Graph
5304 Commits
Author SHA1 Message Date
Malte Ubl 797650db73 Merge base branch 2026-10-26 05:34:56 -07:00
Malte UblandClaude Opus 5.5 91b437c090 Keep path-mapped island declarations out of the module graph
A re-export from an island package that tsconfig `paths` maps to its
installed directory pushed the package's declaration file into the module
order, so the lowering compiled the declarations' own imports (SC2013 in
the package's .d.mts). Such a re-export now adds no module edge; the
lowering reports the island boundary as for any island re-export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 05:34:47 -07:00
Malte UblandClaude Opus 5.5 637d78bb67 Load island packages that tsconfig paths map to their directory
A monorepo can pin one copy of a package with a tsconfig `paths` entry
that names its installed directory. Its import then resolves as a project
import to the package's declarations, so when the package runs in a Node
island, preflight refused it as types-only (SC1010) and the lowering
skipped it as a project module, leaving its bindings unlowered (SC2013).
Both now treat it as the island import it is: typed by its declarations,
loaded in Node.

Corpus 6839 imports an ESM island package through such a mapping and uses
its interfaces and generic aliases from typed code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 05:34:47 -07:00
Chris Tate 214cb122a7 Expect the word-segments pilot to segment in its Node island 2026-10-26 02:04:41 -05:00
Chris Tate ba01821d08 Expect the word-segments pilot to segment in its Node island 2026-10-26 02:04:36 -05:00
Chris Tate 8a71a20e32 Merge ni/i2-handles 2026-10-25 21:39:21 -05:00
Chris Tate 28b76f7b25 Merge ni/i1-stack-bound 2026-10-25 21:08:37 -05:00
Chris Tate c9116749c1 Merge ni/3-hosted-loop 2026-10-25 20:18:43 -05:00
Chris Tate 1a2eb52016 Start nested Node entries below the frames a fiber switch left live
A host callback marks where it runs on Node's stack, and a call into
Node.js from a fiber starts below that mark. Runtime code the callback
runs may go deeper on Node's stack before it starts or resumes a fiber,
and those frames stay live while the fiber runs: a call into Node.js
from the fiber overwrote them. scr_switch now reports where it leaves
Node's stack, and the mark moves down to it for the rest of the
callback.

6823 runs a timer callback 200 frames deep that starts an async
function calling into Node.js before its first await.
2026-10-25 19:54:03 -05:00
Chris Tate c46faa93b2 Merge base branch 2026-10-25 19:32:26 -05:00
Chris Tate c3ac3f6882 Merge main 2026-10-25 18:52:38 -05:00
Chris Tate 56099ae21c Erase lambdas that implement a generic method through their context (#2274) 2026-10-25 18:07:47 -05:00
Chris Tate 9067f06c02 Cache the zone offset at UTC midnights for local-time conversions (#2272) 2026-10-25 18:01:58 -05:00
Chris Tate 68151efd37 Name new corpus programs instead of numbering them (#2270) 2026-10-25 17:54:47 -05:00
Chris Tate 27c00f6577 util: runtime format strings, inspect.custom and colors, untyped promisify (#1911) 2026-10-25 17:46:31 -05:00
Chris Tate b63dc67f9e Let boxable function arms ride a checked-dynamic union (#2269) 2026-10-25 17:44:23 -05:00
Chris Tate fad9cbdf57 Keep U+11A7 after a Hangul LV syllable in NFC and NFKC (#2266) 2026-10-25 17:31:45 -05:00
Chris Tate d33b083a3b Cache the zone offset at UTC midnights for local-time conversions
Local setters and the field constructor convert a local time value to
UTC by bracketing it with the zone offset a day before and after, then
checking the candidate instants: three to five localtime(3) calls per
conversion. In glibc each call takes the zone lock and, for dates past
the zone file's last transition, parses the zone's rule string again.

The offsets now come from a per-thread cache of offsets at UTC midnights:
a day whose two midnights agree has that offset throughout, given at
most one transition per day, which the conversion already assumes. A
day with a transition still asks localtime for the instant. A change of
process.env.TZ clears the cache.
2026-10-25 17:30:44 -05:00
Malte UblandClaude Opus 5.5 1733a4c84b Name new corpus programs instead of numbering them
Parallel changes kept taking the same next corpus number (6992 twice, the
Node island programs renumbered several times). The harness never needed
the numbers: it discovers every entry by glob, and 818 programs already
have descriptive names. AGENTS.md now makes a name, without a number, the
convention for new programs and keeps the numbered ones as they are.

The two scripts that sampled programs by number skipped named programs.
They now key a named program by a stable hash of its name, so they sample
it at the same rate; the numbered programs they pick are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:17:09 -07:00
Chris Tate 8be991aeca Skip worker cancellation polls in short loops inside another loop (#2261) 2026-10-25 17:14:42 -05:00
Chris Tate 67c38b5361 Keep the whole union of an optional parameter that reaches a recursive placeholder (#2241) 2026-10-25 17:10:27 -05:00
Chris Tate 48e87d342f Run the linker job directly for host Linux links with lld (#2253) 2026-10-25 17:05:57 -05:00
Chris Tate f1a69d9bb0 Probe hashed number-key maps without normalizing integer keys (#2264) 2026-10-25 17:03:41 -05:00
Malte UblandClaude Opus 5.5 3375304945 Erase lambdas that implement a generic method through their context
A lambda with no type parameters of its own, contextually typed by a
generic signature (`send: (m) => …` for an interface's `send<T>(m:
Message<T>): string`), takes that signature's type parameters: its
parameter is `Message<T>`. A generic lambda written with its own type
parameters already lowers once, erased, with them bound to `unknown`, but
this one tried to map `Message<T>` with `T` unbound and was refused
(SC2009).

It now lowers the same way, erased, binding the contextual signature's
type parameters to `unknown`. Parameters bound in the enclosing scope
keep their bindings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:02:24 -07:00
Malte UblandClaude Opus 5.5 605e312e78 Let boxable function arms ride a checked-dynamic union
A union with a checked-dynamic arm (`unknown`, fetch's AbortSignal)
maps to the checked-dynamic value when every other arm is one the
checked-dynamic tree holds faithfully. Function arms were excluded, so
`Progress | AbortSignal | undefined` was refused (SC2009).

The tree boxes a function whose parameters check in and whose result
converts out by reference (canBoxFuncIntoDyn), and `typeof x ===
"function"` narrows it back out to the typed function. Such arms now
join the collapse. The corpus program checks calls, identity (`===`
against the original), and the other arm's members against Node.

pi's SessionManager.listAll takes `onProgressOrSignal?: SessionListProgress
| AbortSignal`. The refusal rejected the whole SessionManager class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:02:19 -07:00
Chris Tate 5f76d41a71 Keep U+11A7 after a Hangul LV syllable in NFC and NFKC
libunicode composes an LV syllable with U+11A7 as if it were a trailing
consonant (U+11A8..U+11C2), which drops it: "가ᆧ".normalize()
gave "가" where Node gives "가ᆧ". U+11A7 is a class-0 vowel
that composes with nothing, so for the composing forms the code points
between occurrences of it normalize on their own and it is kept as it
is. The guard sits in front of the vendored library (scr_unicode_normalize),
for String.prototype.normalize and the NFC step of IDNA mapping.

8009-normalize-hangul-jungseong-o-yae prints the code points of all four
forms for U+11A7 after LV and LVT syllables, conjoining jamo, other
starters and combining marks.
2026-10-25 16:57:11 -05:00
Chris Tate 8d485dcf5f Convert promise and function values into a union's arm of their kind (#2257) 2026-10-25 16:56:50 -05:00
Chris Tate 60c89fd456 Keep record values that subtype reduction folds into an inferred return type (#2069) 2026-10-25 16:50:31 -05:00
Chris Tate 247f43c0f0 Mark emitted functions sanitize_address only in sanitized builds (#2251) 2026-10-25 16:44:16 -05:00
Chris Tate 8c579a793b Check only the files whose diagnostics the tsc gate keeps (#2263) 2026-10-25 16:39:45 -05:00
Chris Tate 3a900ed9b6 Keep the poll in nested loops whose counter can stop changing at 2^53
The range analysis caps a counter that steps by 1 at 2^53, where
`j + 1 === j`, so a loop such as `for (let j = 2 ** 53 - 2;
j < 2 ** 53 + 10; j++)` has a range of three values at its condition and
was taken for a loop of three runs. It never ends, and without its poll
worker.terminate() could not stop it. A loop's runs now count as bounded
only when a step from every value in its counter's range gives a
different value.
2026-10-25 16:38:27 -05:00
Chris Tate 35161d1883 Cross package values at their declared type where the JS literal type lacks members (#2262) 2026-10-25 16:38:00 -05:00
Chris Tate e3f02c73c9 Probe hashed number-key maps without normalizing integer keys
A number-key Map or Set read whose key has an integer view
(sc_map_entry_f64_int) fell back to the same hashed probe as any double
key, which tests for NaN and -0 before hashing. The fallback is now
sc_map_entry_f64_hashed_int, which takes the integer and converts it to
the key word directly: an integer is never NaN, and zero converts to +0.

Both hashed probes test the absent-key filter only before scanning a map
that keeps no bucket table. The filter keeps two of its 64 bits per key,
so it rejects few absent keys once a map has a bucket table, and the
probe's first bucket read answers those.

The map layout and the runtime lookup are unchanged. Corpus 8331 covers
integers the compiler tracks as integers on hashed maps and absent keys on
small bucket tables, and matches Node's output.
2026-10-25 16:32:27 -05:00
Chris Tate 27954618c7 Merge base branch 2026-10-25 16:31:56 -05:00
Chris Tate 474edacb4f Prefer the union arm that keeps every field of a converted record (#2259) 2026-10-25 16:26:24 -05:00
Chris Tate a9ea71df7d Compare unions that hold promises as untyped values
A promise converted into a union's promise arm is a new promise, so two
optional slots set to one promise each hold their own conversion, and a
value narrowed out of such a slot may be one too. Union equality compared
those arm payloads by pointer and answered false where Node answers true.

Any comparison between a union with a promise arm and a promise or another
such union now compares both sides as untyped values, where a converted
promise answers with its origin's identity.
2026-10-25 16:22:25 -05:00
Chris Tate c50ddd3c91 Merge base branch and mark p12 as a race 2026-10-25 16:21:09 -05:00
Chris Tate 34401a7d7b Merge base branch 2026-10-25 16:16:47 -05:00
Chris Tate d4a677525d Build the sanitized three.js nodes fixture in its own CI job (#2210) 2026-10-25 16:16:34 -05:00
Chris Tate ef14f0ae8a Merge main 2026-10-25 16:15:54 -05:00
Chris Tate 0ee74478fd Run paired row sums two columns per step (#2247) 2026-10-25 16:15:20 -05:00
Chris Tate a96fbcfb64 Refuse static member reads of MIMEType and MIMEParams in JavaScript
JavaScript sources hold node:util's MIMEType and MIMEParams as identity
tokens, so a read such as MIMEType.prototype or MIMEType.name answered
undefined where Node returns the class's member. Those reads now report
SC2020, as the TypeScript spelling does at compile time; in JavaScript
the refusal throws when the read runs.

The node24-mime-errors fixture reads MIMEType.prototype to take the
getters' descriptors, so its expected refusal is now SC2020.
2026-10-25 16:14:48 -05:00
Chris Tate 062d04668d Batch the program's identifier symbols before collection (#2254) 2026-10-25 16:08:26 -05:00
Chris Tate 110396ee2d Replace a package's declaration files or supply its declarations with type patches (#2245) 2026-10-25 16:03:41 -05:00
Chris Tate d1f0113e49 Check only the files whose diagnostics the tsc gate keeps
The tsc gate (preflight's errorsOf, and the original program of a JSX or
declaration-projection build) asked for every file's semantic
diagnostics, then dropped all of those in an opted-in package's files, in
unselected package JavaScript and in package shims. With --npm-static
that is nearly the whole check: on three.js's nodes fixture the 82
package files took 1.17 s and reported 13,022 diagnostics, the program's
own files 0.1 s.

getPreEmitDiagnostics takes the files whose diagnostics its caller keeps.
When some file is left out, the server checks only the kept files
(getDiagnosticsOfCheckedFiles), and their semantic diagnostics come in
the full check's order. When a stored answer for the supplied
declaration files applies to the program, it stands in for checking
those files, as in the full check; the storage rule is unchanged. A
global diagnostic can come from checking any file, so when the partial
check reports one, the full check answers as before. At load time,
before workspace packages are known, the gate leaves out only package
and shim files.

The kept diagnostics are unchanged.
2026-10-25 15:58:14 -05:00
Chris Tate 829f35bf85 Pass sanitizeAttributes where the serialized-IR test emits directly
The test emits each corpus program from its serialized IR with its own
emitter options and compares the text with compile()'s. compile() now
marks functions sanitize_address only in sanitized builds, so the test
passes the same setting as objectAudit.
2026-10-25 15:55:57 -05:00
Chris Tate 9cfeb2408f Count shorthand property reads of an initializer-less JavaScript let (#2252) 2026-10-25 15:54:08 -05:00
Chris Tate 11de08b931 Skip worker cancellation polls in short loops inside another loop
In a worker program, a loop inside another loop of the same function
needs less than its own budget, because the enclosing loop polls at
least once every 64 of its iterations:

- A loop whose counters' proven ranges bound its runs, and those of the
  loops in its body, to 64 x 64 emits no poll. This covers loops with
  constant bounds, such as mandelbrot's lane and iteration loops. The
  bound uses the counted and two-counter loop ranges, or the range of a
  counter that the update alone steps by a constant where the condition
  reads it. Loops whose counted form needs a run-time guard don't count.
- An innermost counted loop is strip-mined like a counted loop over
  typed arrays, whatever its body. A run of at most 64 iterations never
  polls, and the budget's countdown leaves the body. A run of at most
  16384 iterations is one block and polls once as it leaves. A longer
  run polls between blocks of 64, but not after its last block.

Between two polls there are then at most 64 iterations of the enclosing
loop, and in each of them at most 16384 unpolled iterations of each
strip-mined inner loop and 64 x 64 runs of each bounded nest. A loop
that no other loop of its function encloses polls as before.

New corpus program: native-worker-terminate-bounded-loops.ts.
2026-10-25 15:46:27 -05:00
Chris Tate 94446a086a Answer Object.prototype's methods on typed records (#2244) 2026-10-25 15:43:30 -05:00
Chris Tate 224e040aac Map generic alias casts inside generic bodies with the instance's arguments (#2227) 2026-10-25 15:32:14 -05:00