Skip to content

flt2dec front of format_short & format_fixed - #154505

Open
pascaldekloe wants to merge 6 commits into
rust-lang:mainfrom
pascaldekloe:flt2dec-uni
Open

pascaldekloe wants to merge 6 commits into
rust-lang:mainfrom
pascaldekloe:flt2dec-uni

Conversation

@pascaldekloe

@pascaldekloe pascaldekloe commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

The fallback to Dragon was placed in the Grisu module. As a result tests don't test what they appear to test, and some benchmarks from Grisu measured Dragon instead.

The corrected values in the tests haven been verified against the Go implementation.

@rustbot

rustbot commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in float parsing

cc @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 Mar 28, 2026
@rustbot

rustbot commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @scottmcm, libs
  • @scottmcm, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, joboet, scottmcm

@tgross35 tgross35 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for preparing this!

I only had time to go through the first commit here, which mostly looks pretty good to me with a few small requests. If you'd like to fix those then put only the first commit in a separate PR, I'd be happy to approve that bit and shrink the remaining todo here.

As a noncritical note, I'm having a bit of trouble understanding the commit summaries. The messages usually have details, but I'm not entirely sure what something like "write out of flt2dec/random.rs" or "test flt2dec front of format_short & format_fixed" means. We don't really have a guideline but sticking to the usual style with changes described in imperative mood would help a bit (e.g. something like flt2dec: test: Don't use `write!` in random tests or flt2dec: test: Test `format_{short,fixed}` via the main entrypoint).

I'll review the rest a little later.

View changes since this review

Comment thread library/core/src/fmt/float.rs
Comment thread library/core/src/num/imp/flt2dec/mod.rs
Comment thread library/core/src/num/imp/flt2dec/strategy/grisu.rs Outdated
Comment thread library/core/src/num/imp/flt2dec/mod.rs
Comment thread library/coretests/tests/num/flt2dec/strategy/grisu.rs Outdated
Comment thread library/coretests/benches/num/flt2dec/strategy/grisu.rs
@pascaldekloe

Copy link
Copy Markdown
Contributor Author

Pushed the commit explainer plus distinct summary lines in Rust docs @tgross35. :-) I'll wait for the rest of the review. Some urgency would be nice because I have time to do this now. 🙏

The git messages ain't readable sections on their own indeed. You need the code in conjunction to comprehend the listings. I'll work on that.

@tgross35 tgross35 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Next batch, mostly for the second commit

View changes since this review

Comment thread library/coretests/benches/num/flt2dec/strategy/grisu.rs
Comment thread library/coretests/tests/num/flt2dec/equiv.rs
Comment thread library/coretests/tests/fmt/float.rs
Comment thread library/coretests/tests/fmt/float.rs
Comment thread library/coretests/tests/num/flt2dec/random.rs Outdated
Comment thread library/coretests/tests/num/flt2dec/equiv.rs
Comment thread library/coretests/tests/num/flt2dec/random.rs
Comment thread library/coretests/tests/num/flt2dec/equiv.rs
Comment thread library/coretests/tests/num/flt2dec/mod.rs Outdated
Comment thread library/core/src/num/imp/flt2dec/mod.rs
Comment thread library/coretests/tests/num/flt2dec/mod.rs
Comment thread library/coretests/tests/num/flt2dec/strategy/dragon.rs
Comment thread library/coretests/tests/num/flt2dec/mod.rs Outdated
Comment thread library/coretests/tests/num/flt2dec/mod.rs Outdated
Comment thread library/coretests/tests/fmt/float.rs
Comment thread library/coretests/tests/num/flt2dec/mod.rs Outdated
Comment thread library/core/src/num/imp/flt2dec/mod.rs
Comment thread library/core/src/fmt/float.rs
@tgross35

Copy link
Copy Markdown
Member

Let's make sure there's no perf effect.

@bors try @rust-timer queue

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 27, 2026
@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 27, 2026
@rustbot

rustbot commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

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

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 27, 2026
flt2dec front of format_short & format_fixed
@rust-bors

rust-bors Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: cb7a7f2 (cb7a7f2a841fd88e9e55ffb325dfabdc4476a5b2, parent: 4933094f25ba1edf2de0a203665976832fc85bc9)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (cb7a7f2): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (secondary 3.9%)

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)
3.9% [1.8%, 6.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 488.817s -> 487.773s (-0.21%)
Artifact size: 393.48 MiB -> 393.50 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 27, 2026
@pascaldekloe

pascaldekloe commented May 14, 2026 •

Copy link
Copy Markdown
Contributor Author

All done with a few options open @tgross35.

@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 May 14, 2026
@rust-bors rust-bors Bot 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 Oct 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 19, 2026
flt2dec front of format_short & format_fixed



The fallback to Dragon was placed in the Grisu module. As a result tests don't test what they appear to test, and some benchmarks from Grisu measured Dragon instead.

The corrected values in the tests haven been verified against the Go implementation.
tgross35 added a commit to tgross35/rust that referenced this pull request Oct 19, 2026
flt2dec front of format_short & format_fixed

The fallback to Dragon was placed in the Grisu module. As a result tests don't test what they appear to test, and some benchmarks from Grisu measured Dragon instead.

The corrected values in the tests haven been verified against the Go implementation.
@tgross35

Copy link
Copy Markdown
Member

Enclosed in rollup,
@bors yield

@rust-bors

rust-bors Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #164554.

rust-bors Bot pushed a commit that referenced this pull request Oct 19, 2026
Rollup of 4 pull requests

Successful merges:

 - #154505 (flt2dec front of format_short & format_fixed)
 - #163732 (Bump libc to v0.2.191)
 - #164532 ([tiny] Remove some useless `.into()` calls)
 - #164523 (Clean up `tests/rustdoc-html`)
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 19, 2026
flt2dec front of format_short & format_fixed



The fallback to Dragon was placed in the Grisu module. As a result tests don't test what they appear to test, and some benchmarks from Grisu measured Dragon instead.

The corrected values in the tests haven been verified against the Go implementation.
@tgross35

Copy link
Copy Markdown
Member

@bors r-

#164554 (comment)

@rust-bors rust-bors Bot 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 Oct 19, 2026
@rust-bors

rust-bors Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#164554), which was unapproved.

Auto build was cancelled due to unapproval. Cancelled workflows:

View changes since this unapproval

@tgross35

Copy link
Copy Markdown
Member

@bors try jobs=test-x86_64-mingw-1

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 19, 2026
flt2dec front of format_short & format_fixed


try-job: test-x86_64-mingw-1
@tgross35

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 59d1c07 has been tentatively approved by tgross35

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot 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 Oct 19, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 19, 2026
flt2dec front of format_short & format_fixed



The fallback to Dragon was placed in the Grisu module. As a result tests don't test what they appear to test, and some benchmarks from Grisu measured Dragon instead.

The corrected values in the tests haven been verified against the Go implementation.
@rust-bors

rust-bors Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 8f0ec02 (8f0ec02643410e51fc7ac533d03ca29e79b7a97d)
Base parent: b6eeb93 (b6eeb93c992027a03e1fd120b6652546396b142c)

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-x86_64-gnu-aux failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- num::flt2dec::f32_fixed_sanity_test stdout ----

thread 'num::flt2dec::f32_fixed_sanity_test' (2708) panicked at library/coretests/tests/num/flt2dec/mod.rs:289:5:
assertion `left == right` failed: dragon short format of 12676506_f32 * -102_f32.exp2()
  left: ([51], -23)
 right: ([50], -23)
---- num::flt2dec::f32_fixed_sanity_test stdout end ----

failures:
    num::flt2dec::f32_fixed_sanity_test

test result: FAILED. 2813 passed; 1 failed; 23 ignored; 0 measured; 0 filtered out; finished in 1632.61s

error: test failed, to rerun pass `-p coretests --test coretests`
Bootstrap failed while executing `miri --stage 2 library/core library/alloc --tests`
Currently active steps:
test::Crate { build_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, mode: Std, crates: ["core", "alloc"] } at src/bootstrap/src/core/build_steps/test.rs:3622
Build completed unsuccessfully in 0:52:48
make: *** [Makefile:56: check-aux] Error 1
  local time: Mon Oct 19 09:03:20 UTC 2026
  network time: Mon, 19 Oct 2026 09:03:20 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 19, 2026
@rust-bors

rust-bors Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 2a5f389 failed: CI. Failed job:

This branch has not been deployed

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants