Proof of concept mechanical port of ircnet/ircd to Rust as part of a bit about C being insecure for network services
0

Configure Feed

Select the types of activity you want to include in your feed.

ircd.rs / docs / claude-memory / p5-s2s-stats-flake.md
1.8 kB

name: p5-s2s-stats-flake description: "Two STATS golden tests (golden_s2s_s_serv_stats + golden_s_misc stats_t) fail on clean HEAD — pre-existing reference-C garbage flakes, not regressions" metadata: node_type: memory type: project originSessionId: f1eaf4be-a5fc-4e63-8a3b-ecd454bbe182#

Two golden tests fail with reference-C STATS garbage, both nondeterministic and independent of your change (the reference-C binary is frozen — your Rust edits can't alter its output; the Rust side prints the correct value):

  1. ircd-golden/tests/golden_s2s_s_serv_stats.rs (s2s_stats_match_reference): report_myservers (STATS m) prints an uninitialized peer sendq for a freshly- bursting peer link — e.g. …0kB recv 3544950785030750208kB sq BURST V1… (left=cref) vs Rust's 0kB sq. Confirmed pre-existing by git stash + rebuild + re-run.
  2. ircd-golden/tests/golden_s_misc.rs (stats_t_matches_reference): STATS t's "link checks … dropped %luSq/%luYg/%luFl" line (s_misc.c:1079) prints ircstp->is_cklQ/is_ckly/is_cklno — which are u_int (4 bytes) — with %lu (8 bytes), so the still-C variadic sendto_one va_args 4 bytes of adjacent call-frame garbage (e.g. 281470681743360Sq/…) vs Rust's 0Sq/0Yg/0Fl. A width-mismatch varargs bug in the C reporter, surfaced at P7ff (read_message port).

How to apply: when a cluster's golden run shows EITHER of these red, it is NOT your regression — verify the divergence is reference=garbage / Rust=clean-value, note it in the commit/log, and move on. A real fix belongs to the canonicalizer (mask the STATS counter fields) or to fixing the C %lu/u_int mismatch — both are P8/P11 concerns once the variadic senders are replaced. Related: [[p5-s2s-golden-harness]], [[run-only-edited-tests]].