flt2dec front of format_short & format_fixed - #154505
Conversation
|
Some changes occurred in float parsing cc @tgross35 |
|
r? @scottmcm rustbot has assigned @scottmcm. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
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.
|
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. |
20351fd to
aaf4362
Compare
aaf4362 to
894fa1e
Compare
|
Let's make sure there's no perf effect. @bors try @rust-timer queue @rustbot author |
This comment has been minimized.
This comment has been minimized.
|
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
flt2dec front of format_short & format_fixed
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (cb7a7f2): comparison URL. Overall result: no relevant changes - no action neededBenchmarking 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 countThis 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.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 488.817s -> 487.773s (-0.21%) |
|
Also, you've mentioned a few times that you have followup work planned. Could you share the bigger picture or goal you're working toward? That would probably help me understand some of the changes. |
This comment has been minimized.
This comment has been minimized.
* No generics abstraction of Grisu and Dragon * The stringify! of input in assertion message * TestableFloat abstraction omitted with macro * MSVC omission direct on respective test * FIX test missed verification of the last digit * FIX test assertion value miss due the previous Unified signature plus description on assertion tools: * check_shortest! -> check_short! * try_exact! -> check_fixed_buf_match! * try_fixed! -> check_fixed_resolution! * check_exact & check_exact! -> check_fixed_mix! * check_exact_one -> check_coef_pow2!
Inverted assertion order. It's not the value of exp which steers the branche. The concern at hand is not having any digits (i.e, an empty buffer). The reason for not having digits can be asserted, as an optional double check, just to be more sure we ended up without digits for the correct reason. Both the current and the correct value are equivalent when rounded to three decimals.
|
@rustbot ready |
We decided to proceed in small steps as the explanation didn't work. Shortest answer would be less code, fewer types, and better documentation. The longer answer is optimization. The mikado construction prevents many options with entanglement. |
|
It has been another month @tgross35. |
There was a problem hiding this comment.
Again I'm sorry this has lingered, I've not been active in libs reviews. In the future if you don't hear back from a reviewer in a few weeks (myself or anyone), feel free to @rustbot reroll to request a new one - or ask on Zulip.
I'd appreciate a ping but I expect you'll have a different reviewer for all followup work.
Anyway with the tests added back this LGTM. I'm going to rebase it to kick of PR CI and make sure nothing regressed in the meantime, r=me after then.
|
Actually it doesn't let me push so we'll just do this @bors try jobs=x86_64-gnu,tidy, |
This comment has been minimized.
This comment has been minimized.
flt2dec front of format_short & format_fixed try-job: x86_64-gnu try-job: tidy try-job:
|
@bors r+ rollup=iffy |
This comment has been minimized.
This comment has been minimized.
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.
|
💔 Test for a42d7c5 failed: CI. Failed job:
|
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@rustbot author needs an update for the above failure (new clippy lint) |
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.