OpArrayCache: propagateDirty doesn't work correctly in the beginning
buotex opened this issue · comments
To simulate:
In PixelClassification,
- Reload project with saved prediction data
- replace opSlicedSlicedArrayCache with opArrayCache for the prediction_cache_gui in opPixelClassification
- label some pixels while not in liveUpdate
- click LiveUpdate
Expected behaviour: Retraining of Random Forest
Observed behaviour: It will pull data from the harddisk-stored prediction cache instead of recalculating
Additional notes:
After labeling once while having LiveUpdate activated, it will afterwards behave as expected
Reasoning: In OpArrayCache, if "self._cache == None" and "fixAtCurrent == True",
NO flags (e.g. FixedDirty) are set if the Input is dirty, therefore later changing fixAtCurrent to False will not send Output.propagateDirty().
After labeling while LiveUpdate is activated, self._cache is filled and the operator will remember changes in the "fixed" state, propagating them later when becoming unfixed.
In a later stage, this then dirties precomputed_predictions_gui.SlowInput, triggering a re-computation.
I think using _forwardDirty as in the blockedCaches should fix this behaviour.
Very Important , this seems a big bug
Can a test case for this be added to lazyflow/tests/testOpArrayCache.py?
Some asserts fail when not setting the blockShape manually (testOpArrayCache:43), as then the blockState is not correctly initialized.
This issue has been fixed. Also the asserts mentioned in the last comment were fixed in 5e28ad3.