Repository navigation
Ariadne conference: a stale tick is no clock reading; the relay re-stamps a still avatar every 5 s - #999
Merged
Conversation
…amps a still avatar every 5 s The room tree's copy of a still avatar's pose was re-stamped every second, so each receiver got every still peer's pose.server_tick once a second, and the WebSocket re-broadcast sent it again. The pose stream already carries the 1 s heartbeat that clients' clocks follow, but the tree's could not be stretched: a client took every sample's tick as a clock reading. A still peer's pose in the tree is stamped at its last heartbeat, so a joiner that had applied a current stream sample would seek its clock back to the stale tick and forward again at the next one, dropping its avatar's logged inputs each time. - holon::apply_authoritative: only a sample at least as new as the newest one applied, from any participant, is a clock reading (holon::read_clock). An older one still updates its participant. More than holon_config::stale_reading_ticks (1200, 10 s) older is a restarted relay, whose ticks start again near zero, and is a reading. - server_pump takes the tree pose heartbeat (default 1 s). arisrv passes 5 s, under client_pump's 10 s leftover window; arisrv_aoi_bench follows. - arisrv_aoi_bench: the late joiner frames as a client does while it joins, and the report gives its clock's re-alignments. Tests: holon_test AStaleSampleIsNoClockReading (RealignCounterCountsSeeks now seeks on a stalled replica instead of a stale peer); holon_sync_test AJoinerTakesNoClockReadingFromAStaleTreeTick and ThePoseHeartbeatPacesTheTreesRestamp.
…et-pose-tick # Conflicts: # src/cvc/tests/holon_sync_test.cpp
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.
Why
After #995 quieted the traffic meters, the room tree's
pose.server_tickwas most of anidle client's downlink:
The pose stream already carries the 1 s heartbeat that clients' clocks follow. But the tree's heartbeat
couldn't be stretched, because a client took every sample's tick as a clock reading:
and forward again at the next sample.
At 1 s this already happened (a late joiner re-aligned up to 4 times). A longer tree heartbeat made it
worse, which is why #995 left the heartbeat alone.
What changes
holon::apply_authoritative:The slew/seek moved into
holon::read_clock.holon_config::stale_reading_ticksolder (1200 ticks, 10 s, the same window asclient_pump's leftover rule) is a restarted relay, whose ticks start again near zero. That one isstill a reading.
server_pump: takes the tree pose heartbeat (pose_heartbeat_s, default 1 s, unchanged forclients that read poses only from the tree). arisrv passes 5 s, under
client_pump's 10 s leftoverwindow.
arisrv_aoi_benchmirrors it.arisrv_aoi_bench: the late joiner now runs frames like a real client while it joins, plus 3 safter converging. The report gives its clock's re-alignments, which is how the numbers below were
measured.
HolonTest.RealignCounterCountsSeeksasserted the old behavior: "a peer whose tick a heartbeat left old... seeks the clock back". It now checks a counted seek from a stalled replica instead.
Measured
arisrv_aoi_bench --clients 4 --layout spawn --move off --media off --transport ws --poses stream --seconds 15, five runs each, on Windows (static Release). Four still clients and a late joiner."Before" is #995's tip; "after" is #995 plus this change.
When a second re-align remains, the joiner's first sample came from the tree, still stale, before any
stream sample. The next current sample moves the clock forward once, with no back-and-forth.
One idle browser client, local relay, 60 s of the page's WebSocket frames (as in #995):
pose.server_tick1.0–1.3)pose.server_tick0.33)The up difference is one
rtt_msmeter write in that window.A browser client's own re-align count at join isn't a useful measure here. While the page loads, its
measured round trip runs from about 4 s down to 20 ms, and the lead follows it, so the clock re-aligns
at startup even alone in the room.
Tests
holon_testAStaleSampleIsNoClockReading:holon_sync_testAJoinerTakesNoClockReadingFromAStaleTreeTick: a joiner takes a still peer's staletree pose without a second re-align. Disabling the gate in
holon.cppmakes it fail with 3 re-alignsinstead of 1, and
AStaleSampleIsNoClockReadingfail too.holon_sync_testThePoseHeartbeatPacesTheTreesRestamp: 10 re-stamps in 10 s at 1 s, 2 at 5 s, withno other pose leaf written.
holon_test,holon_sync_testroom_intrinsics_test,room_avatar_testroom_aoi_test,room_aoi_relay_testroom_relay_integration_testNotes
measured with both applied.