The Math Library is not passing tests on Windows. This is the next thing I'm working on

math

#21

bleh… I just realized that this generates the matrices randomly. It uses a seed, but maybe given the input it’s deterministic.


#22

@Bob_Carpenter, I was able to get it to crash at the same spot on both mac and linux. The random matrix generation was just making debugging harder because the input values were different on Mac and Windows.


#23

I’m getting closer to figuring out what’s up. I’m noticing something a little crazy. The elements on the stack are reversed in Windows vs Mac.

Mac:

Running main() from lib/gtest_1.8.1/src/gtest_main.cc
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from MathMatrix
[ RUN      ] MathMatrix.matrix_exp_multiply_vd
stack size at start: 0
stack size after Av (5, 5): 25
Av =   -0.96871   0.398827   0.241306   0.741373   0.108926
  0.888077  -0.915624  -0.373344   0.255238   0.717304
-0.0899219  -0.898862  -0.800546  -0.222652  -0.271382
  0.683227   0.827031  -0.780702  -0.104228   0.885106
 -0.996585  -0.097802   0.739617   0.235266 -0.0247717
stack size after Avec: 25
B =   -0.96871   0.398827   0.241306   0.741373   0.108926
  0.888077  -0.915624  -0.373344   0.255238   0.717304
-0.0899219  -0.898862  -0.800546  -0.222652  -0.271382
  0.683227   0.827031  -0.780702  -0.104228   0.885106
 -0.996585  -0.097802   0.739617   0.235266 -0.0247717
stack size after B: 25
stack size: 25
stack size after res_vd: 26
res_vd =   -0.259808    0.333592  -0.0945327     0.51547    0.792543
  -0.141685    -0.12088   0.0982995    0.470017    0.815454
 -0.0395531    -0.24775   -0.371873   -0.418615   -0.766173
 -0.0120908    0.697351 0.000335594    0.696504     1.84603
   -0.53138   -0.561327    0.283649   -0.524745   -0.623747
STACK, size=26
0  -0.96871:0  -0.96871 : 0
1  0.398827:0  0.398827 : 0
2  0.241306:0  0.241306 : 0
3  0.741373:0  0.741373 : 0
4  0.108926:0  0.108926 : 0
5  0.888077:0  0.888077 : 0
6  -0.915624:0  -0.915624 : 0
7  -0.373344:0  -0.373344 : 0
8  0.255238:0  0.255238 : 0
9  0.717304:0  0.717304 : 0
10  -0.0899219:0  -0.0899219 : 0
11  -0.898862:0  -0.898862 : 0
12  -0.800546:0  -0.800546 : 0
13  -0.222652:0  -0.222652 : 0
14  -0.271382:0  -0.271382 : 0
15  0.683227:0  0.683227 : 0
16  0.827031:0  0.827031 : 0
17  -0.780702:0  -0.780702 : 0
18  -0.104228:0  -0.104228 : 0
19  0.885106:0  0.885106 : 0
20  -0.996585:0  -0.996585 : 0
21  -0.097802:0  -0.097802 : 0
22  0.739617:0  0.739617 : 0
23  0.235266:0  0.235266 : 0
24  -0.0247717:0  -0.0247717 : 0
25  0:0  0 : 0
------------------------------------------------------------

Windows:

Running main() from lib/gtest_1.8.1/src/gtest_main.cc
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from MathMatrix
[ RUN      ] MathMatrix.matrix_exp_multiply_vd
stack size at start: 0
stack size after Av (5, 5): 25
Av =   -0.96871   0.398827   0.241306   0.741373   0.108926
  0.888077  -0.915624  -0.373344   0.255238   0.717304
-0.0899219  -0.898862  -0.800546  -0.222652  -0.271382
  0.683227   0.827031  -0.780702  -0.104228   0.885106
 -0.996585  -0.097802   0.739617   0.235266 -0.0247717
stack size after Avec: 25
B =   -0.96871   0.398827   0.241306   0.741373   0.108926
  0.888077  -0.915624  -0.373344   0.255238   0.717304
-0.0899219  -0.898862  -0.800546  -0.222652  -0.271382
  0.683227   0.827031  -0.780702  -0.104228   0.885106
 -0.996585  -0.097802   0.739617   0.235266 -0.0247717
stack size after B: 25
stack size: 25
stack size after res_vd: 26
res_vd =   -0.259808    0.333592  -0.0945327     0.51547    0.792543
  -0.141685    -0.12088   0.0982995    0.470017    0.815454
 -0.0395531    -0.24775   -0.371873   -0.418615   -0.766173
 -0.0120908    0.697351 0.000335594    0.696504     1.84603
   -0.53138   -0.561327    0.283649   -0.524745   -0.623747
STACK, size=26
0  -0.0247717:0  -0.0247717 : 0
1  0.235266:0  0.235266 : 0
2  0.739617:0  0.739617 : 0
3  -0.097802:0  -0.097802 : 0
4  -0.996585:0  -0.996585 : 0
5  0.885106:0  0.885106 : 0
6  -0.104228:0  -0.104228 : 0
7  -0.780702:0  -0.780702 : 0
8  0.827031:0  0.827031 : 0
9  0.683227:0  0.683227 : 0
10  -0.271382:0  -0.271382 : 0
11  -0.222652:0  -0.222652 : 0
12  -0.800546:0  -0.800546 : 0
13  -0.898862:0  -0.898862 : 0
14  -0.0899219:0  -0.0899219 : 0
15  0.717304:0  0.717304 : 0
16  0.255238:0  0.255238 : 0
17  -0.373344:0  -0.373344 : 0
18  -0.915624:0  -0.915624 : 0
19  0.888077:0  0.888077 : 0
20  0.108926:0  0.108926 : 0
21  0.741373:0  0.741373 : 0
22  0.241306:0  0.241306 : 0
23  0.398827:0  0.398827 : 0
24  -0.96871:0  -0.96871 : 0
25  0:0  0 : 0
------------------------------------------------------------

Unfortunately, both of them crash (Mac sometimes, Windows all the time), so I haven’t found the root cause of this all, but I don’t think the stack should have the elements in reverse order.