Rewrite `test-float-parse` in Rust by tgross35 · Pull Request #127510 · rust-lang/rust

@rustbot rustbot added 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)

labels

Jul 9, 2024

Mark-Simulacrum

tgross35

The existing implementation uses Python to launch a set of Rust-written
binaries. Unfortunately, this is currently broken; it seems that some
updates meant it no longer compiles.

There is also a problem that support for more float types (`f16`,
`f128`) would be difficult to add since this is very specialized to
`f32` and `f64`.

Because of these sortcomings, migrate to a version written in Rust. This
version should be significantly faster; test generators can execute in
parallel, and test cases are chunked and parallelized. This should also
resolve the preexisting "... the worker processes are leaked and stick
around forever" comment.

This change also introduces genericism over float types and properties,
meaning it will be much easier to extend support to newly added types.

`num::BigRational` is used in place of Python's fractions for
infinite-precision calculations.
Since `test-float-parse` is now implemented in Rust, we can move it into
the global workspace and check dependency licenses.
With updates to `test-float-parse`, it is now possible to run as another
Rust tool. Enable check, clippy, and test.

Test runs the unit tests, as well as shorter parsing tests (takes
approximately 1 minute).

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jul 21, 2024
…mpiler-errors

Rollup of 7 pull requests

Successful merges:

 - rust-lang#126450 (Promote Mac Catalyst targets to Tier 2, and ship with rustup)
 - rust-lang#127177 (Distribute rustc_codegen_cranelift for arm64 macOS)
 - rust-lang#127510 (Rewrite `test-float-parse` in Rust)
 - rust-lang#127720 ([`macro_metavar_expr_concat`] Allow `concat` in repetitions)
 - rust-lang#127734 (Windows: move BSD socket shims to netc)
 - rust-lang#127839 (Fix git safe-directory path for docker images)
 - rust-lang#128005 (Remove _tls_used hack)

r? `@ghost`
`@rustbot` modify labels: rollup

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jul 21, 2024
…r=Mark-Simulacrum

Rewrite `test-float-parse` in Rust

Migrate from the currently broken Rust + Python `test-float-parse` to a Rust implementation. This newer version should be significantly faster (tests execute in parallel with threads, rather than series across multiple processes, which also eliminates the "...the worker processes are leaked and stick around forever" message), and should be significantly easier to extend to the new float types.

Since this is faster and hopefully more stable, we should be able to launch it with `x` and run the faster tests in CI.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jul 21, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#126450 (Promote Mac Catalyst targets to Tier 2, and ship with rustup)
 - rust-lang#127177 (Distribute rustc_codegen_cranelift for arm64 macOS)
 - rust-lang#127510 (Rewrite `test-float-parse` in Rust)
 - rust-lang#127977 (Update wasi-sdk in CI to latest release)
 - rust-lang#127985 (Migrate `test-benches`, `c-unwind-abi-catch-panic` and `compiler-lookup-paths-2` `run-make` tests to rmake)
 - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables)

r? `@ghost`
`@rustbot` modify labels: rollup

@bors bors 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-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

labels

Jul 21, 2024

@tgross35

With the previous improvements, it is now possible to run float parsing
tests as part of CI. Enable it here.

This only runs a subset of tests, which takes about one minute.

@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-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Jul 21, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jul 21, 2024
…r=Mark-Simulacrum

Rewrite `test-float-parse` in Rust

Migrate from the currently broken Rust + Python `test-float-parse` to a Rust implementation. This newer version should be significantly faster (tests execute in parallel with threads, rather than series across multiple processes, which also eliminates the "...the worker processes are leaked and stick around forever" message), and should be significantly easier to extend to the new float types.

Since this is faster and hopefully more stable, we should be able to launch it with `x` and run the faster tests in CI.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jul 21, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jul 21, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jul 22, 2024

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Jul 22, 2024
Rollup merge of rust-lang#127510 - tgross35:test-float-parse-update, r=Mark-Simulacrum

Rewrite `test-float-parse` in Rust

Migrate from the currently broken Rust + Python `test-float-parse` to a Rust implementation. This newer version should be significantly faster (tests execute in parallel with threads, rather than series across multiple processes, which also eliminates the "...the worker processes are leaked and stick around forever" message), and should be significantly easier to extend to the new float types.

Since this is faster and hopefully more stable, we should be able to launch it with `x` and run the faster tests in CI.

@tgross35 tgross35 deleted the test-float-parse-update branch

July 22, 2024 16:22

Alexhuszagh added a commit to Alexhuszagh/rust-lexical that referenced this pull request

Nov 2, 2024
This also does not require a Python install for the testing process and
is much faster.

Related to rust-lang/rust#127510

Closes #176

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Nov 14, 2024
…, r=jieyouxu

update outdated comment about test-float-parse

It's no longer a Python program since rust-lang#127510.

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Nov 14, 2024
Rollup merge of rust-lang#133008 - onur-ozkan:update-outdated-comment, r=jieyouxu

update outdated comment about test-float-parse

It's no longer a Python program since rust-lang#127510.