xodio / xod

XOD IDE
https://xod.io
GNU Affero General Public License v3.0
896 stars 119 forks source link

Fix dirtyness propagation optimization to work fine with tweaks #2048

Closed brusherru closed 4 years ago

brusherru commented 4 years ago

It fixes #2047

The bug was introduced in the 0.33.0 right in the commit https://github.com/xodio/xod/commit/0880f41e252d8e000ade77b5efdb65d28857eba3 😬

evgenykochetkov commented 4 years ago

If I understand #2047 correctly, the following is happening:

digital-write node that wants to update only when UPD pin is touched, as stated by

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

but the code generated in handleDebugProtocolMessages https://github.com/xodio/xod/blob/faf25a86cec036638306768886562b314805313b/packages/xod-arduino/platform/program.tpl.cpp#L149-L150 (and maybe in some other place?) does not respect that.

I think that forcing generation of node_NNN_isOutputDirty_XXX and marking nodes as dirty in such situation is not right. The role of tweak node connected to pin with evaluate_on_pin disabled should be reduced to just storing the received value, and marking the pin ~and node~ dirty should be skipped.

brusherru commented 4 years ago

@nkrkv @evgenykochetkov check it out again, please :)