Skip to content

FE-1536: Contour surface for optimization studies with local recompute - #9398

Draft
kube wants to merge 1 commit into
cf/fe-1535-sweep-parameters-as-intervals-with-a-range-sliderfrom
cf/fe-1536-contour-surface-for-optimization-studies-with-local
Draft

FE-1536: Contour surface for optimization studies with local recompute#9398
kube wants to merge 1 commit into
cf/fe-1535-sweep-parameters-as-intervals-with-a-range-sliderfrom
cf/fe-1536-contour-surface-for-optimization-studies-with-local

Conversation

@kube

@kube kube commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

The Optuna-style contour surface existed only in the Experiments drawer. An optimization study is where it matters most: it already declares bounded parameters and an objective, and its trials stream back with parameter and objective values. This adds a Surface section to the optimization detail drawer — the study's trials drawn as markers over a contour computed locally, navigable by sliders and clicks, streaming the objective's mean and median at the selected point.

🔗 Related links

🔍 What does this change?

  • sampleDetachedObjective on the experiments context: local compute against an arbitrary net snapshot on a serialized single-worker lane. Compilation (HIR artifacts + scenario HIR) is cached per study; the objective runs as an expression metric; booleans coerce to the engine's 0/1 encoding. This exists because a study must run its frozen input.model.definition, not the live editor net — the two drift the moment the user edits after launching.
  • react/optimizations/surface-grid.ts: quantized axes from the study's domains — log-scale domains quantize in log space, integer domains snap to their declared step (7 unit tests).
  • optimization-surface.tsx in the drawer after Steps, gated on two non-boolean optimized parameters: X/Y pickers, one slider per optimized parameter (initialized from the best trial, else the domain midpoint), a coarse-to-fine local sampling walk feeding the contour, per-position caching with ladder seeds (common random numbers, same rule as sweeps), a readout streaming the objective's mean · median · runs for the selected point, the study's completed trials as rings (best highlighted) projected the way Optuna's plot_contour projects, and click-to-navigate.
  • The DS Slider gains step and onChangeEnd pass-throughs.
  • User guide (optimization.md "The surface view") and the arch-docs sweep-surface page gain the optimization-surface story; patch changesets for both packages.

Verified live in the "Run Supply Chain optimization" story: a 100-trial fake study streamed in, the Surface section rendered with sliders at the best trial's values, the trial rings drew across the plane, and real local simulations of the frozen snapshot landed points that filled the contour.

Known follow-up (in the ticket): local batches queue on one serialized lane, so on heavy nets the selected point's readout can wait behind walk cells — it should jump the queue.

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 3:20am
hashdotdesign-tokens Ready Ready Preview Aug 28, 2026 3:20am
petrinaut Ready Ready Preview Aug 28, 2026 3:20am
petrinaut-docs Ready Ready Preview Aug 28, 2026 3:20am

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