internal error: Oops! Entered absent arg Arg: lvl
Summary
GHC 9.6.1 (and 9.4.4) emits:
Exception: src/HordeAd/Core/DualNumber.hs:137:10-49: No instance nor default method for class operation +
which is fully expected, because I removed that method to cause the problem, and then
shortTestForCI: internal error: Oops! Entered absent arg Arg: lvl
Type: ADVal 'ADModeGradient Double
-> ADVal 'ADModeGradient Double -> ADVal 'ADModeGradient Double
In module `MnistFcnnScalar'
(GHC version 9.6.1 for x86_64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
Steps to reproduce
Check out this branch
https://github.com/Mikolaj/horde-ad/tree/missing-method-bug-repro
and run
cabal test shortTestForCI --enable-optimization -ftest_seq --allow-newer --ghc-options='-dcore-lint -dstg-lint -dcmm-lint -dtag-inference-checks'
The same happens without the --ghc-options options. The emitted lint warnings look the same as in #23079, so probably there is nothing interesting in the linter output. Also @bgamari said these warnings "look fairly benign".
This may be hard to minimise, because running only the single test that crashes, does not reproduce the problem:
cabal test shortTestForCI --enable-optimization -ftest_seq --allow-newer --test-options='-p "O artificial 1 2 3 4 5"'
Expected behavior
Does not cause an internal error.
Environment
- GHC version used: 9.6.1 (the same or similar also seen in 9.4.4 and long ago in 9.0.2)
Optional:
- Operating System: Linux
- System Architecture: x86-64