You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Non-deterministic sampling when seed is fixed but batch_size or reference sampling varies #104
Tsim sampling is currently not fully deterministic with respect to the random seed. While setting a fixed seed is expected to produce reproducible results, the output also depends on the internal batch_size used during sampling, as well as whether compute_reference_X_sample=True is enabled.
This violates the common expectation that fixing the seed alone should guarantee reproducibility.
The assertion fails even though the same seed is used. The assertion passes when batch_size is the same for both sample calls.
Observed Behavior
Changing batch_size changes the sampled results, even with a fixed seed.
When batch_size is not explicitly specified, Tsim selects it dynamically (e.g., based on available memory), which can lead to inconsistent results across runs or environments.
When compute_reference_X_sample=True, Tsim may internally increase the batch size (e.g., by 1), further affecting determinism.
Expected Behavior
Sampling should be fully deterministic given a fixed seed, regardless of: batch_size, internal batching strategy, whether reference samples are computed
Root cause
Tsim samples random numbers per f variable, for a whole batch at once
Activity