Skip to content

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

Draft
kube wants to merge 1 commit into
cf/fe-1546-stream-range-sweeps-as-one-stochastic-simulation-over-thefrom
cf/fe-1549-randomize-sweep-parameter-draws-with-a-seed-derived-shift
Draft

FE-1549: Rotate sweep parameter draws by a seed-derived shift#9435
kube wants to merge 1 commit into
cf/fe-1546-stream-range-sweeps-as-one-stochastic-simulation-over-thefrom
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
@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
@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 Ready Ready Preview Aug 30, 2026 1:22pm
petrinaut Ready Ready Preview Aug 30, 2026 1:22pm
petrinaut-docs Ready Ready Preview Aug 30, 2026 1:22pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 30, 2026 1:22pm

Request Review

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