Skip to content

Conversation

@karolzwolak
Copy link
Member

@karolzwolak karolzwolak commented Aug 15, 2025

Deduplicates recip, powi, to_degrees, and to_radians float tests.
I had to fiddle and slightly increase the tolerances for a few comparisons, so maybe not all of the tests are worth deduplicating.

Part of #141726.
Best reviewed commit-by-commit.

r? @tgross35

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 15, 2025
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 19, 2025
@karolzwolak
Copy link
Member Author

update: simplify and minimize thresholds for assert_approx_ex comparisons.

@rust-log-analyzer

This comment has been minimized.

@karolzwolak
Copy link
Member Author

update:

  • increase f16 APPROX theshold to 2e-3
  • use more precise values in tests to fix failures in CI

@karolzwolak karolzwolak requested a review from tgross35 August 20, 2025 17:41
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 20, 2025
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small request then LGTM

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 28, 2025
I left the additional asserts on {f16, f128}::MAX.recip() in a new
test_max_recip tests.
@karolzwolak
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 30, 2025
@tgross35
Copy link
Contributor

Thank you!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 30, 2025

📌 Commit ddb15c2 has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 30, 2025
bors added a commit that referenced this pull request Aug 30, 2025
dedup recip, powi, to_degrees, and to_radians float tests

Deduplicates recip, powi, to_degrees, and to_radians float tests.
I had to fiddle and slightly increase the tolerances for a few comparisons, so maybe not all of the tests are worth deduplicating.

Part of #141726.
Best reviewed commit-by-commit.

r? `@tgross35`
@bors
Copy link
Collaborator

bors commented Aug 30, 2025

⌛ Testing commit ddb15c2 with merge 87955a2...

@tgross35
Copy link
Contributor

Makes sense, let's double check. r=me after a pass
@bors2 try jobs=x86_64-gnu-aux

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 31, 2025
dedup recip, powi, to_degrees, and to_radians float tests

try-job: x86_64-gnu-aux
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 31, 2025

💔 Test for eee819c failed: CI. Failed jobs:

@karolzwolak
Copy link
Member Author

I also missed the

/// Miri adds some extra errors to float functions; make sure the tests still pass.
/// These values are purely used as a canary to test against and are thus not a stable guarantee Rust provides.
/// They serve as a way to get an idea of the real precision of floating point operations on different platforms.
const APPROX_DELTA: f32 = if cfg!(miri) { 1e-4 } else { 1e-6 };

in

assert_approx_eq!((-3.1f32).powi(2), 9.61, APPROX_DELTA);

@tgross35 Could you re-run the try job? I don't have the privileges.

@tgross35
Copy link
Contributor

@bors2 try jobs=x86_64-gnu-aux

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 31, 2025
dedup recip, powi, to_degrees, and to_radians float tests

try-job: x86_64-gnu-aux
@rust-bors
Copy link

rust-bors bot commented Aug 31, 2025

☀️ Try build successful (CI)
Build commit: 4539ffa (4539ffa0b42be19574e5181628bbbc3e00adcd65, parent: 564ee219127b796d56f74767366fd359758b97de)

@tgross35
Copy link
Contributor

Going to run once more because I think the earlier failures came from Miri's randomness
@bors2 try jobs=x86_64-gnu-aux

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 31, 2025
dedup recip, powi, to_degrees, and to_radians float tests

try-job: x86_64-gnu-aux
@rust-bors
Copy link

rust-bors bot commented Aug 31, 2025

☀️ Try build successful (CI)
Build commit: 878adfd (878adfdad5d4813464596c61503f5817e19d8eb2, parent: f73bcd50a433b7c17225ca98b44064236e7e84b3)

@tgross35
Copy link
Contributor

tgross35 commented Sep 1, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 1, 2025

📌 Commit 9028efc has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 1, 2025
bors added a commit that referenced this pull request Sep 1, 2025
Rollup of 5 pull requests

Successful merges:

 - #145468 (dedup recip, powi, to_degrees, and to_radians float tests)
 - #145643 (coverage: Build an "expansion tree" and use it to unexpand raw spans)
 - #145754 (fix(lexer): Don't require frontmatters to be escaped with indented fences)
 - #146060 (fixup nix dev shell again)
 - #146068 (compiletest: Capture panic messages via a custom panic hook)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1d520e2 into rust-lang:master Sep 1, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Sep 1, 2025
rust-timer added a commit that referenced this pull request Sep 1, 2025
Rollup merge of #145468 - karolzwolak:float-tests-dedup, r=tgross35

dedup recip, powi, to_degrees, and to_radians float tests

Deduplicates recip, powi, to_degrees, and to_radians float tests.
I had to fiddle and slightly increase the tolerances for a few comparisons, so maybe not all of the tests are worth deduplicating.

Part of #141726.
Best reviewed commit-by-commit.

r? `@tgross35`
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Sep 9, 2025
…gross35

dedup recip, powi, to_degrees, and to_radians float tests

Deduplicates recip, powi, to_degrees, and to_radians float tests.
I had to fiddle and slightly increase the tolerances for a few comparisons, so maybe not all of the tests are worth deduplicating.

Part of rust-lang#141726.
Best reviewed commit-by-commit.

r? `@tgross35`
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Sep 9, 2025
Rollup of 5 pull requests

Successful merges:

 - rust-lang#145468 (dedup recip, powi, to_degrees, and to_radians float tests)
 - rust-lang#145643 (coverage: Build an "expansion tree" and use it to unexpand raw spans)
 - rust-lang#145754 (fix(lexer): Don't require frontmatters to be escaped with indented fences)
 - rust-lang#146060 (fixup nix dev shell again)
 - rust-lang#146068 (compiletest: Capture panic messages via a custom panic hook)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants