Skip to content

ZeroDivisionError error in perf_notes.py

The nightly-x86_64-linux-deb12-release-perf job currently fails with many errors of the form

   /builds/ghc/ghc/tmp/ghctest-d_8pq88c/test   spaces/testsuite/tests/perf/compiler/T9872d.run                       T9872d [Traceback (most recent call last):
  File "/builds/ghc/ghc/testsuite/driver/testlib.py", line 1647, in test_common_work
    await do_test(name, way, func, args, files)
  File "/builds/ghc/ghc/testsuite/driver/testlib.py", line 1760, in do_test
    result = await func(*[name,way] + args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/ghc/ghc/testsuite/driver/testlib.py", line 1875, in compile
    return await do_compile( name, way, False, None, [],  [], extra_hc_opts )
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/ghc/ghc/testsuite/driver/testlib.py", line 1967, in do_compile
    statsResult = check_generic_stats(TestName(name), way, opts.generic_stats_test)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/ghc/ghc/testsuite/driver/testlib.py", line 2130, in check_generic_stats
    res = report_stats(name, way, metric, gen_stat)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/ghc/ghc/testsuite/driver/testlib.py", line 2162, in report_stats
    (perf_change, metric_result) = Perf.check_stats_change(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/ghc/ghc/testsuite/driver/perf_notes.py", line 627, in check_stats_change
    lowerBound, upperBound = acceptance_window.get_bounds(expected_val)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/ghc/ghc/testsuite/driver/perf_notes.py", line 143, in get_bounds
    return (-1/0, +1/0)
            ~~^~
ZeroDivisionError: division by zero

I belivee the problem here is that we are using integer division, which naturally can't represent infinity. However, it's a bit baffling to me why we are only seeing this now.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information