Skip to content

fix: preserve components, pins, and nets with duplicate readable names - #253

Open
ugin-man wants to merge 1 commit into
tscircuit:mainfrom
ugin-man:codex/fix-readable-id-collisions
Open

ugin-man wants to merge 1 commit into
tscircuit:mainfrom
ugin-man:codex/fix-readable-id-collisions

Conversation

@ugin-man

@ugin-man ugin-man commented Sep 7, 2026

Copy link
Copy Markdown

With useReadableIds: true, repeated component names overwrite entries in chipMap, repeated pin labels overwrite chipPinMap, and distinct source nets sharing a name collapse into one netMap entry. For example, renaming the five components in ExampleCircuit02 to the same display name leaves only one chip after conversion.

Allocate readable identifiers before building the problem, using the original source IDs to keep the mappings consistent across chip ownership and connection maps. Preserve each first/unique requested name and suffix subsequent duplicates. Reserve all requested names first so a generated suffix cannot take a later component or pin's existing name. Source-ID mode remains unchanged.

Four new regression tests fail on the unchanged base and pass after the fix. They cover component/pin/net count preservation, pin ownership and offsets, connection counts, existing suffix names, and unchanged source-ID output.

Validation: full bun test passes 113 tests with 1 existing skip (1068 assertions, 2 snapshots); tsc --noEmit, ESM/DTS build, changed-file Biome formatting, and diff whitespace checks pass. No dependency or existing snapshot changes.

Prepared with Codex (Astra) assistance and verified locally.

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
matchpack Ready Ready Preview Sep 7, 2026 10:56pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview bea19ab0 Deployed Sep 7, 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.

1 participant