Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace in-tree rustc_apfloat with the new version of the crate #113843

Merged
merged 5 commits into from
Jul 26, 2023

Conversation

wesleywiser
Copy link
Member

@wesleywiser wesleywiser commented Jul 18, 2023

Replace the in-tree version of rustc_apfloat with the new version of the crate which has been correctly licensed. The new crate incorporates upstream changes from LLVM since the original port was done including many correctness fixes and has been extensively fuzz tested to validate correctness.

Fixes #100233
Fixes #102403
Fixes #113407
Fixes #113409
Fixes #55993
Fixes #93224
Closes #93225
Closes #109573

@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 18, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jul 18, 2023

Changes rustc_apfloat. rustc_apfloat is currently in limbo and you almost certainly don't want to change it (see #55993).

cc @eddyb

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jul 18, 2023

The Miri subtree was changed

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

@wesleywiser
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 18, 2023
@bors
Copy link
Contributor

bors commented Jul 18, 2023

⌛ Trying commit ef39d1b631a24f78e40286cb5f6c1e3e61b6519e with merge d724b5ab2f4ac098ff483349a80b6a3799a5177b...

@RalfJung
Copy link
Member

Would be great if you could also change Miri back to using apfloat for FMA. :) That would be basically undoing the functional part of rust-lang/miri@5a4ac1e. Then Miri tests will already check that some FMA bugs have been fixed.

@bors
Copy link
Contributor

bors commented Jul 18, 2023

☀️ Try build successful - checks-actions
Build commit: d724b5ab2f4ac098ff483349a80b6a3799a5177b (d724b5ab2f4ac098ff483349a80b6a3799a5177b)

@rust-timer

This comment has been minimized.

@wesleywiser
Copy link
Member Author

@craterbot run start=master#d3515155216e98c23440ea92c3f49c6a0d7101fc end=try#d724b5ab2f4ac098ff483349a80b6a3799a5177b mode=build-and-test

@craterbot
Copy link
Collaborator

👌 Experiment pr-113843 created and queued.
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 18, 2023
@craterbot
Copy link
Collaborator

🚧 Experiment pr-113843 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d724b5ab2f4ac098ff483349a80b6a3799a5177b): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.7% [0.6%, 0.8%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.4%] 5
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Cycles

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

Binary size

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

Bootstrap: 658.716s -> 658.315s (-0.06%)

@rustbot rustbot added the perf-regression Performance regression. label Jul 19, 2023
@eddyb
Copy link
Member

eddyb commented Jul 19, 2023

Would be great if you could also change Miri back to using apfloat for FMA. :) That would be basically undoing the functional part of rust-lang/miri@5a4ac1e. Then Miri tests will already check that some FMA bugs have been fixed.

@RalfJung that may be premature, given how many holes in the FMA fix I'm finding - initially I thought it was more sub-cases of the assertion failing:

But now I'm starting to suspect the FMA fix (llvm/llvm-project@e62555c) actually made things worse, introducing subtle rounding errors because of how it computes the direction of subtraction, and the original bug should be analyzed from scratch and fixed correctly this time.

(I may attempt this myself once I have collected enough samples from bruteforcing f32 FMA - a sentence I never imagined uttering, but so far it's sitting strong at 0.15 trillion input combinations tested, of which 16 differ from hardware due to the rounding error, and 13 hit the assertion check)


Something I did miss, however, is that we don't seem to have any issue about the assertion itself?

is the only issue I know related to the FMA, and is about a different behavior (related to infinities) - I only mention the assertion in comments on that issue because I hit it while checking that the issue itself was fixed.

@RalfJung
Copy link
Member

rustc_apfloat FMA is currently unused in rustc and Miri. It used to be used by Miri but I switched it to using host floats instead to fix rust-lang/miri#2468. CTFE doesn't support FMA. That's why we have no open issue for that.

@eddyb
Copy link
Member

eddyb commented Jul 19, 2023

CTFE doesn't support FMA. That's why we have no open issue for that.

Small caveat: we're still affected by LLVM constant-folding, so we would still get the results wrong (or trigger a LLVM assertion if they're enabled) in all of those cases, just like Clang, as long as LLVM can constant-fold the FMA.

@craterbot
Copy link
Collaborator

🎉 Experiment pr-113843 is completed!
📊 194 regressed and 104 fixed (327355 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@wesleywiser wesleywiser force-pushed the replace_rustc_apfloat branch from ab98ba6 to 9d3e35c Compare July 26, 2023 17:32
@wesleywiser
Copy link
Member Author

@chenyukang I took the liberty of including the test you wrote for #109573.

@RalfJung I did the same for the tests you wrote for #113416 and I also added an annotation to require LLVM 16 to skip the test on older LLVM versions which have various APFloat bugs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (69c127efbbbba1d5118c1e803bc59c32ff6b73a0): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.4%] 19
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 2
Improvements ✅
(primary)
-0.4% [-0.5%, -0.2%] 5
Improvements ✅
(secondary)
-0.7% [-1.0%, -0.3%] 13
All ❌✅ (primary) 0.1% [-0.5%, 0.4%] 24

Max RSS (memory usage)

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

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-9.4% [-9.9%, -9.1%] 3
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 650.097s -> 652.929s (0.44%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 26, 2023
@wesleywiser wesleywiser added the perf-regression-triaged The performance regression has been triaged. label Jul 26, 2023
@wesleywiser
Copy link
Member Author

ripgrep check incr-unchanged results:

  -3,353,625    <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::exec_cache_promotions::<rustc_middle::ty::context::TyCtxt>
   3,263,696    <rustc_middle::query::on_disk_cache::OnDiskCache>::drop_serialized_data
  -2,298,458    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<&rustc_middle::ty::typeck_results::TypeckResults>
  -2,265,223    <rustc_middle::query::on_disk_cache::CacheEncoder>::encode_tagged::<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, &rustc_middle::ty::typeck_results::TypeckResults>
   1,744,248    <rustc_metadata::creader::CStore as rustc_session::cstore::CrateStore>::def_path_hash
  -1,470,714    rustc_expand::mbe::transcribe::transcribe
  -1,390,598    <rustc_middle::traits::specialization_graph::Children as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
   1,213,904    <rustc_expand::mbe::macro_rules::MacroRulesMacroExpander as rustc_expand::base::TTMacroExpander>::expand
   1,154,276    rustc_middle::ty::codec::encode_with_shorthand::<rustc_middle::query::on_disk_cache::CacheEncoder, rustc_middle::ty::Ty, <rustc_middle::query::on_disk_cache::CacheEncoder as rustc_type_ir::codec::TyEncoder>::type_shorthands>
   1,112,683    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, rustc_middle::ty::Ty, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
  -1,069,158    <rustc_middle::traits::specialization_graph::Children as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
   1,068,987    <indexmap::map::IndexMap<rustc_middle::ty::fast_reject::SimplifiedType, alloc::vec::Vec<rustc_span::def_id::DefId>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
     923,611    <indexmap::map::IndexMap<rustc_middle::ty::fast_reject::SimplifiedType, alloc::vec::Vec<rustc_span::def_id::DefId>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
    -842,230    <std::collections::hash::map::HashMap<rustc_span::def_id::DefId, rustc_span::def_id::DefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
     549,531    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, alloc::vec::Vec<rustc_middle::ty::adjustment::Adjustment>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
     497,603    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, rustc_middle::ty::Ty, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
    -464,974    <rustc_query_impl::query_impl::predicates_of::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 24]>)>>::call_once
     404,938    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle::ty::generics::GenericPredicates>
     398,187    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, alloc::vec::Vec<rustc_middle::ty::adjustment::Adjustment>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
    -388,491    rustc_query_system::dep_graph::graph::hash_result::<core::option::Option<rustc_middle::hir::Owner>>
     381,599    <rustc_query_impl::query_impl::hir_owner::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 16]>)>>::call_once
     363,055    <rustc_middle::ty::generic_args::GenericArgKind as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
...

bitmaps opt incr-unchanged results:

  -10,577,536    rustc_expand::mbe::transcribe::transcribe
    9,382,846    <rustc_expand::mbe::macro_rules::MacroRulesMacroExpander as rustc_expand::base::TTMacroExpander>::expand
   -8,768,145    <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::exec_cache_promotions::<rustc_middle::ty::context::TyCtxt>
    8,535,202    <rustc_middle::query::on_disk_cache::OnDiskCache>::drop_serialized_data
   -2,639,527    <rustc_query_impl::query_impl::predicates_of::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 24]>)>>::call_once
   -2,483,917    <rustc_middle::query::on_disk_cache::CacheEncoder>::encode_tagged::<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, &rustc_middle::ty::typeck_results::TypeckResults>
    2,353,419    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle::ty::generics::GenericPredicates>
   -1,947,284    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<&rustc_middle::ty::typeck_results::TypeckResults>
    1,726,673    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle::ty::generics::Generics>
   -1,627,947    rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
   -1,605,749    rustc_query_system::dep_graph::graph::hash_result::<core::option::Option<rustc_middle::hir::Owner>>
    1,579,890    <rustc_query_impl::query_impl::hir_owner::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 16]>)>>::call_once
    1,282,824    rustc_ast::mut_visit::visit_delim_span::<rustc_expand::mbe::transcribe::Marker>
    1,185,576    <rustc_parse::parser::Parser>::check_fn_front_matter
   -1,114,990    <rustc_middle::traits::specialization_graph::Children as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
    1,031,069    <rustc_middle::query::on_disk_cache::CacheEncoder>::encode_tagged::<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, &rustc_middle::ty::generics::Generics>
    1,015,462    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle::ty::generic_args::EarlyBinder<rustc_middle::ty::Ty>>
      998,071    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, rustc_middle::ty::Ty, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
      987,506    <[rustc_middle::metadata::ModChild] as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
     -896,909    <rustc_middle::ty::generics::Generics as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
     -876,019    <rustc_trait_selection::traits::select::SelectionContext>::in_task::<<rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation::{closure#0}::{closure#0}, core::result::Result<core::option::Option<rustc_middle::traits::select::SelectionCandidate>, rustc_middle::traits::SelectionError>>::{closure#0}
      867,729    <rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation_no_cache
      854,340    <rustc_type_ir::sty::TyKind<rustc_middle::ty::context::TyCtxt> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
     -847,307    <rustc_middle::ty::generics::GenericPredicates as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
     -816,733    <rustc_parse::parser::Parser>::parse_ty_common
     -748,748    <rustc_middle::traits::specialization_graph::Children as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
      748,442    <indexmap::map::IndexMap<rustc_middle::ty::fast_reject::SimplifiedType, alloc::vec::Vec<rustc_span::def_id::DefId>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
      732,548    rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
      722,094    <indexmap::map::IndexMap<rustc_middle::ty::fast_reject::SimplifiedType, alloc::vec::Vec<rustc_span::def_id::DefId>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
     -707,531    <std::collections::hash::map::HashMap<rustc_span::def_id::DefId, rustc_span::def_id::DefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
...

image check incr-unchanged results:

  -14,210,692    <rustc_middle::query::on_disk_cache::CacheEncoder>::encode_tagged::<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, &rustc_middle::ty::typeck_results::TypeckResults>
  -13,363,792    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<&rustc_middle::ty::typeck_results::TypeckResults>
  -12,229,371    <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::exec_cache_promotions::<rustc_middle::ty::context::TyCtxt>
   11,902,033    <rustc_middle::query::on_disk_cache::OnDiskCache>::drop_serialized_data
    7,322,694    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, rustc_middle::ty::Ty, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
    7,317,551    rustc_middle::ty::codec::encode_with_shorthand::<rustc_middle::query::on_disk_cache::CacheEncoder, rustc_middle::ty::Ty, <rustc_middle::query::on_disk_cache::CacheEncoder as rustc_type_ir::codec::TyEncoder>::type_shorthands>
   -4,976,407    rustc_expand::mbe::transcribe::transcribe
    4,096,682    <rustc_expand::mbe::macro_rules::MacroRulesMacroExpander as rustc_expand::base::TTMacroExpander>::expand
    3,293,765    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, rustc_middle::ty::Ty, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
    3,004,652    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle::ty::generics::GenericPredicates>
   -2,989,542    <rustc_query_impl::query_impl::predicates_of::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 24]>)>>::call_once
    2,925,891    <rustc_type_ir::sty::TyKind<rustc_middle::ty::context::TyCtxt> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
    2,648,104    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, alloc::vec::Vec<rustc_middle::ty::adjustment::Adjustment>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
    2,395,651    <rustc_middle::ty::generic_args::GenericArgKind as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
    2,358,319    <rustc_metadata::creader::CStore as rustc_session::cstore::CrateStore>::def_path_hash
    2,255,841    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle::ty::generics::Generics>
    1,864,322    <rustc_parse::parser::Parser>::check_fn_front_matter
   -1,864,021    rustc_query_system::dep_graph::graph::hash_result::<core::option::Option<rustc_middle::hir::Owner>>
    1,830,882    <rustc_query_impl::query_impl::hir_owner::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 16]>)>>::call_once
    1,825,706    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, alloc::vec::Vec<rustc_middle::ty::adjustment::Adjustment>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
   -1,765,357    <rustc_middle::traits::specialization_graph::Children as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
   -1,629,935    rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
   -1,452,369    <[rustc_middle::ty::adjustment::Adjustment] as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
    1,401,790    <rustc_middle::query::on_disk_cache::CacheEncoder>::encode_tagged::<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, &rustc_middle::ty::generics::Generics>
   -1,381,302    <rustc_middle::ty::generics::GenericPredicates as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
   -1,372,984    <rustc_middle::traits::specialization_graph::Children as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
    1,372,426    <indexmap::map::IndexMap<rustc_middle::ty::fast_reject::SimplifiedType, alloc::vec::Vec<rustc_span::def_id::DefId>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
   -1,299,567    <rustc_parse::parser::Parser>::parse_ty_common
    1,274,693    <rustc_middle::query::on_disk_cache::CacheEncoder>::encode_tagged::<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::ty::generics::GenericPredicates>
...

serde check incr-patched results:

  -78,649,002    rustc_expand::mbe::transcribe::transcribe
   67,255,328    <rustc_expand::mbe::macro_rules::MacroRulesMacroExpander as rustc_expand::base::TTMacroExpander>::expand
  -13,427,056    <rustc_middle::query::on_disk_cache::CacheEncoder>::encode_tagged::<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, &rustc_middle::ty::typeck_results::TypeckResults>
  -12,227,523    <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::exec_cache_promotions::<rustc_middle::ty::context::TyCtxt>
   12,111,674    rustc_ast::mut_visit::visit_delim_span::<rustc_expand::mbe::transcribe::Marker>
   11,901,634    <rustc_middle::query::on_disk_cache::OnDiskCache>::drop_serialized_data
  -11,189,045    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<&rustc_middle::ty::typeck_results::TypeckResults>
    6,384,479    rustc_middle::ty::codec::encode_with_shorthand::<rustc_middle::query::on_disk_cache::CacheEncoder, rustc_middle::ty::Ty, <rustc_middle::query::on_disk_cache::CacheEncoder as rustc_type_ir::codec::TyEncoder>::type_shorthands>
    6,038,453    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, rustc_middle::ty::Ty, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
    5,877,435    <rustc_middle::ty::generic_args::GenericArgKind as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
    5,064,876    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle::ty::generics::GenericPredicates>
    4,530,435    <rustc_parse::parser::Parser>::check_fn_front_matter
   -3,947,848    <rustc_query_impl::query_impl::predicates_of::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 24]>)>>::call_once
    3,750,621    <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle::ty::generics::Generics>
    3,255,828    <rustc_middle::query::on_disk_cache::CacheEncoder>::encode_tagged::<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::ty::generics::GenericPredicates>
   -3,169,739    <rustc_parse::parser::Parser>::parse_ty_common
   -3,119,383    <rustc_middle::ty::generics::GenericPredicates as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
    2,824,559    <[rustc_middle::ty::generic_args::GenericArg] as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
    2,723,915    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, rustc_middle::ty::Ty, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
    2,425,410    <rustc_middle::query::on_disk_cache::CacheEncoder>::encode_tagged::<rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, &rustc_middle::ty::generics::Generics>
   -2,373,103    <rustc_middle::query::on_disk_cache::CacheDecoder as rustc_type_ir::codec::TyDecoder>::cached_ty_for_shorthand::<<rustc_middle::ty::Ty as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode::{closure#0}>
   -2,241,215    <rustc_middle::ty::sty::Binder<rustc_middle::ty::PredicateKind> as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
   -2,152,566    <rustc_middle::ty::generics::Generics as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
   -2,074,686    rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
   -2,025,386    rustc_query_system::dep_graph::graph::hash_result::<core::option::Option<rustc_middle::hir::Owner>>
    2,022,692    <rustc_query_impl::query_impl::hir_owner::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 16]>)>>::call_once
   -1,915,142    <&mut <&rustc_middle::ty::list::List<rustc_middle::ty::generic_args::GenericArg> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode::{closure#0} as core::ops::function::FnOnce<(usize,)>>::call_once
   -1,873,279    <&rustc_middle::ty::generics::Generics as rustc_serialize::serialize::Encodable<rustc_middle::query::on_disk_cache::CacheEncoder>>::encode
   -1,804,137    <rustc_middle::ty::generic_args::GenericArg as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
    1,800,030    <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, alloc::vec::Vec<rustc_middle::ty::adjustment::Adjustment>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
...

I don't see anything relevant to changing APFloat here, seems to perhaps be just different inlining decisions being made. I'm going to go ahead and mark as perf-regression-triaged.

@@ -914,16 +914,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
let x = this.read_scalar(x)?.to_f64()?;
let exp = this.read_scalar(exp)?.to_i32()?;

// Saturating cast to i16. Even those are outside the valid exponent range so
Copy link
Member

Choose a reason for hiding this comment

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

I am trying to figure out why this was originally here so that I can justify why its being removed now.

I got to this commit: 0743ed6
and now I'm stuck. Why were we clamping ldexp exponent to i16, and why don't we need to keep doing so now? I'm assuming its a weakness in the old APFloat API that has since been addressed in the new rustc_apfloat, but can you confirm that @wesleywiser ?

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI this is from Miri PR rust-lang/miri#902

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm assuming its a weakness in the old APFloat API that has since been addressed in the new rustc_apfloat, but can you confirm that @wesleywiser ?

Yes, exactly. The old APFloat API took ldexp as an i16 but the new crate takes i32 which matches what the code originally did before calling into APFloat. There's additional discussion why i16 is sufficient for this parameter in the discussion here rust-lang/miri#902 (comment).

Copy link
Member

Choose a reason for hiding this comment

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

I see. So in theory this could have stayed as-is, but since it was an artifact of a prior limitation, we're removing it. RIght?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I could have just added an .into() to do the i16 -> i32 conversion but since we're actually doing a i32 -> i16 -> i32 conversion, it seemed cleaner to just remove the conversions entirely.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, thanks for the nice cleanup. :)

Copy link
Member

Choose a reason for hiding this comment

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

I can explain this one, it's llvm/llvm-project@8606d01 [APFloat] Enlarge ExponentType to 32bit integer from late 2019 - previously, miri was stuck with an i32 and rustc_apfloat wanted i16, but they now both agree on i32.

@pnkfelix
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jul 26, 2023

📌 Commit 9d3e35c has been approved by pnkfelix

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 Jul 26, 2023
@@ -0,0 +1,9 @@
// run-pass
// compile-flags: -O -Zmir-opt-level=3 -Cno-prepopulate-passes
// min-llvm-version: 16.0 (requires APFloat fixes in LLVM)
Copy link
Member

Choose a reason for hiding this comment

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

It is still a mystery to me why with -Cno-prepopulate-passes this require apfloat fixes. 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'm not sure either. Investigating more into LLVM at this point didn't seem worthwhile to me if it's been fixed in LLVM 16 but I could be convinced otherwise 🙂

Perhaps the issue is that LLVM 14's bitcode reader fails to roundtrip the float?

Copy link
Member

Choose a reason for hiding this comment

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

LLVM constant-folding is not a pass, but rather happens when instructions are attempted to be created.

There are passes, however, that do non-trivial simplifications, and propagate constants from e.g. loads of constant globals (though that might be in constant-folding, too? unsure), which re-triggers the constant-folding logic that first happened when the instructions were built, to account for their new inputs (you can almost think of it as "replace all uses of X with Y" simply rebuilding all instructions using X, and then the constructors of those instructions see Y now, which lets them try constant-folding again, and maybe get farther this time).

In fewer words: attempting to add a runtime LLVM Instruction to a BasicBlock may result in a Constant being produced instead (I don't know if there's a way to bypass this).

Copy link
Member

Choose a reason for hiding this comment

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

Small addendum: you may see something different when testing calls (of either LLVM intrinsics or libm functions it knows about): IIRC, those are handled by a pass, it's only the native LLVM IR operations that get constant-folded as they're built.


fn f() -> f64 {
std::hint::black_box(-1.0) % std::hint::black_box(-1.0)
}
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be basically the same as tests/ui/const_prop/apfloat-remainder-regression.rs? Is it worth having both?

Copy link
Member Author

Choose a reason for hiding this comment

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

I figured since there are two different issues, it was probably worth having two tests, but I really don't feel strongly either way.

@bors
Copy link
Contributor

bors commented Jul 26, 2023

⌛ Testing commit 9d3e35c with merge 0d95f91...

@klensy
Copy link
Contributor

klensy commented Jul 26, 2023

Let's see if it fails on CI: rust-lang/rustc_apfloat#10

@bors
Copy link
Contributor

bors commented Jul 26, 2023

☀️ Test successful - checks-actions
Approved by: pnkfelix
Pushing 0d95f91 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 26, 2023
@bors bors merged commit 0d95f91 into rust-lang:master Jul 26, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 26, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0d95f91): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-0.5%, -0.3%] 6
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.1%] 4
All ❌✅ (primary) -0.4% [-0.5%, -0.3%] 6

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
-6.2% [-6.2%, -6.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.9% [-6.2%, 2.3%] 2

Cycles

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

Binary size

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

Bootstrap: 649.74s -> 652.686s (0.45%)

@rustbot rustbot removed the perf-regression Performance regression. label Jul 27, 2023
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Oct 6, 2023
Language
--------

- [Uplift `clippy::fn_null_check` lint as `useless_ptr_null_checks`.]
  (rust-lang/rust#111717)
- [Make `noop_method_call` warn by default.]
  (rust-lang/rust#111916)
- [Support interpolated block for `try` and `async` in macros.]
  (rust-lang/rust#112953)
- [Make `unconditional_recursion` lint detect recursive drops.]
  (rust-lang/rust#113902)
- [Future compatibility warning for some impls being incorrectly
  considered not overlapping.]
  (rust-lang/rust#114023)
- [The `invalid_reference_casting` lint is now **deny-by-default**
  (instead of allow-by-default)]
  (rust-lang/rust#112431)

Compiler
--------

- [Write version information in a `.comment` section like GCC/Clang.]
  (rust-lang/rust#97550)
- [Add documentation on v0 symbol mangling.]
  (rust-lang/rust#97571)
- [Stabilize `extern "thiscall"` and `"thiscall-unwind"` ABIs.]
  (rust-lang/rust#114562)
- [Only check outlives goals on impl compared to trait.]
  (rust-lang/rust#109356)
- [Infer type in irrefutable slice patterns with fixed length as array.]
  (rust-lang/rust#113199)
- [Discard default auto trait impls if explicit ones exist.]
  (rust-lang/rust#113312)
- Add several new tier 3 targets:
    - [`aarch64-unknown-teeos`]
      (rust-lang/rust#113480)
    - [`csky-unknown-linux-gnuabiv2`]
      (rust-lang/rust#113658)
    - [`riscv64-linux-android`]
      (rust-lang/rust#112858)
    - [`riscv64gc-unknown-hermit`]
      (rust-lang/rust#114004)
    - [`x86_64-unikraft-linux-musl`]
      (rust-lang/rust#113411)
    - [`x86_64-unknown-linux-ohos`]
      (rust-lang/rust#113061)
- [Add `wasm32-wasi-preview1-threads` as a tier 2 target.]
  (rust-lang/rust#112922)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Add `Read`, `Write` and `Seek` impls for `Arc<File>`.]
  (rust-lang/rust#94748)
- [Merge functionality of `io::Sink` into `io::Empty`.]
  (rust-lang/rust#98154)
- [Implement `RefUnwindSafe` for `Backtrace`]
  (rust-lang/rust#100455)
- [Make `ExitStatus` implement `Default`]
  (rust-lang/rust#106425)
- [`impl SliceIndex<str> for (Bound<usize>, Bound<usize>)`]
  (rust-lang/rust#111081)
- [Change default panic handler message format.]
  (rust-lang/rust#112849)
- [Cleaner `assert_eq!` & `assert_ne!` panic messages.]
  (rust-lang/rust#111071)
- [Correct the (deprecated) Android `stat` struct definitions.]
  (rust-lang/rust#113130)

Stabilized APIs
---------------

- [Unsigned `{integer}::div_ceil`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.div_ceil)
- [Unsigned `{integer}::next_multiple_of`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.next_multiple_of)
- [Unsigned `{integer}::checked_next_multiple_of`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.checked_next_multiple_of)
- [`std::ffi::FromBytesUntilNulError`]
  (https://doc.rust-lang.org/stable/std/ffi/struct.FromBytesUntilNulError.html)
- [`std::os::unix::fs::chown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.chown.html)
- [`std::os::unix::fs::fchown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.fchown.html)
- [`std::os::unix::fs::lfchown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.lchown.html)
- [`LocalKey::<Cell<T>>::get`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.get)
- [`LocalKey::<Cell<T>>::set`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.set)
- [`LocalKey::<Cell<T>>::take`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.take)
- [`LocalKey::<Cell<T>>::replace`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.replace)
- [`LocalKey::<RefCell<T>>::with_borrow`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.with_borrow)
- [`LocalKey::<RefCell<T>>::with_borrow_mut`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.with_borrow_mut)
- [`LocalKey::<RefCell<T>>::set`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.set-1)
- [`LocalKey::<RefCell<T>>::take`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.take-1)
- [`LocalKey::<RefCell<T>>::replace`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.replace-1)

These APIs are now stable in const contexts:

- [`rc::Weak::new`]
  (https://doc.rust-lang.org/stable/alloc/rc/struct.Weak.html#method.new)
- [`sync::Weak::new`]
  (https://doc.rust-lang.org/stable/alloc/sync/struct.Weak.html#method.new)
- [`NonNull::as_ref`]
  (https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.as_ref)

Cargo
-----

- [Encode URL params correctly for `SourceId` in `Cargo.lock`.]
  (rust-lang/cargo#12280)
- [Bail out an error when using `cargo::` in custom build script.]
  (rust-lang/cargo#12332)

Compatibility Notes
-------------------

- [Update the minimum external LLVM to 15.]
  (rust-lang/rust#114148)
- [Check for non-defining uses of return position `impl Trait`.]
  (rust-lang/rust#112842)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Remove LLVM pointee types, supporting only opaque pointers.]
  (rust-lang/rust#105545)
- [Port PGO/LTO/BOLT optimized build pipeline to Rust.]
  (rust-lang/rust#112235)
- [Replace in-tree `rustc_apfloat` with the new version of the crate.]
  (rust-lang/rust#113843)
- [Update to LLVM 17.]
  (rust-lang/rust#114048)
- [Add `internal_features` lint for internal unstable features.]
  (rust-lang/rust#108955)
- [Mention style for new syntax in tracking issue template.]
  (rust-lang/rust#113586)
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Nov 16, 2023
Pkgsrc changes:
 * Adjust patches and cargo checksums to new versions.
 * For an external LLVM, set dependency of llvm >= 15, in accordance
   with the upstream changes.
 * Add a patch with a backport from LLVM 17.0.3 fixing codegen for
   PPC, ref. rust-lang/rust#116845

Upstream changes:

Version 1.73.0 (2023-10-05)
==========================

Language
--------

- [Uplift `clippy::fn_null_check` lint as `useless_ptr_null_checks`.]
  (rust-lang/rust#111717)
- [Make `noop_method_call` warn by default.]
  (rust-lang/rust#111916)
- [Support interpolated block for `try` and `async` in macros.]
  (rust-lang/rust#112953)
- [Make `unconditional_recursion` lint detect recursive drops.]
  (rust-lang/rust#113902)
- [Future compatibility warning for some impls being incorrectly
  considered not overlapping.]
  (rust-lang/rust#114023)
- [The `invalid_reference_casting` lint is now **deny-by-default**
  (instead of allow-by-default)]
  (rust-lang/rust#112431

Compiler
--------

- [Write version information in a `.comment` section like GCC/Clang.]
  (rust-lang/rust#97550)
- [Add documentation on v0 symbol mangling.]
  (rust-lang/rust#97571)
- [Stabilize `extern "thiscall"` and `"thiscall-unwind"` ABIs.]
  (rust-lang/rust#114562)
- [Only check outlives goals on impl compared to trait.]
  (rust-lang/rust#109356)
- [Infer type in irrefutable slice patterns with fixed length as array.]
  (rust-lang/rust#113199)
- [Discard default auto trait impls if explicit ones exist.]
  (rust-lang/rust#113312)
- Add several new tier 3 targets:
    - [`aarch64-unknown-teeos`]
      (rust-lang/rust#113480)
    - [`csky-unknown-linux-gnuabiv2`]
      (rust-lang/rust#113658)
    - [`riscv64-linux-android`]
      (rust-lang/rust#112858)
    - [`riscv64gc-unknown-hermit`]
      (rust-lang/rust#114004)
    - [`x86_64-unikraft-linux-musl`]
      (rust-lang/rust#113411)
    - [`x86_64-unknown-linux-ohos`]
      (rust-lang/rust#113061)
- [Add `wasm32-wasi-preview1-threads` as a tier 2 target.]
  (rust-lang/rust#112922)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Add `Read`, `Write` and `Seek` impls for `Arc<File>`.]
  (rust-lang/rust#94748)
- [Merge functionality of `io::Sink` into `io::Empty`.]
  (rust-lang/rust#98154)
- [Implement `RefUnwindSafe` for `Backtrace`]
  (rust-lang/rust#100455)
- [Make `ExitStatus` implement `Default`]
  (rust-lang/rust#106425)
- [`impl SliceIndex<str> for (Bound<usize>, Bound<usize>)`]
  (rust-lang/rust#111081)
- [Change default panic handler message format.]
  (rust-lang/rust#112849)
- [Cleaner `assert_eq!` & `assert_ne!` panic messages.]
  (rust-lang/rust#111071)
- [Correct the (deprecated) Android `stat` struct definitions.]
  (rust-lang/rust#113130)

Stabilized APIs
---------------

- [Unsigned `{integer}::div_ceil`]
  (https://doc.rust-lang.org/stable/std/primitiv e.u32.html#method.div_ceil)
- [Unsigned `{integer}::next_multiple_of`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.next_multiple_of)
- [Unsigned `{integer}::checked_next_multiple_of`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.checked_next_multiple_of)
- [`std::ffi::FromBytesUntilNulError`]
  (https://doc.rust-lang.org/stable/std/ffi/struct.FromBytesUntilNulError.html)
- [`std::os::unix::fs::chown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.chown.html)
- [`std::os::unix::fs::fchown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.fchown.html)
- [`std::os::unix::fs::lfchown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.lchown.html)
- [`LocalKey::<Cell<T>>::get`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.get)
- [`LocalKey::<Cell<T>>::set`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.set)
- [`LocalKey::<Cell<T>>::take`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.take)
- [`LocalKey::<Cell<T>>::replace`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.replace)
- [`LocalKey::<RefCell<T>>::with_borrow`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.with_borrow)
- [`LocalKey::<RefCell<T>>::with_borrow_mut`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.with_borrow_mut)
- [`LocalKey::<RefCell<T>>::set`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.set-1)
- [`LocalKey::<RefCell<T>>::take`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.take-1)
- [`LocalKey::<RefCell<T>>::replace`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.replace-1)

These APIs are now stable in const contexts:

- [`rc::Weak::new`]
  (https://doc.rust-lang.org/stable/alloc/rc/struct.Weak.html#method.new)
- [`sync::Weak::new`]
  (https://doc.rust-lang.org/stable/alloc/sync/struct.Weak.html#method.new)
- [`NonNull::as_ref`]
  (https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.as_ref)

Cargo
-----

- [Encode URL params correctly for `SourceId` in `Cargo.lock`.]
  (rust-lang/cargo#12280)
- [Bail out an error when using `cargo::` in custom build script.]
  (rust-lang/cargo#12332)

Misc
----

Compatibility Notes
-------------------

- [Update the minimum external LLVM to 15.]
  (rust-lang/rust#114148)
- [Check for non-defining uses of return position `impl Trait`.]
  (rust-lang/rust#112842)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they
represent significant improvements to the performance or internals
of rustc and related tools.

- [Remove LLVM pointee types, supporting only opaque pointers.]
  (rust-lang/rust#105545)
- [Port PGO/LTO/BOLT optimized build pipeline to Rust.]
  (rust-lang/rust#112235)
- [Replace in-tree `rustc_apfloat` with the new version of the crate.]
  (rust-lang/rust#113843)
- [Update to LLVM 17.]
  (rust-lang/rust#114048)
- [Add `internal_features` lint for internal unstable features.]
  (rust-lang/rust#108955)
- [Mention style for new syntax in tracking issue template.]
  (rust-lang/rust#113586)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet