Skip to content

FE-1546: Stream range sweeps as one stochastic simulation - #9419

Draft
kube wants to merge 2 commits into
cf/fe-1536-contour-surface-for-optimization-studies-with-localfrom
cf/fe-1546-stream-range-sweeps-as-one-stochastic-simulation-over-the
Draft

FE-1546: Stream range sweeps as one stochastic simulation#9419
kube wants to merge 2 commits into
cf/fe-1536-contour-surface-for-optimization-studies-with-localfrom
cf/fe-1546-stream-range-sweeps-as-one-stochastic-simulation-over-the

Conversation

@kube

@kube kube commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

A sweep's range selection sharded the region into quantized grid points and computed one small batch per point — slow (a scenario compile and batch per point, breadth-first leveling) and not what a range means. A range selection now runs as one stochastic simulation over the ranges: every run draws its own value per ranged parameter, the whole worker pool computes it, and the metric distribution over the region streams from the first frames.

🔗 Related links

🔍 What does this change?

  • sweep-session.ts rebuilt around selections: a point runs at its value (ladder, GPU-eligible, unchanged); a range emits one batch per ladder rung whose runs carry per-run parameter values (sweepRangeRuns) — drawn continuously inside the selected value interval (the slider's quantized positions bound the interval, they do not grid it), low-discrepancy per axis and prefix-stable in the global run index, so a rung extends the exact sequence earlier rungs drew and the cache never goes stale. The cache keys whole selections; a point is a degenerate range, so the surface's per-point sampling shares it.
  • ExperimentRequest.runs: per-run overrides now flow through the backend layer; the simulator, the experiment runtime, and per-shard slicing already supported them. The worker-pool backend forwards them; the WebGPU backend explicitly refuses requests with per-run values (its shader bakes parameters in) with a clear blocker.
  • The provider routes range batches straight to a full-shard CPU pool — no backend walk, full parallelism — while point batches keep the chosen backend (GPU included).
  • Scenario compilation needs one value per parameter, so an initial state derived from a ranged parameter holds at the range's value-space midpoint while runtime reads vary per run; documented in the user guide and arch page.
  • The navigator status reads "N of M runs — sampling across the selected ranges"; the per-cell counters are gone from the sweep state.

14 sweep-session tests pin the new contract: one batch per rung with drawn runs inside the value bounds, prefix stability across rungs, point selections sending no per-run values, range revisits resuming mid-ladder with the identical drawn sequence, and distinct selections caching apart.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an existing block or library which will be updated (@hashintel/petrinaut, @hashintel/petrinaut-core; patch changeset included)

📜 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

🤖 Generated with Claude Code

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

vercel Bot commented Aug 28, 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 28, 2026 8:21pm
petrinaut Ready Ready Preview Aug 28, 2026 8:21pm
petrinaut-docs Ready Ready Preview Aug 28, 2026 8:21pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 28, 2026 8:21pm

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 28, 2026
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