Skip to content

feat(datagen): add SeedConfig with per-type seed resolution#143

Open
Dylan-M wants to merge 1 commit intomainfrom
04-06-feat_datagen_add_seedconfig_with_per-type_seed_resolution
Open

feat(datagen): add SeedConfig with per-type seed resolution#143
Dylan-M wants to merge 1 commit intomainfrom
04-06-feat_datagen_add_seedconfig_with_per-type_seed_resolution

Conversation

@Dylan-M
Copy link
Copy Markdown
Contributor

@Dylan-M Dylan-M commented Apr 27, 2026

Proposed Change

Adds SeedConfig, which resolves a deterministic seed per identity type so generation across types is independently reproducible.

Part of PIPE-927 common data generation package stack. Foundation for PIPE-785, PIPE-928, PIPE-943, and the rest of the simulator stack.

Checklist
  • Changes are tested
  • CI has passed

Copy link
Copy Markdown
Contributor Author

Dylan-M commented Apr 27, 2026

@Dylan-M Dylan-M marked this pull request as ready for review April 27, 2026 14:40
@Dylan-M Dylan-M requested review from a team as code owners April 27, 2026 14:40
Base automatically changed from dylanmyers/pipe-927-common-data-generation-package to main May 8, 2026 17:02
@Dylan-M Dylan-M force-pushed the 04-06-feat_datagen_add_seedconfig_with_per-type_seed_resolution branch from 31ca17f to 610f2ef Compare May 8, 2026 17:16
Comment thread internal/datagen/seed.go
func (s *SeedConfig) ResolveSeed(identityType string) int64 {
var override *int64
switch identityType {
case "systems":
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when system is mentioned instead of systems. It would fall back to shared. I guess enums would be a better way to go forward. What do you think?

Comment thread internal/datagen/seed.go
// Shared seed for all identity types. 0 = generate random seed at startup.
Shared int64

// Per-identity-type overrides. If set (non-nil), overrides Shared for that type.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit : Shared uses 0 as the “unset, randomize on Init” sentinel, which means callers cannot intentionally use shared seed 0 even though 0 is a valid deterministic math/rand seed. That quietly breaks the PR’s reproducibility contract for one legitimate input value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants