Open In progress bug report

update_pcb aborts on Altium's component-link Confirm (reaper presses No); keepBoardOnly leaves pair/net removals enabled; stalls on large boards

JelleJocque · ·marked in progress by kcknox

altium-bridge 0.2.102 · Adom Bridge 2.1.198 (96320c1c) · Altium Designer Develop (licensed) · Windows 11

1. altium_update_pcb aborts: the reaper answers Altium's component-link question with "No"

  • Setup: a PcbDoc first made with altium_build_board (board-only parts), then filled from the schematic.
  • Every altium_update_pcb {execute:true, keepBoardOnly:true} stops after ~20 s with read_failed. altium_status.reapedDialogs shows {"category": "unreadable_confirm", "title": "Confirm", "pressed": "No"}, then {"category": "single_ok_acknowledgement", "title": "Information", "pressed": "OK"}.
  • The dialog is Altium's "create component links automatically or manually?" question. "No" cancels the change order.
  • It also happens when new parts are added after the existing parts are already linked.
  • Expected: answer it with "Automatically Create Component Links".

2. keepBoardOnly leaves destructive rows enabled (detail:true preview)

  • "Remove Differential Pair": every row enabled. The skill text says board-made pairs are unticked by default; net classes are unticked correctly.
  • "Remove Nets": nets whose pins are all on board-only parts are enabled. Their "Remove Pins From Nets" rows are unticked, but the net removal is not, so connections between board-only pins would be lost.

3. Large boards: stalls, agent errors, watchdog kills

  • altium_add_rule, altium_impedance {apply} and altium_net_classes take 60-120 s and often pass ab's budget.
  • altium_impedance {apply} raises an "Error" dialog from the agent script; afterwards the board is no longer "current" and altium_save fails.
  • The agent loop sometimes stays resident after a run (alive:false, residentAnywhere:true) and Altium ignores the user's clicks. altium_agent_stop answers "the loop did not exit"; a stop file in both agent folders ends it (cf. #27).
  • The watchdog killed X2 several times ("X2 frozen/window-less 45s after a bridge-involved close", seat warning), once during a read-only call.
  • altium_move_parts: large batches led to a hang; small batches with a save after each work.

Online DRC is off. The same verbs are fast on small boards. Happy to collect traces.

3 Replies

Colby Knox marked this in progress ·
Colby Knox ·

Thank you, Jelle. Parts 1 and 2 are in altium-bridge 0.2.103, public now. Part 3 needs a little more from you; questions at the end.

2. keepBoardOnly now keeps what board-only parts need. I reproduced it on Altium Designer Develop 26.11.1. The setup was a board-only part with its own nets and a board-made differential pair, then a sheet without that part. Both changes below were read back from the board after update_pcb {execute:true, keepBoardOnly:true}.

  • Differential pairs: Altium names that group "Remove Differential Pair(1)", and the bridge only recognised the plural, so it left those rows ticked. They are now unticked by default, along with net classes, rules and rooms. removeBoardOnlyClasses:true still lets them go.
  • Nets: the "Remove Nets" rows for nets on the board-only parts you keep are now unticked too, so the connections between their pins stay.

1. The "Confirm" during Update PCB. On my Develop the link question comes as its own "Component Links" window, which update_pcb already answers with "Automatically Create Component Links". So I couldn't raise the painted Yes/No "Confirm" you got, and I didn't want to press Yes on a question the bridge can't read. Instead:

  • What you see: during update_pcb, that kind of Confirm is now photographed once its question is drawn and returned as altiumAsked[].shot. If answering it No stopped the update, the reply is errorCode: altium_asked instead of read_failed.
  • What to do: if the question is the component-link one, call again with confirm:"yes", and the bridge answers Yes.
  • Earlier boxes: the reaper's photos in altium_dialog_log now show the question as well. They were blank, because they were taken before Altium drew the text.

Could you send the altiumAsked photo the first time it appears on 0.2.103? With the question known, I'll answer it automatically.

3. Large boards. I'd like to fix these properly, so a few details would help:

  • the board's size (altium_routing_state → counts), and one slow call with its durationMs;
  • for altium_impedance {apply}, the reply including errorShot (the picture of Altium's Error box);
  • when the loop stays resident and altium_agent_stop says "the loop did not exit", the altium_agent_status reply at that moment (liveWorkspaces);
  • for the watchdog closures, the altium_dialog_log reply afterwards.

A trace from one slow run is plenty. I'll keep this open for part 3.

JelleJocque ·

Thanks Colby! 0.2.103 is installed here.

Part 1: I'll send the altiumAsked photo the first time it appears.

Part 3:

  • Board size (altium_routing_state → counts): {"arcs": 0, "components": 1219, "nets": 758, "pads": 4559, "polygons": 0, "tracks": 0, "vias": 0}
  • Slow call: the same altium_routing_state now answers in durationMs: 23764 on 0.2.103 (roundtripMs: 17381); on 0.2.102 it took about 77 s (measured on my side, I don't have its durationMs).
  • Watchdog closure, altium_dialog_log afterwards (today, local time). Note: this one happened during an altium_eval of my own DelphiScript (editing one rule on every layer), not during a plain bridge verb like the earlier ones in the report, which I no longer have logs for.
    • 16:29:42 and 16:30:52: closeWatchdog: ADDevelop, "Altium main window gone or hung while a resident loop heartbeats - stop file dropped"
    • 16:31:39: killed: true, "X2 frozen/window-less 45s after a bridge-involved close - terminated", _seatWarning, zombieBreaker 9344
  • altium_impedance {apply} errorShot and altium_agent_status when the loop does not exit: I didn't keep these. I'll send them the next time they happen.
Colby Knox ·

Thanks, Jelle: your dialog log found it. altium-bridge 0.2.104 is public now with the fixes below.

The watchdog closures. Altium runs the bridge's agent in its own main thread, so its window stops responding for as long as a command runs, like your altium_eval or altium_routing_state on a board your size. The bridge's close watchdog took that for a stuck shutdown. It stopped the agent, and after 45 s it ended Altium. That is the closeWatchdog and killed: true pair in your log, and most likely the earlier closures too: on 0.2.102, your altium_routing_state alone took about 77 s.

  • Now the bridge knows the command is its own and leaves Altium alone. The dialog log says busyHang instead.
  • A window that hangs while no bridge command is running (Altium loading a large board, say) is reported, never ended.
  • I checked it with a 70 s altium_eval and a 48 s altium_routing_state on a 50,000-object board. Altium kept running in both.

altium_routing_state speed.

  • The agent stopped itself 15 s after a command started. Any longer command ended it as it answered, and the next step had to start it again. Each restart cost about 3 s of the 6 s between your durationMs and roundtripMs. It now counts from when the command finishes.
  • On my test boards the bridge's own share is now under a second, and Altium's share is about 10% smaller.
  • Most of what remains is Altium answering one read per pad, part and connection: about 0.15 to 0.7 ms each, so roughly 15 s on your board. Could you send one durationMs and roundtripMs from 0.2.104?

altium_eval now waits up to 600 s for its reply (timeout, default 60). It was cut off at 60 s, even while the script kept running.

Still open: the altium_impedance {apply} errorShot, and altium_agent_status when altium_agent_stop says the loop did not exit. That second one may have been the same cause: the loop cannot exit until the command it is running finishes. Please send either one if it happens on 0.2.104. I'll keep this issue open for those and for part 1's altiumAsked photo.

Log in to reply.