Repository navigation
fix: Cadence parts read their pins from the right section and library, and export_design refuses a pin on two nets - #331
Merged
Conversation
…ction and the right library Two lookups picked the wrong definition, and a pin then landed on the wrong net, or on two. A section whose symbol name ends in a letter while its part numbers the sections -1, -2, ... found no pin map, and every pin took its position in the symbol as its number. BeagleBone AI's processor read 85 of its 760 balls. The record's section index now names the section. A part's definition was the first one cached under its name. The Cache keeps one per source library and each placed part names its own, so a design holding R from two libraries with opposite pin maps had its resistors' pins swapped. Capture's exports follow the part's own library, also over the Packages/ copy. Both are checked against outside references: BeagleBone AI against the netlist of its board, the digital convertor against Capture's export. Refs #327 Claude-Session: https://claude.ai/code/session_01CX9foYVQXcQCGbXw6hXDGn
… writing a file it cannot reload A schematic can wire one physical pin to two nets, which Capture's design check reports as an error. The parsed netlist lists the pin under both, and exporting it wrote a Universal Netlist that the reader then rejected. The export now names the pins and their nets and writes nothing; queries on the design answer as before. Fixes #327 Claude-Session: https://claude.ai/code/session_01CX9foYVQXcQCGbXw6hXDGn
The beaglebone-ai and digital-convertor fixtures are on test-fixtures main (IntelligentElectron/test-fixtures#18), with the same content the branch commit had. Claude-Session: https://claude.ai/code/session_01CX9foYVQXcQCGbXw6hXDGn
This was referenced Nov 25, 2026
Closed
…, and decide the table cells real files reach A placed part names its package, library, view and section, and the file holds the package and view it means. scripts/dsn-definition-check.ts walks those links directly and compares each pin's number, Pin Ignore flag and name with what the parser resolves. Over the fixtures and 640 public designs it finds no difference on 220,197 pins; with either lookup fix removed it reports the pins that fix corrects. The fixture test runs it on every Cadence fixture. The cells of section-pin-map and part-definition that real parts reach are decided on that check and on Capture's exports. The cells no real part reaches stay drafts. readPartDefinitions is the definitions block of the design parser, moved out unchanged so the check reads the same index the parser builds. Refs #327 Claude-Session: https://claude.ai/code/session_01CX9foYVQXcQCGbXw6hXDGn
…maintainer A vendor format is a fact, so a reading of it is proven or not yet proven, and no reading is a choice for a person. AGENTS.md now says so: an agent decides from real vendor data, records what is unproven as an open question, and uses decision tables as its own instrument for covering every case. A cell is decided when every real case in it is verified, and stays a draft until then. Claude-Session: https://claude.ai/code/session_01CX9foYVQXcQCGbXw6hXDGn
The test parses a 2.8 MB Cadence design through the command line, which takes several seconds, and it ran under the default 5 s limit. It timed out on a CI runner after passing twice. Claude-Session: https://claude.ai/code/session_01CX9foYVQXcQCGbXw6hXDGn
Merged
6 of 7 tasks
…ist-pr-verify-zdefgg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Some Cadence designs put a part's pins on the wrong pin numbers, and then on the wrong nets or on two nets at once.
export_designwrote such a design to a file that the same release refused to reload (#327). Two lookups in the.DSNreader picked the wrong definition:Packages/copy. A design holdingRfrom two libraries with opposite pin maps had every resistor's pins swapped. Each part now reads its pin numbers, Pin Ignore flags and pin names from its own library.A design that still wires one physical pin to two nets is now refused by
export_designwith the pins and their nets named. Queries on it answer as before.Changes
pin-resolver.ts: a symbol suffix that names no stored pin map resolves by the record's section index; a suffix that names a map still wins.structures.ts,cache-parser.ts,dsn-parser.ts,pin-resolver.ts,component-builder.ts: the placed part's library reference is read, the Cache is indexed per source library, and pin maps and pin names come from the part's own library first.cli/export-design.ts: refuses a netlist with a pin on several nets, naming up to ten pins, and writes nothing.scripts/dsn-definition-check.tswithtest/integration/cadence-definitions.test.ts: every placed pin checked against the package and view the file itself names for the part. It needs no export, so it runs on any design.section-pin-mapextended, newpart-definition.beaglebone-aiwith the netlist of its board,digital-convertorwith Capture's own export.test/integration/cadence-references.test.tscompares against both; it fails 4 of 5 onmain.U33andU7146.docs/cadence-dsn-format.md: the library join recorded as verified, three claims moved to Refuted, three open questions added.mainDIGITAL_CONVERTORPROIECT_TIE1PROIECT-PCBBeagleBone AI's 11 other pins are processor balls on three 1.8 V rails that the board joins and the schematic names apart, as its PDF prints them. The last two designs are public and carry no license, so they are evidence in the spec and stay out of the fixtures.
Related Issues
Closes #327
Refs #328, which stopped the same failure by throwing in the net assembler. Here the refusal sits in
export_design, so a design stays readable by every query tool, and the two lookups are fixed where they go wrong.Decision tables
Behavior change to
section-pin-map, and a new tablepart-definition. Both are indocs/decision-tables/dsn-net-assignment/: the new table ispart-definition.csv, with its rules inpart-definition.rules.md.Reproduction:
BeagleBone-AI.dsnU4 section C is the instanceAM57XC.Normalwith section index 2, its pin map stored underAM57X-3. No cell covered it: the table assumed a suffix always names a stored map. The wrong outcome was no map, so pinDDR1_RSTwas reported asU4.1; the board has it onU4.AG21. The cell isunit_suffix = unmapped, section_index = in-range, sections listed, and its outcome isthe section at its index.How the cells are decided
AGENTS.md(Accuracy and evidence, merged in #332) sets the rule: the vendor's files decide a cell, never a person.decidedwhen every real placed part that falls in it resolves each pin to the record the file itself names for the part.draft.scripts/dsn-definition-check.tsreads each part's package by name and library, its section by the cell of its view and then the section index, and its view by name and library, and compares every pin's number, Pin Ignore flag and name with the parser's. Over the 21 fixture designs and 640 public designs: 64,244 placed parts, 220,197 pins, 0 differences.section-pin-mapsection-pin-mapsection-pin-mapsection-pin-mapsection-pin-mappart-definitionpart-definitionpart-definitionPackages/stream holds itpart-definitionThese 9 cells are
decided. The other 76 cells ofsection-pin-mapand 8 ofpart-definitionstay drafts, since no real part reaches them. The one exception is 7 parts of a single design that name no library, which leaves nothing to check them against.Fixtures:
Public designs (754
.dsnfiles from public repositories):The check reports each bug when its fix is removed. These are excerpts of its output on the fixtures:
That check shows the parser follows the file's own links. Capture's exports show those links are the ones Capture uses:
pstxnet.datnames its instance, library and view (INS350@ANALOG.R.NORMAL). On the 61 designs whose export corresponds to the design, all 28,015 nodes name the library the part's record names.PROIECT_TIE1,PROIECT-PCB,PROIECT_APD_SCHEMATIC_ANALOGfrom 4.2%,LIDARPROJECTfrom 95.7%). One export scores lower on pin names,PROIECT1: it is of another revision, and none of its 135 nodes names an instance of the design.Replay:
net-assignment.table.test.ts, 120 tests passing.Verification
Verdict: PASS. Built the
packagedbinary from this branch (scripts/build-binary.sh host <dir>/universal-netlist packaged, Bun 1.4.4) beside one built frommain, and drove the CLI and the MCP server over stdio.CLI, the
mainbuild against this branch. Sections 1 to 3 use the new fixtures; section 4 uses two public designs outside the fixtures (LABCOMM_PROJECTON.DSN,SCR-236.dsn):MCP over stdio, this branch:
A later commit moves the definitions block of the design parser into
readPartDefinitions, unchanged. The binary rebuilt after it gives the same netlist hash as the build above on four fixtures, and the same answers:Beyond the binary: 774
.dsnfiles (the 20 earlier fixture designs and 754 from public repositories) were parsed onmainand on this branch. 659 parse on both, and 53 netlists change. Designs that list a pin under two nets go from 15 to 10; the 10 that remain are described in the spec's open questions (§11), with Capture's own design-check messages for them.Testing
npm run type-checkpassesnpm run lintpassesnpm testpasses, with one exception local to the container it ran in: 3,268 passed and 1 failed. The failure issrc/service/cache.test.ts"answers a miss, and does not throw, when the directory cannot be written". It fails the same way onmainthere, because the container runs as root and a read-only directory stays writable. CI'sbuildpasses.Run on the private corpus before merge:
node --import tsx scripts/dsn-definition-check.ts <corpus>: no design should differnode --import tsx scripts/dsn-vs-dat-coverage.ts <corpus>: no design with a corresponding export should lose a net, a pin number or a pin name againstmainChecklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01CX9foYVQXcQCGbXw6hXDGn