Skip to content

FE-1535: Sweep parameters as intervals with a range slider - #9396

Draft
kube wants to merge 1 commit into
cf/fe-1534-run-storybook-against-the-real-optimizer-servicefrom
cf/fe-1535-sweep-parameters-as-intervals-with-a-range-slider
Draft

FE-1535: Sweep parameters as intervals with a range slider#9396
kube wants to merge 1 commit into
cf/fe-1534-run-storybook-against-the-real-optimizer-servicefrom
cf/fe-1535-sweep-parameters-as-intervals-with-a-range-slider

Conversation

@kube

@kube kube commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

A sweep parameter declared min, max, and a value count (default 5), and the navigator computed one grid point at a time. Declaring the count was noise and five points is too coarse to explore with. A sweep now declares an interval only, and the navigator selects a region of it with a range slider — the whole interval by default, resizable, collapsible to a point.

🔗 Related links

🔍 What does this change?

  • Intervals quantize internally (SWEEP_AXIS_STEPS = 50; integer parameters step by whole numbers) — fine enough that returning a slider to an earlier position restores that position's cached runs and distributions, since cells are cached by quantized position.
  • A range selection samples its region progressively: enumerateRegionCells visits the region's cells in a deterministic low-discrepancy order (Halton bases per axis), the session levels them rung by rung up the existing ladder, and the drawer shows the merge of every cached cell in the region — the distribution over the region takes shape after a few points and sharpens with coverage. A point selection is a one-cell region and behaves exactly as before.
  • Every batch still has one concrete value per parameter, so per-batch scenario compilation, seeds (common random numbers per rung, unchanged), and GPU eligibility are untouched by range selections.
  • The navigator becomes one RangeSlider per parameter (new two-thumb ds-components component whose thumbs may coincide) with a Range/Point control; drags commit on release so a gesture cancels at most one batch. The status line counts sampled cells and runs for regions.
  • The create drawer asks for min and max only; the 200-combination cap and its warnings are gone (sampling is lazy, nothing is enumerated up front).
  • The surface view samples an 11-position sub-grid per axis of the same quantized space, holds other parameters at the middle of their selected range, and clicking it collapses both shown axes to a point at the clicked position.

🐾 How to test

Storybook → Simulate / SimulateView → "Parameter sweep": both sliders render with Range/Point controls; switching transmission_rate to Range spans 0.1 – 0.5 with two thumbs; clicking the surface collapses both parameters to a point at the clicked position (verified live, plus 25 parameter-grid and 12 sweep-session unit tests covering quantization, region enumeration, leveling, cache reuse, and the widened-region merge).

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an existing block or library which will be updated (@hashintel/petrinaut, @hashintel/ds-components; patch changesets 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 2:44am
hashdotdesign-tokens Ready Ready Preview Aug 28, 2026 2:44am
petrinaut Ready Ready Preview Aug 28, 2026 2:44am
petrinaut-docs Ready Ready Preview Aug 28, 2026 2:44am

Request Review

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

Labels

area/apps > hash.design Affects the `hash.design` design site (app) 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