Skip to content

arisrv: relay_pair starts its client once the relay serves its room (debug-grpc's arisrv_world_regenerate) - #1567

Merged
transfix merged 1 commit into
masterfrom
fix/relay-pair-waits-for-room
Nov 27, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/relay-pair-waits-for-room

Conversation

@transfix

Copy link
Copy Markdown
Owner

Fixes the red package-linux / libcvc-debug-grpc job on master. It fails only on arisrv_world_regenerate, 3/3 on every master run since the test first ran in that job (#1537). For example, run 45789454487, job 139873382279:

FAIL .../world_regen_client.ari (10.64 s)
     load failed: relay: grpc://127.0.0.1:44831 admitted no room 'ctest' in time (is it the relay's --room?)

What the relay spends the time on

arisrv listens before it loads its --doc. Its room steps only after the load, and only then is the room sent to clients. A client that joins earlier waits for the room for 10 s (relay_session::join). The relay's log stops at rules: because the next thing it does is load the server document.

I timed world_regen_server.ari's load in a local Debug gRPC build (MSVC /Od, probes not committed). Of 5.8 s:

part s
world generation (generate_world), mostly the roads' grade stage (0.85 s) 1.25
painting the dataset bundle's 2048×2048 ground.png (paint_surface) 3.28
encoding it as a PNG (ground_png) 1.22
the GLB (city_bundle_bytes) 0.07

The world's rules are negligible. Release loads the same document in about 1.3 s. CI's Debug lane also has coverage and runs ctest --parallel, which takes the load past 10 s.

The fix

  • arisrv prints [arisrv] serving room '<room>': it steps from now just before its loop (arisrvx too: same main.cpp).
  • relay_pair.py starts the client once it reads that line, or once the relay has stopped, so a relay that fails its load still meets its client as before. It waits at most 90 s, inside these tests' 120 s TIMEOUT.

The test's world and the join wait are unchanged. Nothing is skipped in Debug.

Verified

PRs don't run the debug-grpc lane, so I checked locally with a Debug gRPC build (CVC_ENABLE_GRPC, CVC_ENABLE_WS, assimp on, as CI has them):

  • All 20 arisrv_* ctests pass, including the 7 that use relay_pair.py. arisrv_world_regenerate passes in about 11 s. It passed uncapped before this change too, because the local load (about 5.5 s) fits the 10 s join.
  • To match CI's slowness, I ran the test's own command line inside a Windows job object hard-capped at half a core. The relay's load then takes 21 s, about twice as slow as CI's.
    • The old relay_pair.py fails exactly as CI does: client FAIL at 10.65 s, "admitted no room 'ctest' in time".
    • The new one passes twice: the client's 4 tests in 17.9 s and 17.4 s, the pair in 39.9 s and 40.6 s. That time includes test c's regenerate, which runs a second load on the relay's loop. The client document's 30 s timeout and the test's 120 s both hold.

Not run locally: the arisrvx_* and arigl relay pairs (this build has no Python embedding). pycvc-linux runs them on this PR.

Not in this PR

  • The bundle's ground texture is painted at a fixed 2048² whatever the world's size. On this 200 m world that is about 10 cm per texel, and the streets' paint touches far more texels per road than on a large world (a 600 m world loads faster than this 200 m one). Sizing the texture to the world, or making paint_surface cheaper, would cut every generated world's load and regenerate. world_ground_size is shared with cvcGL's renderer and its tests, so that change belongs in its own PR.
  • A build with CVC_ENABLE_GRPC and without CVC_ENABLE_WS doesn't compile arisrv: reapticks is declared under #if CVC_ENABLE_WS (main.cpp:1516) but used unconditionally (main.cpp:2380).

package-linux / libcvc-debug-grpc has failed arisrv_world_regenerate 3/3 on
every master run since the test first ran there (#1537): the client's load
gives up after its 10 s join with "admitted no room 'ctest' in time".

The relay listens before it loads its --doc, and its room steps (and is sent
to clients) only after. world_regen_server.ari's generated world makes its
dataset at load: timed in a local Debug build, 5.8 s of load are the world
1.25 s (the roads' grade stage 0.85 s), painting the bundle's 2048x2048
ground.png 3.3 s, encoding it as a PNG 1.2 s, and the GLB 0.07 s. Debug with
coverage on CI, under ctest --parallel, takes it past 10 s.

arisrv now prints "serving room '<room>'" just before its loop, and
relay_pair.py starts the client once it reads that line (or the relay has
stopped), within 90 s. Under a job object capping the test at half a core
(the relay's load then takes 21 s), the old relay_pair fails exactly as CI
does, and the new one passes: the client's 4 tests in 17.4 s, the pair in
40.6 s, inside the test's 120 s.
@transfix
transfix enabled auto-merge (squash) November 26, 2026 22:04
@transfix
transfix merged commit 9d863a4 into master Nov 27, 2026
30 checks passed
@transfix
transfix deleted the fix/relay-pair-waits-for-room branch November 27, 2026 03:17
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