Closed linusg closed 1 year ago
Is it possible that these underlying bugs are the ones fixed by #2200?
That doesn't seem to be the case - I compared three different points in the implementation timeline: baseline
(before the commit linked above), editorial
(baseline
+ the commit above implemented), and normative
(editorial
+ the commit you mentioned implemented).
My diffs for them are below, hopefully showing an exact translation of the spec changes into implementation code:
editorial.patch
normative.patch
Going from baseline
to editorial
yields these test262 changes (✅ = test passing, ❌ = test failing, 💥️ = interpreter crashing because of failed assertion, unwrapping empty optional that is assumed to have a value, etc)
Diff Tests:
test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/basic.js ✅ -> 💥️
test/built-ins/Temporal/TimeZone/from/argument-valid.js ✅ -> 💥️
test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/pre-epoch.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/equals/timezone-string-multiple-offsets.js ❌ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/since/largestunit.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/since/timezone-string-datetime.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/since/timezone-string-multiple-offsets.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/until/timezone-string-datetime.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/until/timezone-string-multiple-offsets.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/subclassing-ignored.js ✅ -> 💥️
Going from editorial
to normative
fixes a bunch of other crashes and failures (and one starting to fail :thinking:):
Diff Tests:
test/built-ins/Temporal/Duration/compare/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Duration/prototype/add/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Duration/prototype/round/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Duration/prototype/subtract/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Duration/prototype/total/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Instant/prototype/toString/timezone-string-multiple-offsets.js ✅ -> ❌
test/built-ins/Temporal/ZonedDateTime/compare/zoneddatetime-string.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/from/zoneddatetime-string-multiple-offsets.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/from/zoneddatetime-string.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/equals/sub-minute-offset.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string-multiple-offsets.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/since/sub-minute-offset.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string-multiple-offsets.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/until/sub-minute-offset.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string-multiple-offsets.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string.js 💥️ -> ✅
Both of them combined, e.g. comparing baseline
against editorial
+ normative
:
Diff Tests:
test/built-ins/Temporal/Duration/compare/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Duration/prototype/add/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Duration/prototype/round/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Duration/prototype/subtract/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Duration/prototype/total/relativeto-sub-minute-offset.js ❌ -> ✅
test/built-ins/Temporal/Instant/prototype/toString/timezone-string-multiple-offsets.js ✅ -> ❌
test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/basic.js ✅ -> 💥️
test/built-ins/Temporal/TimeZone/from/argument-valid.js ✅ -> 💥️
test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/pre-epoch.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/compare/zoneddatetime-string.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/from/zoneddatetime-string-multiple-offsets.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/from/zoneddatetime-string.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/equals/sub-minute-offset.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/equals/timezone-string-multiple-offsets.js ❌ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string-multiple-offsets.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/since/largestunit.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/since/sub-minute-offset.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/since/timezone-string-datetime.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/since/timezone-string-multiple-offsets.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string-multiple-offsets.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/until/sub-minute-offset.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/until/timezone-string-datetime.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/until/timezone-string-multiple-offsets.js ✅ -> 💥️
test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string-multiple-offsets.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string.js 💥️ -> ✅
test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/subclassing-ignored.js ✅ -> 💥️
i.e. various crashes are fixed, and various previously passing tests start to crash. Take all of this with a grain of salt, there definitely are bugs, but I'm also convinced that there's a bug hiding somewhere in the spec, either caused or uncovered by these two changes.
FWIW, implementing my initially mentioned fix of replacing the reference to TimeZoneNumericUTCOffset on top of both of these causes absolute mayhem (-70 ✅ +17 ❌ +53 💥️
), leaving me slightly confused. I'll continue to look into this tomorrow.
@linusg Any further insights into what was going on?
Unfortunately not, no.
Verify before closing.
The issue with ParseTemporalTimeZone has been fixed in the meantime, and according to https://libjs.dev/test262/per-file/ all of the failing/crashing tests listed above are now passing on libjs. Closing.
I lost track of this, thanks for checking!
https://github.com/tc39/proposal-temporal/commit/6db76f4808100e2bd92e3aa379ac55b88dad4d91 looks harmless on the surface, but broke 10 tests in test262 after I implemented it. A somehow related implementation bug causing that is of course possible, but I found at least one legitimate issue caused by this commit:
ParseTemporalTimeZoneString
still refers to a TimeZoneNumericUTCOffset parse node contained within the result of parsing TemporalTimeZoneString, even though the latter no longer contains the former. TemporalTimeZoneIdentifier used to contain TimeZoneNumericUTCOffset, but TimeZoneIdentifier only contains TimeZoneUTCOffsetName.When replacing this outdated reference and using TimeZoneUTCOffsetName for
offsetString
, those broken tests are fixed again, but a handful of other tests starts failing, so something else might be amiss - I haven't investigated further.