feat(server): implement echo core #79

Merged
Lochnair merged 2 commits from feat/server-echo-core into main 2026-08-12 16:52:45 +00:00
Lochnair commented 2026-08-12 16:39:17 +00:00 (Migrated from github.com)
No description provided.
chatgpt-codex-connector[bot] (Migrated from github.com) reviewed 2026-08-12 16:42:04 +00:00
chatgpt-codex-connector[bot] (Migrated from github.com) left a comment

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8abab7ee38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `8abab7ee38` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
@@ -0,0 +109,4 @@
impl ClockSource for SystemClock {
fn sample(&mut self) -> ClockSample {
ClockSample {
wall_ns: wall_ns(),
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-08-12 16:42:04 +00:00

P2 Badge Preserve timestamp ordering across wall-clock adjustments

When the system wall clock is stepped backward between the receive and send samples (for example by NTP, virtualization, or an administrator), reading SystemTime::now() independently here can produce a receive-wall timestamp later than the send-wall timestamp. This violates the timestamp ordering contract and can make clients discard server-processing measurements or calculate incorrect wall-clock delays; derive both wall values from a stable baseline/monotonic elapsed time or otherwise enforce nondecreasing samples.

AGENTS.md reference: crates/irtt-server/AGENTS.md:L129-L133

Useful? React with 👍 / 👎.

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Preserve timestamp ordering across wall-clock adjustments** When the system wall clock is stepped backward between the receive and send samples (for example by NTP, virtualization, or an administrator), reading `SystemTime::now()` independently here can produce a receive-wall timestamp later than the send-wall timestamp. This violates the timestamp ordering contract and can make clients discard server-processing measurements or calculate incorrect wall-clock delays; derive both wall values from a stable baseline/monotonic elapsed time or otherwise enforce nondecreasing samples. AGENTS.md reference: [crates/irtt-server/AGENTS.md:L129-L133](https://github.com/Lochnair/irtt-rs/blob/8abab7ee386332e44bd5ad822bf3a56da2abfe75/crates/irtt-server/AGENTS.md#L129-L133) Useful? React with 👍 / 👎.
Lochnair (Migrated from github.com) reviewed 2026-08-12 16:47:52 +00:00
@@ -0,0 +109,4 @@
impl ClockSource for SystemClock {
fn sample(&mut self) -> ClockSample {
ClockSample {
wall_ns: wall_ns(),
Lochnair (Migrated from github.com) commented 2026-08-12 16:47:52 +00:00

Fixed in cce2ff7: timestamp_fields now holds the receive sample back to the send sample per clock domain (ClockSample::not_after), so a backward wall step between the two readings can no longer invert the pair. I kept it a per-reply, stateless correction rather than deriving both wall values from a monotonic baseline — anchoring the wall clock to the process origin would drift and never pick up a legitimate NTP correction, and latching a pre-step value across packets is exactly the smoothing spec §12 forbids; moving the earlier value means both reported values describe the clock as it now stands. Covered by a_backward_wall_step_never_reports_receive_after_send, which pins the wall clamp, the untouched monotonic domain, and the midpoint case.

🤖 Addressed by Claude Code

Fixed in cce2ff7: `timestamp_fields` now holds the receive sample back to the send sample per clock domain (`ClockSample::not_after`), so a backward wall step between the two readings can no longer invert the pair. I kept it a per-reply, stateless correction rather than deriving both wall values from a monotonic baseline — anchoring the wall clock to the process origin would drift and never pick up a legitimate NTP correction, and latching a pre-step value across packets is exactly the smoothing spec §12 forbids; moving the earlier value means both reported values describe the clock as it now stands. Covered by `a_backward_wall_step_never_reports_receive_after_send`, which pins the wall clamp, the untouched monotonic domain, and the midpoint case. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
Sign in to join this conversation.