ID 402572 - Random values are different with between the output of an Expression node and Add node

Follow

Problem summary
Random values are different with between the output of an Expression node and Add node

Customer reported version
Nuke 11.3v4

Customer reported platform
Linux

Steps to reproduce

1) Open Nuke and run the following code in the Script Editor

import nuke

colours = ['red', 'green', 'blue', 'alpha']

def sample_colour(node, x_coord, y_coord):
''' sample the colour at a given pixel output by the node given '''
return [node.sample(c, x_coord + 0.5, y_coord + 0.5) for c in colours]
nuke.addFormat('2048 3 strip_2K')
c = nuke.createNode('Constant')
c.knob('format').setValue('strip_2K')
e = nuke.createNode('Expression')
e['expr0'].setValue('random()')
e['expr1'].setValue('random()')
e['expr2'].setValue('random()')
a = nuke.createNode('Add')

print sample_colour(e, 0, 0)
print sample_colour(a, 0, 0)

Notice that the random values are different with between the output of the Expression and Add nodes

2) Run the last two lines and notice that the random values are now the same.

print sample_colour(e, 0, 0)
print sample_colour(a, 0, 0)



Expected behaviour
The random values should be the same between the output of the Expression and Add nodes

Actual behaviour
Random values are different with between the output of the Expression and Add nodes

Reproduced by support
This bug has been reproduced in:
Nuke 11.3v5 - Windows 10 - macOS 10.11 (El Capitan) - Linux CentOS 7
Nuke 11.3v1 - WIndows 10

Nuke 11.2v1 - WIndows 10

Nuke 11.1v1 - Windows 10

Nuke 11.0v1 - WIndows 10

Nuke 10.5v1 - Windows 10

Nuke 10.0v1 - Windows 10

Nuke 9.0v1 - WIndows 10
Nuke 8.0v1 - Windows 10 - macOS 10.11 (El Capitan) - Linux CentOS 6

Earliest version tested
Nuke 8.0v1 
- This issue appears to be in all versions of the product

    We're sorry to hear that

    Please tell us why