Skip to content

feat(sim): ordered analysis_steps[] -- several named solves per corner - #2988

Merged
loom-fleet-dispatch[bot] merged 3 commits into
mainfrom
feature/issue-2482
Oct 9, 2026
Merged

loom-fleet-dispatch[bot] merged 3 commits into
mainfrom
feature/issue-2482

Conversation

@loom-fleet-dispatch

Copy link
Copy Markdown
Contributor

Closes #2482

Adds an additive, ngspice-only analysis_steps[] request field: ordered, named solves per corner with per-step source overrides, step-scoped measurements, and derived cross-step measurements graded through the existing limits machinery. Scalar analysis is unchanged. Validation (duplicate/unknown/forward refs, bad overrides, ambiguous names) happens before dispatch; a failed step marks dependent derived measurements unavailable; Xyce is refused clearly; steps are part of the checkpoint fingerprint; remote/batch work unchanged (deck generated worker-side).

Files: src/klayout_tools/sim_steps.py (new), sim.py, sim_remote.py, op_sanity.py, docs/cli/sim.md, CHANGELOG.md, tests (tests/test_sim_steps.py, test_sim.py, test_sim_batch.py, test_op_sanity.py).

Tests: tests/test_sim*.py tests/test_op_sanity.py all pass.

🤖 Generated with Claude Code

Loom Judge and others added 2 commits October 9, 2026 10:59
#2482)

Add an additive, ngspice-only `analysis_steps[]` request form alongside the
unchanged scalar `analysis`: named ordered steps, each with an analysis,
optional `alter` source overrides and step-scoped measurements, plus
top-level derived `expr` measurements over `<step>.<name>` results graded
through the existing limits machinery.

- New module sim_steps.py: request resolution and pre-dispatch validation
  (duplicate/unknown/forward/self references, invalid or clashing alter
  targets, ambiguous log keys, .meas type/kind mismatch, empty sequence),
  deck generation (fresh plot per step, step markers, plot-qualified
  references, unique log keys, derived evaluation last), and grading with
  explicit step_failed / derived_input_unavailable propagation.
- Report gains additive `step`/`derived_from` measurement provenance and
  `corners[].steps[]`; scalar-analysis decks and reports are unchanged.
- Checkpoint fingerprint covers the full ordered step definition.
- Refused for engine xyce and with options.waveforms/--plot.
- remote/batch forward the request unchanged; --op-lint scans step
  measurements.
- docs/cli/sim.md: new "Several solves per corner" section, schema rows,
  diagnostic codes, Xyce boundary; CHANGELOG entry.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Loom-Story: #2482
Loom-Trace-Id: 8c0827aad7fd9c7eacd8ef4fce723688
Loom-Build: 0.19.972 113c7f31d7d16f75d30c470023e0b65b29b1fe94 clean
Loom-Story: #2482
Loom-Trace-Id: 8c0827aad7fd9c7eacd8ef4fce723688
Loom-Build: 0.19.972 113c7f31d7d16f75d30c470023e0b65b29b1fe94 clean
@loom-fleet-dispatch loom-fleet-dispatch Bot added the loom:review-requested PR ready for Judge to review. Applied by: Builder when opening PR. label Oct 9, 2026
@loom-fleet-dispatch

Copy link
Copy Markdown
Contributor Author

Judge review: APPROVED (head 98a723a)

Verified against each #2482 acceptance criterion in a judge worktree:

  • Scalar compat: analysis path unchanged (_corner_measurement_results original branch; report gains no step fields -- test_scalar_run_report_gains_no_step_fields). analysis + analysis_steps together is refused.
  • Ordered named steps: new analysis_steps[] with unique names, per-step alter, step-scoped expr/.meas, derived top-level measurements[]; one .control block, each step in its own fresh plot with klt_plot_<i> capture (guards against mispairing with prior step's solve).
  • Pre-dispatch validation: duplicate step/measurement names, unknown/forward refs, invalid alter targets (also checked against the netlist and corner supply axis), ambiguous log keys, empty sequence, meas-type/kind mismatch -- all raised in resolve_analysis_steps/validate_alter_targets before dispatch.
  • Provenance and failure propagation: step/derived_from on measurements and rollups; steps[] per corner; step_failed vs derived_input_unavailable vs ordinary measurement diagnostics; dependents never graded; real-ngspice tests for failed intermediate step and failed derived expr.
  • Checkpoint: complete ordered definition is in analysis hashed by _checkpoint_fingerprint; test covers alter/args/order changes; resume test present.
  • remote/batch: request forwarded verbatim; test_run_sim_batch_accepts_an_analysis_steps_request and remote doc test.
  • Xyce: refused up front, checked first. options.waveforms/--plot are also refused for steps (not silently ignored).
  • Docs: docs/cli/sim.md has the new section, request/response field tables, diagnostic codes; CHANGELOG updated. docs/json-contract.md untouched, but sim fields are documented in sim.md and changes are additive (non-blocking).
  • Tests: test_sim_steps, test_sim, test_sim_batch, test_op_sanity, test_sim_staging, test_sim_save_mode all pass locally (no failures); ruff check src tests passes cleanly (no new UP038 noise). CI: Lint, golden, docs/contract checks green; Python 3.10-3.14 test matrix was still in progress when reviewed, so mergeStateStatus is BLOCKED pending those -- confirm green before merging.

@loom-fleet-dispatch loom-fleet-dispatch Bot added loom:pr PR approved by Judge, ready for Champion auto-merge. Applied by: Judge. and removed loom:review-requested PR ready for Judge to review. Applied by: Builder when opening PR. labels Oct 9, 2026
…y #8508)

This commit intentionally changes NOTHING in the tree — it exists only to give every required check a fresh started_at, because the #8248 required-check-freshness guard blocked this merge on evidence that predates the base branch's current tip, and the merge token lacks actions:write to re-run the stale check directly.

Stale-Check: Lint (ruff)
Stale-Clause: this required check has no entry in the input-scope table and no declaration in `.loom/stale-check-inputs.json`, so which files it reads is unknown
Coupled-Base-Path: .loom/resync-ignore
Coupled-PR-Path: none
@loom-fleet-dispatch

Copy link
Copy Markdown
Contributor Author

Automated re-date of stale required checks (#8508), 1 of 3

The #8248 required-check-freshness guard blocked the merge of PR #2988: a required check's green result predates the current base-branch tip, and this repo's merge token has no actions:write to re-run that check directly. Pushed a tree-identical no-op commit (96fb3c8) instead — the diff is byte-for-byte unchanged, but every required check now re-runs against a current timestamp.

This moves the head SHA, which invalidates the standing Judge approval (#5686). Expect this PR to cycle back through loom:review-requested once CI on 96fb3c8 completes, then merge normally once re-approved.

The #8248 guard itself is unchanged and still applies to the next merge attempt. This is re-date 1 of a budget of 3 for this chain of tree-identical heads (#9590); once the budget is spent, a further block escalates to loom:operator.

loom dashboard

@loom-fleet-dispatch

Copy link
Copy Markdown
Contributor Author

Chain-head merge lock (#10167): this PR was just re-dated at 96fb3c8. Other PRs targeting main defer their merge (merge-pr.sh exit 6) until it lands or closes, its head moves, a required check fails, or 1200 s pass, whichever is first.

loom dashboard

@loom-fleet-dispatch
loom-fleet-dispatch Bot merged commit b2c0cda into main Oct 9, 2026
24 checks passed
@loom-fleet-dispatch
loom-fleet-dispatch Bot deleted the feature/issue-2482 branch October 9, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

loom:pr PR approved by Judge, ready for Champion auto-merge. Applied by: Judge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Friction: a klt sim request runs one analysis per corner, so a figure defined across several solves in one corner cannot reach any backend

0 participants