Fix the DurationFormat fractionl output [v8/v8 : main]

0 views
Skip to first unread message

Jakob Linke (Gerrit)

unread,
Dec 16, 2025, 5:07:56 AM12/16/25
to Frank Tang, Leszek Swirski, Manish Goregaokar, V8 LUCI CQ, v8-re...@googlegroups.com
Attention needed from Frank Tang

Jakob Linke added 9 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Jakob Linke . resolved

cc Manish and Leszek, please do chime in if you have comments. I did not review against the spec in this round, Manish would you be the right person to do so?

File src/objects/js-duration-format.cc
Line 761, Patchset 1 (Latest):bool OutputSimpleNumber(const char* type, int64_t value, size_t powerOfTen,
Jakob Linke . unresolved

Please comment what the difference is to OutputLongShortOrNarrow, and which part of the spec this implements.

Line 770, Patchset 1 (Latest): // k. If value is not 0 or display is not "auto" or displayRequired is "true",
Jakob Linke . unresolved

This last part is assumed false?

Line 775, Patchset 1 (Latest): // return Output(type, value, fmt, addToLast, display_negative_sign,
Jakob Linke . unresolved

Leftover

Line 803, Patchset 1 (Latest): if (digits.length() < powerOfTen) {
Jakob Linke . unresolved

Let's add a `DCHECK_LE(powerOfTen, 9)` to be safe.

Line 814, Patchset 1 (Latest): return display_negative_sign;
Jakob Linke . unresolved

Why return anything if the result is unused below?

Line 951, Patchset 1 (Latest): record.time_duration.seconds * 1000000000LL;
Jakob Linke . unresolved

What protects against overflow here and below?

File test/intl/regress-463070442.js
Line 5, Patchset 1 (Latest):// Test the fractional operation is calculate in Math Value not double.
Jakob Linke . unresolved

Please explain what "Math Value" means. A link to https://tc39.es/ecma262/#sec-mathematical-operations would help.

Line 8, Patchset 1 (Latest): {hours: 0, minutes: 0, seconds: 2, milliseconds: 712}));
Jakob Linke . unresolved

Could you add more tests covering edge cases, e.g. for large values.

Open in Gerrit

Related details

Attention is currently required from:
  • Frank Tang
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I975699d53dddfb00ae04494e1ed21889b6faaac4
Gerrit-Change-Number: 7263705
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Tang <ft...@chromium.org>
Gerrit-Reviewer: Frank Tang <ft...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-CC: Leszek Swirski <les...@chromium.org>
Gerrit-CC: Manish Goregaokar <manis...@google.com>
Gerrit-Attention: Frank Tang <ft...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Dec 2025 10:07:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Frank Tang (Gerrit)

unread,
Dec 18, 2025, 6:30:19 PM12/18/25
to Leszek Swirski, Manish Goregaokar, Jakob Linke, V8 LUCI CQ, v8-re...@googlegroups.com
Attention needed from Jakob Linke

Frank Tang added 3 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Frank Tang . resolved

Please do NOT look at it yet. We found some more problem. Fixing it now.

File src/objects/js-duration-format.cc
Line 803, Patchset 1: if (digits.length() < powerOfTen) {
Jakob Linke . resolved

Let's add a `DCHECK_LE(powerOfTen, 9)` to be safe.

Frank Tang

Done

Line 814, Patchset 1: return display_negative_sign;
Jakob Linke . resolved

Why return anything if the result is unused below?

Frank Tang

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Jakob Linke
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I975699d53dddfb00ae04494e1ed21889b6faaac4
Gerrit-Change-Number: 7263705
Gerrit-PatchSet: 2
Gerrit-Owner: Frank Tang <ft...@chromium.org>
Gerrit-Reviewer: Frank Tang <ft...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-CC: Leszek Swirski <les...@chromium.org>
Gerrit-CC: Manish Goregaokar <manis...@google.com>
Gerrit-Attention: Jakob Linke <jgr...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 23:30:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jakob Linke <jgr...@chromium.org>
unsatisfied_requirement
open
diffy

Manish Goregaokar (Gerrit)

unread,
Dec 19, 2025, 1:15:49 PM12/19/25
to Frank Tang, Leszek Swirski, Jakob Linke, V8 LUCI CQ, v8-re...@googlegroups.com
Attention needed from Frank Tang and Jakob Linke

Manish Goregaokar added 1 comment

Patchset-level comments
Jakob Linke . resolved

cc Manish and Leszek, please do chime in if you have comments. I did not review against the spec in this round, Manish would you be the right person to do so?

Manish Goregaokar

I'm not super familiar with this spec but I can verify against it if you'd like. Unfortunately I have a hard time figuring out what parts of the spec this implements: the spec text comments in the new function do not seem to be anywhere in ecma402 or proposal-intl-duration-format (which one should we be using here?), and I'm also having a hard time figuring out what spec sections the existing edited code is for. Perhaps https://tc39.es/ecma402/#sec-formatnumericseconds ?

Open in Gerrit

Related details

Attention is currently required from:
  • Frank Tang
  • Jakob Linke
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I975699d53dddfb00ae04494e1ed21889b6faaac4
Gerrit-Change-Number: 7263705
Gerrit-PatchSet: 2
Gerrit-Owner: Frank Tang <ft...@chromium.org>
Gerrit-Reviewer: Frank Tang <ft...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-CC: Leszek Swirski <les...@chromium.org>
Gerrit-CC: Manish Goregaokar <manis...@google.com>
Gerrit-Attention: Jakob Linke <jgr...@chromium.org>
Gerrit-Attention: Frank Tang <ft...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 18:15:45 +0000
unsatisfied_requirement
open
diffy

Frank Tang (Gerrit)

unread,
Dec 19, 2025, 7:01:18 PM12/19/25
to Leszek Swirski, Manish Goregaokar, Jakob Linke, V8 LUCI CQ, v8-re...@googlegroups.com
Attention needed from Jakob Linke

Frank Tang added 7 comments

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Frank Tang . resolved

ok, ready for another round of review. PTAL

File src/objects/js-duration-format.cc
Line 761, Patchset 1:bool OutputSimpleNumber(const char* type, int64_t value, size_t powerOfTen,
Jakob Linke . resolved

Please comment what the difference is to OutputLongShortOrNarrow, and which part of the spec this implements.

Frank Tang

Done

Line 770, Patchset 1: // k. If value is not 0 or display is not "auto" or displayRequired is "true",
Jakob Linke . resolved

This last part is assumed false?

Frank Tang

Done

Line 775, Patchset 1: // return Output(type, value, fmt, addToLast, display_negative_sign,
Jakob Linke . resolved

Leftover

Frank Tang

Done

Line 951, Patchset 1: record.time_duration.seconds * 1000000000LL;
Jakob Linke . resolved

What protects against overflow here and below?

Frank Tang

!temporal::IsValidDuration(isolate, record)
should throw before reaching this point

File test/intl/regress-463070442.js
Line 5, Patchset 1:// Test the fractional operation is calculate in Math Value not double.
Jakob Linke . resolved

Please explain what "Math Value" means. A link to https://tc39.es/ecma262/#sec-mathematical-operations would help.

Frank Tang

Done

Line 8, Patchset 1: {hours: 0, minutes: 0, seconds: 2, milliseconds: 712}));
Jakob Linke . resolved

Could you add more tests covering edge cases, e.g. for large values.

Frank Tang

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Jakob Linke
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I975699d53dddfb00ae04494e1ed21889b6faaac4
    Gerrit-Change-Number: 7263705
    Gerrit-PatchSet: 3
    Gerrit-Owner: Frank Tang <ft...@chromium.org>
    Gerrit-Reviewer: Frank Tang <ft...@chromium.org>
    Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-CC: Manish Goregaokar <manis...@google.com>
    Gerrit-Attention: Jakob Linke <jgr...@chromium.org>
    Gerrit-Comment-Date: Sat, 20 Dec 2025 00:01:14 +0000
    unsatisfied_requirement
    open
    diffy

    Frank Tang (Gerrit)

    unread,
    Dec 19, 2025, 7:02:20 PM12/19/25
    to Leszek Swirski, Manish Goregaokar, Jakob Linke, V8 LUCI CQ, v8-re...@googlegroups.com
    Attention needed from Jakob Linke

    Frank Tang added 1 comment

    File src/objects/js-duration-format.cc
    Line 813, Patchset 3 (Latest): // Use faster ICU API formatInt if the vaue fit the precision int64_t,
    Frank Tang . resolved

    Please fix this WARNING reported by Spellchecker: "vaue" is a possible misspelling of "value".

    To bypass Spellchecker, add a foot...

    "vaue" is a possible misspelling of "value".

    To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jakob Linke
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I975699d53dddfb00ae04494e1ed21889b6faaac4
    Gerrit-Change-Number: 7263705
    Gerrit-PatchSet: 3
    Gerrit-Owner: Frank Tang <ft...@chromium.org>
    Gerrit-Reviewer: Frank Tang <ft...@chromium.org>
    Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-CC: Manish Goregaokar <manis...@google.com>
    Gerrit-Attention: Jakob Linke <jgr...@chromium.org>
    Gerrit-Comment-Date: Sat, 20 Dec 2025 00:02:17 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Jakob Linke (Gerrit)

    unread,
    Jan 8, 2026, 8:24:21 AM (22 hours ago) Jan 8
    to Frank Tang, Leszek Swirski, Manish Goregaokar, V8 LUCI CQ, v8-re...@googlegroups.com
    Attention needed from Frank Tang

    Jakob Linke voted and added 3 comments

    Votes added by Jakob Linke

    Code-Review+1

    3 comments

    Patchset-level comments
    File-level comment, Patchset 1:
    Jakob Linke . unresolved

    cc Manish and Leszek, please do chime in if you have comments. I did not review against the spec in this round, Manish would you be the right person to do so?

    Manish Goregaokar

    I'm not super familiar with this spec but I can verify against it if you'd like. Unfortunately I have a hard time figuring out what parts of the spec this implements: the spec text comments in the new function do not seem to be anywhere in ecma402 or proposal-intl-duration-format (which one should we be using here?), and I'm also having a hard time figuring out what spec sections the existing edited code is for. Perhaps https://tc39.es/ecma402/#sec-formatnumericseconds ?

    Jakob Linke

    Yes that is the spec section I found as well. A second look would be appreciated since my familiarity here is zero :)

    Jakob Linke . resolved

    Rubberstamp +1 from my side.

    File src/objects/js-duration-format.cc
    Line 770, Patchset 1: // k. If value is not 0 or display is not "auto" or displayRequired is "true",
    Jakob Linke . unresolved

    This last part is assumed false?

    Frank Tang

    Done

    Jakob Linke

    How?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Frank Tang
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I975699d53dddfb00ae04494e1ed21889b6faaac4
    Gerrit-Change-Number: 7263705
    Gerrit-PatchSet: 3
    Gerrit-Owner: Frank Tang <ft...@chromium.org>
    Gerrit-Reviewer: Frank Tang <ft...@chromium.org>
    Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-CC: Manish Goregaokar <manis...@google.com>
    Gerrit-Attention: Frank Tang <ft...@chromium.org>
    Gerrit-Comment-Date: Thu, 08 Jan 2026 13:24:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Manish Goregaokar <manis...@google.com>
    Comment-In-Reply-To: Jakob Linke <jgr...@chromium.org>
    Comment-In-Reply-To: Frank Tang <ft...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Manish Goregaokar (Gerrit)

    unread,
    Jan 8, 2026, 12:02:21 PM (18 hours ago) Jan 8
    to Frank Tang, Jakob Linke, Leszek Swirski, V8 LUCI CQ, v8-re...@googlegroups.com
    Attention needed from Frank Tang

    Manish Goregaokar added 1 comment

    Patchset-level comments
    Jakob Linke . unresolved

    cc Manish and Leszek, please do chime in if you have comments. I did not review against the spec in this round, Manish would you be the right person to do so?

    Manish Goregaokar

    I'm not super familiar with this spec but I can verify against it if you'd like. Unfortunately I have a hard time figuring out what parts of the spec this implements: the spec text comments in the new function do not seem to be anywhere in ecma402 or proposal-intl-duration-format (which one should we be using here?), and I'm also having a hard time figuring out what spec sections the existing edited code is for. Perhaps https://tc39.es/ecma402/#sec-formatnumericseconds ?

    Jakob Linke

    Yes that is the spec section I found as well. A second look would be appreciated since my familiarity here is zero :)

    Manish Goregaokar

    Yeah, the code doesn't really match well so I'm not sure how to verify it against the spec. Comments pointing out spec steps would be really nice to have.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Frank Tang
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I975699d53dddfb00ae04494e1ed21889b6faaac4
    Gerrit-Change-Number: 7263705
    Gerrit-PatchSet: 3
    Gerrit-Owner: Frank Tang <ft...@chromium.org>
    Gerrit-Reviewer: Frank Tang <ft...@chromium.org>
    Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-CC: Manish Goregaokar <manis...@google.com>
    Gerrit-Attention: Frank Tang <ft...@chromium.org>
    Gerrit-Comment-Date: Thu, 08 Jan 2026 17:02:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages