Skip to content

Bump test262 to 7ab7fafa; fix TypedArray.prototype.with after a shrinking coercion - #4157

Merged
lahma merged 1 commit into
sebastienros:mainfrom
lahma:chore/test262-sync
Sep 24, 2026
Merged

lahma merged 1 commit into
sebastienros:mainfrom
lahma:chore/test262-sync

Conversation

@lahma

@lahma lahma commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Pin

old new
SuiteGitSha 35d566604512cba908054eec49f85e64a59f3091 7ab7fafa0003f73fc85c1b95d88094d33f7eb8bd (tc39/test262 main head, confirmed with git ls-remote)
CorpusContentSha256 53f0415391f9b10732861cebc6f4d1229350c9367347e6d98102f59f76e19ff0 3a5186f786877400125b6ab4a73e4528821faa911527bd8e6ba69c92c000a23d

The digest was recomputed from the local git tree with a script that mirrors Test262CorpusAcquisition.ComputeDigest: ordinal-sorted /harness and /test paths, each hashed as an int32-LE length, the UTF-8 path, then SHA-256(content). As a check, the script reproduces the old committed digest exactly for 35d56660 (53,945 files). The new tree has 53,955 files, which is the 10 added in the range. The runner then downloaded the GitHub archive and accepted it against the new digest, so two independent computations agree.

Commit range 35d56660..7ab7fafa (5 commits)

No features.txt change. Nothing outside test/ changed.

commit what impact
95ad0fc2 Intl.Locale -u-<ukey>-true/-yes coverage now includes digit-first ukeys passes
0a888ef3 tc39/test262#5136: TypedArray.prototype.{with,filter} when a coercion or callback shrinks or detaches the buffer, for tc39/ecma262#3979 (open, "has test262 tests": ! TypedArraySetElement → ?) with: 8 failures; filter: passes
045bf6f9 German {weekday: "short", day, month: "long"} must contain "Sa.," 2 failures, parked (see below)
020f5c80 NumberFormat significant-digits rounding across a magnitude (ToRawPrecision) passes
7ab7fafa formatToParts for the same passes

Failures before → after

run total passed failed skipped
new pin, no engine change 102,740 102,621 10 109
this PR 102,740 102,629 0 111

The 10 failures were TypedArray/prototype/with/{index,value}-coercion-shrinks.js and their BigInt/ versions (4 files × 2 modes), plus german-weekday-no-year.js (2 modes). All 8 with failures were the same CLR exception escaping into script:

System.ArgumentException: Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray')

Fix: %TypedArray%.prototype.with — https://tc39.es/ecma262/#sec-%typedarray%.prototype.with

With reads len, then coerces the index and the value. Either coercion can run script that shrinks a resizable buffer, and JsArrayBuffer.Resize reallocates the block. The step-9 IsValidIntegerIndex check only proves that actualIndex survived. With then bulk-copied len * elementSize bytes out of the shorter block. It now copies min(len, current length) elements. Every missing element goes through TypedArraySetElement(A, k, undefined), which is step 12.c/e as corrected by tc39/ecma262#3979: NaN for float arrays, +0 for integer arrays, and a TypeError for BigInt arrays. The <remarks> names the open PR, because the published prose still says !. The bulk-copy fast path is unchanged whenever nothing shrank.

filter already propagated the TypeError, because a[n] = kept[n] goes through the throwing setter, so it needed no change.

Parked: intl402/DateTimeFormat/prototype/format/german-weekday-no-year.js

This goes under the existing === INTL402 EXCLUSIONS === banner, with a comment naming what removes it. Jint writes "Sa 24 Dezember"; CLDR's German MMMMEd is "EEE, d. MMMM", which gives "Sa., 24. Dezember". Passing needs two things this engine does not have:

  1. Skeleton matching. A component bag must resolve to a pattern from CLDR availableFormats through a format matcher (https://tc39.es/ecma402/#sec-createdatetimeformat). JsDateTimeFormat.FormatWithComponents / FormatComponentsToParts instead assemble fields in ShortDatePattern order with fixed separators. The same gap is why English prints "Sat December 24" where CLDR says "Sat, December 24".
  2. Format-context weekday names. .NET's AbbreviatedDayNames are ICU's stand-alone forms ("Sa"). The format-context "Sa." is not reachable through DateTimeFormatInfo, and ICldrProvider.GetWeekdayNames has no context parameter.

This is too large for a sync PR. A real fix needs a pattern source on ICldrProvider (public surface), a .NET-derived fallback for DefaultCldrProvider, a format matcher, and a rewrite of the string, parts and range lanes onto the matched pattern. It is intl402 only, so the banner invariant holds.

Unit tests — failing first

New file Jint.Tests/Runtime/TypedArrayWithShrinkTests.cs. It covers index- and value-coercion shrinks for every numeric element type, both BigInt types (TypeError), and Float16 (gated with [IgnoreUnless] on System.Half, like DataViewBoundsTests). It also has guards for the RangeError on a negative index shrunk out of bounds, a length-tracking buffer that grows during coercion, and an unshrunk offset view. Each case runs in script with its own catch, so a leaking CLR exception fails the test instead of passing as an error.

engine total failed passed skipped
unfixed (main's IntrinsicTypedArrayPrototype.cs) 90 70 18 2
fixed 90 0 88 2

Before the fix, all 70 failures were the ArgumentException above (net48's Float16 rows fail on Half first). The 18 passing cases are the six guards × 3 TFMs, which are meant to pass on both sides. The 2 skipped cases are net48's Float16 rows.

SpecAnchors.txt gains ecma262 sec-%typedarray%.prototype.with (count 1259 → 1260). The anchor was checked against tc39/ecma262 spec.html.

Other suites

  • Jint.Tests: 34,022 total / 34,006 passed / 0 failed / 16 skipped (net10.0, net8.0, net48)
  • Jint.Tests.PublicInterface: 10,474 / 10,411 / 0 / 63. The first full run had one net48 failure in HostPumpAdmissionTests.AnAdmittedCallbackHoldsTheParkPastItsCeiling ("the canary was admitted by an engine the park had already released"), a host-pump timing test this diff does not touch. The class then passed 3/3 in isolation, and a second full run was green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PanPJbBD7pQC9fRiTpHxvs

…rinking coercion

Moves SuiteGitSha 35d56660 -> 7ab7fafa (5 upstream commits, test-only, no
features.txt change) and recomputes CorpusContentSha256 over the new tree.

%TypedArray%.prototype.with bulk-copied the length it read before coercing
the index and the value, so a coercion that shrank a resizable buffer made
Array.Copy read past the reallocated block and a CLR ArgumentException
escaped into the host. It now copies only the elements the source still
has and writes undefined through TypedArraySetElement for the rest (NaN,
+0, or a TypeError for BigInt), per tc39/ecma262#3979 as tested by
tc39/test262#5136.

intl402/DateTimeFormat/prototype/format/german-weekday-no-year.js parks
under the INTL402 banner: it needs CLDR availableFormats skeleton matching
and format-context weekday names, which the component-bag lane lacks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PanPJbBD7pQC9fRiTpHxvs
@lahma
lahma merged commit 431590d into sebastienros:main Sep 24, 2026
9 checks passed
@lahma
lahma deleted the chore/test262-sync branch September 25, 2026 16:17
lahma added a commit that referenced this pull request Oct 5, 2026
…g coercion (#4218)

Adapted from 431590d (engine fix and regression
tests only; the test262 pin is not bumped).

%TypedArray%.prototype.with bulk-copied the length read before coercing the index
and the value, so a coercion that shrank a resizable buffer made Array.Copy read
past the reallocated block and a CLR ArgumentException escaped into the host. It
now copies only the elements the source still has and writes undefined through
TypedArraySetElement for the rest (NaN, +0, or a TypeError for BigInt).

Co-authored-by: Claude Opus 5.5 (1M context) <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