Skip to content

estimate.ts: size scriptless problem_spec solves from typed spec fields (drop the Julia-source regexes) #342

Description

@aarontrowbridge

Roadmap context: vault plan `plan-20260812-142100-problemspecs-issimo-roadmap` (W2.3).

The problem

`packages/amico-run/src/estimate.ts` scrapes `N`/`levels` out of Julia source with regexes (`extractKeyVars`) — and rejects scriptless `problem_spec` solvespecs outright ("no script to size"). Once Phase 3 (#340) makes spec-authored solves the default path, the estimator must not be the step that still demands a script.

Tasks

  • When the solvespec carries `problem_spec`, parse it (smol-toml) and read the typed fields: `problem.N`, `system.params.levels` (per-component for composites), `pulse.T`, trajectory kind (unitary vs ket vs density drives the dimension scaling), wrapper count (sampling multiplies).
  • Emit the same `{sizeClass, estimatedBytes, localRamBytes, offloadSuggested, reason}` JSON contract — the estimator's output shape is unchanged; only the input adapter is new.
  • Keep the regex path for script solves (free tier isn't going away); share the size model between both adapters.
  • Fixtures: minimal/rich/wrapped problemspec TOMLs from `packages/schema/test/fixtures` reused as estimator inputs.

Acceptance

  • `amico-run estimate` on a scriptless `problem_spec` solvespec prints the standard estimate JSON; numbers match the script-path estimate for an equivalent authored script within the model's own tolerance.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions