State:In Progress|TargetRelease:No Target|icon_bug|icon_nuke|database:public|Resolution:Fixed|BugID:542517|
Problem summary:
BlinkScript produces incorrect results on the CPU when using arrays of vectors
Customer reported version:
Nuke 12.2v10
Customer reported platform:
CentOS 5
Steps to reproduce:
1) Launch Nuke and create a BlinkScript node in the Node Graph.
2) In the BlinkScript's Properties, replace the Kernel Source with the following code:
kernel Test: ImageComputationKernel<ePixelWise> { Image<eWrite> dst;param: float3 colours[3];void process(){ if (colours[1].y == 5) { dst() = 1; } else { dst() = 0.2f; }}};
3) Click the Recompile button, and View the BlinkScript node.
4) Open the BlinkScript's Kernel Parameters tab, and change the center-most value of colours to 5.
5) Toggle Use GPU if available on and off to compare the results between the GPU and CPU:

Expected behavior:
Switching between the GPU and CPU should not produce different results.
Actual behavior:
The CPU evaluates the BlinkScript incorrectly, as it appears that the float3 vectors are being padded to 4 elements.
Additionally, some older versions of Nuke might occasionally print an error message like 4 errors generated., but this does not seem to happen consistently:

Workaround:
Instead of using vectors and arrays with float3 colours[3];, this issue can be avoided by using a 3x3 matrix type that BlinkScript natively supports, such as: float3x3 colours;
Reproduced by Support in:
Nuke 14.0v4 - Windows 10, CentOS 7
Nuke 14.0v1 - Windows 10
Nuke 13.0v1 - Windows 10
Nuke 12.1v1 - Windows 10, CentOS 7
Nuke 12.0v8 - Windows 10, CentOS 7
Nuke 12.0v1 - Windows 10
Nuke 11.0v1 - Windows 10
Nuke 10.0v1 - Windows 10, CentOS 7
Earliest version tested:
Nuke 10.0v1 - This issue appears to be in all tested versions of the product.
However, please note that before Nuke 12.1v1 this BlinkScript doesn't seem to work correctly on the CPU or GPU.
We're sorry to hear that
Please tell us why