Skip to content

An each starts no queued item once its join has its answer - #52

Merged
jithinAB merged 2 commits into
masterfrom
pact-loops/each-gate-joins
Dec 2, 2026
Merged

jithinAB merged 2 commits into
masterfrom
pact-loops/each-gate-joins

Conversation

@jithinAB

@jithinAB jithinAB commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

An each with at-once-at-most: queued its items on an asyncio.Semaphore. When an item ended, releasing the gate woke the next queued item before the join (_Run.branches) had read the end and seen its waits-for: met, so items past the answer still ran. On master, a three-item each under waits-for: the-first-good-answer and at-once-at-most: 1 runs all three items.

What changes

  • _Run.branches(stage, work, at_once=None) takes the work as callables, starts at_once of them, and starts the next only after it took the one that ended and its rule is not met. A non-growing each passes its at-once-at-most:; together passes no bound. The growing (keeps-taking) path keeps its gate.
  • Test: test_an_each_starts_no_queued_item_once_its_join_has_its_answer (20 runs; on master it starts t1, t2 and t3, here t1 only). Headline counts +1; CHANGELOG entry.

Checks

  • Every adapter test that imports the workflow runtime (15 files): 110 passed, 15 skipped (opt-in live).

BMH counterpart: budmh's PK-6b conformance listed workflow-shapes/first-good-answer as a reference difference for this race; it retires with the next re-pin.

Conflicts with #51 only in the headline counts (both add one test).

🤖 Generated with Claude Code

jithinAB and others added 2 commits December 3, 2026 01:45
The items of an each with at-once-at-most: waited on a gate, which let the next one in as the
ended one released it, before the join read the end. The join now starts the items itself and
starts the next only when its rule is not met.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…headline

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jithinAB
jithinAB merged commit 6943db6 into master Dec 2, 2026
1 of 2 checks passed
vsraccubits added a commit that referenced this pull request Dec 3, 2026
Brings in master's each/join gate fixes (#51, #52): a growing `each` takes
what the requests that joined the run bring, and starts no queued item once
its join has its answer.

Conflicts resolved:
- CHANGELOG.md: both sides kept, master's 3 and 2 December entries first.
- README.md, docs/90-REVIEW.md: the test counts, rewritten with
  scripts/sync-counts.sh (which also updates site-docs/index.md and
  site-docs/status/verified.md): 5606 tests, 1817 Rust + 3789 adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant