Skip to content

Add seed support to the standard sampling strategy #114

Description

@LeonidElkin

Summary

The standard sampling strategy should support explicit seeding for reproducible sampling.

This should be consistent with the seeding API used by UNU.RAN sampling strategies.


Problem

The standard sampling path does not currently provide a clear user-facing way to control randomness.

This makes deterministic examples, stable tests, backend comparisons, and debugging stochastic behavior harder than necessary.


Expected behavior

Two standard sampling strategies initialized with the same seed should produce the same sample sequence for the same distribution and sample size.

The strategy should not rely on hidden global random state when a seed is provided. Each strategy instance should own an independent RNG.


Acceptance criteria

  1. The standard sampling strategy accepts a public seed argument.
  2. Same seed, same distribution, and same sample size produce reproducible samples.
  3. Different seeds produce different samples.
  4. Standard and UNU.RAN sampling strategies expose a consistent seeding API.
  5. Tests are added for deterministic standard sampling.
  6. Examples or documentation mention seeded standard sampling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ALG: SamplingNew algorithms for sampling or improvements of existing onesEnhancementNew feature or requestpythonPull requests that update python code

    Fields

    No fields configured for Feature.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions