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>
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.
**<sub><sub></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 👍 / 👎.
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.
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)_
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
💡 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
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".
@@ -0,0 +109,4 @@impl ClockSource for SystemClock {fn sample(&mut self) -> ClockSample {ClockSample {wall_ns: wall_ns(),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 👍 / 👎.
@@ -0,0 +109,4 @@impl ClockSource for SystemClock {fn sample(&mut self) -> ClockSample {ClockSample {wall_ns: wall_ns(),Fixed in
cce2ff7:timestamp_fieldsnow 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 bya_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