kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #43112
Re: Connection graph question
-
To:
Jon Evans <jon@xxxxxxxxxxxxx>
-
From:
Wayne Stambaugh <stambaughw@xxxxxxxxx>
-
Date:
Wed, 11 Dec 2019 18:26:54 -0500
-
Autocrypt:
addr=stambaughw@xxxxxxxxx; prefer-encrypt=mutual; keydata= mQGiBEM0hxQRBAC2fNh3YOVLu1d5GZ0SbrTNldGiGnCJPLqzEnqFX9v6jmf33TMt6EmSLkl6 Wtfkoj0nVwKxcYmJkA8DX0QAokBkwNIzhSsBzQvthBLIk/5LnPVVKrEXOcL4mUyH1doKlkaE slgJozNa6Av+oavcvD02o1zJOloBbaHlNlyRt7fKswCgtIFlVjWggVH/15KfWk+Qo5JVPbME AIUBAQyL2OAx0n60AWec2WHnO9buHuG0ibtICgUMkE+2MRmYyKwYRdyVwGoIUemFuOyHp0AJ InX4T+vy2E7vkwODqjtMLfIoRkokW74Fi4nrvjlhOAw/vdq/twLbAmR9MOfPTpR4y7kQy1O2 /n+RkkRvh26vTzfbQmrH7cBJhk6aA/9Uwvu3E4zNJgHVZeS0HyWtmR1eOPPRbnkPgJTToX5O KMKzTJI/FX6kT7cFoCamitHrW3BJP4Dx+cMMsa47EGxqVTdbVJ4LjogsXTXxb+0Fn1u4zBdx x3Cer6O7+hqWy7zvpzeC6nSREjqDKa5CgHtv/GLm5uFPOmsjAsnHj2tlBrQmV2F5bmUgU3Rh bWJhdWdoIDxzdGFtYmF1Z2h3QGdtYWlsLmNvbT6IeAQTEQIAOBYhBOffs6CbblRzBkv33BtR cWlZ+CReBQJbFBS2AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEBtRcWlZ+CReMI8A nRbrLkzp7+c2f0vX7sfg4ICX8LAKAJ9uClo4uJajmZa5zZrL2nKdZlUwIrkCDQRDNIcxEAgA gCru+3/aOC6RCjpvYC72wY+d5SmHphC6yeiV2/mOumyt5MLo/Ps2GznZr11JspqFk5K/Zpvp MMLqqjDZ39+50a2iKRQFJ6NlK+hJWMmj6eJygQrCwYo3Gjc6CqfrqUv+8VSnf/i5sIZmtOVA 4ZjML18MuBvMSsNdVLFJd5HNnYb1iOECpvqdPVh/21LLCEw7MUUGGnHBhCrmk2aJe5hFmcSN g4ldBcXrgMQBwf7aMVoobXBMFDb/IENByXn0llB7Gr2IFMRmNS9/p8s/II1Yl2bTqyX4FSz8 cfn7C9KEz7faZ7wzAcpwHFC/zs3JoAjJ0IEKdNUpIwAlKMzT3CzctwADBQf/cxpG28MKyrqk nNmq/8LQLy+x6FSYXBLjxQz9BiBNYeesDZQ6J5UbL1mjpJzMa5tLZypPYo4bbGyR22hrbyDF K7m6AcVaMIJKl98g4ukMutFfAJyRDaREH5Zl/X1P4u1Z/yaAIy9mKaNbaK1/5djNJ5wCTFen TUgAp9xdc30kGkFDdLJFp5uxDY4P0vaZiZdjUCvDM3Zjv5IzpNOfxVqTUBQNUP/BnnKhkk0p DTD6s3X8S+D0rOtEBQ8K0cwERI/E8EFa8nj0TNw4e2MYGR8wg+SxqJ7z5f0zPY0bO6G9DDFB wYCqzzPWGqdAh9vA5971TAbPERtdFybhkurozp2SfYhJBBgRAgAJBQJDNIcxAhsMAAoJEBtR cWlZ+CResHUAniULLCWiT26ieRTl7N2vS6vBo/DuAJ4m7Ss/gyiW6ybTn1ctDXAUgm2QVQ==
-
Cc:
KiCad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
In-reply-to:
<CA+qGbCD1FmH4-0AuaFpZT-f=LocvvpBuB4JFxV2yrqQ3uXt-=g@mail.gmail.com>
-
Openpgp:
preference=signencrypt
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0
Hi Jon,
That's kind of what I thought. I will track down every where in the
code where we call UpdateSymbolLinks() and to a full connectivity graph
rebuild. It's ugly but at least there will be no stale item pointers.
We really should only be calling UpdateSymbolLinks() on schematic load,
symbol library changes, and symbol library table changes. Thanks for
the help.
Cheers,
Wayne
On 12/11/19 6:17 PM, Jon Evans wrote:
> Hi Wayne,
>
> I can't look at the code this minute, but I think you basically have it
> right. This call is quite expensive so if we can not trust the pin map
> to be valid, we'll probably want to come up with some way to make a
> targeted update so that we don't incur the computation time of a full
> recalculation.
>
> -Jon
>
> On Wed, Dec 11, 2019 at 6:01 PM Wayne Stambaugh <stambaughw@xxxxxxxxx
> <mailto:stambaughw@xxxxxxxxx>> wrote:
>
> I'm guessing this is primarily a question for Jon but maybe someone else
> can answer my question. My recent symbol inheritance merge revealed
> that the connection graph code has a serious fragility issue. This
> comment in the updateItemConnectivity function raised a red flag:
>
> // Assumption: we don't need to call UpdatePins() here because anything
> // that would change the pins of the component will have called it
> already
>
> It turns out this assumption was not only wrong, it was really wrong.
> Now that the LIB_PART of the SCH_COMPONENT is no longer a pointer link
> but an actual copy of the library symbol, any change to the underlying
> library symbol will result in stale pin map pointers. This is what has
> been causing all of the crash bugs. I cannot believe that we haven't
> had more issues. The only thing that saved us was as long as the
> original LIB_PART pointer was around somewhere, it wouldn't crash even
> if the connection information was completely wrong. I think I have
> fixed everyplace where the LIB_PART copy is changed in SCH_COMPONENT but
> that still leaves the issue of keeping the connection graph up to date.
> There are lots of places in the code where we call UpdateSymbolLinks().
> This will replace every single library symbol copy in the schematic with
> a new copy which will render the connect graph pointers completely out
> of date. What needs to be done to ensure the the connection graph is
> not stale? It appears to me that I have to call Recalulate( rootSheet,
> true ) is the correct thing to do but this will perform a complete
> rebuild of the connection graph. I'm guessing that has a lot of
> overhead involved in it. Is there a better way that I'm missing here?
>
> Cheers,
>
> Wayne
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
References