Open ashton314 opened 1 month ago
Indeed, with commit d714874 I had to do some funny work around branches: whenever you enter an if
expression, we switch into processing the branch blocks in a pseudo-CPS mode. This is because the decision communication needs to wrap the rest of the computation together. (See how endpoint projection is defined for ăââ[d] â ââ; Că.)
Since decision communication is scoped to an if
expression (i.e. it cannot sensibly appear outside an if
) then the if
should in principle be able to tell what parties need to know about the decision.
I'm confused. Why do branches need different processing?
Looking at this chunk from sec 5.3, the projection looks local. This translation could happen outside an if
:
Is there trouble implementing choose
and allow
?
HasChor does choice broadcasting automatically: https://doi.org/10.1145/3607849
Sec 3.3 says it's for convenience, but may lead to more communication than necessary.
EDIT: the Choral paper has a longer discussion. https://dl.acm.org/doi/pdf/10.1145/3632398
Broadcasting seems like a very reasonable default! Can Chorex look ahead for choice-broadcast expressions and use the default only if there are none in the branch?
Consider this example from the paper:
The paper goes on to say that only ââ never needs to be informed because its behavior is the same down both branches; not so for ââ, since its behavior depends on what ââ decides at the test in the
if
.We should be able to figure out what parties actually need to know what the decision is and automatically add the decision-sending code by looking at the branches and analyzing how actors' behaviors differ. So, I'd like to be able to write:
Is this tantamount to asking, "how much can I lift out of the if?"