public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Giuliano Procida <gprocida@google.com>
To: Dodji Seketeli <dodji@seketeli.org>
Cc: "Giuliano Procida via Libabigail" <libabigail@sourceware.org>,
	kernel-team@android.com, "Matthias Männich" <maennich@google.com>
Subject: Re: [PATCH] abidiff: improve treatment of array types in leaf changes mode
Date: Fri, 4 Dec 2020 14:41:46 +0000	[thread overview]
Message-ID: <CAGvU0H=3GzDcK4OsPNTe65b_TpnbiMNCtKLA19==yTHhmVFLuw@mail.gmail.com> (raw)
In-Reply-To: <865z5hq1eo.fsf@seketeli.org>

Hi.

On Fri, 4 Dec 2020 at 11:02, Dodji Seketeli <dodji@seketeli.org> wrote:

> Hello Giuliano,
>
> Giuliano Procida <gprocida@google.com> a écrit:
>
> [...]
>
> > diff --git a/src/abg-ir.cc b/src/abg-ir.cc
> > index c6f7c13e..b0db9c39 100644
> > --- a/src/abg-ir.cc
> > +++ b/src/abg-ir.cc
> > @@ -23606,7 +23606,7 @@ types_have_similar_structure(const type_base*
> first,
> >         || ty1->get_dimension_count() != ty2->get_dimension_count()
> >         || !types_have_similar_structure(ty1->get_element_type(),
> >                                          ty2->get_element_type(),
> > -                                        indirect_type))
> > +                                        true))
> >       return false;
> >
> >        return true;
>
> I think this change is correct, thanks for spotting that.
>
> However ...
>
> [...]
>
> > If an array's element type doesn't change name but has some other
> > (local) change, then the change should not also be considered local to
> > the array type.
>
> I find this comment confusing, even if I think I see what you mean.
>
> A change being local or not, is a concept that is not at the same
> logical level as the concept of "type similarity" defined in the comment
> of the function types_have_similar_structure.  I would say that the type
> similarity concept is at a lower logical level.  So seeing this comment
> that applies to a higher level concept for a change made to something
>
> But I agree that the comments of types_have_similar_structure are
> confusing as well.
>
> So I am proposing two patches following this message, for this issue.
> One patch amends the the comments for types_have_similar_structure, and
> the second one is your patch, with amended comments.
>
> And we can discuss from there as you like.
>
>
I'm happy with your patches and have replied to them. However, I'll be
honest, I've found this aspect (local changes and types with
similar structure) of abidiff really hard to reason about. I'm likely
looking at things the wrong way, but here's roughly how I see things.

We want to identify "leaf" changes. I think of them more as "root" (cause)
changes, but that's just inverting the edges in some graph. These should be
(user-defined) types that have not changed name but have changed in some
way "directly" (indirectly would be if there were a more remote cause of
the same sort). There are also direct changes to symbols' types.
User-defined types with local changes have paths to the symbols whose types
they affect - they are the impacted interfaces.

Now with libabigail, there is the notion of local vs non-local change which
might not correspond exactly with the notion sketched above, but it's
certainly related. And then there are at least two more
pieces: types_have_similar_structure which is used in decisions about
locality and lastly the logic used to filter changes for consideration in
the leaf report - they have to be local plus a lot of other conditions.

The decision-making that goes into leaf reporting seems to be spread across
several bits of code and I speculate that it was an inconsistency between
two of these that resulted in diff nodes being selected for inclusion but
actually have no local diff to report (by the represent helper function).
If I knew what types_have_similar_structure had to be consistent with I
could check all the cases or, more interestingly, see if the decisions
being made in two different places could be made in just one place.

Regards,
Giuliano.


> [...]
>
> Cheers,
>
> --
>                 Dodji
>

  parent reply	other threads:[~2020-12-04 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 15:09 Giuliano Procida
2020-12-04 11:02 ` Dodji Seketeli
2020-12-04 11:05   ` [PATCH 1/2] ir: Add better comments to types_have_similar_structure Dodji Seketeli
2020-12-04 11:07   ` [PATCH 2/2] ir: Arrays are indirect types for type similarity purposes Dodji Seketeli
2020-12-04 14:41   ` Giuliano Procida [this message]
2020-12-07 13:24     ` [PATCH] abidiff: improve treatment of array types in leaf changes mode Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGvU0H=3GzDcK4OsPNTe65b_TpnbiMNCtKLA19==yTHhmVFLuw@mail.gmail.com' \
    --to=gprocida@google.com \
    --cc=dodji@seketeli.org \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    --cc=maennich@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).