make_move_gate

jaxrens.constraints.base.make_move_gate(descriptors, mutates)[source]

Build the constraint gate for a single move type.

Selects the descriptors whose depends_on intersects this move’s mutates set — i.e. the constraints the move could actually violate — instantiates their predicates once, and returns a combined gate.

Parameters:
Returns:

None when no registered constraint depends on an aspect this move mutates (the caller then uses its no-op fast path), otherwise a function (positions, types, cell) -> (ok, reject_reason) where ok is a scalar bool (all constraints satisfied) and reject_reason is the int32 bucket of the first violated constraint (0 when ok).

Return type:

Callable[[Array, Array, Array], tuple] | None