Skip to content

feat: add DC operating-point simulations#2682

Closed
ShiboSoftwareDev wants to merge 1 commit into
mainfrom
agent/operating-point-simulation
Closed

feat: add DC operating-point simulations#2682
ShiboSoftwareDev wants to merge 1 commit into
mainfrom
agent/operating-point-simulation

Conversation

@ShiboSoftwareDev

@ShiboSoftwareDev ShiboSoftwareDev commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes first-class DC operating-point simulation in @tscircuit/core.

  • adds simulationType="spice_dc_operating_point" and wall-clock timeout handling to <analogsimulation />
  • emits scalar voltage/current operating-point results and associates them with voltage probes/ammeters
  • adds <chip simulationBoundary /> so proprietary or out-of-scope ICs can intentionally terminate the analog model
  • requires unmodeled, non-boundary chips to produce a classified missing_model error
  • converts converter/engine failures into simulation_experiment_error records instead of aborting the render
  • classifies missing engines, unsupported built-in-engine analyses, timeouts, invalid netlists, non-convergence, and generic engine errors
  • preserves transient analysis defaults and existing delayed pulse injection (pulseDelay, rise/fall time, pulse width)
  • updates existing virtual-power-chip fixtures to declare their simulation boundary explicitly

The end-to-end test runs ngspice on a 5 V divider and verifies 5 V at VIN, 2.5 V at VOUT, and 2.5 mA through an ammeter. It includes a combined schematic/operating-point SVG snapshot.

Tests

  • bunx tsc --noEmit
  • bun run build
  • changed-file Biome check
  • focused simulation regression set: 6 passed
  • complete tests/features/spice-analysis run: 29 passed, 1 unrelated visual snapshot mismatch

The remaining visual mismatch is spice-analysis01-platform-config: its transient-result assertion passes, but the legacy schematic snapshot differs after the test emits its existing capacity-autorouter Unexpected numItems value: 0 error. This PR does not change that transient rendering path, so the unrelated snapshot was not refreshed.

Stack and merge order

  1. Schema/result contract: add operating-point simulation result schema circuit-json#646
  2. Public props: Add operating-point simulation props props#730
  3. .op netlist generation: Generate DC operating-point SPICE analyses circuit-json-to-spice#50
  4. ngspice execution/result conversion: Return scalar ngspice operating points ngspice-spice-engine#25
  5. SVG results and diagnostics: feat: render DC operating-point simulation results circuit-to-svg#622
  6. Core integration (this PR): feat: add DC operating-point simulations #2682

This draft intentionally targets the next package releases from the preceding PRs:

  • circuit-json@^0.0.449
  • @tscircuit/props@^0.0.578
  • circuit-json-to-spice@^0.0.45
  • @tscircuit/ngspice-spice-engine@^0.0.20
  • circuit-to-svg@^0.0.388

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Error Error Jul 14, 2026 6:24pm

Request Review

@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@github-actions

Copy link
Copy Markdown

This PR was closed because it has been inactive for 1 day since being marked as stale.

@github-actions github-actions Bot closed this Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant