You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error in handling final empty tree in stats API #2745
The value for the last window should be 0 like the first window. I thought initially that this was a staightforward uninitialised memory issue, but it's not that simple. The value we compute seems to depend deterministically on the middle tree topology (many topologies don't lead to this error at all). The value is close to zero, but not that close, and larger trees seem to lead to larger errors in the final value.
I made a start on writing some tests, but I'm not sure what I'm looking for now.
This cropped up in the windowed divmat implementation in #2736, where these errors are causing tests to fail when I compare the branch stat version of the divergence matrix with the new implementations.
Whoops, this isn't a but after all, just some subtle numerical stuff. Because the stats API is maintaining a running sum, it must subtract all the previous values out when we have an empty tree, and this inevitably leads to some numerical fuzziness. The only reason this numerical fuzziness becomes a problem here is because we're comparing with zero, we have to specify an absolute rather than relative tolerance.
Activity
jeromekelleher commentedon Apr 23, 2023
Whoops, this isn't a but after all, just some subtle numerical stuff. Because the stats API is maintaining a running sum, it must subtract all the previous values out when we have an empty tree, and this inevitably leads to some numerical fuzziness. The only reason this numerical fuzziness becomes a problem here is because we're comparing with zero, we have to specify an absolute rather than relative tolerance.
Nothing to see here, closing!