Skip to content

Conversation

@Cesar-Cardoso
Copy link
Contributor

Summary:
Python's modulo operation with floating point numbers produces inaccurate results due to binary representation limitations (e.g., 1.0 % 0.1 returns ~0.1 instead of 0). This caused valid fractional step sizes to incorrectly fail validation.

The fix uses np.isclose() for tolerance-based comparison when checking if a range is evenly divisible by the step size.

see #4599

Reviewed By: saitcakmak

Differential Revision: D88077995

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Dec 1, 2025
@meta-codesync
Copy link

meta-codesync bot commented Dec 1, 2025

@Cesar-Cardoso has exported this pull request. If you are a Meta employee, you can view the originating Diff in D88077995.

@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.50%. Comparing base (4cf0828) to head (d2bce29).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4604   +/-   ##
=======================================
  Coverage   96.50%   96.50%           
=======================================
  Files         557      557           
  Lines       57585    57588    +3     
=======================================
+ Hits        55571    55574    +3     
  Misses       2014     2014           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…4604)

Summary:

Python's modulo operation with floating point numbers produces inaccurate results due to binary representation limitations (e.g., 1.0 % 0.1 returns ~0.1 instead of 0). This caused valid fractional step sizes to incorrectly fail validation.

The fix uses np.isclose() for tolerance-based comparison when checking if a range is evenly divisible by the step size.

see facebook#4599

Reviewed By: saitcakmak

Differential Revision: D88077995
@meta-codesync
Copy link

meta-codesync bot commented Dec 3, 2025

This pull request has been merged in b5d75bf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants