Repository: WebAssembly/wabt

Issue #1044: test failures on x86 32bit (i686)
Created: 2019-03-15T15:38:56Z
Running the 1.0.10 testsuite (test/run-tests.py) on x86 32bit (i686) yields the following failed tests:
- test/interp/unary.txt
  STDOUT MISMATCH:
  --- expected
  +++ actual
  @@ -21,7 +21,7 @@
   f64_abs() => f64:100.000000
   f64_sqrt_neg_is_nan() => i32:1
   f64_sqrt_100() => f64:10.000000
  -f64_ceil() => f64:-0.000000
  +f64_ceil() => f64:0.000000
   f64_floor() => f64:-1.000000
   f64_trunc() => f64:-0.000000
   f64_nearest_lo() => f64:1.000000
...
- test/wasm2c/spec/conversions.txt
  expected error code 0, got 1.
  STDERR MISMATCH:
  --- expected
  +++ actual
  @@ -0,0 +1,17 @@
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 407, in <module>
  +    sys.exit(main(sys.argv[1:]))
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 400, in main
  +    forward_stdout=True).RunWithArgs()
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/utils.py", line 104, in RunWithArgs
  +    raise error
  +utils.Error: Error running "out/test/wasm2c/spec/conversions/conversions":
  +conversions-main.c:1394: assertion failed: in Z_conversions_0Z_i32Z2Ereinterpret_f32Z_if(make_nan_f32(0x200000)): expected 2141192192, got 2145386496.
  +conversions-main.c:1397: assertion failed: in Z_conversions_0Z_i32Z2Ereinterpret_f32Z_if(-make_nan_f32(0x200000)): expected 4288675840, got 4292870144.
  +conversions-main.c:1439: assertion failed: in Z_conversions_0Z_i64Z2Ereinterpret_f64Z_jd(make_nan_f64(0x4000000000000)): expected 9219994337134247936, got 9222246136947933184.
  +conversions-main.c:1442: assertion failed: in Z_conversions_0Z_i64Z2Ereinterpret_f64Z_jd(-make_nan_f64(0x4000000000000)): expected 18443366373989023744, got 18445618173802708992.
  +During handling of the above exception, another exception occurred:
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 413, in <module>
  +    sys.stderr.write(u'{0}\n'.format(e).encode('ascii', 'replace'))
  +TypeError: write() argument must be str, not bytes
  STDOUT MISMATCH:
  --- expected
  +++ actual
  @@ -1 +1 @@
  -401/401 tests passed.
  +397/401 tests passed.
- test/wasm2c/spec/float_literals.txt
  expected error code 0, got 1.
  STDERR MISMATCH:
  --- expected
  +++ actual
  @@ -0,0 +1,21 @@
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 407, in <module>
  +    sys.exit(main(sys.argv[1:]))
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 400, in main
  +    forward_stdout=True).RunWithArgs()
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/utils.py", line 104, in RunWithArgs
  +    raise error
  +utils.Error: Error running "out/test/wasm2c/spec/float_literals/float_literals":
  +float_literals-main.c:258: assertion failed: in Z_float_literals_0Z_f32Z2Einformally_known_as_plain_snanZ_iv(): expected 2141192192, got 2145386496.
  +float_literals-main.c:264: assertion failed: in Z_float_literals_0Z_f32Z2Emisc_nanZ_iv(): expected 2139169605, got 2143363909.
  +float_literals-main.c:267: assertion failed: in Z_float_literals_0Z_f32Z2Emisc_positive_nanZ_iv(): expected 2142257232, got 2146451536.
  +float_literals-main.c:270: assertion failed: in Z_float_literals_0Z_f32Z2Emisc_negative_nanZ_iv(): expected 4289379550, got 4293573854.
  +float_literals-main.c:351: assertion failed: in Z_float_literals_0Z_f64Z2Einformally_known_as_plain_snanZ_jv(): expected 9219994337134247936, got 9222246136947933184.
  +float_literals-main.c:357: assertion failed: in Z_float_literals_0Z_f64Z2Emisc_nanZ_jv(): expected 9218888453225749180, got 9221140253039434428.
  +float_literals-main.c:360: assertion failed: in Z_float_literals_0Z_f64Z2Emisc_positive_nanZ_jv(): expected 9219717281780008969, got 9221969081593694217.
  +float_literals-main.c:363: assertion failed: in Z_float_literals_0Z_f64Z2Emisc_negative_nanZ_jv(): expected 18442992325002076997, got 18445244124815762245.
  +During handling of the above exception, another exception occurred:
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 413, in <module>
  +    sys.stderr.write(u'{0}\n'.format(e).encode('ascii', 'replace'))
  +TypeError: write() argument must be str, not bytes
  STDOUT MISMATCH:
  --- expected
  +++ actual
  @@ -1 +1 @@
  -83/83 tests passed.
  +75/83 tests passed.
- test/wasm2c/spec/float_memory.txt
  expected error code 0, got 1.
  STDERR MISMATCH:
  --- expected
  +++ actual
  @@ -0,0 +1,17 @@
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 407, in <module>
  +    sys.exit(main(sys.argv[1:]))
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 400, in main
  +    forward_stdout=True).RunWithArgs()
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/utils.py", line 104, in RunWithArgs
  +    raise error
  +utils.Error: Error running "out/test/wasm2c/spec/float_memory/float_memory":
  +float_memory-main.c:280: assertion failed: in Z_float_memory_0Z_i32Z2EloadZ_iv(): expected 2141192192, got 2145386496.
  +float_memory-main.c:325: assertion failed: in Z_float_memory_1Z_i64Z2EloadZ_jv(): expected 9219994337134247936, got 9222246136947933184.
  +float_memory-main.c:370: assertion failed: in Z_float_memory_2Z_i32Z2EloadZ_iv(): expected 2141192192, got 2145386496.
  +float_memory-main.c:415: assertion failed: in Z_float_memory_3Z_i64Z2EloadZ_jv(): expected 9219994337134247936, got 9222246136947933184.
  +During handling of the above exception, another exception occurred:
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 413, in <module>
  +    sys.stderr.write(u'{0}\n'.format(e).encode('ascii', 'replace'))
  +TypeError: write() argument must be str, not bytes
  STDOUT MISMATCH:
  --- expected
  +++ actual
  @@ -1 +1 @@
  -60/60 tests passed.
  +56/60 tests passed.
- test/wasm2c/spec/float_misc.txt
  expected error code 0, got 1.
  STDERR MISMATCH:
  --- expected
  +++ actual
  @@ -0,0 +1,42 @@
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 407, in <module>
  +    sys.exit(main(sys.argv[1:]))
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 400, in main
  +    forward_stdout=True).RunWithArgs()
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/utils.py", line 104, in RunWithArgs
  +    raise error
  +utils.Error: Error running "out/test/wasm2c/spec/float_misc/float_misc":
  +float_misc-main.c:257: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(1, 1.1102230246251568e-16): expected 1.0000000000000002, got 1.
  +float_misc-main.c:269: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(9.2233720368547758e+18, 1024.25): expected 9.2233720368547779e+18, got 9.2233720368547758e+18.
  +float_misc-main.c:275: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(9007199254740992, 1.0000100000000001): expected 4.4501477170144047e-308, got 9007199254740992.
  +float_misc-main.c:278: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(9007199254740994, 0.9999847412109375): expected 4.4501477170144047e-308, got 9007199254740996.
  +float_misc-main.c:383: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(-2.1089660532788995e+242, 5.8148323342119634e+248): expected 5.8148302252459106e+248, got 5.8148302252459096e+248.
  +float_misc-main.c:386: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(1.0231579266682148e+236, 4.5020430079749491e+224): expected 1.0231579266727168e+236, got 1.023157926672717e+236.
  +float_misc-main.c:389: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(-1.3052997857095656e+188, 1.5489943422018657e+203): expected 1.5489943422018645e+203, got 1.5489943422018643e+203.
  +float_misc-main.c:392: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(4.7629997434721684e+139, 4.5558645105825967e+155): expected 4.5558645105825967e+155, got 4.5558645105825976e+155.
  +float_misc-main.c:395: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(3.9589525165584138e-300, 2.3092460710062946e-290): expected 2.30924607140219e-290, got 2.3092460714021897e-290.
  +float_misc-main.c:491: assertion failed: in Z_float_misc_0Z_f64Z2EaddZ_ddd(1.7976931348623157e+308, 9.979201547673598e+291): expected 1.7976931348623157e+308, got inf.
  +float_misc-main.c:512: assertion failed: in Z_float_misc_0Z_f64Z2EsubZ_ddd(1, 5.5511151231257839e-17): expected 0.99999999999999989, got 1.
  +float_misc-main.c:605: assertion failed: in Z_float_misc_0Z_f64Z2EsubZ_ddd(5.8169880657930389e-24, 2.5021499241540866e-35): expected 5.8169880657680178e-24, got 5.816988065768017e-24.
  +float_misc-main.c:608: assertion failed: in Z_float_misc_0Z_f64Z2EsubZ_ddd(4.3336683304809554e-296, 1.6945582607476316e-304): expected 4.3336683135353726e-296, got 4.3336683135353731e-296.
  +float_misc-main.c:611: assertion failed: in Z_float_misc_0Z_f64Z2EsubZ_ddd(6.9080526763152571e-77, 1.2001773734799856e-60): expected -1.2001773734799856e-60, got -1.2001773734799854e-60.
  +float_misc-main.c:614: assertion failed: in Z_float_misc_0Z_f64Z2EsubZ_ddd(-2.2044291547443813e-12, -2.7947429925618632e-21): expected -2.2044291519496381e-12, got -2.2044291519496385e-12.
  +float_misc-main.c:617: assertion failed: in Z_float_misc_0Z_f64Z2EsubZ_ddd(4.0163935691177612e-08, 0.17053881989395447): expected -0.17053877973001877, got -0.1705387797300188.
  +float_misc-main.c:701: assertion failed: in Z_float_misc_0Z_f64Z2EsubZ_ddd(1.7976931348623157e+308, 9.979201547673598e+291): expected 1.7976931348623157e+308, got 1.7976931348623155e+308.
  +float_misc-main.c:728: assertion failed: in Z_float_misc_0Z_f64Z2EmulZ_ddd(1848874847, 19954562207): expected 3.6893488147419111e+19, got 3.6893488147419103e+19.
  +float_misc-main.c:827: assertion failed: in Z_float_misc_0Z_f64Z2EmulZ_ddd(4.4091927284399547e-103, 1.1518840702296592e-173): expected 5.0788788664624316e-276, got 5.0788788664624308e-276.
  +float_misc-main.c:830: assertion failed: in Z_float_misc_0Z_f64Z2EmulZ_ddd(-0.0029800418264724318, 6.3125412993218003e+217): expected -1.8811637103313594e+215, got -1.8811637103313598e+215.
  +float_misc-main.c:833: assertion failed: in Z_float_misc_0Z_f64Z2EmulZ_ddd(-3.0834457808130011e+110, -1.0081049555008529e-196): expected 3.1084369716557833e-86, got 3.1084369716557829e-86.
  +float_misc-main.c:836: assertion failed: in Z_float_misc_0Z_f64Z2EmulZ_ddd(3.4938750131567728e+233, 2.1313169159308099e+18): expected 7.4465549176890102e+251, got 7.4465549176890113e+251.
  +float_misc-main.c:839: assertion failed: in Z_float_misc_0Z_f64Z2EmulZ_ddd(-1.2500108005100234e-83, 1.0352657041604675e+270): expected -1.294093311598199e+187, got -1.2940933115981991e+187.
  +float_misc-main.c:1055: assertion failed: in Z_float_misc_0Z_f64Z2EdivZ_ddd(-2.0395956046834761e+176, -7.4740887394612257e+58): expected 2.7288886656040712e+117, got 2.7288886656040717e+117.
  +float_misc-main.c:1058: assertion failed: in Z_float_misc_0Z_f64Z2EdivZ_ddd(-3.0426171229468766e+164, -2.6556792326588243e+99): expected 1.1457020432022042e+65, got 1.145702043202204e+65.
  +float_misc-main.c:1061: assertion failed: in Z_float_misc_0Z_f64Z2EdivZ_ddd(4.9235240512480726e+55, -3.6634082831003669e+290): expected -1.3439736089369927e-235, got -1.3439736089369929e-235.
  +float_misc-main.c:1064: assertion failed: in Z_float_misc_0Z_f64Z2EdivZ_ddd(2.8926084355634162e+65, 5.1719487583733548e+128): expected 5.5928791461444777e-64, got 5.5928791461444784e-64.
  +float_misc-main.c:1067: assertion failed: in Z_float_misc_0Z_f64Z2EdivZ_ddd(-4.2154258234426861e+248, 1.4285058546706491e+105): expected -2.9509335293656034e+143, got -2.950933529365603e+143.
  +float_misc-main.c:1217: assertion failed: in Z_float_misc_0Z_f64Z2EdivZ_ddd(1, 0.99999999999999989): expected 1.0000000000000002, got 1.
  +During handling of the above exception, another exception occurred:
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 413, in <module>
  +    sys.stderr.write(u'{0}\n'.format(e).encode('ascii', 'replace'))
  +TypeError: write() argument must be str, not bytes
  STDOUT MISMATCH:
  --- expected
  +++ actual
  @@ -1 +1 @@
  -440/440 tests passed.
  +411/440 tests passed.
- test/wasm2c/spec/float_exprs.txt
  expected error code 0, got 1.
  STDERR MISMATCH:
  --- expected
  +++ actual
  @@ -0,0 +1,17 @@
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 407, in <module>
  +    sys.exit(main(sys.argv[1:]))
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 400, in main
  +    forward_stdout=True).RunWithArgs()
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/utils.py", line 104, in RunWithArgs
  +    raise error
  +utils.Error: Error running "out/test/wasm2c/spec/float_exprs/float_exprs":
  +float_exprs-main.c:3133: assertion failed: in Z_float_exprs_87Z_f32Z2Enonarithmetic_nan_bitpatternZ_ii(2139107856u): expected 4286591504, got 4290785808.
  +float_exprs-main.c:3136: assertion failed: in Z_float_exprs_87Z_f32Z2Enonarithmetic_nan_bitpatternZ_ii(4286591504u): expected 2139107856, got 2143302160.
  +float_exprs-main.c:3163: assertion failed: in Z_float_exprs_87Z_f64Z2Enonarithmetic_nan_bitpatternZ_jj(9218868437227418128ull): expected 18442240474082193936, got 18444492273895879184.
  +float_exprs-main.c:3166: assertion failed: in Z_float_exprs_87Z_f64Z2Enonarithmetic_nan_bitpatternZ_jj(18442240474082193936ull): expected 9218868437227418128, got 9221120237041103376.
  +During handling of the above exception, another exception occurred:
  +Traceback (most recent call last):
  +  File "/builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py", line 413, in <module>
  +    sys.stderr.write(u'{0}\n'.format(e).encode('ascii', 'replace'))
  +TypeError: write() argument must be str, not bytes
  STDOUT MISMATCH:
  --- expected
  +++ actual
  @@ -1 +1 @@
  -794/794 tests passed.
  +790/794 tests passed.
...
**** FAILED ******************************************************************
- test/interp/unary.txt
    /builddir/build/BUILD/wabt-1.0.10/bin/wasm-interp out/test/interp/unary/unary.wasm --run-all-exports
- test/wasm2c/spec/conversions.txt
    /usr/bin/python3 /builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py out/test/wasm2c/spec/conversions.wast --bindir=/builddir/build/BUILD/wabt-1.0.10/bin --no-error-cmdline -o out/test/wasm2c/spec/conversions
- test/wasm2c/spec/float_literals.txt
    /usr/bin/python3 /builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py out/test/wasm2c/spec/float_literals.wast --bindir=/builddir/build/BUILD/wabt-1.0.10/bin --no-error-cmdline -o out/test/wasm2c/spec/float_literals
- test/wasm2c/spec/float_memory.txt
    /usr/bin/python3 /builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py out/test/wasm2c/spec/float_memory.wast --bindir=/builddir/build/BUILD/wabt-1.0.10/bin --no-error-cmdline -o out/test/wasm2c/spec/float_memory
- test/wasm2c/spec/float_misc.txt
    /usr/bin/python3 /builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py out/test/wasm2c/spec/float_misc.wast --bindir=/builddir/build/BUILD/wabt-1.0.10/bin --no-error-cmdline -o out/test/wasm2c/spec/float_misc
- test/wasm2c/spec/float_exprs.txt
    /usr/bin/python3 /builddir/build/BUILD/wabt-1.0.10/test/run-spec-wasm2c.py out/test/wasm2c/spec/float_exprs.wast --bindir=/builddir/build/BUILD/wabt-1.0.10/bin --no-error-cmdline -o out/test/wasm2c/spec/float_exprs

I suspect all but the first are due to lower float precision.

Duplicate issue #1973: Many floating-point errors on i386
Created: 2022-08-27T22:29:39Z
When running the full test suite on i386, many floating-point-related failures occur. The test summary is reproduced below.
**** FAILED ******************************************************************
- test/spec/float_exprs.txt
    /ws/build/spectest-interp out/test/spec/float_exprs/float_exprs.json
- test/spec/float_misc.txt
    /ws/build/spectest-interp out/test/spec/float_misc/float_misc.json
- test/spec/local_tee.txt
    /ws/build/spectest-interp out/test/spec/local_tee/local_tee.json
- test/spec/simd_f32x4_arith.txt
    /ws/build/spectest-interp out/test/spec/simd_f32x4_arith/simd_f32x4_arith.json
- test/spec/simd_f32x4_pmin_pmax.txt
    /ws/build/spectest-interp out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.json
- test/spec/simd_f64x2_arith.txt
    /ws/build/spectest-interp out/test/spec/simd_f64x2_arith/simd_f64x2_arith.json
- test/spec/simd_f64x2_pmin_pmax.txt
    /ws/build/spectest-interp out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.json
- test/wasm2c/old-spec/select.txt
    /usr/bin/python3 /ws/test/run-spec-wasm2c.py out/test/wasm2c/old-spec/select.txt --bindir=/ws/build --no-error-cmdline -o out/test/wasm2c/old-spec/select
- test/wasm2c/spec/const.txt
    TIMEOUT
- test/wasm2c/spec/conversions.txt
    /usr/bin/python3 /ws/test/run-spec-wasm2c.py out/test/wasm2c/spec/conversions.wast --bindir=/ws/build --no-error-cmdline -o out/test/wasm2c/spec/conversions
- test/wasm2c/spec/float_exprs.txt
    /usr/bin/python3 /ws/test/run-spec-wasm2c.py out/test/wasm2c/spec/float_exprs.wast --bindir=/ws/build --no-error-cmdline -o out/test/wasm2c/spec/float_exprs
- test/wasm2c/spec/float_memory.txt
    /usr/bin/python3 /ws/test/run-spec-wasm2c.py out/test/wasm2c/spec/float_memory.wast --bindir=/ws/build --no-error-cmdline -o out/test/wasm2c/spec/float_memory
- test/wasm2c/spec/float_misc.txt
    /usr/bin/python3 /ws/test/run-spec-wasm2c.py out/test/wasm2c/spec/float_misc.wast --bindir=/ws/build --no-error-cmdline -o out/test/wasm2c/spec/float_misc
- test/wasm2c/spec/local_tee.txt
    /usr/bin/python3 /ws/test/run-spec-wasm2c.py out/test/wasm2c/spec/local_tee.wast --bindir=/ws/build --no-error-cmdline -o out/test/wasm2c/spec/local_tee

See the following GHA logs for full details: https://github.com/WebAssembly/wabt/runs/8053046874?check_suite_focus=true

Closing comment (2023-01-08T22:06:49Z): Duplicate of #1044