Skip to content

test: reproduce AM3352 power probe Circuit JSON import failure - #4851

Closed
rushabhcodes wants to merge 5 commits into
mainfrom
repro/testpoint-circuit-json-roundtrip
Closed

rushabhcodes wants to merge 5 commits into
mainfrom
repro/testpoint-circuit-json-roundtrip

Conversation

@rushabhcodes

@rushabhcodes rushabhcodes commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Importing saved Circuit JSON containing a native <testpoint /> throws No inflator implemented for source component ftype: "simple_test_point".

Reproduce #4525 with the AM3352 SBC's USB-C 5 V output probe, extracted from the pinned power-supply design. The fixture keeps C_PD_OUT (10 µF, 0805), TP_5V (1.5 mm pad), their 5 mm spacing, and their VIN_5V connections. Both parts are translated together to center the excerpt on a small board. Only this power-net connection is included; routing is generated locally for the excerpt.

A test.failing regression checks that the saved probe, ports, net connections, copper, and silkscreen survive importing. A separate passing visual test requires the exact missing-inflator exception and verifies the source has real routed copper and no circuit errors, so an unrelated failure cannot satisfy the reproduction.

Validation: both reproduction tests pass on unchanged production code with Bun 1.4.2; the paired SVG was rendered and inspected.

First layer of native GitHub stack, followed by fix #4852. Matching branches are also published in rushabhcodes/core.

AM3352 power probe and the failed import

Copilot AI balanced review requested due to automatic review settings October 22, 2026 16:21
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
tscircuit-core-benchmarks Ready Ready Preview Oct 28, 2026 4:14am UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@rushabhcodes
rushabhcodes added this pull request to stack #4853 October 22, 2026 16:23
@rushabhcodes rushabhcodes changed the title test: reproduce native testpoint Circuit JSON import failure test: reproduce AM3352 power probe Circuit JSON import failure Oct 22, 2026
Comment on lines +1 to +57
import { getTestFixture } from "./get-test-fixture"

export const getTestPointInflationFixture = async () => {
const { circuit: original } = getTestFixture()
// Power-output probe from the AM3352 SBC's USB-C PD supply:
// https://github.com/tscircuit/am3352-sbc/blob/bc85a52da8dcad023a3721ca9c90f7a9d29ea3d6/design/pd-power.tsx
// nets.tsx expands Cap to an 0805 capacitor with pin1 on VIN_5V.
// Extract only the VIN_5V probe connection; the capacitor's GND connection
// and the rest of the power supply are outside this regression.
// Keep the original names, values, pad size and 5 mm spacing; translate both
// parts by (+35.5, +18) mm to center this excerpt on a small test board.
// Route only this extracted circuit locally, then import its saved copper.
original.add(
<board width={14} height={8}>
<capacitor
name="C_PD_OUT"
capacitance="10uF"
footprint="0805"
pcbX={-2.5}
/>
<testpoint
name="TP_5V"
footprintVariant="pad"
padDiameter={1.5}
pcbX={2.5}
/>
<trace from=".C_PD_OUT > .pin1" to="net.VIN_5V" />
<trace from=".TP_5V > .pin1" to="net.VIN_5V" />
</board>,
)
await original.renderUntilSettled()

const { circuit: imported } = getTestFixture()
let importError: Error | undefined
try {
imported.add(
<board
width={14}
height={8}
routingDisabled
circuitJson={original.getCircuitJson()}
/>,
)
await imported.renderUntilSettled()
} catch (error) {
if (
!(error instanceof Error) ||
error.message !==
'No inflator implemented for source component ftype: "simple_test_point"'
) {
throw error
}
importError = error
}

return { original, imported, importError }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

File naming inconsistency: The fixture file is named get-testpoint-inflation-fixture.tsx but the exported function is getTestPointInflationFixture. The file name uses testpoint (no camel-case boundary between 'test' and 'point'), while the export name uses TestPoint (with a capital P). For consistency, the file should be named get-test-point-inflation-fixture.tsx to match the export name getTestPointInflationFixture, similar to how the imported get-test-fixture file matches its export getTestFixture. Variable naming and file naming should be consistent relative to other variable or file names in the project.

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

This branch was successfully deployed

1 active deployment
Preview — 0055685a Deployed Oct 28, 2026 by vercel[bot]
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