Repository navigation
Open
Labels
Description
Found with the seq fuzzer
$ ./target/debug/coreutils seq -80 18.333615880731813 8158 > a.txt
$ LANG=C /usr/bin/seq -80 18.333615880731813 8158 > b.txt
$ diff -u a.txt b.txt
--- a.txt 2023-12-31 16:35:42.919872401 +0100
+++ b.txt 2023-12-31 16:36:00.859817826 +0100
@@ -376,75 +376,75 @@
6795.105955274429875
6813.439571155161688
6831.773187035893501
-6850.106802916625314
+6850.106802916625313
6868.440418797357127
6886.774034678088940
6905.107650558820753
6923.441266439552566
6941.774882320284379
6960.108498201016192
-6978.442114081748005
+6978.442114081748004
6996.775729962479818
7015.109345843211631
7033.442961723943444
7051.776577604675257
7070.110193485407070
7088.443809366138883
-7106.777425246870696
+7106.777425246870695
7125.111041127602509
7143.444657008334322
7161.778272889066135
7180.111888769797948
7198.445504650529761
7216.779120531261574
-7235.112736411993387
+7235.112736411993386
7253.446352292725200
7271.779968173457013
7290.113584054188826
7308.447199934920639
7326.780815815652452
7345.114431696384265
-7363.448047577116078
+7363.448047577116077
7381.781663457847891
7400.115279338579704
7418.448895219311517
7436.782511100043330
7455.116126980775143
7473.449742861506956
-7491.783358742238769
+7491.783358742238768
7510.116974622970582
7528.450590503702395
7546.784206384434208
7565.117822265166021
7583.451438145897834
7601.785054026629647
-7620.118669907361460
+7620.118669907361459
7638.452285788093273
-7656.785901668825086
+7656.785901668825085
7675.119517549556899
7693.453133430288712
7711.786749311020525
7730.120365191752338
-7748.453981072484151
+7748.453981072484150
7766.787596953215964
-7785.121212833947777
+7785.121212833947776
7803.454828714679590
7821.788444595411403
7840.122060476143216
7858.455676356875029
-7876.789292237606842
+7876.789292237606841
7895.122908118338655
-7913.456523999070468
+7913.456523999070467
7931.790139879802281
7950.123755760534094
7968.457371641265907
7986.790987521997720
-8005.124603402729533
+8005.124603402729532
8023.458219283461346
-8041.791835164193159
+8041.791835164193158
8060.125451044924972
8078.459066925656785
8096.792682806388598
8115.126298687120411
-8133.459914567852224
-8151.793530448584037
+8133.459914567852223
+8151.793530448584036
Probably the usual numerial computing issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
- StatusShow more project fieldsNo status
Activity
samueltardieu commentedon Jan 1, 2024
Yes, and uutils is more consistent than GNU coreutils here.
drinkcat commentedon Feb 26, 2025
Played a bit with coreutils on different architectures here: https://gist.github.com/drinkcat/04b193dce9429205db3a3ed8dca8a7e6
Difference matrix follows:
I'm not sure what the objective is in terms on exact compability, but given that coreutils isn't consistent across architectures, I wonder if this is worth fixing, or if this is just something we can accept (and that no one would ever notice...).
Maximkaaa commentedon Jun 19, 2025
Using a more extreme example:
I would argue that in this case any user would expect the second output and not the first.
The only question is are there existing scripts that rely on incorrect behavior of GNU implementation for some reason, The Hyrum's Law states that there must be such scripts...
drinkcat commentedon Jun 19, 2025
Yeah, I documented some of this here: https://github.com/uutils/coreutils/blob/main/docs/src/extensions.md , but we could expand further, comments welcome. Also note that GNU coreutils documentation makes no guarantee (https://www.gnu.org/software/coreutils/manual/coreutils.html#seq-invocation), and that the behaviour is different on various architectures.
It's not completely impossible that somebody out there relies on
seqto round numbers to 80-bit floats (on x86), but... well... I don't think it's terribly valuable to replicate that behaviour. And nothing prevent GNU coreutils to switching to arbitrary precision decimal numbers as well in a future version, that'd break those users.drinkcat commentedon Jun 19, 2025
Oh, IMHO the thing that makes this issue worth keeping open is to find a way to get the fuzzer to ignore those rounding errors... We'd still want to test varied parameters (rounding behaviour is tricky for example), but we need to ignore those least significant digits errors.
mrudat commentedon Nov 4, 2025
Given that I just spent some time looking at this, and seq currently (at least in the main branch) uses arbitrary-precision arithmetic... It looks like this isn't a bug anymore?
eylulseyit commentedon Oct 15, 2026
Hi, I read through the thread, and I agree with @drinkcat’s comment from June 2025. So the remaining work seems to be making fuzz_seq ignore small differences in the last digits, while still comparing the number of lines, the format and the exit code exactly. Once that works, fuzz_seq could be changed from false to true in fuzzing.yml. Would that be enough to close this issue and #7186? If so, I’d like to work on it.