FE-1686: Stream a sweep's first GPU point by probing after start and sharing one setup across its points - #9665
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
f061eb5 to
3fe57fb
Compare
3fe57fb to
a6e0be2
Compare
a6e0be2 to
2f2669c
Compare
PR SummaryMedium Risk Overview Adds For parameter sweeps, every batch now carries swept net parameters in the per-run buffer ( Reviewed by Cursor Bugbot for commit 129492d. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟡 Changes recommended
Sweep dependency detection misses cross-axis expressions, failed probes can trigger duplicate concurrent probes, and required changesets are absent.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Moves WebGPU calibration into the run phase for immediate streaming and reuses GPU setup across sweep points.
Changes:
- Adds streamed, shared GPU calibration with cached-calibration growth.
- Sends swept parameters through per-run buffers.
- Updates tests and user/architecture documentation.
File summaries
| File | Description |
|---|---|
libs/@local/petrinaut-arch-docs/content/simulation/gpu-capacity-calibration.mdx |
Documents run-phase and shared calibration. |
libs/@local/petrinaut-arch-docs/content/experiments/sweep-orchestration.mdx |
Documents uniform sweep buffers. |
libs/@local/petrinaut-arch-docs/content/experiments/parameter-sweeps.mdx |
Documents GPU setup reuse. |
libs/@local/petrinaut-arch-docs/content/experiments/backend-selection.mdx |
Clarifies runtime probe failures. |
libs/@local/petrinaut-arch-docs/content/diagrams/gpu-capacity-calibration.d2 |
Updates calibration failure flow. |
libs/@hashintel/petrinaut/src/react/experiments/provider/sweep-batch-instantiation/sweep-run-overrides.ts |
Derives and builds sweep run plans. |
libs/@hashintel/petrinaut/src/react/experiments/provider/sweep-batch-instantiation/sweep-run-overrides.test.ts |
Tests sweep parameter plans. |
libs/@hashintel/petrinaut/src/react/experiments/provider/sweep-batch-instantiation.ts |
Applies uniform plans to batches. |
libs/@hashintel/petrinaut/src/react/experiments/provider.tsx |
Supplies sweep axes. |
libs/@hashintel/petrinaut/docs/experiments.md |
Updates user-facing GPU behavior. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-experiment-handle/shared-calibration.ts |
Coordinates in-flight probes. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-experiment-handle/shared-calibration.test.ts |
Tests calibration sharing. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-experiment-handle/run-phase.ts |
Orchestrates probe and run phases. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-experiment-handle/run-phase.test.ts |
Tests run-phase sequencing. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-experiment-handle/calibration.ts |
Adds probe metadata and slab floors. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-experiment-handle/calibration.test.ts |
Tests revised calibration behavior. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-experiment-handle/calibration.test-helpers.ts |
Shares calibration test fixtures. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-experiment-handle.ts |
Runs and shares calibration after start. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-experiment-handle.test.ts |
Tests concurrent handle behavior. |
libs/@hashintel/petrinaut-core/src/webgpu/gpu-backend-cache.test.ts |
Tests setup-key reuse. |
libs/@hashintel/petrinaut-core/src/webgpu/backend.ts |
Stores in-flight calibration state. |
Review details
- Files reviewed: 21/21 changed files
- Comments generated: 3
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2f2669c. Configure here.
2f2669c to
7f6a3c8
Compare
…nt selections share the GPU setup
…e and share the GPU handle test builders
… batch probes again
…ion for later batches
4599a62 to
129492d
Compare

Important
Experimental
Behind the WebGPU and Parameter sweeps feature flags.
Summary
Before this PR, the first point a sweep computed on the GPU showed nothing until it was done, while every later rung of the same point streamed from its first chunk. Two causes compounded. The derived-capacity probe ran while the experiment handle was being created, before anything subscribed to its metrics store, so its frames surfaced as one complete picture once the handle existed. And a point selection carried no per-run parameter buffer, so every swept value was baked into the shader and its cache key: each parameter change destroyed the device, recompiled the shader and probed from scratch, paying the first cause again.
This PR moves the probes into the run phase, after
start(), so their chunks stream like the attempt's, and carries a sweep's swept parameters through the per-run buffer for every selection, so all points of a sweep share one compiled shader, one device and one calibration. Rungs that start on the same marking share a single in-flight probe, and a shared calibration that a new point outgrows grows once and re-probes from the grown slabs. Measured on real WebGPU, the first frames of a fresh point now draw within about 50 to 160 ms of the click on every bundled model tried, against 250 to 450 ms and a full-picture jump before; a parameter change no longer destroys or requests a device.9665.mp4
Links
Changes
GPU handle
start()slabsFromProbesizes its heavy-tail arena check from the uncapped observationSweep batches
Review fixes
Known issues
Next steps
maxTimeTest coverage
run-phase.test.ts:shared-calibration.test.ts:gpu-experiment-handle.test.ts:calibration.test-helpers.ts:gpu-backend-cache.test.ts:sweep-run-overrides.test.ts:How to test
launch_rateandsatellite_initial_altitude, Add metric > Place tokens > Run