Thanks. On cost: the patch copies once per accepted timepoint (after CKTaccept), not per Newton iteration, and copies back only before a retry — one memcpy beside at least one load and factor per timepoint, and Holger's paranoia run got faster. A fix in asrcload.c would need the B source to keep its accepted controlling values in its states and use them in MODEINITPRED, as dioload.c does. I'm happy to try that if you prefer it, but as you say other devices may have the same bug, which is why I put...
Sorry, I forgot to include the deck in the orignal post. hmm.
A failed transient step is retried from its own failed Newton iterate
Thanks to you both. The use case, as Holger asked: we're a host app using shared ngspice. A live run uses ".save none" and takes every point through SendData, because nothing stops it and stored vectors would grow for ever. Then, in the same process and without reloading the library, the user runs an ordinary batch analysis (AC or transient), sources a netlist with no .save at all, and reads its vectors. That's where the flag left over from the live run gave us vectors of length 1. An explicit reset...
Correction to the patch description: the #ifdef SHARED_MODULE around the reset is required, not optional — savenone itself is only declared under SHARED_MODULE (outitf.c), so the non-shared build wouldn't compile without it. The patch itself is unchanged.
.save none sticks: every later analysis keeps vectors at length 1 (shared library)
OPtran never finishes when a GetSyncData callback is registered (shared library)