Skip to content

Improve decoupling capacitor layout#80

Open
grantf04 wants to merge 3 commits into
tscircuit:mainfrom
grantf04:grantf04/decoupling-cap-layout
Open

Improve decoupling capacitor layout#80
grantf04 wants to merge 3 commits into
tscircuit:mainfrom
grantf04:grantf04/decoupling-cap-layout

Conversation

@grantf04
Copy link
Copy Markdown

@grantf04 grantf04 commented May 9, 2026

Summary

  • detect decoupling caps from circuit-json style inputs that omit rotation metadata and net flags, including one-hop strong pin connections to power nets
  • bypass generic packing for decoupling_caps partitions and place caps in a deterministic centered row with the configured decap gap
  • preserve inferred one-hop power/ground nets when creating cap-only partitions so later partition packing still has the right net pads
  • add focused row-layout, partition net-preservation, and RP2040 integration regression coverage
  • keep the decap detection unit test independent from the Cosmos page/render stack so CI exercises the solver directly

/claim #15

Tests

  • npx --yes bun test tests/ChipPartitionsSolver.test.ts tests/IdentifyDecouplingCapsSolver/IdentifyDecouplingCapsSolver06.test.ts tests/PackInnerPartitionsSolver/SingleInnerPartitionPackingSolver.test.ts tests/LayoutPipelineSolver/RP2040Circuit.test.ts
  • npx --yes bun test
  • npx --yes bun run format:check
  • npx --yes tsc --noEmit
  • npx --yes bun run build

Review feedback addressed

  • preserved inferred one-hop decoupling-cap net connections inside cap-only partitions before downstream packing

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

@grantf04 is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d11c2e0a79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +151 to +156
for (const [netConnKey, isNetConnected] of Object.entries(
this.inputProblem.netConnMap,
)) {
if (!isNetConnected) continue
const [p, n] = netConnKey.split("-") as [PinId, NetId]
if (p === connectedPinId) nets.add(n)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve inferred one-hop nets in cap partitions

When a cap pin only gets its power net through the newly added one-hop strong connection path, that inferred net exists only inside getNetIdsForPin; ChipPartitionsSolver.createInputProblemFromPartition later copies only direct netConnMap entries for the cap pins and drops the strong edge to the main chip because the main chip is excluded from the decap partition. In those inputs, the cap is identified and moved into a decoupling_caps partition, but its inherited V/GND network is absent from the partition passed to PartitionPackingSolver, so the final partition packing cannot align that decap row to the corresponding power net.

Useful? React with 👍 / 👎.

@grantf04
Copy link
Copy Markdown
Author

grantf04 commented May 9, 2026

Addressed the automated review feedback in 14c0e62: decap partitions now preserve inferred one-hop V/GND net connections from the main chip, with a regression test in ChipPartitionsSolver.test.ts. Full bun test, format, type-check, and build pass locally and GitHub Actions are green.

@grantf04
Copy link
Copy Markdown
Author

grantf04 commented May 9, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@grantf04
Copy link
Copy Markdown
Author

grantf04 commented May 9, 2026

Follow-up on the remaining red status: the only failing check is Vercel asking a tscircuit team member to authorize this fork deployment. The repo-owned CI checks are green: test, format-check, and type-check. I do not see a code-side failure to address there.

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