brian2genn icon indicating copy to clipboard operation
brian2genn copied to clipboard

test_synapse_generator_random fails occasionally

Open tnowotny opened this issue 4 years ago • 2 comments

the test fails occasionally on some (seemingly randomly chosen) setup as follows:

2020-07-08T13:11:15.4206410Z >       assert_equal(S4.i, np.ones(7)*2)
2020-07-08T13:11:15.4207290Z E       AssertionError: 
2020-07-08T13:11:15.4207910Z E       Arrays are not equal
2020-07-08T13:11:15.4208820Z E       
2020-07-08T13:11:15.4209390Z E       Mismatch: 100%
2020-07-08T13:11:15.4210100Z E       Max absolute difference: 2.0
2020-07-08T13:11:15.4210790Z E       Max relative difference: 1.0
2020-07-08T13:11:15.4211950Z E        x: array([0, 0, 1, 1, 1, 1, 1], dtype=int32)
2020-07-08T13:11:15.4212790Z E        y: array([ 2.,  2.,  2.,  2.,  2.,  2.,  2.])

gut-feeling I wonder whether it has something to do with a failure to invalidate arrays in the array cache so that they are not read back correctly into python after run. This doesn't explain though why the test only fails n some instances and only occasionally.

tnowotny avatar Jul 08 '20 16:07 tnowotny

We've only ever seen this specific outcome on OS X though, right? I wonder whether it is not a bug in the C++ code, e.g. some "undefined behaviour" or some wrong use of pointers. This could explain why it only happens sometimes.

mstimberg avatar Jul 08 '20 16:07 mstimberg

could be - definitely seen it on OS X but I have a feeling I have also seen it on Windows once ... not sure.

tnowotny avatar Jul 08 '20 16:07 tnowotny