Skip to content

fix(union)!: a zero fixed union weight disables its child - #187

Merged
blackopsrepl merged 1 commit into
mainfrom
feature/178-union-zero-weight
Nov 4, 2026
Merged

blackopsrepl merged 1 commit into
mainfrom
feature/178-union-zero-weight

Conversation

@blackopsrepl

Copy link
Copy Markdown
Collaborator

Closes #178. Base main @ 601f8968, one commit 2ecd40c1.

Gate on 2ecd40c1 (fmt, clippy -D warnings, doc-names file-length facade-reachability public-api deps, rustdoc -D warnings, examples, workspace all-feature tests, doctests): EXIT 0, 1531 passed, 0 failed, 65 result lines. Mutation check: counting a disabled child in the union size fails a_disabled_child_is_not_counted_in_the_union_size.

The docs said a zero weight disables a union child; the compiler rejected
every zero weight instead. Zero weights are now accepted: the scheduler
never pulls from such a child, the composition never opens its cursor, and
the union's size leaves it out, so an enclosing `candidate_count` union
weighs it as absent. Fixed weights that are all zero are rejected, because
such a union can never produce a move.

Closes #178.

BREAKING CHANGE: the configuration error for fixed union weights changed
from "must all be positive" to "need at least one positive weight"; a
union with some zero weights now compiles and runs without those children.
@blackopsrepl
blackopsrepl merged commit 2ecd40c into main Nov 4, 2026
12 checks passed
@blackopsrepl
blackopsrepl deleted the feature/178-union-zero-weight branch November 4, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Union weights: a zero weight is rejected instead of disabling the child

1 participant