diff --git a/test/cases.c++ b/test/cases.c++ index fdb99485..06a371a6 100644 --- a/test/cases.c++ +++ b/test/cases.c++ @@ -72,6 +72,7 @@ void configure_actor(unsigned &last_space_id, const actor_testcase testcase, con log_trace("configure_actor: space %lu for %s", space_id, testcase2str(testcase)); global::actors.emplace_back(actor_config(testcase, params, unsigned(space_id), wait4id)); global::databases.insert(params.pathname_db); + params.prng_seed += bleach64(space_id); } void testcase_setup(const char *casename, const actor_params ¶ms, unsigned &last_space_id) { diff --git a/test/test.c++ b/test/test.c++ index 1d8db898..c13466e5 100644 --- a/test/test.c++ +++ b/test/test.c++ @@ -770,7 +770,7 @@ static bool execute_thunk(const actor_config *const_config, const mdbx_pid_t pid size_t iter = 0; do { if (iter) { - prng_seed(config.params.prng_seed += INT32_C(0xA4F4D37B)); + prng_salt(iter); log_verbose("turn PRNG to %u", config.params.prng_seed); } iter++; diff --git a/test/test.h++ b/test/test.h++ index 861429ff..876b83cc 100644 --- a/test/test.h++ +++ b/test/test.h++ @@ -263,8 +263,8 @@ public: } static bool review_params(actor_params ¶ms, unsigned space_id) { + (void)space_id; // silently fix key/data length for fixed-length modes - params.prng_seed += bleach32(space_id); if ((params.table_flags & MDBX_INTEGERKEY) && params.keylen_min != params.keylen_max) params.keylen_min = params.keylen_max; if ((params.table_flags & (MDBX_INTEGERDUP | MDBX_DUPFIXED)) && params.datalen_min != params.datalen_max) diff --git a/test/utils.c++ b/test/utils.c++ index 442e4a21..884fd844 100644 --- a/test/utils.c++ +++ b/test/utils.c++ @@ -124,7 +124,8 @@ void prng_fill(uint64_t &state, void *ptr, size_t bytes) { /* __thread */ uint64_t prng_state; -void prng_seed(uint64_t seed) { prng_state = bleach64(seed); } +void prng_seed(uint64_t seed) { prng_state = seed; } +void prng_salt(unsigned salt) { prng_state += bleach32(salt) * UINT64_C(0xD14A2783862DAB); } uint32_t prng32(void) { return prng32_white(prng_state); } diff --git a/test/utils.h++ b/test/utils.h++ index caa34049..2abc393b 100644 --- a/test/utils.h++ +++ b/test/utils.h++ @@ -313,6 +313,7 @@ void prng_fill(uint64_t &state, void *ptr, size_t bytes); extern uint64_t prng_state; void prng_seed(uint64_t seed); +void prng_salt(unsigned salt); uint32_t prng32(void); uint64_t prng64(void); void prng_fill(void *ptr, size_t bytes);