osmose.engine_cs.philox¶
The C# engine’s random numbers, reproduced in Python (spec section 5.3, plan task 0.5).
The C# engine draws every number from Philox4x64-10, which is also what numpy.random.Philox
implements, so Python can compute any word the engine draws. Later tests use this to feed the
Numba oracle kernel the same permutations the C# kernel gets (spec section 10.1). Pure NumPy;
importing it never loads the CLR.
The NumPy call. numpy.random.Philox increments its 256-bit counter before generating
a block, so the block for counter c comes from Philox(counter=c - 1, key=k) followed by
random_raw(4). Counter and key are little-endian multi-word integers: c0 and K0 are
the least significant words.
Functions
|
The four 64-bit words of the block for counter |
|
The engine's key for a run ( |
|
Vigna's SplitMix64 finaliser ( |
|
The counter's third word: |