Skip to content

Conversation

LorrensP-2158466
Copy link
Contributor

@LorrensP-2158466 LorrensP-2158466 commented Sep 4, 2025

Take 2 of #143906. The last 2 commits are what changed compared to the original pr.

Verified the tests using (fish shell):

env MIRIFLAGS="-Zmiri-max-extra-rounding-error -Zmiri-many-seeds" ./x miri --no-fail-fast std core coretests  -- f32 f64

r? @RalfJung

@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 Sep 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 4, 2025

The Miri subtree was changed

cc @rust-lang/miri

@LorrensP-2158466
Copy link
Contributor Author

I have a feeling this is not related to my pr.

@RalfJung
Copy link
Member

RalfJung commented Sep 5, 2025

Verified the tests using (fish shell):

Since the sign of the error is still random, it'd be good to run this at least with a few seeds. When multiple operations are chained in a test, we want to hit the case where they all err in the same direction.

@RalfJung
Copy link
Member

RalfJung commented Sep 5, 2025

@rustbot author

@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 Sep 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 5, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@LorrensP-2158466
Copy link
Contributor Author

LorrensP-2158466 commented Sep 5, 2025

Ran it with miri-many-seeds, I'll update the pr post.

@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 Sep 5, 2025
@RalfJung
Copy link
Member

RalfJung commented Sep 5, 2025

@bors try jobs=x86_64-gnu-aux

rust-bors bot added a commit that referenced this pull request Sep 5, 2025
…ems-take2, r=<try>

Miri: non-deterministic floating point operations in foreign_items

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

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

assert_approx_eq!(f32::consts::FRAC_PI_4.cos().acos(), f32::consts::FRAC_PI_4, 16);
assert_approx_eq!(f64::consts::FRAC_PI_4.cos().acos(), f64::consts::FRAC_PI_4, 16);
assert_biteq(1.0f32.acos(), 0.0, "acos(1) = 0");
assert_biteq(1.0f64.acos(), 0.0, "acos(1) = 0");

assert_approx_eq!(1.0f32.cosh(), 1.54308f32);
Copy link
Member

Choose a reason for hiding this comment

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

Interesting, this line fails now... is the reference value here rounded already? On the playground, the unaltered result is 1.5430806.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah using the more precise value seems to suffice to make the test pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

@RalfJung
Copy link
Member

RalfJung commented Sep 5, 2025

Seems like you'll also have to try

./x run miri -- src/tools/miri/tests/pass/float.rs -Zmiri-max-extra-rounding-error -Zmiri-many-seeds

@RalfJung RalfJung force-pushed the miri-float-nondet-foreign-items-take2 branch from 1bbd490 to 3008073 Compare September 5, 2025 09:13
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Sep 5, 2025

💔 Test for 49f8750 failed: CI. Failed jobs:

@RalfJung
Copy link
Member

RalfJung commented Sep 5, 2025

FWIW, I can reproduce this failure with

MIRIFLAGS="-Zmiri-max-extra-rounding-error -Zmiri-many-seeds" ./x miri std --doc  -- f32 f64

In fact I see more than just one failure then:

failures:
    library/std/src/num/f32.rs - f32::f32::atanh (line 1122)
    library/std/src/num/f64.rs - f64::f64::erfc (line 1244)

Please double-check that you are running this command in the right working tree; it's odd that this would not fail for you.

@LorrensP-2158466
Copy link
Contributor Author

I'm sorry, I was in a hurry and accidentally used --no-doc. Took my time now and double-checked everything.

@rustbot ready.

@RalfJung
Copy link
Member

RalfJung commented Sep 6, 2025

@bors try

rust-bors bot added a commit that referenced this pull request Sep 6, 2025
…ems-take2, r=<try>

Miri: non-deterministic floating point operations in foreign_items
@rust-bors

This comment has been minimized.

@RalfJung
Copy link
Member

RalfJung commented Sep 6, 2025

I'm still seeing failures when I run this locally

thread 'f32::test_gamma' (1009) panicked at library/std/tests/floats/f32.rs:199:5:
5.999998 is not approximately equal to 6.0 (threshold 1e-6, difference 1.9073486e-6)

@rust-bors
Copy link

rust-bors bot commented Sep 6, 2025

☀️ Try build successful (CI)
Build commit: ec7872e (ec7872eaf3947bed06ff4f61662931ec46a3e02f, parent: 397f93362974d298b79e0e0cd43677014aa7b722)

@LorrensP-2158466
Copy link
Contributor Author

ran (copy/pasted):

env MIRIFLAGS="-Zmiri-max-extra-rounding-error -Zmiri-many-seeds" ./x miri --no-fail-fast std core coretests  -- f32 f64

And everything passed.

@RalfJung
Copy link
Member

RalfJung commented Sep 6, 2025

Yeah also works here now. :)

Please clean up the history a little, then we can give this another shot and land it.
@rustbot author

@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 Sep 6, 2025
@LorrensP-2158466 LorrensP-2158466 force-pushed the miri-float-nondet-foreign-items-take2 branch from 6e6049b to e7e06ac Compare September 6, 2025 19:45
@LorrensP-2158466
Copy link
Contributor Author

LorrensP-2158466 commented Sep 6, 2025

Yeah also works here now. :)

Sorry for the incomplete testing and thanks for your patience :).

I cleaned everything up into the original 3 commits to keep things consistent. I can always split it up if needed.

@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 Sep 6, 2025
@RalfJung
Copy link
Member

RalfJung commented Sep 7, 2025

All right, let's hope it sticks this time.

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Sep 7, 2025

📌 Commit e7e06ac has been approved by RalfJung

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 7, 2025
@bors
Copy link
Collaborator

bors commented Sep 7, 2025

⌛ Testing commit e7e06ac with merge f13ef0d...

@bors
Copy link
Collaborator

bors commented Sep 7, 2025

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing f13ef0d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 7, 2025
@bors bors merged commit f13ef0d into rust-lang:master Sep 7, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Sep 7, 2025
Copy link
Contributor

github-actions bot commented Sep 7, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing fbd8f95 (parent) -> f13ef0d (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard f13ef0d75d834c826c9479a5d244bcfb9891df45 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. pr-check-1: 1695.9s -> 1354.6s (-20.1%)
  2. x86_64-gnu-llvm-19: 2920.1s -> 2426.0s (-16.9%)
  3. x86_64-rust-for-linux: 3035.7s -> 2623.4s (-13.6%)
  4. i686-gnu-2: 6229.9s -> 5389.6s (-13.5%)
  5. i686-gnu-1: 8556.5s -> 7416.2s (-13.3%)
  6. x86_64-msvc-ext3: 6183.5s -> 6975.5s (12.8%)
  7. x86_64-gnu-tools: 3792.4s -> 3385.8s (-10.7%)
  8. x86_64-gnu-llvm-19-1: 3647.1s -> 3266.8s (-10.4%)
  9. armhf-gnu: 5206.4s -> 4689.2s (-9.9%)
  10. aarch64-gnu-llvm-19-2: 2420.3s -> 2184.6s (-9.7%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f13ef0d): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 1.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.0% [1.0%, 1.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary 6.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
6.3% [6.3%, 6.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 467.216s -> 467.986s (0.16%)
Artifact size: 387.43 MiB -> 387.44 MiB (0.00%)

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Sep 10, 2025
…oreign-items-take2, r=RalfJung

Miri: non-deterministic floating point operations in foreign_items

Take 2 of rust-lang#143906. The last 2 commits are what changed compared to the original pr.

Verified the tests using (fish shell):
```fish
env MIRIFLAGS="-Zmiri-max-extra-rounding-error -Zmiri-many-seeds" ./x miri --no-fail-fast std core coretests  -- f32 f64
```

r? `@RalfJung`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

6 participants