Index: libcfa/src/bits/random.hfa
===================================================================
--- libcfa/src/bits/random.hfa	(revision 4020f093cecdb5a64c17a94defa7b548aa5b64ea)
+++ libcfa/src/bits/random.hfa	(revision 261e107b40e5f345760c2815edd2bbad73ca50db)
@@ -10,6 +10,6 @@
 // Created On       : Fri Jan 14 07:18:11 2022
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Dec  5 13:13:14 2022
-// Update Count     : 128
+// Last Modified On : Fri Dec  9 17:08:30 2022
+// Update Count     : 169
 // 
 
@@ -23,11 +23,19 @@
 // Set default PRNG for architecture size.
 #ifdef __x86_64__										// 64-bit architecture
-#define LEHMER64
-#define XORSHIFT_6_21_7
-//#define XOSHIRO256PP
-//#define XOSHIRO128PP
+	// 64-bit generators
+	#define LEHMER64
+	//#define XORSHIFT_12_25_27
+	//#define XOSHIRO256PP
+	//#define KISS_64
+
+	// 32-bit generators
+	#define XORSHIFT_6_21_7
+	//#define XOSHIRO128PP
 #else													// 32-bit architecture
-#define XORSHIFT_13_7_17
-#define XORSHIFT_6_21_7
+	// 64-bit generators
+	#define XORSHIFT_13_7_17
+
+	// 32-bit generators
+	#define XORSHIFT_6_21_7
 #endif // __x86_64__
 
@@ -35,19 +43,4 @@
 
 // SKULLDUGGERY: typedefs name struct and typedef with the same name to deal with CFA typedef numbering problem.
-
-#ifdef LEHMER64
-#define PRNG_NAME_64 lehmer64
-#define PRNG_STATE_64_T __uint128_t
-#endif // LEHMER64
-
-#ifdef XORSHIFT_13_7_17
-#define PRNG_NAME_64 xorshift_13_7_17
-#define PRNG_STATE_64_T uint64_t
-#endif // XORSHIFT_13_7_17
-
-#ifdef XORSHIFT_6_21_7
-#define PRNG_NAME_32 xorshift_6_21_7
-#define PRNG_STATE_32_T uint32_t
-#endif // XORSHIFT_6_21_7
 
 #ifdef XOSHIRO256PP
@@ -62,4 +55,35 @@
 typedef struct PRNG_STATE_32_T { uint32_t s[4]; } PRNG_STATE_32_T;
 #endif // XOSHIRO128PP
+
+#ifdef LEHMER64
+#define PRNG_NAME_64 lehmer64
+#define PRNG_STATE_64_T __uint128_t
+#endif // LEHMER64
+
+#ifdef WYHASH64
+#define PRNG_NAME_64 wyhash64
+#define PRNG_STATE_64_T uint64_t
+#endif // LEHMER64
+
+#ifdef XORSHIFT_13_7_17
+#define PRNG_NAME_64 xorshift_13_7_17
+#define PRNG_STATE_64_T uint64_t
+#endif // XORSHIFT_13_7_17
+
+#ifdef XORSHIFT_6_21_7
+#define PRNG_NAME_32 xorshift_6_21_7
+#define PRNG_STATE_32_T uint32_t
+#endif // XORSHIFT_6_21_7
+
+#ifdef XORSHIFT_12_25_27
+#define PRNG_NAME_64 xorshift_12_25_27
+#define PRNG_STATE_64_T uint64_t
+#endif // XORSHIFT_12_25_27
+
+#ifdef KISS_64
+#define PRNG_NAME_64 kiss_64
+#define PRNG_STATE_64_T GLUE(PRNG_NAME_64,_t)
+typedef struct PRNG_STATE_64_T { uint64_t z, w, jsr, jcong; } PRNG_STATE_64_T;
+#endif // KISS_^64
 
 #ifdef XORWOW
@@ -85,4 +109,8 @@
 
 
+// ALL PRNG ALGORITHMS ARE OPTIMIZED SO THAT THE PRNG LOGIC CAN HAPPEN IN PARALLEL WITH THE USE OF THE RESULT.
+// Therefore, the set_seed routine primes the state by calling the PRNG with the state so the seed is not return as the
+// first random value.
+
 #ifdef __cforall										// don't include in C code (invoke.h)
 
@@ -120,4 +148,5 @@
 static inline void xoshiro256pp_set_seed( xoshiro256pp_t & state,  uint64_t seed ) {
 	state = (xoshiro256pp_t){ {seed, seed, seed, seed} };
+	xoshiro256pp( state );
 } // xoshiro256pp_set_seed
 
@@ -154,4 +183,5 @@
 static inline void xoshiro128pp_set_seed( xoshiro128pp_t & state, uint32_t seed ) {
 	state = (xoshiro128pp_t){ {seed, seed, seed, seed} };
+	xoshiro128pp( state );								// prime
 } // xoshiro128pp_set_seed
 
@@ -168,20 +198,23 @@
 	static inline void lehmer64_set_seed( __uint128_t & state, uint64_t seed ) {
 		state = seed;
+		lehmer64( state );
 	} // lehmer64_set_seed
 
 	//--------------------------------------------------
 	static inline uint64_t wyhash64( uint64_t & state ) {
-		state += 0x60bee2bee120fc15;
+		uint64_t ret = state;
+		state += 0x_60be_e2be_e120_fc15;
 		__uint128_t tmp;
-		tmp = (__uint128_t) state * 0xa3b195354a39b70d;
+		tmp = (__uint128_t) ret * 0x_a3b1_9535_4a39_b70d;
 		uint64_t m1 = (tmp >> 64) ^ tmp;
-		tmp = (__uint128_t)m1 * 0x1b03738712fad5c9;
+		tmp = (__uint128_t)m1 * 0x_1b03_7387_12fa_d5c9;
 		uint64_t m2 = (tmp >> 64) ^ tmp;
 		return m2;
-	}
-
-	static inline void wyhash64_set_seed( __uint128_t & state, uint64_t seed ) {
+	} // wyhash64
+
+	static inline void wyhash64_set_seed( uint64_t & state, uint64_t seed ) {
 		state = seed;
-	} // lehmer64_set_seed
+		wyhash64( state );								// prime
+	} // wyhash64_set_seed
 #endif // __SIZEOF_INT128__
 
@@ -195,6 +228,7 @@
 } // xorshift_13_7_17
 
-static inline void xorshift_13_7_17_set_seed( uint64_t & state, uint32_t seed ) {
+static inline void xorshift_13_7_17_set_seed( uint64_t & state, uint64_t seed ) {
 	state = seed;
+	xorshift_13_7_17( state );							// prime
 } // xorshift_13_7_17_set_seed
 
@@ -214,5 +248,43 @@
 static inline void xorshift_6_21_7_set_seed( uint32_t & state, uint32_t seed ) {
 	state = seed;
+	xorshift_6_21_7( state );							// prime
 } // xorshift_6_21_7_set_seed
+
+//--------------------------------------------------
+// The state must be seeded with a nonzero value.
+static inline uint64_t xorshift_12_25_27( uint64_t & state ) {
+	uint64_t ret = state;
+	state ^= state >> 12;
+	state ^= state << 25;
+	state ^= state >> 27;
+	return ret * 0x_2545_F491_4F6C_DD1D;
+} // xorshift_12_25_27
+
+static inline void xorshift_12_25_27_set_seed( uint64_t & state, uint64_t seed ) {
+	state = seed;
+	xorshift_12_25_27( state );							// prime
+} // xorshift_12_25_27_set_seed
+
+//--------------------------------------------------
+// The state must be seeded with a nonzero value.
+#ifndef KISS_64
+typedef struct kiss_64_t { uint64_t z, w, jsr, jcong; } kiss_64_t;
+#endif // ! KISS_64
+
+static inline uint64_t kiss_64( kiss_64_t & state ) with(state) {
+	kiss_64_t ret = state;
+	z = 36969 * (z & 65535) + (z >> 16);
+	w = 18000 * (w & 65535) + (w >> 16);
+	jsr ^= (jsr << 17);
+	jsr ^= (jsr << 13);
+	jsr ^= (jsr << 5);
+	jcong = 69069 * jcong + 1234567;
+	return ((ret.z << 16 + ret.w) ^ ret.jcong) + ret.jsr;
+} // kiss_64
+
+static inline void kiss_64_set_seed( kiss_64_t & state, uint64_t seed ) with(state) {
+	z = 1; w = 1; jsr = 4; jcong = seed;
+	kiss_64( state );									// prime
+} // kiss_64_set_seed
 
 //--------------------------------------------------
@@ -222,20 +294,19 @@
 #endif // ! XORWOW
 
-static inline uint32_t xorwow( xorwow_t & state ) {
+static inline uint32_t xorwow( xorwow_t & state ) with(state) {
 	// Algorithm "xorwow" from p. 5 of Marsaglia, "Xorshift RNGs".
-	uint32_t ret = state.a + state.counter;
-	uint32_t t = state.d;
-
-	uint32_t const s = state.a;
-	state.d = state.c;
-	state.c = state.b;
-	state.b = s;
+	uint32_t ret = a + counter;
+	uint32_t t = d;
+
+	uint32_t const s = a;
+	d = c;
+	c = b;
+	b = s;
 
 	t ^= t >> 2;
 	t ^= t << 1;
 	t ^= s ^ (s << 4);
-	state.a = t;
-
-	state.counter += 362437;
+	a = t;
+	counter += 362437;
 	return ret;
 } // xorwow
@@ -243,4 +314,5 @@
 static inline void xorwow_set_seed( xorwow_t & state, uint32_t seed ) {
 	state = (xorwow_t){ seed, seed, seed, seed, 0 };
+	xorwow( state );									// prime
 } // xorwow_set_seed
 
Index: libcfa/src/concurrency/thread.cfa
===================================================================
--- libcfa/src/concurrency/thread.cfa	(revision 4020f093cecdb5a64c17a94defa7b548aa5b64ea)
+++ libcfa/src/concurrency/thread.cfa	(revision 261e107b40e5f345760c2815edd2bbad73ca50db)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Nov 30 18:14:07 2022
-// Update Count     : 95
+// Last Modified On : Fri Dec  9 15:13:04 2022
+// Update Count     : 98
 //
 
@@ -230,7 +230,6 @@
 void set_seed( size_t seed ) {
 	PRNG_STATE_T & state = active_thread()->random_state;
+	PRNG_SET_SEED( state, seed );
 	__global_random_seed = seed;
-	PRNG_SET_SEED( state, seed );
-	(void)PRNG_NAME( state );							// prime PRNG
 	__global_random_prime = seed;
 	__global_random_mask = true;
Index: libcfa/src/stdlib.cfa
===================================================================
--- libcfa/src/stdlib.cfa	(revision 4020f093cecdb5a64c17a94defa7b548aa5b64ea)
+++ libcfa/src/stdlib.cfa	(revision 261e107b40e5f345760c2815edd2bbad73ca50db)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:10:29 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Dec  5 11:59:03 2022
-// Update Count     : 628
+// Last Modified On : Fri Dec  9 15:11:30 2022
+// Update Count     : 631
 //
 
@@ -232,5 +232,4 @@
 	__global_random_seed = seed;
 	PRNG_SET_SEED( __global_random_state, seed );
-	PRNG_NAME( __global_random_state );
 } // set_seed
 
Index: libcfa/src/stdlib.hfa
===================================================================
--- libcfa/src/stdlib.hfa	(revision 4020f093cecdb5a64c17a94defa7b548aa5b64ea)
+++ libcfa/src/stdlib.hfa	(revision 261e107b40e5f345760c2815edd2bbad73ca50db)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Nov 30 18:18:26 2022
-// Update Count     : 760
+// Last Modified On : Fri Dec  9 15:11:30 2022
+// Update Count     : 763
 //
 
@@ -426,6 +426,6 @@
 
 static inline {
-	void set_seed( PRNG32 & prng, uint32_t seed_ ) with( prng ) { seed = seed_; PRNG_SET_SEED_32( state, seed ); PRNG_NAME_32( state ); } // set seed
-	uint32_t get_seed( PRNG32 & prng ) __attribute__(( warn_unused_result )) with( prng ) { return seed; } // get seed
+	void set_seed( PRNG32 & prng, uint32_t seed_ ) with( prng ) { seed = seed_; PRNG_SET_SEED_32( state, seed ); }
+	uint32_t get_seed( PRNG32 & prng ) __attribute__(( warn_unused_result )) with( prng ) { return seed; }
 	uint32_t prng( PRNG32 & prng ) __attribute__(( warn_unused_result )) with( prng ) { callcnt += 1; return PRNG_NAME_32( state ); } // [0,UINT_MAX]
 	uint32_t prng( PRNG32 & prng, size_t u ) __attribute__(( warn_unused_result )) { return prng( prng ) % u; } // [0,u)
@@ -443,6 +443,6 @@
 
 static inline {
-	void set_seed( PRNG64 & prng, uint64_t seed_ ) with( prng ) { seed = seed_; PRNG_SET_SEED_64( state, seed ); PRNG_NAME_64( state ); } // set seed
-	uint64_t get_seed( PRNG64 & prng ) __attribute__(( warn_unused_result )) with( prng ) { return seed; } // get seed
+	void set_seed( PRNG64 & prng, uint64_t seed_ ) with( prng ) { seed = seed_; PRNG_SET_SEED_64( state, seed ); }
+	uint64_t get_seed( PRNG64 & prng ) __attribute__(( warn_unused_result )) with( prng ) { return seed; }
 	uint64_t prng( PRNG64 & prng ) __attribute__(( warn_unused_result )) with( prng ) { callcnt += 1; return PRNG_NAME_64( state ); } // [0,UINT_MAX]
 	uint64_t prng( PRNG64 & prng, size_t u ) __attribute__(( warn_unused_result )) { return prng( prng ) % u; } // [0,u)
