coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

seq: add f128 code paths

Open jalil-salame opened this issue 1 year ago • 7 comments

  • refactors uumain

  • adds regression test for #6182 (commented out until implementation is done)

  • preliminary implementation of the f128 code path (feature gated)

    I'm having issues with libquadmath.so.0: it loads fine when I run the binary directly (target/debug/coreutils seq ...), but fails when I run the tests (cargo test/cargo nextest run). It might be a weird NixOS issue though.

I'll try using the nightly f128 code tomorrow to verify the tests pass.

jalil-salame avatar Aug 10 '24 22:08 jalil-salame

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Aug 10 '24 23:08 github-actions[bot]

The main features this needs to work on nightly are impl FromStr for f128 and impl Display for f128.

I tried implementing them by converting to/from BigDecimal, but that is a lot of code (hard to maintain) and I don't think I even did it correctly as a bunch of tests are failing.

I'll keep this as a draft and keep an eye on the f128 stabilization process; whenever FromStr and Display are stabilized I'll give it another try.

If anyone in the future wants to give this a shot, then check the following links:

  • Docs on f128: https://doc.rust-lang.org/stable/std/primitive.f128.html
  • f128 impl tracking issue: https://github.com/rust-lang/rust/issues/116909
  • Wikipedia on IEEE f128: https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format

jalil-salame avatar Aug 11 '24 21:08 jalil-salame

@jalil-salame it is still marked as draft, are you still working on it? thanks

sylvestre avatar Dec 02 '24 09:12 sylvestre

The main features this needs to work on nightly are impl FromStr for f128 and impl Display for f128.

I tried implementing them by converting to/from BigDecimal, but that is a lot of code (hard to maintain) and I don't think I even did it correctly as a bunch of tests are failing.

I'll keep this as a draft and keep an eye on the f128 stabilization process; whenever FromStr and Display are stabilized I'll give it another try.

If anyone in the future wants to give this a shot, then check the following links:

  • Docs on f128: https://doc.rust-lang.org/stable/std/primitive.f128.html
  • f128 impl tracking issue: https://github.com/rust-lang/rust/issues/116909
  • Wikipedia on IEEE f128: https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format

It is blocked by these issues, I left it open so that contributors could see this before starting an attempt, if you feel it should be closed/reattempted, feel free to do so

jalil-salame avatar Dec 02 '24 09:12 jalil-salame

sorry, it needs to be rebased :/

sylvestre avatar Feb 16 '25 23:02 sylvestre

sorry, it needs to be rebased :/

I don't see why it should:

This is blocked on nightly parsing/display support for f128, so until rust-lang/rust#116909 is closed, there is not much progress I can do. I am subscribed to the issue, so once that is resolved I will try to get back to this.

jalil-salame avatar Feb 16 '25 23:02 jalil-salame

It would be great if you could mark this PR as blocked with a label c:

jalil-salame avatar Feb 16 '25 23:02 jalil-salame

please reopen when ready

sylvestre avatar Sep 09 '25 21:09 sylvestre