Skip to content

refactor(engine): expose headless workspace contracts and drop in-process RPC - #275

Closed
KoEkko wants to merge 26 commits into
mainfrom
ekko/refactor-ecc-cli-integration
Closed

KoEkko wants to merge 26 commits into
mainfrom
ekko/refactor-ecc-cli-integration

Conversation

@KoEkko

@KoEkko KoEkko commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

What Changed

  • Move workspace create/update, configuration, step configuration, spec validation, and execution readiness into headless engine APIs so CLI and Studio share one contract.
  • Keep Project Manifest ownership in chipcompiler.project and expose load/create/mutate APIs that CLI reuses through compatibility aliases.
  • Publish committed analysis, signoff, and QoR scoring from the engine, including a shared scoring policy for headless assessment and CLI reports.
  • Remove the in-process RPC runtime (chipcompiler.runtime, ecc rpc, FastAPI/jsonrpcserver/uvicorn). Transport stays outside ECC.
  • Align CLI parameter filters with flow steps, keep read-only inspection side-effect free, and preserve rollback evidence on failed configuration updates.

Scope

Select the areas touched by this PR:

  • CLI - command behavior, Typer command surface, output formats, or workspace commands.
  • Flow/runtime - workspace lifecycle, EngineFlow, step execution, logs, metrics, or artifacts.
  • EDA integration - Yosys, ECC-Tools, DreamPlace, KLayout, PDKs, or native/runtime wrappers.
  • Build/package - Nix, PyInstaller, wheels, uv.lock, or release artifacts.
  • CI/release - GitHub Actions, version checks, changelog, or release automation.
  • Tests/docs only

Runtime And Packaging Impact

  • No runtime or packaging impact
  • CLI output or machine-readable contract changed
  • Workspace layout, flow state, or artifact paths changed
  • Native toolchain or wrapper behavior changed
  • ecc-tools or ecc-dreamplace dependency changed
  • PyInstaller, Nix, or release artifact changed

Notes:

  • Breaking: ecc rpc and chipcompiler.runtime are gone. Studio must use Runtime Adapter plus these headless APIs.
  • Packaging drops FastAPI, jsonrpcserver, pydantic, and uvicorn from pyproject.toml, uv.lock, Nix, and PyInstaller collection.
  • Workspace configuration still uses home/ecc.toml; failed updates restore the previous files under the workspace lock.

Validation

List the commands you ran. Mark checks that are not applicable as N/A.

  • uv run pytest test/
  • uv run ruff check chipcompiler test (scoped to changed engine/project/data/test paths)
  • uv run ruff format --check chipcompiler test (same scoped paths)
  • PyInstaller smoke: ecc --help, ecc --version, ecc version --json
  • Nix smoke: nix run .#cli -- --help
  • Manual flow smoke:
  • Other: uv run pytest -q test/engine test/project test/cli/params/test_flow_filters.py test/cli/params/test_workspace_commands.py test/cli/commands/test_signoff.py test/data/test_workspace.py test/data/test_workspace_config.py test/packaging/test_cli_entrypoint.py — 199 passed

Skipped checks and reason:

  • Full uv run pytest test/ not run in this pass; CI Test job covers the remaining suite.
  • PyInstaller and Nix smokes not run locally; packaging change is dependency removal plus ecc.spec resource collection, not CLI entrypoint behavior.

Checklist

  • I kept the change scoped to ECC.
  • I updated docs or user-facing CLI text where behavior changed.
  • I included lockfile or version metadata updates when dependencies changed.
  • I documented any submodule updates and why they are needed.
  • I did not include local caches, virtual environments, or generated build outputs.
  • I explained skipped validation and remaining risk.

Move the public parameter schema and workspace override helpers into the data layer while keeping CLI compatibility facades.
Preserve creator input modes, flow filters, read-only configuration and signoff assessment semantics across CLI and headless APIs.
Reuse the report scoring policy for headless assessments and expose the committed step callback contract.
Keep ECC headless and leave Runtime Adapter transport dependencies to Studio.
Keep manifest audit timestamps, tolerate forward-version QoR facts and malformed checklists, and map collector failures to the signoff domain error.
Keep the CLI import paths as module aliases while making Project APIs independent of CLI internals, add read-only workspace loading, and materialize config-target parameters.
@KoEkko
KoEkko marked this pull request as draft September 10, 2026 03:51
Keep configuration updates under an exclusive lock and recover from
on-disk backups instead of restoring file bytes from process memory.
Move fail thresholds, weights, and metric selection into qor_scoring.
CLI reports and Snapshot assessment call that module; stop documenting
a GUI port and a second threshold table.
Bring in #243 so the branch sits on current ECC main.
Studio rejects the whole snapshot QoR section when any analysis metric
uses category "power". Restore the canonical power_integrity mapping
and remap existing on-disk qor_metrics.json when assembling snapshots.
Studio reads std_cell/macro/io-pad metrics plus database_facts and
lvs_connectivity_summary from the snapshot. Emit those from existing
feature JSON, and reject STA when pdk.sdc is unset instead of crashing.
@Emin017

Emin017 commented Sep 10, 2026

Copy link
Copy Markdown
Member

Remove the in-process RPC runtime (chipcompiler.runtime, ecc rpc, FastAPI/jsonrpcserver/uvicorn). Transport stays outside ECC

So after this PR is merged, what will the new transport solution be?

@KoEkko KoEkko closed this Sep 10, 2026
@KoEkko

KoEkko commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

Remove the in-process RPC runtime (chipcompiler.runtime, ecc rpc, FastAPI/jsonrpcserver/uvicorn). Transport stays outside ECC

So after this PR is merged, what will the new transport solution be?

Transport is still stdio JSON-RPC; ownership just moves from ECC to the Studio Runtime Adapter. ECC keeps only the headless engineering APIs shared by the CLI and the Adapter.
Just like this.
image

@Emin017

Emin017 commented Sep 10, 2026

Copy link
Copy Markdown
Member

Transport is still stdio JSON-RPC; ownership just moves from ECC to the Studio Runtime Adapter. ECC keeps only the headless engineering APIs shared by the CLI and the Adapter. Just like this. image

So will the Studio Runtime Adapter be implemented in TypeScript in the ecos-studio repository?

@KoEkko

KoEkko commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

Python

@Emin017 Emin017 reopened this Sep 10, 2026
Sizer stores Timing Opt as timing_optimization_sizer. Snapshot analysis
fell back to Timing optimization_sizer, so Studio showed empty QoR,
layout, reports, and subflow for a successful step.
@KoEkko KoEkko closed this Sep 11, 2026
@KoEkko
KoEkko deleted the ekko/refactor-ecc-cli-integration branch September 14, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants