The node-engine never overwrites a rank wait with the composer's mark; the composer's watch ends with its run (H-A-480) #252

Merged
mesh-tools merged 3 commits from fix/rank-wait-kept into main 2026-11-22 15:22:37 +00:00
Member

Builds: design 47 H2, lead answer H-A-480 and its addendum (hq branch design/47-H1-answers-59, commits 218c4020 and 10627efc); H §771, H-A-59.

Cause

main.259's integration test TestNatsAWantOfAHigherRankWaits… failed: under load, the composer's mark, written from a stale read of a have, overwrote the rank wait that a settle had written in between, and the rank wait was never written again.

The change

  • The composer's mark and its clear are a compare-and-set on the have's revision they read; a lost race reads again and keeps the other cause.
  • A module waiting for its rank is never marked.
  • The clear's two cases: a mark is cleared only while the have still says the mark, and a mark on a module that never ran is cleared at the next pass that composes it.
  • A mark whose every write lost its race is said once (failure is loud), not dropped silently.
  • The composer's loop and hearers end with the node agent's run: the agent waits for them (Composer.Wait) once its run stops.

Tests

  • The fixed integration test passes 15 of 15 runs under load (was 14 of 15).
  • -count=15: no panic.
  • New TestAgent rows for the rank-wait line and the clear's guard, each seen failing first.

Reviewed-by: mesh-code-reviewer@shanks at 43839ae66a (two rounds)
Pushed-by: lead-47@shanks

Builds: design 47 H2, lead answer H-A-480 and its addendum (hq branch design/47-H1-answers-59, commits 218c4020 and 10627efc); H §771, H-A-59. ## Cause main.259's integration test `TestNatsAWantOfAHigherRankWaits…` failed: under load, the composer's mark, written from a stale read of a have, overwrote the rank wait that a settle had written in between, and the rank wait was never written again. ## The change - The composer's mark and its clear are a compare-and-set on the have's revision they read; a lost race reads again and keeps the other cause. - A module waiting for its rank is never marked. - The clear's two cases: a mark is cleared only while the have still says the mark, and a mark on a module that never ran is cleared at the next pass that composes it. - A mark whose every write lost its race is said once (failure is loud), not dropped silently. - The composer's loop and hearers end with the node agent's run: the agent waits for them (`Composer.Wait`) once its run stops. ## Tests - The fixed integration test passes 15 of 15 runs under load (was 14 of 15). - `-count=15`: no panic. - New `TestAgent` rows for the rank-wait line and the clear's guard, each seen failing first. Reviewed-by: mesh-code-reviewer@shanks at 43839ae66ac9a296fdcc4047ff2b4b524b12c5d1 (two rounds) Pushed-by: lead-47@shanks
mesh-tools added 3 commits 2026-11-22 15:22:32 +00:00
Under load, a rank wait settle wrote between the composer's read of a have and its
mark was overwritten by the mark and never written again. The mark and its clear
now write over the revision they read (a lost race reads again and keeps the other
cause), a module waiting for its rank is never marked, and a mark on a module that
never ran is cleared at the next pass that composes it.

Builds: design 47 H2 H-A-480 (and its addendum), H §771, H-A-59
The composer's loop and its hearers outlived the node agent's run and logged after
it ended; the node agent now waits for them (Composer.Wait) once its run stops.

Builds: design 47 H2 H-A-480
Review round 1: the line that never marks a module waiting for its rank and the
clear's "only while the have still says the mark" had no failing test; each now
has one. A mark whose every write lost its race is now said, not dropped silently
(P-failure-loud).

Builds: design 47 H2 H-A-480 (review round 1 finding)
mesh-tools merged commit 266512663b into main 2026-11-22 15:22:37 +00:00
mesh-tools deleted branch fix/rank-wait-kept 2026-11-22 15:22:37 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-host#252