Engine notes · reproducible randomness

What is 0x6d2b79f5?

It is the increment in Mulberry32, the small deterministic generator behind this site's seeded backtests. It is not a magic seed, and the implementation is not Squirrel3.

One increment, two streams

Mulberry32 holds a 32-bit state. Each call adds 0x6d2b79f5 to that state, wraps at 32 bits, then mixes the bits with shifts, XORs, and integer multiplication. The result is divided by 232 to produce a number in [0, 1). The constant is the fixed step between states. A run seed is the starting state supplied by the user; it can be any unsigned 32-bit integer.

In a backtest, the first stream turns each draw into a 32-bit round seed. The wheel starts a fresh Mulberry32 stream from that round seed and uses its first draw to choose a pocket. A separate strategy stream begins from seed ^ 0x9e3779b9, so calls to ctx.rng() do not consume wheel draws. The same configuration and seed reproduce the same sequence; changing the strategy's random calls does not shift the wheel sequence.

Run the actual engine

Trace eight spins from a seed

This calls the production createRng and rngSpin functions. The outer generator makes a round seed; a fresh inner generator maps that seed to a pocket. Enter a 32-bit unsigned integer in decimal or hexadecimal.

Scroll the trace sideways to see pocket and color.

First eight spins for seed 12345 on the european wheel
SpinRound seedHexPocketColor
142079008690xfacf78c533black
213174909440x4e87510015black
320796464500x7bf4e2f213black
435130015520xd164265024black
521879781860x8269e5ca27red
614923802770x58f3ea7535black
73167862300x12e1c63613black
832916477630xc4328f1336red

The displayed trace is the backtest pocket path. The animated Game wheel has its own visual physics layer.

What the trace proves

It proves repeatability of this implementation. It does not certify a physical wheel, unpredictability, or cryptographic security. The pocket mapping assigns the 232 possible 32-bit values to 37 or 38 buckets, with bucket sizes differing by at most one value. That arithmetic does not establish uniform output from the generator. Our generator validation study reports observed frequency and serial tests, including a primary sample that crossed its 5% chi-square threshold. A statistical test is evidence about a sample, not a guarantee about every seed or run.

The original Mulberry32 reference includes a caveat about its small state and output coverage. This engine is for repeatable simulation. Do not use this generator for secrets, security tokens, or real-money outcomes.

Read the implementation

The relevant code is src/engine/rng.ts for the generator and pocket map, and src/engine/strategy/kernel.ts for the two-stage backtest path. Try the same seed in Engineer mode, or inspect the betting-system runs built on it.

Sources