ID 541803 - BlinkScript documentation contains an incorrect example on using setRange() with two parameters

Follow

Problem summary:
BlinkScript documentation contains an incorrect example on using setRange() with two parameters.
 
Currently, the 2D Ranged Access example states that the following setRange() calls are equivalent, but they do not produce the same results:

src.setRange(-xRadius, -yRadius, xRadius, yRadius);src.setRange(xRadius, yRadius);

Customer reported version:
Nuke 13.2v3
 
Customer reported platform:
RHEL 7
 
Steps to reproduce:
1) Launch Nuke and create a Noise node in the Node Graph.
2) Create a BlinkScript node, and replace the Kernel Source with the following code:
kernel TestKernel : ImageComputationKernel<ePixelWise> { Image<eRead, eAccessRanged2D, eEdgeClamped> src; // the Input image Image<eWrite, eAccessPoint> dst; // the Output image param: int xRadius, yRadius; void define() { // In define(), parameters can be given labels and default values. defineParam(xRadius, "X Radius", 100); defineParam(yRadius, "Y Radius", 100); } void init() { src.setRange(xRadius, yRadius); //Based on the docs, this should be equivalent to src.setRange(-xRadius, -yRadius, xRadius, yRadius), but it is not} void process() { dst() = src(0, 0); // Write the result to the output image } };
3) Click the Recompile button, View the BlinkScript node, and observe the Edge Clamping (pictured below):

 
Expected behavior:
src.setRange(xRadius, yRadius) should produce the same results as src.setRange(-xRadius, -yRadius, xRadius, yRadius) and not Edge Clamp the image.
 
Actual behavior:
Edge Clamping issues appear when using the two parameter version of setRange() as described in the documentation.
 
Workaround:
If the range is symmetrical (xRadius == yRadius), use src.setRange(-xRadius, xRadius) instead of src.setRange(xRadius, yRadius).
 
Reproduced by Support in:
Nuke 14.0v4 - Windows 10, CentOS 7
Nuke 13.0v1 - Windows 10
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

    We're sorry to hear that

    Please tell us why