Skip to content

feat(submit): pack design + pins.lock + manifest into a single bundle.zip#165

Merged
lanserge merged 8 commits intomainfrom
feat/bundle-zip-submit
Apr 29, 2026
Merged

feat(submit): pack design + pins.lock + manifest into a single bundle.zip#165
lanserge merged 8 commits intomainfrom
feat/bundle-zip-submit

Conversation

@lanserge
Copy link
Copy Markdown
Contributor

@lanserge lanserge commented Apr 29, 2026

Summary

  • Replaces the two-part rtlil + config multipart submit with a single bundle part carrying bundle.zip. Inside the zip:
    • manifest.json — the only contract; consumers locate payloads through it.
    • <design basename> — e.g. top.il, taken from rtlil_path.
    • pins.lock — the pinlock JSON (pinlock.model_dump_json).
  • Manifest fields: version: "1", project (from [chipflow] project_name), process and package (from [chipflow.silicon]), design_file and pins_lock_file (zip-relative paths). Keys whose value names a file inside the archive carry a _file suffix.
  • Dry-run writes bundle.zip next to the rtlil (Path(rtlil_path).parent), so it lands inside amaranth's build folder rather than the user's CWD.

Why a single bundle

One uniform shape on the wire, on disk, and in storage. The manifest is the indirection point — adding macro folders later (rebased PR #163) is purely additive: new _file keys + new folders, no wire-format change. Reproducibility win too: the bundle is a single self-describing artifact you can replay months later.

Files

  • chipflow/platform/silicon_step.py+_build_bundle_zip helper; rewritten dry-run + submit blocks.
  • tests/test_silicon_submit.py — kept the 3 browser-prompt tests (mocking the helper); added TestBuildBundleZip (manifest shape, real-filename preservation) and TestSiliconSubmitBundlePost (asserts the multipart payload is {"bundle": ("bundle.zip", bytes, "application/zip")}).

Cross-repo PRs

  • chipflow-api (v1, production): ChipFlow/chipflow-api#20
  • chipflow-backend: ChipFlow/chipflow-backend#302
  • chipflow-api-v2 (parked, draft): ChipFlow/chipflow-api-v2#2

End-to-end validation

Real submission against chipflow-api-staging with backend image branch-feat-bundle-zip-submit: build 0620ceda-c829-4142-94c3-42f8abe9c518 ran the full IHP SG13G2 synth + P&R flow to status="completed".

Test plan

  • pytest --ignore=tests/test_cli_integration.py — 65 passed, 10 skipped (pre-existing CLI-integration skips).
  • ruff check clean on chipflow/ and tests/.
  • End-to-end against the staging API + bundle-aware backend, completed.

The submit endpoint receives one multipart 'bundle' part instead of
separate 'rtlil' and 'config' parts. Inside the zip:

  manifest.json           {"version": "1", "rtlil": "...", "config": "pins.lock"}
  <rtlil basename>        e.g. top.il, taken from rtlil_path
  pins.lock               the pinlock JSON

The manifest is the only contract; consumers locate the rtlil and
config payloads through it. This lays the groundwork for adding macro
folders later by extending the manifest, with no further wire-format
change.
Adds the chipflow.toml [chipflow] project_name to manifest.json under a
"project" key so the backend can identify the design without parsing
the config payload (useful for log lines, working-directory naming,
and dashboards).
Drops the artifact next to amaranth's build output (Path(rtlil_path).parent)
instead of the current working directory, so it lands inside the project's
build folder alongside the rtlil it was packed from.
The key now matches what the value actually points to (pins.lock).
Leaves room for adding other config-like files later without overloading
a generic "config" key.
Renames manifest keys whose value names a file in the archive:
"rtlil" -> "rtlil_file", "pins_lock" -> "pins_lock_file". Plain value
keys ("version", "project") stay as-is. Makes the role of each key
self-documenting and unambiguous as the manifest grows.
The manifest key now describes the role (the design's intermediate
representation) rather than the format. Lets the same key carry rtlil
today and another intermediate (Verilog, FIRRTL) tomorrow without
another rename. The function still takes an rtlil_path parameter
because that's what the caller actually has on hand from amaranth.
Adds chipflow.toml [chipflow.silicon] process value (e.g. "sky130",
"gf180") under a "process" key in manifest.json. The backend uses it to
pick the right PDK / flow without re-parsing the pinlock.

The pre-existing browser-prompt tests grew a real silicon.process.value
on their config mock to satisfy the new attribute access.
Adds chipflow.toml [chipflow.silicon] package value (e.g. "cf20") under
a "package" key in manifest.json. Together with "process", lets the
backend pick the right PDK + package combination without re-parsing
the pinlock.
@github-actions
Copy link
Copy Markdown

Tests Skipped Failures Errors Time
86 10 💤 0 ❌ 0 🔥 34.037s ⏱️

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-29 22:16 UTC

@lanserge lanserge marked this pull request as draft April 29, 2026 18:00
@lanserge lanserge marked this pull request as ready for review April 29, 2026 22:02
@lanserge lanserge merged commit 205c96d into main Apr 29, 2026
6 checks passed
@lanserge lanserge deleted the feat/bundle-zip-submit branch April 29, 2026 22:14
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.

1 participant