Repository navigation
state_exec: the async scheduler's messaging with no router costs one test - #1543
Merged
Merged
Conversation
…test S2b's A/B (#1524) left the msg.* 3% gate inconclusive, but a quiet rerun put msg.* 3.7% slower, mostly msg.fanout, msg.producer_consumer and msg.broadcast. With no router, or the router off, every message operation still made an out-of-line call (async_scheduler::homed_elsewhere, then exec_router::active), every receive looked its process up twice (park_receiver, then subscribe_if_remote), and every delivery made an empty group handle. - exec_router::active() is inline: its two counters move from the pimpl into the class. - async_scheduler::routing_on() (inline) tests the router; homed_elsewhere is an inline wrapper over the out-of-line homed_elsewhere_slow, which runs only with the router on. - park_receiver returns the process it parked, and receive_message / receive_message_until subscribe at a remote home only while routing is on, with no second lookup. - deliver_to_receivers makes its handle only while routing is on. Behaviour is unchanged: router, stress, exec_pool, groups, async, intrinsics, integration and the Ariadne suites pass at the default and at CVC_EXEC_SLICE_STEPS=256.
Owner
Author
|
Three-way A/B, 2026-11-25 11:02-11:09 local time, in a quiet window: the waiter needed three quiet checks a minute apart, and every kept run was quiet. Three rounds of 5 reps of
|
transfix
added a commit
that referenced
this pull request
Nov 26, 2026
…lace the poster's wait (S2b.R3) (#1561) A follow-up to threaded execution's S2b (#1524, #1543), fixing the skeptic's findings K-1 to K-6. A group in its teardown never waited for another closed home, so a receiving group torn down with its home sent its answers and unsubscribes ahead of the home's forward: a duplicate broadcast delivery, a leaked tracker, and a dead process's record that kept the router on. Waiting instead would deadlock two homes torn down at once. - A closed handle takes router entries into a late queue until it is done. The teardown forwards each key's entries to one target, the key's home among the groups open when its first entry goes, forwards the late entries until none are left, then unregisters under the handle's lock and keeps each key's target as a forwarding address. A refused poster follows that address at once. A teardown's own forwards go to open groups only, so nothing comes back to it except a deliver's requeue. - The seal is a backstop for posters as fast as the forward: when a round's batch doesn't shrink, reaches the ingress cap, or 4 rounds have gone, only another teardown's forward is still taken, and any other poster waits for done, a bounded wait. - K-2: a teardown's queued and late sends are forwarded only for keys it homed. K-3: once its teardown begins, post_message goes through the group's handle, keeping a host's order; a post that would die with the group dies now, counted. K-4: the constructor's guard spans the whole constructor. K-5: three of the skeptic's probes are adopted. - The R3 review's fixes: seal on a batch that doesn't shrink or reaches the cap, try_post's refusal reasons, address hops don't count against the 16 re-resolutions, closed-handle posts take only the late-queue mutex and done is atomic. - The router model has the late queue in place of the wait (quick 32 checks, deep 49, 0 unexpected), and the skeptic's teardown-no-wait mutation finds the three findings. The router-model job's timeout is raised to 90 minutes. 16 RouterR3 tests are added to SAN_REQUIRED_S2B.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A follow-up to threaded execution's S2b (#1524). Its A/B left the
msg.*3% gate inconclusive. A quiet rerun (#1524 (comment)) then putmsg.*3.7% slower than before S2b, 17 of 20 points, mostly inmsg.fanout,msg.producer_consumerandmsg.broadcast.With no router set, or the router off, the async scheduler still paid for routing on every message operation:
async_scheduler::homed_elsewhere, and with a router set a second one toexec_router::active;park_receiverand again insubscribe_if_remote;This change:
exec_router::active()inline, by moving its two counters from the pimpl into the class;async_scheduler::routing_on(), an inline test of the router;homed_elsewherebecomes an inline wrapper over the out-of-linehomed_elsewhere_slow, which runs only with the router on;park_receiverreturn the process it parked, so a receive subscribes at a remote home only while routing is on, with no second lookup;deliver_to_receiversbuild its handle only while routing is on.Behaviour is unchanged. On Windows MSVC Release these suites pass at the default and at
CVC_EXEC_SLICE_STEPS=256: router 66, stress 2, exec_pool 87, groups 33, async 143, intrinsics 181, integration 105, ariadne_runtime 364, ariadne_host 54.Measurement: a three-way quiet-window A/B is pending. It compares
msg.*andsched.single.*across base 6489379 (before S2b), S2b as merged (67fda68), and this branch. Its numbers will be added here.