Skip to content

fix: thread FitConfig.seed into fit_frontier → _subsample/_split_buffer #41

Open
Sanjay-Kirti wants to merge 1 commit into
adrida:mainfrom
Sanjay-Kirti:fix/seed-propagation
Open

fix: thread FitConfig.seed into fit_frontier → _subsample/_split_buffer #41
Sanjay-Kirti wants to merge 1 commit into
adrida:mainfrom
Sanjay-Kirti:fix/seed-propagation

Conversation

@Sanjay-Kirti

Copy link
Copy Markdown

Summary

FitConfig.seed was persisted to config.json but never forwarded into fit_frontier(). _subsample() and _split_buffer() always used their hardcoded default seed=42, making FitConfig(seed=...) a no-op.

Reproduction (from #30):

fit(traces, ".tracer-a", embeddings=X, config=FitConfig(seed=1))
fit(traces, ".tracer-b", embeddings=X, config=FitConfig(seed=999))
# Both produced identical splits despite different seeds

FitConfig.seed was persisted to config.json but never forwarded into
fit_frontier(). _subsample() and _split_buffer() always used their
hardcoded default seed=42, making FitConfig(seed=...) a no-op.

Fix: add seed parameter to fit_frontier() and pass config.seed from
api.py. Both _subsample() and _split_buffer() already accepted seed
as a kwarg; they just never received it.

Two tests added:
- test_fitconfig_seed_affects_splits: proves _split_buffer produces
  different splits with different seeds
- test_fit_frontier_seed_propagates: proves fit_frontier forwards
  the seed correctly end-to-end

Default behavior unchanged (seed=42 remains the default throughout).

Closes adrida#30
@Sanjay-Kirti Sanjay-Kirti requested a review from adrida as a code owner June 11, 2026 06:23
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.

1 participant