ekmett / ad

Automatic Differentiation
http://hackage.haskell.org/package/ad
BSD 3-Clause "New" or "Revised" License
372 stars 73 forks source link

doctest failure with data-reify-0.6.2 (but not with data-reify-0.6.1) #89

Closed RyanGlScott closed 4 years ago

RyanGlScott commented 4 years ago

On the master branch of ad, running the doctests against data-reify-0.6.2 will produce the following failures:

Test suite doctests: RUNNING...
/home/rgscott/Documents/Hacking/Haskell/travis-maintenance/checkout/ekmett/ad/src/Numeric/AD/Newton/Double.hs:125: failure in expression `rosenbrock (conjugateGradientDescent rosenbrock [0, 0] !! 5) < 0.1'
expected: True
 but got: False
          ^

/home/rgscott/Documents/Hacking/Haskell/travis-maintenance/checkout/ekmett/ad/src/Numeric/AD/Newton.hs:291: failure in expression `rosenbrock (conjugateGradientDescent rosenbrock [0, 0] !! 5) < 0.1'
expected: True
 but got: False
          ^

Examples: 122  Tried: 122  Errors: 0  Failures: 2

What's more, these failures do not occur if built against data-reify-0.6.1. Here are the respective values of rosenbrock (conjugateGradientDescent rosenbrock [0, 0] !! 5) when built against each version of data-reify:

(You'll get the same results if you use Numeric.AD.Newton.Double.conjugateGradientDescent instead.)

I've bisected this to ku-fpg/data-reify#8, but it's not yet clear to me why this causes the regression. Until I figure out why, I'll restrict the test suite to data-reify < 0.6.2.

RyanGlScott commented 4 years ago

It is also worth noting that this test suite failure does not occur with the latest Hackage release of ad (4.4). This failure only started happening in the master branch of ad after commit ed1e015f418b004348a210a9a1ded5d5b2415ec1.

RyanGlScott commented 4 years ago

I've uploaded data-reify-0.6.3 to Hackage, which restores the old (pre-0.6.2) behavior, fixing the ad test suite as a consequence. Moreover, I have deprecated data-reify-0.6.2 on Hackage so that cabal's constraint solver is disinclined to choose it in build plans. As a result, there should no longer be any need to explicitly exclude data-reify-0.6.2 in ad.cabal, so I'm deeming this issue resolved.