Opened 9 years ago

Closed 9 years ago

Last modified 3 years ago

#627 closed optimization (performed)

fix resource handling in parsimony

Reported by: westram Owned by: westram
Priority: minor Milestone: arb7.0
Component: ARB_PARSIMONY Version: SVN
Keywords: Cc:

Description (last modified by westram)

  • parsimony leaks nodes and edges fixed with [13321]
    • does not really affect usability, because this happens only under rare conditions (e.g. remove/add nodes) and does not affect tree optimization itself
    • but this hinders checking parsimony with memory debuggers like valgrind/leak sanitizer
  • one cause for #620 seems to be an initialization problem: didnt fix anything :(
    • when new nodes get inserted into tree it is impossible to push their (not-inserted) state onto the undo-stack (as insertion is performed by base class which does not know anything about undo-stacks)
    • the node-factory can perform these stack operations, but w/o correct resource handling it appears hard to verify whether that fix does work as expected
  • the method moveNextTo (in AP_tree and AP_tree_nlen) is really a PITA compared to what it effectively does (remove a node and re-add it to another part of the tree). Debugging/reading that code is quite useless.
    With proper resource handling at hand, it would be possible to replace the whole thing by remove+insert - i do not expect that to generate more combines.

still TODO

  • provoke create+destroy on same stack frame ⇒ instant delete possible when stack frame gets removed (true for accept and revert) by [13380:13382]
  • top-level FrameStackData should not store anything. That data is outside of any stack-frame ⇒ state will always get accepted ⇒ handle resources like accept does
    by [13379]
  • use sorted vectors instead of sets for resource management (only need to check for common nodes/edges when a stack-frame is dropped)

Attachments (3)

moveNextTo_original.patch (4.0 KB) - added by westram 9 years ago.
attempt to replace moveNextTo by simpler implementation (use old method; compare with new)
moveNextTo_replacement.patch (10.3 KB) - added by westram 9 years ago.
like moveNextTo_original.patch, but use new, compare with old (changes test results)
moveNextTo_diff.patch (6.6 KB) - added by westram 9 years ago.
interdiff between both methods

Download all attachments as: .zip

Change History (15)

comment:1 Changed 9 years ago by westram

  • Owner changed from devel to westram
  • Status changed from new to _started

comment:2 Changed 9 years ago by westram

basically fixed by [13321]

comment:3 in reply to: ↑ description Changed 9 years ago by westram

Replying to description:

  • one cause for #620 seems to be an initialization problem:
    • when new nodes get inserted into tree it is impossible to push their (not-inserted) state onto the undo-stack (as insertion is performed by base class which does not know anything about undo-stacks)
    • the node-factory can perform these stack operations, but w/o correct resource handling it appears hard to verify whether that fix does work as expected

Tested initializing new nodes with [13341]: had no effect on restore bugs :(

comment:4 Changed 9 years ago by westram

  • Description modified (diff)
  • Priority changed from normal to minor
  • Status changed from _started to assigned

comment:5 Changed 9 years ago by westram

  • Status changed from assigned to _started

comment:6 Changed 9 years ago by westram

  • Description modified (diff)

comment:7 Changed 9 years ago by westram

  • Description modified (diff)

Changed 9 years ago by westram

attempt to replace moveNextTo by simpler implementation (use old method; compare with new)

Changed 9 years ago by westram

like moveNextTo_original.patch, but use new, compare with old (changes test results)

Changed 9 years ago by westram

interdiff between both methods

comment:8 in reply to: ↑ description ; follow-up: Changed 9 years ago by westram

Replying to westram:

  • the method moveNextTo (in AP_tree and AP_tree_nlen) is really a PITA compared to what it effectively does (remove a node and re-add it to another part of the tree). Debugging/reading that code is quite useless.
    With proper resource handling at hand, it would be possible to replace the whole thing by remove+insert - i do not expect that to generate more combines.

I give up on that issue: wasn't able to figure out why the new method changes the test results. Changes are caused by running NNI after quick-add (which uses moveNextTo to find best position). The NNI behaves slightly different when the new method is used, but i could not detect the reason why. Topologies (before NNI) are identical for both versions of moveNextTo().

comment:9 Changed 9 years ago by westram

  • Resolution set to performed
  • Status changed from _started to closed

comment:10 Changed 8 years ago by westram

  • Milestone set to arb6.1

mark changes that got fixed after arb 6.0.x

comment:11 in reply to: ↑ 8 Changed 6 years ago by westram

Replying to westram:

I give up on that issue: wasn't able to figure out why the new method changes the test results. Changes are caused by running NNI after quick-add (which uses moveNextTo to find best position). The NNI behaves slightly different when the new method is used, but i could not detect the reason why. Topologies (before NNI) are identical for both versions of moveNextTo().

Again stumbled across that problem: the use of moveNextTo() apparently causes edges to be moved around in the tree. quick-add processes an EdgeChain attempting to visit all possible insert-positions. as a result some insert positions are not visited at all, others are visited twice.

comment:12 Changed 3 years ago by westram

  • Milestone changed from arb6.1 to arb7.0

Milestone renamed

Note: See TracTickets for help on using tickets.