Re: RFR: 8362448: Make use of the Double.toString(double) algorithm in java.text.DecimalFormat [v5]

2025-07-18 Thread Raffaello Giulietti
> Align the behavior of `DecimalFormat` on `double`s with that of `Formatter`. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Refactoring to paramaterized tests. - Changes: - all: https://git.openjdk.org/

Re: RFR: 8315131: Clarify VarHandle set/get access on 32-bit platforms [v3]

2025-07-18 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 23:15:44 GMT, John R Rose wrote: >> Yep, to distinguish access and the encapsulated read-modify-write atomicity, >> I decided to avoid using "atomic"/"non-atomic" altogether - now it is just >> "make no atomicity guarantee" > > Not sure this is relevant, but isn't "opaque" a

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v3]

2025-07-18 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 21:40:13 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Implement review feedback. Since the refactoring

Re: RFR: 8362448: Make use of the Double.toString(double) algorithm in java.text.DecimalFormat [v4]

2025-07-18 Thread Raffaello Giulietti
> Align the behavior of `DecimalFormat` on `double`s with that of `Formatter`. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Removed temporary comment from tests. - Changes: - all: https://git.openjdk.org/

Re: RFR: 8362448: Make use of the Double.toString(double) algorithm in java.text.DecimalFormat [v3]

2025-07-18 Thread Raffaello Giulietti
> Align the behavior of `DecimalFormat` on `double`s with that of `Formatter`. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Added tests. - Changes: - all: https://git.openjdk.org/jdk/pull/26364/files -

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v3]

2025-07-18 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 21:40:13 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Implement review feedback. Looks fine --

Re: RFR: 8315131: Clarify VarHandle set/get access on 32-bit platforms [v5]

2025-07-17 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 18:28:04 GMT, Chen Liang wrote: >> On 32 bit platforms, when an access to long/double is aligned, it is >> supported but not atomic. The original wording in >> `MethodHandles::byteBufferViewVarHandle` sounds as if it is not supported at >> all. We can fix that by borrowing

Re: RFR: 8362448: Make use of the Double.toString(double) algorithm in java.text.DecimalFormat [v2]

2025-07-17 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 18:26:14 GMT, Naoto Sato wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added comment to COMPAT static field. > > Good to see this enhancement, Raffaell

Re: RFR: 8362448: Make use of the Double.toString(double) algorithm in java.text.DecimalFormat [v2]

2025-07-17 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 17:58:51 GMT, Justin Lu wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added comment to COMPAT static field. > > src/java.base/share/classes/jdk/internal/

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-17 Thread Raffaello Giulietti
On Wed, 16 Jul 2025 18:51:41 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > The methods directly affected by this update are atan, exp, and sin, cos, > tan. The sin, cos, and tan method are affected by the updates to > KernelRemPio2 and ta

Re: RFR: 8361842: Move input validation checks to Java for String-related intrinsics [v8]

2025-07-17 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 14:29:08 GMT, Raffaello Giulietti wrote: > What is the thinking when an `@IntrinsicCandidate` method invokes another > `@IntrinsicCandidate` method? Which part is responsible for the checks? > > For example, the Java code of `StringCoding.encodeISOArray

Re: RFR: 8361842: Move input validation checks to Java for String-related intrinsics [v8]

2025-07-17 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 07:20:34 GMT, Volkan Yazici wrote: >> Validate input in `java.lang.StringCoding` intrinsic Java wrappers, improve >> their documentation, enhance the checks in the associated IR or assembly >> code, and adapt them to cause VM crash on invalid input. >> >> ## Implementation

Re: RFR: 8361842: Move input validation checks to Java for String-related intrinsics [v8]

2025-07-17 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 07:20:34 GMT, Volkan Yazici wrote: >> Validate input in `java.lang.StringCoding` intrinsic Java wrappers, improve >> their documentation, enhance the checks in the associated IR or assembly >> code, and adapt them to cause VM crash on invalid input. >> >> ## Implementation

Re: RFR: 8361842: Move input validation checks to Java for String-related intrinsics [v8]

2025-07-17 Thread Raffaello Giulietti
On Thu, 10 Jul 2025 12:18:25 GMT, Volkan Yazici wrote: >> Volkan Yazici has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Replace casting with `as_Region()` in `generate_string_range_check` > > src/java.base/share/classes/java/lang/StringC

Re: RFR: 8361842: Move input validation checks to Java for String-related intrinsics [v8]

2025-07-17 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 07:20:34 GMT, Volkan Yazici wrote: >> Validate input in `java.lang.StringCoding` intrinsic Java wrappers, improve >> their documentation, enhance the checks in the associated IR or assembly >> code, and adapt them to cause VM crash on invalid input. >> >> ## Implementation

Re: RFR: 8362448: Make use of the Double.toString(double) algorithm in java.text.DecimalFormat [v2]

2025-07-17 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 13:41:06 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added comment to COMPAT static field. > > src/java.base/share/classes/jdk/interna

Re: RFR: 8362448: Make use of the Double.toString(double) algorithm in java.text.DecimalFormat [v2]

2025-07-17 Thread Raffaello Giulietti
> Align the behavior of `DecimalFormat` on `double`s with that of `Formatter`. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Added comment to COMPAT static field. - Changes: - all: https://git.openjdk.org/

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-17 Thread Raffaello Giulietti
On Wed, 16 Jul 2025 04:53:04 GMT, Joe Darcy wrote: > Add `@Stable` to the static final arrays used in the Java port of FDLIBM. The arrays at L.2257-2262 could be declared `static` and `@Stable` as well, and moved outside the method. src/java.base/share/classes/java/lang/FdLibm.java line 815:

RFR: 8362448: Make use of the Double.toString(double) algorithm in java.text.DecimalFormat

2025-07-17 Thread Raffaello Giulietti
Align the behavior of `DecimalFormat` on `double`s with that of `Formatter`. - Commit messages: - Merge branch 'master' into 8362448 - 8362448: Make use of the Double.toString(double) algorithm in java.text.DecimalFormat - Remove some unused methods from FloatingDecimal. - Rename

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-16 Thread Raffaello Giulietti
On Wed, 16 Jul 2025 10:32:41 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 2755: >> >>> 2753: * is even and this BigInteger is negative, an {@code >>> ArithmeticException} will be >>> 2754: * thrown. >>> 2755: * >> >> I think this specifi

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-16 Thread Raffaello Giulietti
On Sat, 12 Jul 2025 09:18:27 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Removed useless instruction src/java.bas

Re: RFR: 8315131: Clarify VarHandle set/get access on 32-bit platforms [v3]

2025-07-16 Thread Raffaello Giulietti
On Fri, 11 Jul 2025 19:02:31 GMT, Chen Liang wrote: >> On 32 bit platforms, when an access to long/double is aligned, it is >> supported but not atomic. The original wording in >> `MethodHandles::byteBufferViewVarHandle` sounds as if it is not supported at >> all. We can fix that by borrowing

Re: RFR: 8362207: Add more test cases for possible double-rounding in fma

2025-07-15 Thread Raffaello Giulietti
On Tue, 15 Jul 2025 01:10:05 GMT, Joe Darcy wrote: > From discussions related to IEEE 754, a few explicit test cases were > identified where plausible, but incorrect, implementations of fma using > higher precision. These test cases are useful to include in the regression > tests of the float-

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v4]

2025-07-15 Thread Raffaello Giulietti
On Wed, 4 Jun 2025 13:12:33 GMT, Shaojin Wen wrote: >> Some static final arrays of BigInteger and BigDecimal are stable and >> immutable. We should add `@Stable` to give the optimizer more information > > Shaojin Wen has updated the pull request with a new target base due to a > merge or a reba

Integrated: 8358540: Enhance MathUtils in view of FloatingDecimal enhancements

2025-07-15 Thread Raffaello Giulietti
On Wed, 4 Jun 2025 14:22:43 GMT, Raffaello Giulietti wrote: > Another step in enhancing floating-point <-> decimal conversions. This pull request has now been integrated. Changeset: 563e8762 Author:Raffaello Giulietti URL: https://git.openjdk.org/j

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread Raffaello Giulietti
On Mon, 14 Jul 2025 15:46:47 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 1936: >> >>> 1934: * where {@code nthRoot(., n)} denotes the mathematical {@code >>> n}th root. >>> 1935: * The contents of {@code this} are not changed. The >>>

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread Raffaello Giulietti
On Mon, 14 Jul 2025 15:40:18 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 1964: >> >>> 1962: final double rad = Math.nextUp(x >= 0 ? x : x + 0x1p64); >>> 1963: final double approx = n == 3 ? Math.cbrt(rad) : >>> Math.pow(r

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread Raffaello Giulietti
On Sat, 12 Jul 2025 09:18:27 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Removed useless instruction I'm looking

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread Raffaello Giulietti
On Sat, 12 Jul 2025 09:18:27 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Removed useless instruction I agree that

Re: RFR: 8315131: Clarify VarHandle set/get access on 32-bit platforms [v3]

2025-07-11 Thread Raffaello Giulietti
On Fri, 11 Jul 2025 19:02:31 GMT, Chen Liang wrote: >> On 32 bit platforms, when an access to long/double is aligned, it is >> supported but not atomic. The original wording in >> `MethodHandles::byteBufferViewVarHandle` sounds as if it is not supported at >> all. We can fix that by borrowing

Re: RFR: 8315131: Clarify VarHandle set/get access on 32-bit platforms [v2]

2025-07-11 Thread Raffaello Giulietti
On Fri, 11 Jul 2025 14:27:21 GMT, Chen Liang wrote: >> On 32 bit platforms, when an access to long/double is aligned, it is >> supported but not atomic. The original wording in >> `MethodHandles::byteBufferViewVarHandle` sounds as if it is not supported at >> all. We can fix that by borrowing

Re: RFR: 8077587: BigInteger Roots [v18]

2025-07-11 Thread Raffaello Giulietti
On Fri, 6 Jun 2025 08:08:09 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Update "since" version Right. --

Re: RFR: 8315131: Clarify VarHandle set/get access on 32-bit platforms

2025-07-11 Thread Raffaello Giulietti
On Fri, 11 Jul 2025 08:19:43 GMT, Aleksey Shipilev wrote: >> On 32 bit platforms, when an access to long/double is aligned, it is >> supported but not atomic. The original wording in >> `MethodHandles::byteBufferViewVarHandle` sounds as if it is not supported at >> all. We can fix that by borr

Re: RFR: 8077587: BigInteger Roots [v18]

2025-07-11 Thread Raffaello Giulietti
On Fri, 6 Jun 2025 08:08:09 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Update "since" version Sure, the initial

Re: RFR: 8077587: BigInteger Roots [v15]

2025-07-10 Thread Raffaello Giulietti
On Sat, 17 May 2025 11:25:58 GMT, fabioromano1 wrote: >> The [Rampdown Phase One](https://openjdk.org/projects/jdk/25/) for JDK 25 is >> about 3 weeks from now. >> >> I think it's a bit too late for API additions to be approved in due time. >> And even if we could rush this work for 25, it mak

Re: RFR: 8320759: Creation of random BigIntegers can be made faster [v3]

2025-07-02 Thread Raffaello Giulietti
On Sat, 2 Dec 2023 15:42:18 GMT, fabioromano1 wrote: >> A faster and simpler way to generate random BigIntegers, avoiding eventually >> trimming of leading zeros in magnitude array. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision:

Re: RFR: 8320759: Creation of random BigIntegers can be made faster [v3]

2025-07-02 Thread Raffaello Giulietti
On Wed, 6 Dec 2023 15:07:59 GMT, fabioromano1 wrote: >> So, item 1 is a non-issue and item 2 is not likely a problem in practice. >> What, if anything, will be done about item 3? > > @bplb Maybe an assertion at the end of `randomBits(int, Random)` method, or a > test class. @fabioromano1 Do yo

Re: RFR: 8334015: Add Support for UUID Version 7 (UUIDv7) defined in RFC 9562 [v10]

2025-07-02 Thread Raffaello Giulietti
On Tue, 1 Jul 2025 15:20:07 GMT, Jaikiran Pai wrote: >> The uniqueness comes not just from the timestamp but also from the random >> data in the other bytes that are generated for each new UUID. > > Hello Roger, that's true about the uniqueness semantics. However, from what I > understand of RF

Re: RFR: 8358540: Enhance MathUtils in view of FloatingDecimal enhancements [v3]

2025-06-30 Thread Raffaello Giulietti
> Another step in enhancing floating-point <-> decimal conversions. Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request conta

Integrated: 8358804: Improve the API Note of BigDecimal.valueOf(double)

2025-06-14 Thread Raffaello Giulietti
On Fri, 13 Jun 2025 15:21:38 GMT, Raffaello Giulietti wrote: > Documenting a suggestion for `float` arguments. This pull request has now been integrated. Changeset: 26848a7d Author: Raffaello Giulietti URL: https://git.openjdk.org/jdk/commit/26848a7d6ce4c573b679a690fd36e6d708224

Re: RFR: 8358804: Improve the API Note of BigDecimal.valueOf(double) [v2]

2025-06-13 Thread Raffaello Giulietti
> Documenting a suggestion for `float` arguments. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Suggestion by reviewer. - Changes: - all: https://git.openjdk.org/jdk/pull/25805/files - new: ht

Re: RFR: 8358804: Improve the API Note of BigDecimal.valueOf(double)

2025-06-13 Thread Raffaello Giulietti
On Fri, 13 Jun 2025 17:39:38 GMT, Brian Burkhalter wrote: >> Documenting a suggestion for `float` arguments. > > src/java.base/share/classes/java/math/BigDecimal.java line 1383: > >> 1381: * the result usually contains too many trailing digits compared >> 1382: * to the precision of a

RFR: 8358804: Improve the API Note of BigDecimal.valueOf(double)

2025-06-13 Thread Raffaello Giulietti
Documenting a suggestion for `float` arguments. - Commit messages: - 8358804: Improve the API Note of BigDecimal.valueOf(double) Changes: https://git.openjdk.org/jdk/pull/25805/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25805&range=00 Issue: https://bugs.openjdk.org/

Re: RFR: 8358540: Enhance MathUtils in view of FloatingDecimal enhancements [v2]

2025-06-06 Thread Raffaello Giulietti
> Another step in enhancing floating-point <-> decimal conversions. Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two a

Re: RFR: 8077587: BigInteger Roots [v15]

2025-06-05 Thread Raffaello Giulietti
On Sat, 17 May 2025 11:25:58 GMT, fabioromano1 wrote: >> The [Rampdown Phase One](https://openjdk.org/projects/jdk/25/) for JDK 25 is >> about 3 weeks from now. >> >> I think it's a bit too late for API additions to be approved in due time. >> And even if we could rush this work for 25, it mak

Re: RFR: 8358540: Enhance MathUtils in view of FloatingDecimal enhancements

2025-06-04 Thread Raffaello Giulietti
On Wed, 4 Jun 2025 14:22:43 GMT, Raffaello Giulietti wrote: > Another step in enhancing floating-point <-> decimal conversions. Changes include, but are not limited to: - Accessing `g0()` and `g1()` with the exponent rather than the negated exponent. - Inverting the order of the `Ma

RFR: 8358540: Enhance MathUtils in view of FloatingDecimal enhancements

2025-06-04 Thread Raffaello Giulietti
Another step in enhancing floating-point <-> decimal conversions. - Commit messages: - 8358540: Enhance MathUtils in view of FloatingDecimal enhancements Changes: https://git.openjdk.org/jdk/pull/25641/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25641&range=00 Issue:

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v2]

2025-06-04 Thread Raffaello Giulietti
On Wed, 4 Jun 2025 13:53:09 GMT, Raffaello Giulietti wrote: >> BigInteger is an object that is considered immutable, but its field mag is >> actually changed. This is incredible and should be fixed here. It is easy to >> make mistakes. > > Please do _not_ fix th

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v2]

2025-06-04 Thread Raffaello Giulietti
On Fri, 30 May 2025 22:21:34 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 192: >> >>> 190: * zero-length mag array. >>> 191: */ >>> 192: @Stable >> >> `BigInteger.mag` gets written to a few times during computation in  >> `BigInteger​.large

Re: RFR: 8356891: Some code simplifications in BigInteger [v25]

2025-05-28 Thread Raffaello Giulietti
On Tue, 27 May 2025 21:42:37 GMT, fabioromano1 wrote: >> Some changes in `Biginteger`s' bit operations that increase the code >> readability and slightly optimize the execution time. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision

Integrated: 8357808: Add a command line option for specifying a counter in TestRandomFloatingDecimal

2025-05-28 Thread Raffaello Giulietti
On Mon, 26 May 2025 18:44:58 GMT, Raffaello Giulietti wrote: > Add a `-Dcount=N` command line option to specify the number of random samples > per test (default is 10'000). This pull request has now been integrated. Changeset: efeb050e Author: Raffaello Giulietti URL:

Re: RFR: 8356891: Some code simplifications in BigInteger [v22]

2025-05-27 Thread Raffaello Giulietti
On Tue, 27 May 2025 17:14:32 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 4732: >> >>> 4730: /* Allocate output array. If all non-sign ints are 0x00, we >>> must >>> 4731: * allocate space for one extra output int. */ >>> 4732:

Re: RFR: 8356891: Some code simplifications in BigInteger [v22]

2025-05-27 Thread Raffaello Giulietti
On Wed, 21 May 2025 09:12:49 GMT, fabioromano1 wrote: >> Some changes in `Biginteger`s' bit operations that increase the code >> readability and slightly optimize the execution time. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision

Re: RFR: 8357808: Add a command line option for specifying a counter in TestRandomFloatingDecimal [v2]

2025-05-26 Thread Raffaello Giulietti
> Add a `-Dcount=N` command line option to specify the number of random samples > per test (default is 10'000). Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Changed option name to "samples". -

RFR: 8357808: Add a command line option for specifying a counter in TestRandomFloatingDecimal

2025-05-26 Thread Raffaello Giulietti
Add a `-Dcount=N` command line option to specify the number of random samples per test (default is 10'000). - Commit messages: - 8357808: Add a command line option for specifying a counter in TestRandomFloatingDecimal Changes: https://git.openjdk.org/jdk/pull/25460/files Webrev:

Re: Add @Stable to BigInteger and BigDecimal

2025-05-26 Thread Raffaello Giulietti
Depending on which static final arrays, this might be fine. On 2025-05-26 01:57, wenshao wrote: Some static final arrays of BigInteger and BigDecimal are stable and immutable. We should add @Stable to give the optimizer more information - Shaojin Wen

Re: RFR: 8357685: Change the type of Integer::digits from char[] to byte[] [v2]

2025-05-24 Thread Raffaello Giulietti
On Sat, 24 May 2025 07:19:24 GMT, Shaojin Wen wrote: >> Integer::digits type can use byte[] instead of char[], which can reduce the >> conversion from char to byte in the process of Integer.toString. Using >> byte[] can also save memory. > > Shaojin Wen has updated the pull request incrementall

Re: RFR: 8357685: Change the type of Integer::digits from char[] to byte[] [v2]

2025-05-24 Thread Raffaello Giulietti
On Sat, 24 May 2025 07:19:24 GMT, Shaojin Wen wrote: >> Integer::digits type can use byte[] instead of char[], which can reduce the >> conversion from char to byte in the process of Integer.toString. Using >> byte[] can also save memory. > > Shaojin Wen has updated the pull request incrementall

Re: RFR: 8356995: Provide default methods min(T, T) and max(T, T) in Comparator interface [v2]

2025-05-21 Thread Raffaello Giulietti
On Wed, 21 May 2025 09:09:15 GMT, Tagir F. Valeev wrote: >> Implementation of Comparator.min and Comparator.max methods. Preliminary >> discussion is in this thread: >> https://mail.openjdk.org/pipermail/core-libs-dev/2025-May/145638.html >> The specification is mostly composed of Math.min/max a

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v6]

2025-05-20 Thread Raffaello Giulietti
On Fri, 16 May 2025 10:10:28 GMT, fabioromano1 wrote: >> There are problems with the `test/jdk/java/math/BigInteger` tests. Can you >> please crosscheck? > >> There are problems with the `test/jdk/java/math/BigInteger` tests. Can you >> please crosscheck? > > @rgiulietti It seems there is a s

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v11]

2025-05-20 Thread Raffaello Giulietti
On Tue, 20 May 2025 13:20:10 GMT, fabioromano1 wrote: >> Some changes in `Biginteger`s' bit operations that increase the code >> readability and slightly optimize the execution time. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v6]

2025-05-20 Thread Raffaello Giulietti
On Fri, 16 May 2025 10:10:28 GMT, fabioromano1 wrote: >> There are problems with the `test/jdk/java/math/BigInteger` tests. Can you >> please crosscheck? > >> There are problems with the `test/jdk/java/math/BigInteger` tests. Can you >> please crosscheck? > > @rgiulietti It seems there is a s

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v6]

2025-05-19 Thread Raffaello Giulietti
On Mon, 19 May 2025 17:16:58 GMT, fabioromano1 wrote: >> I think the suggestion is fine. > > Yes, but perhaps in the current version it's more clear what is the returned > value according to the condition. One could see the suggested variant as "return magBitLength(), except for a corrective t

Re: RFR: 8356995: Provide default methods min(T, T) and max(T, T) in Comparator interface

2025-05-19 Thread Raffaello Giulietti
On Mon, 19 May 2025 07:25:17 GMT, Tagir F. Valeev wrote: > Implementation of Comparator.min and Comparator.max methods. Preliminary > discussion is in this thread: > https://mail.openjdk.org/pipermail/core-libs-dev/2025-May/145638.html > The specification is mostly composed of Math.min/max and C

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v6]

2025-05-19 Thread Raffaello Giulietti
On Fri, 16 May 2025 13:30:01 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 3860: >> >>> 3858: && Integer.lowestOneBit(mag[0]) == mag[0] >>> 3859: && numberOfTrailingZeroInts() == mag.length - 1 >>> 3860: ? magBi

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v8]

2025-05-19 Thread Raffaello Giulietti
On Mon, 19 May 2025 15:02:57 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> An optimization > > src/java.base/share/classes/java/math/BigInte

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v8]

2025-05-19 Thread Raffaello Giulietti
On Fri, 16 May 2025 11:10:12 GMT, fabioromano1 wrote: >> Some changes in `Biginteger`s' bit operations that increase the code >> readability and slightly optimize the execution time. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision

Re: Towards a JSON API for the JDK

2025-05-16 Thread Raffaello Giulietti
Since the parser is specified to be lazy, the backing store needs to be immutable. On 2025-05-16 18:52, Markus KARG wrote: When instead allowing the general interface CharSequence, *any* kind of text source can be parsed, for example, an off-heap located direct CharBuffer, without the need to

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v6]

2025-05-16 Thread Raffaello Giulietti
On Fri, 16 May 2025 11:43:18 GMT, fabioromano1 wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> make magBitLength() an instance method > > src/java.base/share/classes/java/math/BigInteger.java line 3619: > >> 3617:

Re: RFR: 8357063: Document preconditions for DecimalDigits methods

2025-05-16 Thread Raffaello Giulietti
On Thu, 15 May 2025 06:24:44 GMT, Shaojin Wen wrote: > Similar to PR #24982 > Document preconditions on certain DecimalDigits methods that use operations > either unsafe and/or without range checks. The renaming is nice and useful. But #24982, in addition to renaming, emphasizes the expectatio

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v6]

2025-05-15 Thread Raffaello Giulietti
On Thu, 15 May 2025 15:37:39 GMT, fabioromano1 wrote: >> Some changes in `Biginteger`s' bit operations that increase the code >> readability and slightly optimize the execution time. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision

Re: RFR: 8356993: ArrayDeque should use Arrays.fill() instead of for() loops [v2]

2025-05-15 Thread Raffaello Giulietti
On Thu, 15 May 2025 17:56:10 GMT, Archie Cobbs wrote: >> test/jdk/java/util/ArrayDeque/ClearBenchmarkTestJMH.java line 64: >> >>> 62: @Measurement(iterations = 10) >>> 63: @Warmup(iterations = 3) >>> 64: public void fillAndClear() { >> >> I think you need to return the collection or

Re: RFR: 8357063: Document preconditions for DecimalDigits methods

2025-05-15 Thread Raffaello Giulietti
On Thu, 15 May 2025 06:24:44 GMT, Shaojin Wen wrote: > Similar to PR #24982 > Document preconditions on certain DecimalDigits methods that use operations > either unsafe and/or without range checks. @wenshao I understand this is a kind of followup of #24982, but why this title? It seems just

Re: RFR: 8356709: Avoid redundant String formatting in BigDecimal.valueOf(double) [v4]

2025-05-15 Thread Raffaello Giulietti
ham has updated the pull request incrementally with three > additional commits since the last revision: > > - Update > src/java.base/share/classes/jdk/internal/math/FormattedFPDecimal.java > >Align better with spec > >Co-authored-by: Raffaello Giulietti

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v4]

2025-05-15 Thread Raffaello Giulietti
On Tue, 13 May 2025 21:24:08 GMT, fabioromano1 wrote: >> Some changes in `Biginteger`s' bit operations that increase the code >> readability and slightly optimize the execution time. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v4]

2025-05-15 Thread Raffaello Giulietti
On Tue, 13 May 2025 21:24:08 GMT, fabioromano1 wrote: >> Some changes in `Biginteger`s' bit operations that increase the code >> readability and slightly optimize the execution time. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations [v4]

2025-05-15 Thread Raffaello Giulietti
On Tue, 13 May 2025 21:24:08 GMT, fabioromano1 wrote: >> Some changes in `Biginteger`s' bit operations that increase the code >> readability and slightly optimize the execution time. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision

Re: RFR: 8356980: Better handling of non-breaking space

2025-05-15 Thread Raffaello Giulietti
On Thu, 15 May 2025 09:17:42 GMT, Magnus Ihse Bursie wrote: >>> So, this exactly reverses what was done in the fix for JDK-8301991 >> >> No, it doesn't. I still agree with that fix -- the overwhelming majority of >> characters should indeed be UTF-8 instead of unicode sequences. >> >> This is

Re: RFR: 8077587: BigInteger Roots [v15]

2025-05-14 Thread Raffaello Giulietti
On Wed, 14 May 2025 18:07:08 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Revert "Use type long for bitLength inste

Re: RFR: 8077587: BigInteger Roots [v15]

2025-05-14 Thread Raffaello Giulietti
On Wed, 14 May 2025 18:07:08 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Revert "Use type long for bitLength inste

Re: RFR: 8077587: BigInteger Roots [v6]

2025-05-14 Thread Raffaello Giulietti
On Mon, 12 May 2025 19:23:16 GMT, fabioromano1 wrote: >> @fabioromano1 Is [this >> proof](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) >> still relevant? > > @rgiulietti No, the proof of the recurrence used is the one by Zimmermann > linked in the code

Re: RFR: 8356709: Avoid redundant String formatting in BigDecimal.valueOf(double)

2025-05-14 Thread Raffaello Giulietti
On Sun, 11 May 2025 16:32:02 GMT, Johannes Graham wrote: >> Optimize `BigDecimal.valueOf(double)` by using `FormattedFPDecimal` instead >> of converting to decimal string and then parsing it. This results in an >> approximate 6x improvement for me. > > On Aarch64 M4: > > Benchmark

Re: RFR: 8356709: Avoid redundant String formatting in BigDecimal.valueOf(double) [v2]

2025-05-14 Thread Raffaello Giulietti
On Wed, 14 May 2025 13:33:32 GMT, Johannes Graham wrote: >> test/jdk/java/math/BigDecimal/ValueOfDouble.java line 41: >> >>> 39: >>> 40: public class ValueOfDouble { >>> 41: private static final String DIGITS = "1234567899123456789"; // >>> Enough digits to fill a long >> >> Suggestion: >

Re: RFR: 8356709: Avoid redundant String formatting in BigDecimal.valueOf(double) [v3]

2025-05-14 Thread Raffaello Giulietti
On Wed, 14 May 2025 13:47:11 GMT, Johannes Graham wrote: >> Optimize `BigDecimal.valueOf(double)` by using `FormattedFPDecimal` instead >> of converting to decimal string and then parsing it. This results in an >> approximate 6x improvement for me. > > Johannes Graham has updated the pull reque

Re: RFR: 8356709: Avoid redundant String formatting in BigDecimal.valueOf(double) [v2]

2025-05-14 Thread Raffaello Giulietti
On Tue, 13 May 2025 13:03:42 GMT, Johannes Graham wrote: >> Optimize `BigDecimal.valueOf(double)` by using `FormattedFPDecimal` instead >> of converting to decimal string and then parsing it. This results in an >> approximate 6x improvement for me. > > Johannes Graham has updated the pull reque

Integrated: 8343829: Unify decimal and hexadecimal parsing in FloatingDecimal

2025-05-14 Thread Raffaello Giulietti
On Fri, 13 Dec 2024 15:04:12 GMT, Raffaello Giulietti wrote: > See the JBS bug for some details. This pull request has now been integrated. Changeset: d1032d71 Author: Raffaello Giulietti URL: https://git.openjdk.org/jdk/commit/d1032d71bfd50ebc4b328ce9b0cc81cbb80554b0 St

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations

2025-05-13 Thread Raffaello Giulietti
On Mon, 12 May 2025 13:45:08 GMT, fabioromano1 wrote: >> @fabioromano1 While reviewers can of course file JBS issues on behalf of >> contributors, the recommende way is for the latter to file a [bug >> report](https://bugreport.java.com/bugreport/), as they know what they will >> work on bette

Re: RFR: 8356891: Some code simplifications for basic BigIntegers' bit operations

2025-05-13 Thread Raffaello Giulietti
On Sat, 10 May 2025 16:41:17 GMT, fabioromano1 wrote: > Some changes in `Biginteger`s' bit operations that increase the code > readability and slightly optimize the execution time. @fabioromano1 While reviewers can of course file JBS issues on behalf of contributors, the recommende way is for

Integrated: 8355992: Add unsignedMultiplyExact and *powExact methods to Math and StrictMath

2025-05-13 Thread Raffaello Giulietti
On Fri, 2 May 2025 11:47:32 GMT, Raffaello Giulietti wrote: > Add `powExact()` and `unsignedPowExact()` methods that operate on integer > values arguments. > Further, add `unsignedMultiplyExact` methods as well. This pull request has now been integrated. Changeset: 64a858

Re: RFR: 8343829: Unify decimal and hexadecimal parsing in FloatingDecimal [v10]

2025-05-13 Thread Raffaello Giulietti
On Tue, 13 May 2025 03:58:44 GMT, Joe Darcy wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Addressed reviewer comments. > > src/java.base/share/classes/jdk/internal/math/

Re: RFR: 8356695: java/lang/StringBuilder/HugeCapacity.java failing with OOME

2025-05-12 Thread Raffaello Giulietti
On Mon, 12 May 2025 15:53:42 GMT, Roger Riggs wrote: > The failure of the new StringBuilder HugeCapacity test testHugePlus is > intermittent with some GC's. > It could be reliably reproduced with the serialGC and parallelGC's. > > Raise the memory limit from 6G to 8G to accommodate the new test

Re: RFR: 8077587: BigInteger Roots [v6]

2025-05-12 Thread Raffaello Giulietti
On Sat, 10 May 2025 11:57:32 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge branch 'nth-root-branch' of https

Re: RFR: 8356709: Avoid redundant String formatting in BigDecimal.valueOf(double)

2025-05-12 Thread Raffaello Giulietti
On Sun, 11 May 2025 16:22:11 GMT, Johannes Graham wrote: > Optimize `BigDecimal.valueOf(double)` by using `FormattedFPDecimal` instead > of converting to decimal string and then parsing it. This results in an > approximate 6x improvement for me. macOS 15.4.1 / M1 Pro / 32 GiB RAM BigDecimals.

Re: RFR: 8356709: Avoid redundant String formatting in BigDecimal.valueOf(double)

2025-05-12 Thread Raffaello Giulietti
On Sun, 11 May 2025 16:32:02 GMT, Johannes Graham wrote: >> Optimize `BigDecimal.valueOf(double)` by using `FormattedFPDecimal` instead >> of converting to decimal string and then parsing it. This results in an >> approximate 6x improvement for me. > > On Aarch64 M4: > > Benchmark

Re: RFR: 8343829: Unify decimal and hexadecimal parsing in FloatingDecimal [v10]

2025-05-10 Thread Raffaello Giulietti
> See the JBS bug for some details. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Addressed reviewer comments. - Changes: - all: https://git.openjdk.org/jdk/pull/22737/files - new: https://git.openjdk.

Re: RFR: 8343829: Unify decimal and hexadecimal parsing in FloatingDecimal [v9]

2025-05-10 Thread Raffaello Giulietti
On Fri, 9 May 2025 22:58:19 GMT, Chen Liang wrote: >> Raffaello Giulietti has updated the pull request with a new target base due >> to a merge or a rebase. The incremental webrev excludes the unrelated >> changes brought in by the merge/rebase. The pull request contains

Re: RFR: 8343829: Unify decimal and hexadecimal parsing in FloatingDecimal [v8]

2025-05-09 Thread Raffaello Giulietti
> See the JBS bug for some details. Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revis

Re: RFR: 8343829: Unify decimal and hexadecimal parsing in FloatingDecimal [v9]

2025-05-09 Thread Raffaello Giulietti
> See the JBS bug for some details. Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 14 additional commits since the last revis

Re: RFR: 8351443: Improve robustness of StringBuilder [v9]

2025-05-09 Thread Raffaello Giulietti
On Fri, 9 May 2025 16:41:39 GMT, Roger Riggs wrote: >> Refactor AbstractStringBuilder to maintain consistency among count, coder, >> and value buffers while the buffer capacity is being expanded and/or >> inflated from Latin1 to UTF16 representations. >> The refactoring pattern is to read and

Re: RFR: 8355719: Reduce memory consumption of BigInteger.pow() [v55]

2025-05-09 Thread Raffaello Giulietti
On Thu, 8 May 2025 16:48:40 GMT, fabioromano1 wrote: >> This PR optimizes `BigInteger.pow(int)` method. The primary enhancement in >> `pow()` is not concerned most on execution time, but rather in memory >> optimization, because the PR implementation does the "shift of the exponent" >> squarin

  1   2   3   4   5   6   7   8   9   10   >