Skip to content

FE-1549: Rotate sweep parameter draws by a seed-derived shift - #9434

Merged
kube merged 0 commit into
cf/fe-1548-rework-the-optimization-and-sweep-drawer-viewsfrom
cf/fe-1549-randomize-sweep-parameter-draws-with-a-seed-derived-shift
Aug 29, 2026
Merged

FE-1549: Rotate sweep parameter draws by a seed-derived shift#9434
kube merged 0 commit into
cf/fe-1548-rework-the-optimization-and-sweep-drawer-viewsfrom
cf/fe-1549-randomize-sweep-parameter-draws-with-a-seed-derived-shift

Conversation

@kube

@kube kube commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

Range sweeps drew each run's parameter values from a bare per-axis Halton sequence: every experiment explored the identical value sequence regardless of its seed, and deterministic low-discrepancy points are not exchangeable random samples. This rotates each axis's draws by a seed-derived shift (Cranley–Patterson), making them unbiased over the seed while keeping the low-discrepancy convergence, the even early coverage, and prefix stability. Stacked on #9419.

🔗 Related links

🔍 What does this change?

  • sweepRunFraction takes the experiment seed and rotates the radical-inverse fraction by a per-axis shift hashed from the seed and the axis index (32-bit Math.imul hash), modulo 1.
  • sweepRangeRuns threads the seed through; the sweep session passes its experiment seed. A draw depends only on the seed, the axis, and the global run index, so ladder batches still extend the same sequence and the selection cache stays valid.
  • Tests: prefix stability, unit-interval spread across seeds, per-axis distinctness, exact reproduction for one seed, distinct sequences across seeds.
  • Docs: the user-guide sweep section and the parameter-sweeps architecture page describe the seed-shifted draws.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)

📜 Does this require a change to the docs?

The changes in this PR:

  • require changes to docs which are made as part of this PR

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • parameter-grid.test.ts (sweepRunFraction suite, extended) and the existing sweep-session.test.ts range-draw assertions, which now exercise the seeded path.

❓ How to test this?

  1. Run yarn workspace @hashintel/petrinaut dev and open "Simulate / SweepNavigator / Real compute on CPU".
  2. Select a range: the streamed distribution covers the interval from the first rung, as before.
  3. Create two sweeps with different seeds over the same range: their per-run draws differ; re-running the same seed reproduces them.

🤖 Generated with Claude Code

@kube kube self-assigned this Aug 29, 2026
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Building Building Preview Aug 29, 2026 2:43am
petrinaut Building Building Preview Aug 29, 2026 2:43am
petrinaut-docs Building Building Preview Aug 29, 2026 2:43am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 29, 2026 2:43am

Request Review

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team type/eng > backend Owned by the @backend team labels Aug 29, 2026
@kube
kube changed the base branch from cf/fe-1546-stream-range-sweeps-as-one-stochastic-simulation-over-the to cf/fe-1548-rework-the-optimization-and-sweep-drawer-views August 29, 2026 02:43
@kube
kube merged commit 2fb6ed9 into main Aug 29, 2026
28 of 31 checks passed
@kube
kube deleted the cf/fe-1549-randomize-sweep-parameter-draws-with-a-seed-derived-shift branch August 29, 2026 02:43
@kube
kube restored the cf/fe-1549-randomize-sweep-parameter-draws-with-a-seed-derived-shift branch August 29, 2026 02:46
@kube

kube commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator Author

GitHub auto-marked this merged when a stack-link mishap put its base on the branch above it, whose rebase then contained this head. Superseded by #9435, which sits in the correct stack position (#9419#9435#9421).

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

Labels

area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

1 participant