brian-team / brian2genn

Brian 2 frontend to the GeNN simulator
http://brian2genn.readthedocs.io/
GNU General Public License v2.0
47 stars 16 forks source link

test_synapse_generator_random fails occasionally #115

Open tnowotny opened 4 years ago

tnowotny commented 4 years ago

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.

mstimberg commented 4 years ago

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.

tnowotny commented 4 years ago

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