Issue894

Title use operator IDs in PDB match trees
Priority wish Status resolved
Superseder Nosy List florian, jendrik, malte, silvan
Assigned To jendrik Keywords
Optional summary

Created on 2019-02-26.16:07:13 by jendrik, last changed by jendrik.

Messages
msg8560 (view) Author: jendrik Date: 2019-02-27.23:16:51
Thanks for the reviews! I merged the code.
msg8548 (view) Author: silvan Date: 2019-02-27.11:44:01
I had a look and don't have any comments.
msg8546 (view) Author: malte Date: 2019-02-27.10:39:25
Sounds good. Silvan, can you review the code? If you're happy to merge it, then
from my side it can be merged.
msg8545 (view) Author: silvan Date: 2019-02-27.10:06:59
I don't think that we necessarily should use OperatorID instead of int, since I
personally associate OperatorID with the task interface classes (AbstractTask or
TaskProxy). Here, however, we have a custom class AbstractOperator and could use
any identifier to these operators. Actually, with the intended change of this
issue, MatchTree will not know anything about AbstractOperator at all, but only
on "regression preconditions", so I'm fine with it using plain ints as IDs.

Regarding the dump method, I don't think dumping the operators separately and
having to manually map the operator IDs from the MatchTreep dump to separate
output of operators makes debugging easier. I see how the tree output gets more
compact, but that's it. Anyway, I don't think breaking/changing this method is a
good reason not to do the suggested changes, because I see the dump method
rather as a service for developer than a core part.
msg8541 (view) Author: jendrik Date: 2019-02-26.19:26:40
Malte noticed that the patch removes some debug output that maybe requires
discussion: 
https://bitbucket.org/jendrikseipp/downward/pull-requests/120/issue894/diff#comment-93029783

Where we used to call AbstractOperator::dump() (which prints the regression
preconditions and hash effect), the patch now only prints the AbstractOperator ID.

Personally, I think users can simply dump the MatchTree and the
AbstractOperators separately, which might even be more compact and therefore
easier to debug.
msg8540 (view) Author: malte Date: 2019-02-26.19:14:18
I left a few comments.
msg8539 (view) Author: malte Date: 2019-02-26.19:07:49
> It would be a different story if we had a nice way of using OperatorID to
> index into vectors, but that's a different issue, I think.

If we really want that, it should be a one-liner to add to operator_id.h
(although we'd write it in four lines ;-)):

    operator int() const {return index;}

I agree it's a different issue, just pointing it out in case someone is
interested in making this happen.
msg8538 (view) Author: jendrik Date: 2019-02-26.19:02:02
Florian and Silvan, what do you think?
msg8537 (view) Author: jendrik Date: 2019-02-26.19:01:07
I had the same thoughts. I'm leaning towards using ints since all code
(including unmerged code) uses ints, since it has to index into vectors.
Requiring OperatorIDs here would require some boilerplate code for packing and
unpacking ints into and from OperatorID without any big benefit as far as I can
see. It would be a different story if we had a nice way of using OperatorID to
index into vectors, but that's a different issue, I think.
msg8536 (view) Author: malte Date: 2019-02-26.18:50:27
Looking at the code briefly, it uses "int". Is this better than "OperatorID",
which sounds more obvious given the issue title?

I am not saying it should be OperatorID; I don't know.
msg8535 (view) Author: jendrik Date: 2019-02-26.18:11:35
I made a pull request at
https://bitbucket.org/jendrikseipp/downward/pull-requests/120 . Any volunteers
for reviewing?
msg8534 (view) Author: jendrik Date: 2019-02-26.16:07:13
Currently, PDB match trees operate on AbstractOperator objects. If we let them
work on operator IDs instead, reusing pdbs::MatchTree becomes easier and the
saturated cost partitioning code from issue780 doesn't have to touch any code in
the "pdbs" directory. The proposed change also reduces the memory footprint of
code that permanently stores MatchTrees.
History
Date User Action Args
2019-02-27 23:16:51jendriksetstatus: reviewing -> resolved
messages: + msg8560
2019-02-27 11:44:01silvansetmessages: + msg8548
2019-02-27 10:39:25maltesetmessages: + msg8546
2019-02-27 10:06:59silvansetmessages: + msg8545
2019-02-26 19:26:40jendriksetmessages: + msg8541
2019-02-26 19:14:18maltesetmessages: + msg8540
2019-02-26 19:07:49maltesetmessages: + msg8539
2019-02-26 19:02:02jendriksetmessages: + msg8538
2019-02-26 19:01:07jendriksetmessages: + msg8537
2019-02-26 18:50:27maltesetmessages: + msg8536
2019-02-26 18:11:35jendriksetstatus: in-progress -> reviewing
messages: + msg8535
2019-02-26 17:31:19floriansetnosy: + florian
2019-02-26 16:16:37silvansetnosy: + silvan
2019-02-26 16:07:13jendrikcreate