Preserve UAP ping phase and add configurable retry scheduling - #545
Open
NikolayChirkov wants to merge 15 commits into
Open
Preserve UAP ping phase and add configurable retry scheduling#545NikolayChirkov wants to merge 15 commits into
NikolayChirkov wants to merge 15 commits into
Conversation
Introduce SetReceiveSchedule / QueryPeerReceiveSchedule, remove synthetic response-time seed, and align ping send/RX guards with server semantics. Includes unit tests and aether_uap_delivery_timing_bench (live delivery blocked on peer UAP query completion).
…et_next_read_delay. Server ping() alone stores rx_window as nextReadDelay; follow with set_next_read_delay(interval) so get_uap delta matches the promised ping interval. Harden TimePointOffsetByMs against duration::rep overflow that was clamping anchors to TimePoint::min. Co-authored-by: Cursor <cursoragent@cursor.com>
Prove via public QueryPeerReceiveSchedule that last_ping advances while Bob is alive, freezes after a hard-killed missed deadline, and advances again after the same Bob UID returns. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Preserve the nominal UAP ping schedule across transport retries and expose peer receive timing without turning packet-loss recovery into schedule drift.
The client now keeps logical ping cycles anchored to the original nominal grid, extends receive windows for early sends, supports deterministic peer deadline state, and provides runtime control over how many retries are budgeted before the advertised deadline.
Retry scheduling
ReceiveSchedule::ping_retry_countis the number of additional retries whose time is reserved before the advertised deadline Tn.Default:
ping_retry_count = 0Therefore the default path reserves only
guard + R99/2before Tn.For N > 0:
After Tn,
ping_retry_countis no longer a retry limit. The same logical ping continues recovery until a valid server response confirms it.Phase preservation
Retries remain physical attempts of the same logical ping cycle. A late retry never establishes
retry_time + intervalas a new phase. After recovery the next deadline is the first future point on the original nominal grid.Peer state
next_ping_deadlineon the nominal grid.MissedDeadline represents a missed advertised deadline and is recoverable after later client activity — not a permanent failure.
Guard / RX window
ComputePingSendGuard.AE_PING_GUARD_OVERRIDE_US(undefined = dynamic;0= fixed zero;X= fixed X microseconds).Fault testing
Deterministic logical-cycle fault injection replaces timing-racy bind-next behavior:
FAULT_ARMED→FAULT_MATCHED→FAULT_DROPPEDMatching is by
logical_cycle_idandphysical_attempt_index, not wall-clock alone.Validation
Unit
test-api-protocol: 79/79 PASS (final committed tree)Deterministic first-request-loss (200 cases each)
Long phase characterization
ping_retry_count=0runtime acceptance (15 harness-valid cases)State semantics
Harness note: Alice Q2 in the focused
retry_count=0harness is flaky because of dest-cloud warm-up. This is harness/test infrastructure and did not expose a Bob production recovery failure.Design notes
UAP ping scheduling design doc
Test plan
test-api-protocol79/79 on final treescripts/)Made with Cursor