docs(blog): add 011-the-dial-out-you-can-only-test-by-not-dialing
Post 011 in the C->Rust port series, closing the I/O trilogy (009 leaves,
010 inbound front door, this outbound dial). connect_server (s_bsd.c:2516) is
the daemon dialing out to a configured C-line peer. Its whole point is the
connect() succeeding, and that path is untestable at L1 -- it needs a live
listening peer plus the event loop, which is the L2 golden harness; and the
111 golden scenarios all dial INTO the daemon, never make it dial out, so the
most-tested program here has zero coverage of this function's success path.
The L1 oracle therefore diffs the negative space: the three deterministic ways
connect_server refuses to dial -- find_server hit (server already present,
return -1 before any socket), the remote-by notice arm, and connect_inet's
bind() failure into the free_server cleanup (asserting highest_fd unchanged +
hash left clean). Three tests for a function whose job is to connect, none of
which connect.
Also the faithful-port edge case: the DNS-resolution block at s_bsd.c:2544
guarded by !aconf->ipnum.S_ADDR is dead under AF_INET6 (S_ADDR = s6_addr, an
embedded array, so !&array is a constant false; common/os.h:686). Ported by
omitting it -- dead code has no behavior, so the oracle can't distinguish
present from absent, but the oracle also can't PROVE it dead; that's a reading
of the macro, not a test result. Plus the find_server/hash_find_server gotcha:
the suffix-mask search overwrites '.'->'*' in place, faulting on read-only
c"..." literals. All citations verified vs s_bsd.c + connect_server_diff.rs.
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Xe Iaso <me@xeiaso.net>
docs(blog): add 012-you-cant-rename-a-symbol-that-isnt-there
Post 012 in the C->Rust port series, on the one class of function the L1
differential oracle structurally cannot test: file-`static` functions. The
oracle is built on `objcopy --redefine-syms foo cref_foo`, and the rename map
comes from `nm -g --defined-only` (ircd-testkit/build.rs) -- globals only. A
`static` function has internal linkage, no external symbol, so no `cref_`
twin can be made without editing the C. First hit in P6 (lookup_confhost,
static int in s_conf.c -> the L1 test linked but failed undefined).
Two opposite escape hatches: de-static it (the one C edit the faithful port
allows -- storage-class only, justified in a comment; mysk in P7s minted
cref_mysk for free), or leave it static and port a private Rust twin verified
only transitively through its exported caller. P7 has four twins:
set_sock_opts (s_bsd.c:1489), check_init (:873), check_clones (:1577),
connect_inet (:2680). The honest limit: the oracle diffs at exported-symbol
granularity, so a red caller-diff can't localize to the static callee -- GCC
already inlined the static into its caller C-side; the Rust port un-fused them
for readability, but the diff stays whole-symbol. And the 010 trap recurs:
transitive coverage only walks the branches the caller's tested path takes
(check_clones' age-out branch needs a 2s gap no golden scenario waits, so it's
covered by a reading, not a test).
Topic chosen by the user from a 2-option AskUserQuestion. All citations
verified vs s_bsd.rs (the four twins) + ircd-testkit/build.rs (the nm -g
filter) + the P6 progress log (lookup_confhost). Mandatory xe-writing-style +
sound-like-a-person passes run; successive-paragraph-letter audit clean.
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Xe Iaso <me@xeiaso.net>