Skip to content

1.96 beta regressions involving floats #156039

Closed as not planned
Closed as not planned

Description

@theemathas

The following regressions are found by the 1.96 beta crater run. They involve floats in one way or another.

The casper-wasmi-core and soroban-wasmi_core regressions are minimized to the following code, whose assertion passes on stable, but fails on beta.

fn main() {
    assert_eq!((-0.0_f32).min(0.0_f32).to_bits(), 0x8000_0000_u32);
}

The raekna-compute regression is minimized to the following code, whose assertion passes on stable, but fails on beta.

fn main() {
    assert_eq!(11.0_f64.acosh(), 3.0889699048446033_f64);
}

I have not yet minimized the simdeez regression, but it seems to involve SIMD and acosh.

Activity

  1. added
    C-bugCategory: This is a bug.
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    A-floating-pointArea: Floating point numbers and arithmetic
    on May 1, 2026
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on May 1, 2026
  3. bjorn3 commented on May 1, 2026

    @bjorn3
    Member

    The docs of min state:

    If the inputs compare equal (such as for the case of +0.0 and -0.0), either input may be returned non-deterministically.

    So casper-wasmi-core and soroban-wasmi_core were already wrong to assert a specific answer before.

    The docs of acosh state:

    Unspecified precision

    The precision of this function is non-deterministic. This means it varies by platform, Rust version, and can even differ within the same execution from one invocation to the next.

    So raekna-compute was already wrong too.

  4. theemathas commented on May 1, 2026

    @theemathas
    ContributorAuthor

    Minimization of the simdeez regression:

    fn main() {
        assert_eq!(3.4028235e38_f32.acosh(), f32::INFINITY);
        assert_eq!(1.7976931348623157e308_f64.acosh(), f64::INFINITY);
    }

    On stable, both asserts succeed. On beta, each individual assert fails.

    (There are other test failures that I didn't minimize, since they involve precision changes.)

  5. cuviper commented on May 2, 2026

    @cuviper
    Member
    fn main() {
        assert_eq!(3.4028235e38_f32.acosh(), f32::INFINITY);
        assert_eq!(1.7976931348623157e308_f64.acosh(), f64::INFINITY);
    }

    I think these are still precision errors due to MAX inputs -- they used to overflow to infinity, probably in some intermediate calculation, but once you saturate it can't really come back. Now we get 89.415985 and 710.4758600739439, and I confirmed with Wolfram Alpha that these are correct (within some rounding error).

  6. cuviper commented on May 2, 2026

    @cuviper
    Member

    The acosh infinity change was deliberate in #154051 to fix #153878.

  7. theemathas commented on May 2, 2026

    @theemathas
    ContributorAuthor

    The min change is presumably due to #153343.

    Do changes like #153343 and #154051 normally need an FCP?

  8. cuviper commented on May 3, 2026

    @cuviper
    Member

    Do changes like #153343 and #154051 normally need an FCP?

    Not when they're within the documented guarantees (or lack thereof) and also not making any new guarantees.

  9. theemathas commented on May 4, 2026

    @theemathas
    ContributorAuthor

    Closing as intended breakage.

  10. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on May 4, 2026
  11. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on May 5, 2026
  12. added this to the 1.96.0 milestone on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-floating-pointArea: Floating point numbers and arithmeticC-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions