Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-06-27
10:26
Test update for bug [63530267aa]. Fix 32-bit embtest build issue. check-in: b46ac8122b user: pooryorick tags: unchained
09:10
Fix ticket [63530267aa] by implementing ticket [e5f06285de] and making additional corrections. closed check-in: 878682ff5d user: pooryorick tags: pyk-objinterface
09:00
Fix ticket [63530267aa] by implementing ticket [e5f06285de] and making additional corrections. check-in: 8967d7e9c5 user: pooryorick tags: unchained
2023-06-30
20:37 • Closed ticket [63530267aa]: lseq.test fail on i386 plus 5 other changes artifact: ffb0d07711 user: griffin
20:34
Test update for bug [63530267aa]. check-in: 7ae73656d0 user: griffin tags: core-8-branch
19:02
Test update for bug [63530267aa]. Fix 32-bit embtest build issue. check-in: cd8512b73b user: griffin tags: trunk, main
02:31 • Ticket [63530267aa] lseq.test fail on i386 status still Open with 3 other ch... artifact: d6ce45b56d user: chrstphrchvz
02:26 • Ticket [63530267aa]: 3 changes artifact: 72e72915a5 user: chrstphrchvz
2023-06-28
19:36
Fix ticket [63530267aa] by implementing ticket [e5f06285de] and making additional corrections. check-in: 09fe59bbbd user: griffin tags: core-8-branch
2023-06-25
20:04 • Ticket [63530267aa] lseq.test fail on i386 status still Open with 5 other ch... artifact: 04833e5817 user: chrstphrchvz
2023-05-07
20:27 • Ticket [63530267aa]: 3 changes artifact: c5608dbd72 user: emiliano
2023-05-06
19:16 • Ticket [a1aaca786b] Configure & build 32-bit Linux not working status st... artifact: a0c08ed7ed user: chrstphrchvz
19:13 • Ticket [63530267aa] lseq.test fail on i386 status still Open with 3 other ch... artifact: 8999cac549 user: chrstphrchvz
18:32 • New ticket [63530267aa]. artifact: 80b67e1aa2 user: emiliano

lseq.test fail on i386

Closed63530267aa576587c112620515a2bf68870400e3Created 4 years agoUpdated 3 years ago
Descriptionplain2023-05-06 18:32:48
Testing core-8-branch on linux 32 bits, lseq.test shows a failing test.

$ make test TESTFLAGS="-file lseq.test"
Warning: tclOOScript.h may be out of date.
Developers may want to run "make genscript" to regenerate.
This warning can be safely ignored, do not report as a bug!
LD_LIBRARY_PATH=`pwd`: TCLLIBPATH="/home/carla/src/tcl/unix/pkgs" TCL_LIBRARY="/home/carla/src/tcl/library" ./tcltest /home/carla/src/tcl/tests/all.tcl -file lseq.test
Tests running in interp:  /home/carla/src/tcl/unix/tcltest
Tests located in:  /home/carla/src/tcl/tests
Tests running in:  /home/carla/src/tcl/unix
Temporary files stored in /home/carla/src/tcl/unix
Test files run in separate interpreters
Running tests that match:  *
Skipping test files that match:  l.*.test
Only running test files that match:  lseq.test
Tests began at Sat May 06 15:29:02 -03 2023
lseq.test


==== lseq-3.31 lreverse inplace with doubles FAILED
==== Contents of test case:

    lreverse [lseq 1.1 29.9 0.3]

---- Result was:
29.599999999999998 29.299999999999997 28.999999999999996 28.7 28.4 28.099999999999998 27.799999999999997 27.499999999999996 27.2 26.9 26.599999999999998 26.299999999999997 25.999999999999996 25.7 25.4 25.099999999999998 24.799999999999997 24.499999999999996 24.2 23.9 23.599999999999998 23.299999999999997 22.999999999999996 22.7 22.4 22.099999999999998 21.799999999999997 21.499999999999996 21.2 20.9 20.599999999999998 20.299999999999997 20.0 19.7 19.4 19.099999999999998 18.799999999999997 18.5 18.2 17.9 17.599999999999998 17.299999999999997 17.0 16.7 16.4 16.099999999999998 15.799999999999999 15.499999999999998 15.2 14.899999999999999 14.599999999999998 14.299999999999999 13.999999999999998 13.7 13.399999999999999 13.099999999999998 12.799999999999999 12.499999999999998 12.2 11.899999999999999 11.599999999999998 11.299999999999999 10.999999999999998 10.7 10.399999999999999 10.099999999999998 9.799999999999999 9.499999999999998 9.2 8.899999999999999 8.599999999999998 8.299999999999999 7.999999999999998 7.699999999999998 7.399999999999999 7.099999999999999 6.799999999999999 6.499999999999999 6.199999999999998 5.899999999999999 5.599999999999999 5.299999999999999 4.999999999999999 4.699999999999998 4.399999999999999 4.099999999999999 3.799999999999999 3.4999999999999987 3.199999999999999 2.899999999999999 2.5999999999999988 2.299999999999999 1.999999999999999 1.6999999999999988 1.399999999999999 1.099999999999999
---- Result should have been (exact matching):
29.9 29.599999999999998 29.299999999999997 29.0 28.7 28.4 28.099999999999998 27.799999999999997 27.5 27.2 26.9 26.599999999999998 26.299999999999997 26.0 25.7 25.4 25.099999999999998 24.799999999999997 24.5 24.2 23.9 23.599999999999998 23.299999999999997 23.0 22.7 22.4 22.099999999999998 21.799999999999997 21.5 21.2 20.9 20.6 20.299999999999997 20.0 19.7 19.4 19.1 18.799999999999997 18.5 18.2 17.9 17.6 17.299999999999997 17.0 16.7 16.4 16.1 15.799999999999999 15.5 15.2 14.899999999999999 14.6 14.299999999999999 14.0 13.7 13.399999999999999 13.099999999999998 12.8 12.5 12.2 11.899999999999999 11.599999999999998 11.3 11.0 10.7 10.399999999999999 10.099999999999998 9.8 9.5 9.2 8.899999999999999 8.599999999999998 8.3 8.0 7.699999999999999 7.399999999999999 7.099999999999998 6.800000000000001 6.5 6.199999999999999 5.899999999999999 5.599999999999998 5.300000000000001 5.0 4.699999999999999 4.399999999999999 4.099999999999998 3.8000000000000007 3.5 3.1999999999999993 2.8999999999999986 2.599999999999998 2.3000000000000007 2.0 1.6999999999999993 1.3999999999999986 1.1000000000000014
==== lseq-3.31 FAILED


Tests ended at Sat May 06 15:29:02 -03 2023
all.tcl:	Total	79	Passed	78	Skipped	0	Failed	1
Sourced 1 Test Files.
Files with failing tests: lseq.test
Referenced by6
chrstphrchvzwiki2023-05-06 19:13:00

Subscribing myself for updates; I can reproduce this failure on IA-32 Linux. The same failure was recently mentioned in [a1aaca786b] for 9.0.

emilianoplain2023-05-07 20:27:05
I think the test itself is misguided, as it depends on the (sometimes rather surprising) behaviour of floating point math.

Besides not getting the same actual numbers on my machine, I also noted that I don't get the last (aka end) argument, 29.9 in this case.

I traced this problem to generic/tclArithSeries.c , line 335

	len = (dend - dstart + dstep)/dstep;

len is a Tcl_WideInt argument, while the others are doubles. 

For the values on this test it should be

% expr {(29.9 - 1.1 + 0.3) / 0.3}
97.0

but a printf() tells me that len is 96. A second printf confirms that 

	((dend - dstart + dstep)/dstep) - 97.0

equals -0.00000000000000147798, so when assigned to an integral value
it gets promoted to 96, not 97, the series resulting an element short.

I think the precision issue could be solved with [format], maybe using

% lmap x [lseq 1.1 29.9 0.3] {format %g $x}
1.1 1.4 1.7 2 2.3 2.6 2.9 3.2 3.5 3.8 4.1 4.4 4.7 5 5.3 5.6 5.9 6.2 6.5 6.8 7.1 7.4 7.7 8 8.3 8.6 8.9 9.2 9.5 9.8 10.1 10.4 10.7 11 11.3 11.6 11.9 12.2 12.5 12.8 13.1 13.4 13.7 14 14.3 14.6 14.9 15.2 15.5 15.8 16.1 16.4 16.7 17 17.3 17.6 17.9 18.2 18.5 18.8 19.1 19.4 19.7 20 20.3 20.6 20.9 21.2 21.5 21.8 22.1 22.4 22.7 23 23.3 23.6 23.9 24.2 24.5 24.8 25.1 25.4 25.7 26 26.3 26.6 26.9 27.2 27.5 27.8 28.1 28.4 28.7 29 29.3 29.6

Note that on this machine, using 29.900000000000001 instead of 29.9 is enough to get the extra element.
chrstphrchvzwiki2023-06-25 20:04:04

Assigning this ticket to Brian, who has been working on this test.

This may be related to [e5f06285de] which is still present on 8.7.

As of [7ad6f6f6ad05], lseq-3.31 and a few similar tests are skipped for 32-bit on 9.0 using the constraint has64BitLengths. I do not understand why that is appropriate.

chrstphrchvzwiki2023-06-30 02:26:44

I believe the has64BitLengths constraint can be removed from these tests which pass on 32-bit:

  • lseq-3.31, lseq-4.14, and lseq-4.15, which pass as of [f7688d05ca]
  • lseq-4.11, which appears to have always passed since its introduction in [d31251277c]

chrstphrchvzwiki2023-06-30 02:31:28

…It also makes sense to keep the has64BitLengths constraint for lseq-4.4, lseq-4.12, and lseq-4.13.

griffinmarkdown2023-06-30 20:37:16

The lseq test has been synchronized between core-8-branch and main.

Log in (anonymous is fine) to add a comment.