For quite some time we have had occasional failures of the IBCDFO MATLAB actions with strange error messages indicating that MATLAB code was passed index variables whose values are not positive integers. Such errors have not been seen from direct use and testing of the code on personal machines or for studies. In addition, the actions often pass by just rerunning the failed actions.
We spent some time debugging the following particular flavor of these errors, whose message is copied from a macOS-14/R2021a failure
================================================================================
Error occurred in Testpounders/shortTests and it did not run to completion.
---------
Error ID:
---------
'MATLAB:getReshapeDims:notRealInt'
--------------
Error Details:
--------------
Error using reshape
Size arguments must be real integers.
Error in pounders (line 183)
Res(i, :) = F(i, :) - Cres - .5 * D * reshape(D * reshape(Hres, n, m
* n), n, m);
Error in test_identity_combine (line 53)
[X, F, hf, flag, xk_best] = pounders(Ffun, X_0, n, nf_max, g_tol,
delta_0, 1, Low, Upp, Prior, Options, Model);
Error in Testpounders/shortTests (line 25)
test_identity_combine;
================================================================================
Looking back over the recent action history, I see failures for macOS 15/R2021a. Note that we are presently only testing with that MATLAB version and the latest (R2025b).
This specific error can be triggered by calls such as reshape(eye(4), 2.0, 8.5) but not with other potential index errors
>> reshape(eye(4), 2.0, 8.0 + 1 * j)
Error using reshape
Size argument cannot be complex.
>> reshape(eye(4), 2.0, 8.0 + 0 * j)
ans =
1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 1
>> reshape(eye(4), 2, 0)
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension.
>> reshape(eye(4), 2, -1)
Error using reshape
Size vector elements should be nonnegative.
Some debugging output when that line was wrapped in a try/catch block
================================================================================
Error occurred in Testpounders/shortTests and it did not run to completion.
---------
Error ID:
---------
'POUNDERS:ReshapeDims:AssertionFail'
--------------
Error Details:
--------------
Error using pounders (line 217)
Reshape/size failure at i=134.
n=4 (class double), integer=1, finite=1
m=1 (class double), integer=1, finite=1
m*n=4, integer=1, finite=1
size(Hres)=[4 4 1]
size(X)=[1001 4], size(F)=[1001 1], size(Cres)=[1 1], size(D)=[1 4]
Caught: MATLAB:getReshapeDims:notRealInt | Size arguments must be real
integers.
Error in test_identity_combine (line 53)
[X, F, hf, flag, xk_best] = pounders(Ffun, X_0, n, nf_max, g_tol,
delta_0, 1, Low, Upp, Prior, Options, Model);
Error in Testpounders/shortTests (line 25)
test_identity_combine;
================================================================================
where integer=1 means that round(x) == x. Since this debug information does not provide an explanation of the failure, Jeff converted all index arguments to those functions to int32(round(x)). Evaluating the action (of 10 jobs) approximately 5-6 times did not produce errors. The experts believe that the code should not be able to set n and m to non-integer values. In fact, these errors could be produced after many iterations of using n and m successfully.
A current workaround (PR #236) is to explicitly cast the user-provided n and m arguments at the top of pounders
n = int32(n);
m = int32(m);
I am assured that 32-bit indices are sufficient. Based on rerunning the action several times, this appears to have silenced this particular type of "bad index" error.
For quite some time we have had occasional failures of the IBCDFO MATLAB actions with strange error messages indicating that MATLAB code was passed index variables whose values are not positive integers. Such errors have not been seen from direct use and testing of the code on personal machines or for studies. In addition, the actions often pass by just rerunning the failed actions.
We spent some time debugging the following particular flavor of these errors, whose message is copied from a macOS-14/R2021a failure
Looking back over the recent action history, I see failures for macOS 15/R2021a. Note that we are presently only testing with that MATLAB version and the latest (R2025b).
This specific error can be triggered by calls such as
reshape(eye(4), 2.0, 8.5)but not with other potential index errorsSome debugging output when that line was wrapped in a
try/catchblockwhere
integer=1means thatround(x) == x. Since this debug information does not provide an explanation of the failure, Jeff converted all index arguments to those functions toint32(round(x)). Evaluating the action (of 10 jobs) approximately 5-6 times did not produce errors. The experts believe that the code should not be able to setnandmto non-integer values. In fact, these errors could be produced after many iterations of usingnandmsuccessfully.A current workaround (PR #236) is to explicitly cast the user-provided
nandmarguments at the top ofpoundersI am assured that 32-bit indices are sufficient. Based on rerunning the action several times, this appears to have silenced this particular type of "bad index" error.