From 10179a636d41f63870148c941a78c753944dfc9f Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Mon, 9 Feb 2026 12:55:54 +0000 Subject: [PATCH] sampling : also use upper bits for initializing state --- src/llama-sampler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama-sampler.cpp b/src/llama-sampler.cpp index 717e1e73d5..633be9bceb 100644 --- a/src/llama-sampler.cpp +++ b/src/llama-sampler.cpp @@ -416,7 +416,7 @@ struct blue_noise_rng { {-1, -1}, }; for (int i = 0; i < n; i++) { - uint32_t h = rng->next32() % 10; + uint32_t h = (uint32_t)(((uint64_t)rng->next32() * 10) >> 32); states[i] = {tbl[h][0], tbl[h][1]}; // random initial state } }