Skip to content

tests: IntentsMaybeSetFromAnotherThread waits for its writer - #1325

Merged
transfix merged 2 commits into
masterfrom
fix/intents-thread-test
Nov 17, 2026
Merged

transfix merged 2 commits into
masterfrom
fix/intents-thread-test

Conversation

@transfix

Copy link
Copy Markdown
Owner

AriadneWorldVehicles.IntentsMaybeSetFromAnotherThread runs 120 frames while a writer thread replaces vehicle a's intent, then expects a to be moving. The frames take a few tens of milliseconds. On a busy machine the writer can start, or be descheduled, for all of them. Then no intent reaches a, which sits still, and only the last 6 frames move it: speed 0.10766078436440293 m/s.

That's what recipe / windows-2022 / Release read on #1318, on all 3 ctest tries (job 133254944922). A writer held back until the frames end reads the same value bit for bit. The test is unchanged on master, so it can fail any PR's Windows job the same way.

Change (test only, src/cvc/tests/ariadne_scene_world_test.cpp):

  • The frames start once the writer has landed its first intent, waiting at most 10 s.
  • After the 120 frames, the world steps on a frame at a time until an intent lands while it steps, again at most 10 s.
  • A failure now says a's speed after the threaded frames, how many intents landed during them, and whether a existed.

The same two commits are on #1317 (feat/scene-wind, 4b5b01b and f4fbf22), so that branch merges with this one cleanly.

Checked: MSVC Release. AriadneWorldVehicles 15/15 pass, and this test passes 20/20 with --gtest_repeat=20. On the wind branch it also passes with the writer deliberately started 300 ms late.

…intent

The test runs 120 frames while a writer thread replaces vehicle a's intent, then expects a to be
moving. A thread can start late: on a busy machine all 120 frames (a few tens of milliseconds)
passed before the writer ran, no intent reached a, and only the last 6 frames moved it. That
reads 0.10766078436440293 m/s, which is what recipe / windows-2022 / Release read on #1318, and
what a writer held back until the frames end reads here, bit for bit.

The frames now start once the writer has landed an intent (10 s at most). A failure says a's speed
after the threaded frames, how many intents landed during them, and whether a existed. It passes
with the writer started 300 ms late.
…s mid-run

After its first intent the writer may still be descheduled for all 120 frames (a few tens of
milliseconds on a busy machine), which would fail the check that an intent landed while the world
stepped. The world now steps on, a frame at a time, until one does (10 s at most).
@transfix
transfix enabled auto-merge (squash) November 16, 2026 15:49
@transfix
transfix merged commit 83b2d68 into master Nov 17, 2026
29 checks passed
@transfix
transfix deleted the fix/intents-thread-test branch November 17, 2026 02:40
transfix added a commit that referenced this pull request Nov 17, 2026
One conflict, in ci.yml's SAN_CXX_TESTS: this branch added stream_test, net_ws_client_test and
ariadne_host_test to the sanitizer legs' list, and #1292 added gradient_vector_diffusion_test,
critical_points_test and seed_generators_test (reflowing the lines). Kept both.

ci.yml's line 1271 (the arigl-web path filter's files.h/files.cpp line) also goes back to master's
bytes: master stores ci.yml with CRLF but that one line LF-only, and an earlier merge here had
given it a CR, a whitespace-only change in this PR's diff.
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