Skip to content

Make passive-ACK broadcast behavior more fault tolerant - #90

Open
puddly wants to merge 2 commits into
devfrom
puddly/simplified-passive-ack
Open

puddly wants to merge 2 commits into
devfrom
puddly/simplified-passive-ack

Conversation

@puddly

@puddly puddly commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

The spec doesn't treat this as an error condition, just as an early stopping condition. I looked into how other stacks do this:

  • Z-Stack: only counts "fresh" neighbors with nonzero costs, max 8. Stops early. Never reports an error.
  • EmberZNet: only counts neighbors with nonzero costs but less than 3. This excludes weak neighbors (4-7). Does not stop early, always emits 3 broadcasts (but this can be controlled with an EZSP command). Only reports an error if no expected neighbors relay the frame.

I'm a little conflicted about this change because while it does signal a useful error state (broadcasts aren't being received properly), what is an application supposed to do about it? If a router is offline, it won't be aged out for nearly a minute and the error state will persist until then. In the future, we should look into a granular, reactive counters API or something similar to stream error statuses (tied to individual requests) back to the application.

Copilot AI balanced review requested due to automatic review settings November 10, 2026 00:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the revised broadcast completion semantics.

No open issues 🎉

What changed in this PR

This PR makes missing broadcast passive acknowledgments an early-stopping concern rather than a send failure, aligning broadcast and groupcast completion semantics across the Zigbee stack, driver, and control protocol.

Changes:

  • Report success when a broadcast schedule ends after at least one copy was transmitted, even without a passive-ACK quorum.
  • Remove the quorum-not-reached error and its protocol mapping.
  • Update documentation to describe completion in terms of retransmissions ending.
File Description
crates/​ziggurat-zigbee/​src/​sends/​mod.rs Remove the quorum failure variant.
crates/​ziggurat-zigbee/​src/​sends/​broadcasts.rs Succeed when retransmissions end after a successful handoff.
crates/​ziggurat-protocol/​src/​wire.rs Remove the quorum status and update confirmation documentation.
crates/​ziggurat-protocol/​src/​send_tracker.rs Clarify broadcast confirmation semantics in comments.
crates/​ziggurat-protocol/​src/​bridge.rs Remove the quorum error mapping and update documentation.
crates/​ziggurat-driver/​src/​zigbee_stack/​send_handle.rs Document revised broadcast delivery semantics.
crates/​ziggurat-driver/​src/​zigbee_stack/​nwk.rs Update the broadcast delivery comment.
crates/​ziggurat-driver/​src/​zigbee_stack/​aps.rs Clarify broadcast and groupcast completion documentation.
crates/​ziggurat-driver/​src/​zigbee_stack.rs Remove the driver quorum error and conversion.

Review effort: Balanced

@puddly puddly changed the title Remove broadcast passive-ACK quorum Do not treat broadcast passive-ACK quorum failure as an error Nov 10, 2026
@puddly

puddly commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

I've modified the passive ACK algorithm to be a good mix of the two: we stop early if enough routers relay the broadcast but we only consider neighbors with a cost of 3 or better. This should exclude low-quality neighbors.

@zigpy-review-bot zigpy-review-bot added the bugfix This PR fixes a bug label Nov 10, 2026
@puddly puddly changed the title Do not treat broadcast passive-ACK quorum failure as an error Make passive-ACK broadcast behavior more fault tolerant Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants