Skip to content

feat(server): lag compensation quota (CV-164) - #12

Merged
Leo-Galli merged 1 commit into
mainfrom
feat/cv-164-lag-compensation-quota
Nov 24, 2026
Merged

Leo-Galli merged 1 commit into
mainfrom
feat/cv-164-lag-compensation-quota

Conversation

@Leo-Galli

Copy link
Copy Markdown
Contributor

Summary

  • Add server-measured RTT lag compensation (ADR-005): EWMA tracker, interim quota clamp((initial+40×inc)/60, 200, 1000) ms (remeasure CV-305), apply_move_with_rtt credits min(RTT/2, remaining_quota) and sets optional MoveApplied.lag_comp_ms.
  • Persist per-seat quotas and last one-way; claim_flag / check_flag use the same credit so lag-safe moves are not falsely flagged; create_game seeds quotas when clocks are set.
  • Tests with fake RTT (tests/lag_quota.rs); README STATUS Lag compensation Built.

Test plan

  • cargo fmt --check / cargo clippy --locked --all-targets -- -D warnings
  • cargo test --locked (local; Redis integration skips without REDIS_URL, CI has Redis 7)
  • node scripts/verify-readme.mjs
  • CI verify green on this PR

Credit min(RTT/2, remaining seat quota) on apply; EWMA tracker and interim clamp published until CV-305. Flag claims use last one-way sample so lag-safe moves are not falsely flagged.
@Leo-Galli
Leo-Galli merged commit 83f28f9 into main Nov 24, 2026
1 check passed
@Leo-Galli
Leo-Galli deleted the feat/cv-164-lag-compensation-quota branch November 24, 2026 10:40
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