fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
20.74k stars 2.49k forks source link

fmt 9.0 tests fail on i386 #2975

Closed zhsj closed 2 years ago

zhsj commented 2 years ago

Log:

https://buildd.debian.org/status/fetch.php?pkg=fmtlib&arch=i386&ver=9.0.0%2Bds1-1&stamp=1657135081&raw=0

88% tests passed, 3 tests failed out of 24

Total Test time (real) =  22.49 sec

The following tests FAILED:
      3 - chrono-test (Failed)
      7 - format-test (Failed)
      8 - format-impl-test (Failed)
./test/chrono-test.cc:560: Failure
Expected equality of these values:
  "44.000000000000"
  fmt::format("{:%S}", std::chrono::duration<float, std::pico>( 1.54213895E+26))
    Which is: "16.437500000000"
[  FAILED  ] chrono_test.special_durations (0 ms)
./test/format-impl-test.cc:360: Failure
Expected equality of these values:
  s
    Which is: "5.5099196966553210909853471157086794699e-4928"
  "42"
[  FAILED  ] format_impl_test.write_float128 (1 ms)
./test/format-test.cc:1991: Failure
Expected equality of these values:
  fmt::to_string(__float128(0.5))
    Which is: "5.5077973690462315819595188003364951136e-4928"
  "0.5"
[  FAILED  ] format_test.to_string (0 ms)
vitaut commented 2 years ago

Thanks for reporting. Two of the three failures are the same as in #2969 so I'll merge this issue and add a note regarding the chrono-test failure there.

vitaut commented 2 years ago

The first two failures have been fixed in #2969, but the chrono-test turned out to be unrelated. Reopening.

vitaut commented 2 years ago

Managed to repro on bento/debian-10.10-i386.

vitaut commented 2 years ago

The problem is that fmod(154213890000000.0f, 60.0f) gives different results with optimizations disabled (44) and enabled (16.437500000000) on this system.

vitaut commented 2 years ago

chrono-test should be fixed in https://github.com/fmtlib/fmt/commit/d82e1a108d3b3e3e7b8b019b47df9c4ed127723b.

zhsj commented 2 years ago

https://buildd.debian.org/status/package.php?p=fmtlib&suite=experimental

The tests have passed now. 👍

vitaut commented 2 years ago

Thanks for checking!

marxin commented 1 year ago

The problem is that fmod(154213890000000.0f, 60.0f) gives different results with optimizations disabled (44) and enabled (16.437500000000) on this system.

Hey, I noticed similar symptoms with GCC 13 compiler: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109085

You might be able to share more details on that, thanks.