Option to skip automatic schematic trace routing while keeping the schematic (schematicTraceRoutingDisabled)

Open
#5,151 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@cocvn157 is already working on this.

Since Nov 5, 2026.

  • #5165 by @cocvn157 — open
  • #5258 by @jeffrey-graham — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript
Domain
backend, devtools

Research direction

Read the schematic routing entry points: Group_doInitialSchematicTraceRender, Trace_doInitialSchematicTraceRender, and NetLabel.doInitialSchematicTraceRender, along with the existing schematicDisabled precedence and tests. Add schematicTraceRoutingDisabled through the board, platform, project config, and IsolatedCircuit paths described in the proposal, then run the routing tests. Done means routing is skipped at all three entry points when enabled while existing schematic content and PCB output remain as described; the is_connected behavior is still an open question.

Written by the indexing model from the issue text.

Description

Problem

Designs that bring their own schematic wiring still pay for core's automatic schematic trace routing on every render, and today there is no way to turn it off without losing the schematic:

  • schematicDisabled removes every schematic element (components, ports, symbols, sheets, user primitives).
  • The internal _featureMspSchematicTraceRouting = false does not skip routing: it swaps the group-level SchematicTracePipelineSolver for the per-trace router (Trace_doInitialSchematicTraceRender), which throws on traces with more than two ports (GeneralizedAstarAutorouter doesn't currently support 2+ points in a connection, a fatal circuit_generation_failed).
  • tsci build has --routing-disabled for the PCB but no schematic counterpart.

Our case: we convert existing CAD designs to tscircuit. Each chip carries its original symbol as <symbol> artwork with <port>s at the original pin positions, each sheet carries the original wires as <schematicpath>s, and connectivity is <trace path={[...]}>. The router then computes a second wiring on top of the drawn one, and on large boards it dominates the build.

Measurements

tsci build (tscircuit 0.0.3055, core 0.0.2252), routing as today vs the three routing entry points skipped (Group, Trace and NetLabel doInitialSchematicTraceRender, via a Bun --preload for the measurement):

design schematic pins routing on routing skipped
2-layer board, 220 parts 892 62.3 s 38.7 s
6-layer board, 345 parts, 1 746 vias, 149 pours 1 384 1 417 s 409 s
a generated schematic layout of the same 6-layer board (892 traces) 1 384 204–673 s 10.7 s

In a CPU profile of the 1 417 s build, Group_doInitialSchematicTraceRender is 96.5 % of the run (1 449 of 1 501 s).

Synthetic boards from the reproduction below (tsci build --disable-pcb --disable-parts-engine, wall clock including ~6 s CLI start-up):

chips pins source_trace routing on routing skipped schematic_trace on → skipped
16 128 127 10.8 s 7.0 s 104 → 0
32 256 263 13.0 s 8.9 s 210 → 0
64 512 543 21.7 s 9.5 s 420 → 0
128 1 024 1 107 118.0 s 11.0 s 836 → 0

Doubling from 64 to 128 chips multiplies the routing time by about 8 (16 s → 107 s above start-up). (Wall times vary with machine load: a later re-run of the 64-chip case gave 48.3 s vs 9.4 s, with the same 543 source_traces, 512 ports and 420 → 0 schematic_traces.)

Exact behaviour differences when routing is skipped

Compared element by element (multisets of canonical JSON) on the real boards above, in the default and the strict (all-DRC) build:

  • Identical: every source_* element, all PCB elements, cad_component, schematic_component, schematic_port positions and sides, symbols, user schematic primitives (schematic_path, schematic_text, schematic_box…), schematic sheets, PCB DRC errors, and the generated Gerber/drill files.
  • Absent: schematic_trace, schematic_net_label, the schematic_text trace labels (they carry a source_trace_id), and warnings that refer to those elements.
  • Changed: schematic_port.is_connected stays false where a routed wire used to reach the port (today only the routers set it).

Reproduction

// 64 chips with fixed schematic positions; every pin on a net
const N = 64
const COLS = Math.ceil(Math.sqrt(N))
export default () => (
  <board width="200mm" height="200mm">
    {Array.from({ length: N }, (_, i) => (
      <chip
        key={`U${i + 1}`}
        name={`U${i + 1}`}
        footprint="soic8"
        schX={(i % COLS) * 12}
        schY={-Math.floor(i / COLS) * 10}
        pinLabels={{ pin1: "IN", pin2: "B0", pin3: "B1", pin4: "GND", pin5: "OUT", pin6: "L0", pin7: "L1", pin8: "VCC" }}
        schPinArrangement={{
          leftSide: { direction: "top-to-bottom", pins: [1, 2, 3, 4] },
          rightSide: { direction: "top-to-bottom", pins: [5, 6, 7, 8] },
        }}
      />
    ))}
    {Array.from({ length: N }, (_, i) => {
      const u = `U${i + 1}`
      const next = `U${i + 2}`
      const right = i + 1 < N && (i + 1) % COLS !== 0
      return [
        <trace key={`${u}g`} from={`.${u} > .pin4`} to="net.GND" />,
        <trace key={`${u}v`} from={`.${u} > .pin8`} to="net.VCC" />,
        <trace key={`${u}a`} from={`.${u} > .pin2`} to={`net.BUS${i % 4}_A`} />,
        <trace key={`${u}b`} from={`.${u} > .pin3`} to={`net.BUS${i % 4}_B`} />,
        ...(i + 1 < N ? [<trace key={`${u}n`} from={`.${u} > .pin5`} to={`.${next} > .pin1`} />] : []),
        ...(right
          ? [
              <trace key={`${u}r0`} from={`.${u} > .pin6`} to={`net.L${i}_0`} />,
              <trace key={`${u}r0n`} from={`.${next} > .pin6`} to={`net.L${i}_0`} />,
              <trace key={`${u}r1`} from={`.${u} > .pin7`} to={`net.L${i}_1`} />,
              <trace key={`${u}r1n`} from={`.${next} > .pin7`} to={`net.L${i}_1`} />,
            ]
          : []),
      ]
    })}
  </board>
)

tsci build --disable-pcb --disable-parts-engine, once as is and once with Group.prototype.doInitialSchematicTraceRender and Trace.prototype.doInitialSchematicTraceRender replaced by no-ops in a Bun --preload.

Proposal

schematicTraceRoutingDisabled?: boolean (default false):

  • props: on the board, the platform config and the project config (so tscircuit.config.json can set it), next to schematicDisabled;
  • core: IsolatedCircuit.schematicTraceRoutingDisabled with the same precedence as schematicDisabled (circuit override → platform → board prop), and one early return in each routing entry point right after its schematicDisabled check: Group_doInitialSchematicTraceRender, Trace_doInitialSchematicTraceRender (display-label routing is only reached from it), NetLabel.doInitialSchematicTraceRender;
  • cli (follow-up): tsci build --disable-schematic-routing, forwarded like --routing-disabled.

Open question: with routing disabled, should schematic_port.is_connected be set from source_trace connectivity, so viewers keep showing connected ports?

We have the props and core changes ready (core: 29 lines plus a test that renders one design with and without the option and checks the differences listed above; props: the field, a parse test and the regenerated docs) and are happy to open them as PRs if this direction is acceptable.

Dominant language
TypeScript
Stars
61
Forks
256
Avg merge
20h 21m
Merged PRs (30d)
289

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tscircuit/core

All issues in tscircuit/core

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.