Skip to content

Fix hangs in binomial sampling #747

Closed

Description

@dhardy

As noted here it appears that I merged #735 too soon, and it has been causing some tests to hang, though apparently only on MIPS.

Activity

  1. added this to the 0.7 release milestone on Mar 1, 2019
  2. dhardy commented on Mar 7, 2019

    @dhardy
    MemberAuthor

    Progress report:

    • after an argument with SELinux I am able to run the MIPS test locally
    • putting a limit on the loop for the small-expected-value of 100 iterations, the test succeeds on the native target but hits this limit when run on MIPS

    On MIPS, it fails with this output (from just before the loop starts and panicking when x>100):

    Sampling from Bin(20, 0.7)
    Start: u=0.9136724307867923, r=0.0000459986536544739, a=9.000000000000002, s=0.42857142857142866, q=0.7
    thread 'main' panicked at 'Too many tries! u=0.8560244207867922, r=0, x=101', src/distributions/binomial.rs:115:21
    

    Here r is wrong. Is this because of the pow method?

    Edit: using let mut r = q.powi(self.n as i32); instead appears to fix the test (no hang), so this would appear to be the case, though the problem does not appear to be with bit logic (using numeric operations instead does not help).

  3. vks commented on Mar 7, 2019

    @vks
    Contributor

    Could this be due to different rounding behavior?

  4. dhardy commented on Mar 7, 2019

    @dhardy
    MemberAuthor

    I don't know. It seems quite a large error, for I think 5 FP ops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    X-bugType: bug report

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions