Have you seen this?
https://groups.google.com/g/golang-nuts/c/QTML5XM9I-g
https://go.dev/blog/synctest

I don't think it addresses random seeds, but it might help with 
deterministic, lock-step execution for tests.

On Tuesday, 13 May 2025 at 20:54:37 UTC+1 Axel Wagner wrote:

> It used to be possible to do this using NaCl. In fact, the playground used 
> to be implemented using that and was fully deterministic.
> These days, the playground uses gVisor, AFAIK, and is no longer 
> deterministic. I don't know how well the NaCl port is still maintained.
> Come to think of it, you might also try wasm. It's single-threaded and I 
> believe you can pretty much entirely control its interaction with the 
> outside world.
>
> On Tue, 13 May 2025 at 20:53, Jason E. Aten <j.e....@gmail.com> wrote:
>
>> I'd like to run variations of my Raft test code on a fully 
>> deterministic runtime (meaning only one thread, all 
>> randomness from a pseudo RNG controlled with a repeatable seed). 
>> I was looking at the standard (big) Go runtime, and I don't
>> see where there are any options to control the random number
>> generator there used for choosing a select, for instance,
>> but maybe I've missed some already available option? 
>> Setting GOMAXPROC=1 apparently does not prevent other background threads
>> for GC, OS calls, etc... do I understand that right?
>>
>> Trying to figure out if it would a smaller lift to hack some support into 
>> TinyGo,
>> whose typically microcontroller targets are single threaded, as
>> that would give me a big head start, or if the big Go runtime 
>> places that would need pseudo RNGs replaced
>> are isolated enough for it do be doable (in a hacked up, non-supported
>> version, of course)... big Go would have better compatibility with
>> production code of course, but TinyGo is already more conceptually
>> aligned, and might be easier to maintain if the experiment is 
>> successful...
>>
>> Thoughts?
>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com.
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/golang-nuts/da4416ab-9710-4743-9dfd-67a89675af73n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/da4416ab-9710-4743-9dfd-67a89675af73n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/b15a8985-be11-46fa-863a-a71141c59b4bn%40googlegroups.com.

Reply via email to