When working on issue1234 we noticed a problem with our current design of binding tasks to task-independent components. So far, we assumed that the DAG created by task-independent components is mirrored by the created task-specific components. However, if a task-specific component P uses a nested component C only in its constructor, this is not the case. In the DAG of task-independent components P is a parent of C but in the created DAG of task-specific components, P does not store a pointer to C. This is problematic if C is also used by another component P' that is bound to the same task later on (for example, two heuristics both using the same landmark factory but only storing the resulting landmark graph). After P is created, it doesn't store a shared pointer to C and the reference counting cleans up C even though it is later still needed in the construction of P'.
We will try to solve this in the following way:
* When binding a task we create a context object and pass this through the recursive call. This context object stored shared pointers to task-specific objects we want to keep alive, analogous to the retention set we used for iterated search.
* In each binding step, we update the stored pointer so objects that are no longer needed are not kept alive (also like in iterated search).
* This might mean that we can move the caching that is currently done inside the task-independent components into the context class.
* Ideally the solution works for iterated search as well, so that we do not need two separate implementations of this idea.
When we first implemented the solution for the iterated search, we moved from the concept of a context class (called cache back then) to storing the already created objects inside the task-independent classes, so in a sense, we are undoing this change. As far as we are aware, the problems that caused us to change back then would be solved by updating the stored values during the binding step with the retention set idea. We don't have a complete picture of the design yet, though.
|