Skip to content

True divergence: FP precision differences #37335

Closed

Description

@aartbik

JIT-ReleaseIA32 - JIT-DebugX64: !DIVERGENCE! 1.13:3190886612 (output=true)

Gives many subtle differences, like the one below. Given this is 32-bit vs 64-bit, this may be something that needs to be fixed at grammar-level. But perhaps it is real.

< 7.963426227304606e-12
---
> 7.963426227304605e-12

Activity

  1. added
    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
    dartfuzzFound with Dart fuzzing (DartFuzz, libFuzzer, etc.)
    on Jun 21, 2019
  2. self-assigned this
    on Jun 21, 2019
  3. aartbik commented on Jul 1, 2019

    @aartbik
    ContributorAuthor

    Indeed due to 32-bit vs. 64-bit implementation of the pow() method (which ultimately is done by native code). If Dart does not have the same rigid precision requirements as e.g. Java, perhaps it makes sense to avoid testing 32-bit vs. 64-bit divergences as different execution modes.

    2.9065489552295786e-304 ^ 0.61017368125593 is 6.165122919860247e-186 (64-bit)
    2.9065489552295786e-304 ^ 0.61017368125593 is 6.165122919860246e-186 (32-bit)
  4. aartbik commented on Jul 2, 2019

    @aartbik
    ContributorAuthor

    Lasse gives some background.

    The language specification just says that Dart double values are IEEE-754 64-bit floating point values, but nothing more The operations are then defined by the platform libraries, which do not promise any specific implementation.

    So, the libraries do not promise anything, and the VM is free to implement them as inconsistently as JavaScript implementations. Consistency is great, but we prefer to not overpromise :)

    Given this, I think we should deal with this in DartFuzz by either

    • no longer compare 32-bit vs 64-bit execution modes, but only pair same bit size archs
    • no longer generate FP operations when 32-bit vs 64-bit modes are run
  5. aartbik commented on Jul 18, 2019

    @aartbik
    ContributorAuthor
  6. feli-citas commented on Jul 18, 2019

    @feli-citas
    Contributor

    JIT-DEPOPTEVERY-ReleaseX64 - JIT-DebugIA32: !DIVERGENCE! 1.13:483434976 (output=true)

    < 0.00021296142396241748
    ---
    > 0.00021296142396241743
    

    JIT-DebugSIMARM - JIT-ReleaseX64: !DIVERGENCE! 1.13:1962568294 (output=true)

    < 0.509659585465119_
    ---
    > 0.5096595854651191
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.dartfuzzFound with Dart fuzzing (DartFuzz, libFuzzer, etc.)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions