Skip to content

ari/arigl snapshot --settle S; deflake AriNet.SnapshotWaitsThroughWorkBetweenRequests - #920

Merged
transfix merged 2 commits into
masterfrom
fix/ari-net-settle-debug
Oct 31, 2026
Merged

transfix merged 2 commits into
masterfrom
fix/ari-net-settle-debug

Conversation

@transfix

Copy link
Copy Markdown
Owner

AriNet.SnapshotWaitsThroughWorkBetweenRequests failed all 3 retries on #912's package-linux / libcvc-debug lane, the Debug coverage build, at about 10.7 s each. The output was first: 401 with an empty second:, and only one request reached the server. The same lane passed on #911, #902 and #905.

Cause. Between its two requests the document runs a 30000-iteration loop, which must outlast three drains (each pumps the scheduler for 0.1 s) so the test proves that settle waits while a program is busy with nothing in flight. Measured with ari snapshot on that loop:

  • RelWithDebInfo: 0.53 s.
  • Debug, on an idle 32-core machine: 9.5 s, about 18x slower and already at snapshot's 10 s settle cap.

Settle itself behaves correctly: it keeps waiting while the program is runnable and stops at its cap. The test's workload simply doesn't fit the cap in a slow build. Reproduced locally in Debug with every core loaded: with the default cap the loop is cut off (done: empty, 10.4 s); with --settle 120 it finishes (23 s).

Change.

  • --settle S, a general host flag (host_cli): with the network on, snapshot waits at most S seconds for the document to go idle. The default, kDefaultSettleSeconds, is 10 as before.
  • ari, and arigl in a window and with --terminal, pass it to AppRuntime::settle. It also helps a snapshot against a slow server.
  • The test keeps its workload, so it still catches a settle that counts only requests in flight, and runs with --settle 120.

Tests.

  • AriadneHostCli.SettleIsSecondsAboveZero.
  • The fixed test passes 3 of 3 in Debug (about 10 s each).
  • ari_net_test (8) and ariadne_host_test (23) pass in RelWithDebInfo.
  • arigl isn't built locally (the change there is two call sites); CI covers it.

Docs: docs/ARIADNE.md §10.3 and the usage text.

Not done here. time-elapsed, step-count and the other resource intrinsics read ictx.proc, which in Ariadne's action and resident lanes is a placeholder process that never runs, so they report 0 there. A loop bounded by (time-elapsed) would otherwise have been the build-independent way to write this test. Left as a separate fix.

…Requests no longer races the 10 s cap

The test's work between two requests (a 30000-iteration loop) must outlast three drains,
each a 0.1 s pump: 0.53 s optimized, but 9.5 s in a Debug build on an idle 32-core machine,
so a Debug coverage lane on a busy runner ran past snapshot's 10 s settle and lost the
second reply (seen on #912's package-linux / libcvc-debug, 3 of 3 retries).

- --settle S (host_cli, any runtime): with the network on, snapshot waits at most S seconds
  for the document to go idle; default kDefaultSettleSeconds (10), as before. ari and
  arigl (window and --terminal) pass it to AppRuntime::settle.
- The test keeps its workload and runs with --settle 120.
# Conflicts:
#	inc/cvc/ariadne/host_cli.h
#	src/ari/main.cpp
#	src/cvc/ariadne/host_cli.cpp
#	src/cvc/tests/ariadne_host_test.cpp
@transfix
transfix merged commit 2e25a63 into master Oct 31, 2026
28 of 32 checks passed
@transfix
transfix deleted the fix/ari-net-settle-debug branch October 31, 2026 17:44
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