Skip to content

Investigate Tensor's Helpers.IsEqualWithTolerance helper #107934

Closed

Description

@stephentoub

The System.Numerics.Tensors test suite has a Helpers.IsEqualWithTolerance helper method. This is letting through as equal some values which should not be considered equal, in particular when one of the values is infinity or negative infinity. This is one of the reasons we didn't notice the bug cited by #107838, because a value close to 0 and negative infinity were being considered equal. But when updating that helper to accomodate, other existing tests started failing. It's possible those are false positives, but it's also possible we have further edge case bugs to be fixed. We need to investigate.

Activity

  1. ghost added
    needs-area-label
    on Sep 17, 2024
  2. added
    untriaged
    on Sep 17, 2024
  3. added and removed
    needs-area-label
    on Sep 17, 2024
  4. stephentoub commented on Sep 17, 2024

    @stephentoub
    MemberAuthor

    @jeffhandley, this is what I was referring to earlier today offline.

  5. dotnet-policy-service commented on Sep 17, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-numerics-tensors
    See info in area-owners.md if you want to be subscribed.

  6. jeffhandley commented on Sep 17, 2024

    @jeffhandley
    Member

    Thanks, @stephentoub. We should investigate this during the .NET 9 GA milestone and verify correctness of test cases that were slipping through coverage before.

  7. added this to the 9.0.0 milestone on Sep 17, 2024
  8. removed
    untriaged
    on Sep 17, 2024
  9. tannergooding commented on Sep 23, 2024

    @tannergooding
    Member

    A valid implementation would be https://github.com/dotnet/runtime/blob/main/src/libraries/Common/tests/TestUtilities/System/AssertExtensions.cs#L818-L1037

    This ensures that values such as inf and nan are checked exactly, while finite values are within an expected variance amount. It does so in a way that minimizes additional error and which can account for per input result differences.

  10. added
    test-bug
    on Sep 23, 2024
  11. jeffhandley commented on Oct 8, 2024

    @jeffhandley
    Member

    @tannergooding -- I'm punting this to 10.0.0. When we address it, if we find there were lurking correctness bugs, we can consider backporting the fixes to .NET 9 in servicing.

  12. modified the milestones: 9.0.0, 10.0.0 on Oct 8, 2024
  13. jeffhandley commented on Jul 20, 2025

    @jeffhandley
    Member

    @tannergooding I'm moving this out to 11.0.0 since it hasn't been blocking. Please pull back into 10.0.0 if it gets addressed before GA.

  14. modified the milestones: 10.0.0, 11.0.0 on Jul 20, 2025
  15. added
    help wanted
    on Sep 9, 2026
  16. modified the milestones: 11.0.0, Future on Sep 9, 2026
  17. lilinus commented on Oct 2, 2026

    @lilinus
    Contributor

    Looks like a case like this was caught in #135056 after fixes to test helper made in #127868. Should this issue be closed?

  18. tannergooding commented on Oct 2, 2026

    @tannergooding
    Member

    Yeah, looks resolved. Closing

  19. locked and limited conversation to collaborators on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Numerics.Tensorshelp wantedtest-bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions