Skip to main content

Module condition

Module condition 

Source
Expand description

The one predicate mechanism.

Several wrappers gate on a workload-authored polydat expression: if: skips a cycle, while: keeps looping, poll: decides it is done. They are the same operation — evaluate a named binding against the executing node’s kernel and ask whether it is truthy — and they were drifting into separate implementations, with is_truthy copied between if.rs and while.rs under a comment noting the two “share a semantic”. A shared semantic maintained by comment is a semantic that will diverge.

Node-type agnostic by construction. Nothing here knows whether the predicate belongs to an op template, a phase, or something added later. It reads through WireSource, which is whichever polydat kernel instance is in scope for the node being executed. A predicate synthesised into an op-template kernel and one synthesised into a phase kernel are read by the same call; scoping decides which binding is found, exactly as it does for every other wire.

Constants§

UNTIL_BINDING
The wire a poll’s until: expression is lowered to.

Functions§

holds
Evaluate the named predicate against the executing node’s kernel.
is_truthy
Truthiness for every workload-authored predicate in the runtime.