Repository navigation
state_exec: the resource intrinsics and state-watch speak for the running process - #927
Merged
Merged
Conversation
…ning process A host that runs programs on a shared scheduler gives each intrinsics context a placeholder process and no pid: Ariadne's action and resident lanes do. time-elapsed, time-limit, step-count, memory-limit and the message counters read that placeholder, so they reported 0 there, and a loop bounded by (time-elapsed) never ended. state-watch registered its handler for pid 0, which the scheduler ignored, so a watch set from an action or a resident never fired. They now use the process the scheduler is stepping (running_process / running_pid), as self-pid, budget-usage, msg-send and await already did, and the context's own only with no step running. Tests (AriadneResourceIntrinsics.*): a resident's clock-bounded loop ends by the clock with a non-zero step count, an action sees its time limit, and a resident's watch fires; each fails on master. Docs: the developer guide.
# Conflicts: # src/cvc/tests/ariadne_host_test.cpp
# Conflicts: # src/cvc/tests/ariadne_host_test.cpp
…ing-process # Conflicts: # src/cvc/tests/ariadne_host_test.cpp
transfix
enabled auto-merge (squash)
October 31, 2026 17:48
… file #917 adds its resident-restart tests where these were, after the module-tick tests; at the end they no longer conflict with it, whichever lands first.
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.
Found while deflaking
AriNet.SnapshotWaitsThroughWorkBetweenRequests(#920).The bug. A host that runs many programs on one shared scheduler gives each
intrinsics_contexta placeholder process (make_process(), statusready) and leavespidunset. Ariadne's action and resident lanes do this (submit_action,ensure_resident).time-elapsed,time-limit,step-count,memory-limit,message-count,message-limitand the message-byte pair readctx->proc, so in those lanes they reported 0. A loop bounded by(time-elapsed)never ended.state-watchregistered its handler forctx->pid(0). The async scheduler silently ignores an unknown pid, so a watch set from anon:action or a resident never fired.The fix. Two helpers in
intrinsics.cpp:running_process(ctx)(the scheduler'scurrent_process(), elsectx->proc) andrunning_pid(ctx)(current_pid(), elsectx->pid).running_process.state-watchandstate-unwatchtake the watch id from, and register with, the running process.self-pid,budget-usage,msg-sendandawaitalready did.Tests (
ariadne_host_test,AriadneResourceIntrinsics.*). Each fails against master'sintrinsics.cpp:AResidentSeesItsOwnProcess: anon_tickresident's loop bounded by(time-elapsed)ends because the clock passed 0.05 s, not because it hit the 100000-iteration safety cap, and(step-count)is non-zero.AnActionSeesItsLimits: a button'son:sees its(time-limit), not the placeholder's 0, and a non-zero step count.AResidentsWatchFires: a watch set from a resident fires when a later tick changes the node. On master it never fires.Locally every ariadne_* and state_exec_* suite passes (38 binaries), including
state_exec_locks_test, whose watch tests use a fixture with a separate placeholderprocper program.Docs: docs/STATE_EXEC_DEVELOPER_GUIDE.md, "Which process they report on".
Not changed:
memory-usagereads the context's memory tracker, which such a host keeps per program.