Skip to content

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

Merged
kube merged 8 commits into
mainfrom
cf/fe-1535-sweep-parameters-as-intervals-with-a-range-slider
Sep 3, 2026
Merged

FE-1535: Sweep parameters as intervals with a range slider#9396
kube merged 8 commits into
mainfrom
cf/fe-1535-sweep-parameters-as-intervals-with-a-range-slider

Conversation

@kube

@kube kube commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Important

Experimental
Behind the Parameter sweeps feature flag.

Summary

Before this PR, sweep parameters declared min, max, and a value count, five by default. Navigator computed one grid point at a time. Declaring the count was noise. Five points is too coarse to explore with.

Sweep now declares an interval only. Navigator selects a region of it with a range slider: whole interval by default, resizable, collapsible to a point. Region samples progressively. Drawer shows the merged distribution over it.

Links

Changes

UI

  • Navigator gets one RangeSlider per parameter

    RangeSlider is a new two-thumb @hashintel/ds-components component whose thumbs may coincide.
    Each slider carries a Range/Point control.
    Sweep navigator is its only user.
    Drags commit on release, so a gesture cancels at most one batch.

  • Status line counts sampled cells and runs for regions
  • Create drawer asks for min and max only

    200-combination cap and its warnings are gone.
    Sampling is lazy, nothing is enumerated up front.

  • Surface view samples an 11-position sub-grid per axis

    Sub-grid lives in the same quantized space.
    Other parameters hold at the middle of their selected range.
    Clicking the surface collapses both shown axes to a point at the clicked position.

Core

  • Range selection samples its region progressively

    enumerateRegionCells visits cells in a deterministic low-discrepancy order with Halton bases per axis.
    Session levels them rung by rung up the existing ladder.

  • Drawer merges every cached cell in the region

    Distribution takes shape after a few points and sharpens with coverage.

  • Point selection is a one-cell region and behaves as before
  • Intervals quantize internally with SWEEP_AXIS_STEPS = 50

    Integer parameters step by whole numbers. Cells are cached by quantized position, so returning a slider to an earlier position restores its cached runs and distributions.

  • Every batch still has one concrete value per parameter

    Per-batch scenario compilation, seeds, and GPU eligibility are untouched by range selections. Seeds stay common random numbers per rung.

Test coverage

  • parameter-grid.test.ts, sweep-session.test.ts:

    Quantization, region enumeration, leveling, cache reuse, and the widened-region merge.

How to test

  • Open Petrinaut preview on Vercel
  • Viewport controls > Settings > Simulation > Parameter sweeps
  • Load example > SIR
  • Simulate > Experiments > Create
  • Pick scenario, Sweep two numeric parameters, set min and max, Run
  • Expect one slider per swept parameter with a Range/Point control in the results drawer
  • Expect Range spanning its interval with two thumbs
  • Click Surface
  • Expect both parameters collapse to a point at the clicked position

@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
hash Ready Ready Preview Sep 3, 2026 4:26pm UTC
hashdotdesign-tokens Ready Ready Preview Sep 3, 2026 4:26pm UTC
petrinaut Ready Ready Preview Sep 3, 2026 4:26pm UTC
petrinaut-docs Ready Ready Preview Sep 3, 2026 4:26pm UTC

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 area/apps > hash.design Affects the `hash.design` design site (app) labels Aug 28, 2026
@kube
kube force-pushed the cf/fe-1535-sweep-parameters-as-intervals-with-a-range-slider branch from 806db09 to 2831dca Compare August 30, 2026 13:08
@kube
kube force-pushed the cf/fe-1535-sweep-parameters-as-intervals-with-a-range-slider branch from 2831dca to 6fb8473 Compare September 1, 2026 23:17
@kube
kube force-pushed the cf/fe-1535-sweep-parameters-as-intervals-with-a-range-slider branch from 6fb8473 to 93487d6 Compare September 2, 2026 15:04
@kube
kube force-pushed the cf/fe-1535-sweep-parameters-as-intervals-with-a-range-slider branch from 93487d6 to 150aa11 Compare September 2, 2026 16:12
YannisZa
YannisZa previously approved these changes Sep 3, 2026
@kube
kube added this pull request to the merge queue Sep 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a manual request Sep 3, 2026
@kube
kube force-pushed the cf/fe-1535-sweep-parameters-as-intervals-with-a-range-slider branch from 6b793d7 to 2c11d86 Compare September 3, 2026 13:03
@kube
kube requested a review from TimDiekmann September 3, 2026 13:03
TimDiekmann
TimDiekmann previously approved these changes Sep 3, 2026

@TimDiekmann TimDiekmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-approval of pre-rebase

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2c11d86. Configure here.

Comment thread libs/@hashintel/petrinaut/src/react/experiments/sweep-session.ts
Comment thread libs/@hashintel/petrinaut/src/react/experiments/sweep-session.ts
@hash-release hash-release Bot mentioned this pull request Sep 3, 2026
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/apps area/deps Relates to third-party dependencies (area) 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.

4 participants