From fe5319c6759cff02daef589eb70a17ecb018a0c0 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Tue, 1 Dec 2026 04:08:30 -0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(goiparity,nlparity):=20the=20tier=20cl?= =?UTF-8?q?oses=20=E2=80=94=20spread=20deferred,=20oneshot=20retired,=20th?= =?UTF-8?q?irty=20gated=20(V401)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EG2-T02, the Tier EG close (docs/netlink/goip-parity-events.md): - The kernel spread for events is deferred: the probe over both corpora found ten old-only attributes, every one device-, path- or filter-mask-conditional, its fill conditional byte-identical between the corpora's kernels (v7.1 and v7.3) β€” no decoder branch depends on a kernel-conditional attribute. The measurements and citations are V401's. - nlmon-capture is retired: the product stays committed (the base event corpus), the machinery predates every driven-machinery fix, nothing gated or checked boots it. flake.nix's header, nix/README.md's fixture table and docs/netlink/collection.md name the retirement; mkVm.nix loses the flavor, lib.nix its runner, default.nix and nix/default.nix the attrsets. - The thirty monitor rows gate (the thirteen live V398-V399, the seventeen offline V400), each on its own landing's first clean section run and EG2-T02's second; the ungated surface is `addr show dynamic` alone; TestMonitorRowsGated pins all thirty-two. - Tier gates: O5/O9/O10 regenerated (no drift); both full suites; gofmt; vet; the nine checks; test-focused-goip; the docs check; the full run (OVERALL/DRIVER/HYGIENE_PASS, CONTROL_NOISY 1168, UNGATED_CLEAN, 1495 commands); the whole-repo test-go-race. - Two pre-existing main reds from gotc commits fixed in the same task: the write-gate test's admittedWriteTypes map (cba42d462) and the upstream index's two tc write notes (8b707c8b1). πŸ€– This change was made with pi (LLM-assisted). --- docs/locality-enrichment.md | 3 +- docs/netlink/collection.md | 7 +- docs/netlink/coverage-status.md | 26 +- docs/netlink/goip-parity-events-status.md | 13 +- docs/netlink/goip-parity-events.md | 17 +- docs/netlink/upstream/README.md | 2 + flake.nix | 5 + internal/goipparity/commands_test.go | 122 +++++--- nix/README.md | 5 +- nix/default.nix | 20 +- nix/microvms/default.nix | 38 +-- nix/microvms/lib.nix | 228 +------------- nix/microvms/mkVm.nix | 296 ++---------------- nix/microvms/netlink-capture.nix | 7 +- nix/microvms/scripts/goip-parity.exp | 4 +- nix/microvms/scripts/vm-lib.exp | 3 +- pkg/nlparity/goip-parity-allowlist.json | 50 ++- pkg/nlparity/nlparity_allowlist_test.go | 34 ++ pkg/xtcpnl/testdata_test.go | 3 +- .../xtcpnl_extract_event_fixtures_test.go | 2 +- ...cpnl_rtnetlink_events_realfixtures_test.go | 4 +- pkg/xtcpnl/xtcpnl_write_gate_test.go | 7 +- 22 files changed, 266 insertions(+), 630 deletions(-) diff --git a/docs/locality-enrichment.md b/docs/locality-enrichment.md index 8e090732b..83dec9da0 100644 --- a/docs/locality-enrichment.md +++ b/docs/locality-enrichment.md @@ -343,7 +343,8 @@ which is kept only as the explanation of what they do. ```sh nix run .#capture-netlink-fixtures # DUMPS (RTM_GET* replies), host + sudo -nix run .#microvm-x86_64-nlmon-capture # EVENTS (link/addr/route/neigh), hermetic microVM +# The EVENTS oneshot (microvm-x86_64-nlmon-capture) was retired in V401; the +# 7_1_4 event corpus is frozen and committed. ``` Both write into `pkg/xtcpnl/testdata//` and must be run from the repo diff --git a/docs/netlink/collection.md b/docs/netlink/collection.md index 846e13a0d..9a0eba7f6 100644 --- a/docs/netlink/collection.md +++ b/docs/netlink/collection.md @@ -67,18 +67,19 @@ Events are parsed but not yet exported β€” they do not fit `XtcpFlatRecord`, whi ### Regenerating the fixtures -Four harnesses, all producing real `nlmon` captures under `pkg/xtcpnl/testdata//`. **The three primary ones run in a microVM**; the host script is a diagnostic fallback: +Three harnesses, all producing real `nlmon` captures under `pkg/xtcpnl/testdata//`. **The two primary ones run in a microVM**; the host script is a diagnostic fallback: | Command | Captures | Where it runs | |---|---|---| | `nix run .#microvm-x86_64-netlink-dump-capture` | **dumps** β€” `RTM_GET*` request/reply pairs, into `testdata//dumps/` (clean namespace) and `dumps/mesh/` (bridge + veth pair) | in a hermetic microVM, no `sudo` | -| `nix run .#microvm-x86_64-nlmon-capture` | **events** β€” a scripted link / addr / route / neigh sequence | in a hermetic microVM, no `sudo` | | `nix run .#microvm-x86_64-link-write-capture` | **bond / LACP readback** β€” an 802.3ad bond with a real LACP partner in a second namespace, captured in three negotiation states, into `testdata//link-write//` | in a hermetic microVM, no `sudo` | | `nix run .#capture-netlink-fixtures` | **dumps on whatever host you are on** β€” a diagnostic fallback, not the path for committed fixtures | on the host, via `sudo` | Run all of them from the repo root. -`nlmon` mirrors *every* netlink datagram in its namespace, so on a workstation the capture drowns in NetworkManager and nl80211 chatter; the guest is quiet by construction (all four netlink flavors disable `xtcp2.service`, whose own periodic dumps would otherwise swamp it β€” `mkVm.nix`'s `isNetlinkQuiet` names them once so a fifth cannot be added to two of the four places that need it). +**The events corpus is frozen, not regenerable here.** The fourth harness β€” `nix run .#microvm-x86_64-nlmon-capture`, a scripted link / addr / route / neigh sequence β€” was retired in V401 (EG2-T02, [goip-parity-events.md](goip-parity-events.md)): its machinery predates every driven-machinery fix, so re-running it regenerated nothing the corpus compares against. Its product stays committed (`pkg/xtcpnl/testdata/7_1_4/netlink_route_events*.pcap`, the base event corpus), and new event shapes are captured as the goip-parity VM's `ev*` rows instead. + +`nlmon` mirrors *every* netlink datagram in its namespace, so on a workstation the capture drowns in NetworkManager and nl80211 chatter; the guest is quiet by construction (every netlink flavor disables `xtcp2.service`, whose own periodic dumps would otherwise swamp it β€” `mkVm.nix`'s `isNetlinkQuiet` names them once so a new one cannot be added to two of the four places that need it). **A third flavor captures on the same topology but produces no fixtures.** `nix run .#microvm-x86_64-goip-parity` records an `ip β†’ goip β†’ ip` triple per command and runs `goip-parity compare` in the guest, so its output is a verdict rather than committed bytes β€” which is why it is not in the table above. It matters here because it shares this topology *by definition*, not by convention: the namespace build lives in `nix/microvms/scripts/netlink-topology.exp`, sourced by both drivers. The comparator subtracts `D_control = diff(ip_a, ip_b)` on the grounds that a difference visible across a window containing the goip run is not attributable to goip, and that only holds if the parity captures come off the topology these fixtures came off. Two copies would drift, and the symptom would be a green report measuring the wrong thing. If you add a device or a route below, both consumers get it. diff --git a/docs/netlink/coverage-status.md b/docs/netlink/coverage-status.md index d7045ded0..b08337d74 100644 --- a/docs/netlink/coverage-status.md +++ b/docs/netlink/coverage-status.md @@ -470,8 +470,11 @@ the fact that the levels are independent and that things do sit between them. Each is strictly stronger than the one above it, and the interesting entries are the ones that stop partway. The rtnetlink **event** types are decoded, and -since G4-T06 rendered by `goip monitor`, but never compared live: the parity -driver runs no monitor. `RTM_NEWRULE` and `RTM_DELRULE` became events in G4-T05. +since G4-T06 rendered by `goip monitor`; since Tier EG they are compared live: +the matrix drives the monitor section β€” fifteen live rows and seventeen +`monitor file` replay rows, each gated on two consecutive clean runs +(V393–V401, [goip-parity-events.md](goip-parity-events.md)). +`RTM_NEWRULE` and `RTM_DELRULE` became events in G4-T05. ### rtnetlink: ten body layouts, and they are the ten goip needs @@ -668,8 +671,10 @@ dumps and invisible to the monitor. The corpus holds one rule notification, covered by a constructed row, its body the same `fib_rule_hdr` layout. Since G4-T06 `goip monitor` renders all of them, checked against the seven -captured monitor runs; none is compared live, because the matrix drives no -monitor. +captured monitor runs; since Tier EG the matrix compares them β€” the monitor +section's fifteen live rows and seventeen `monitor file` replay rows, +each gated on two consecutive clean runs (V393–V401, +[goip-parity-events.md](goip-parity-events.md)). ### sock_diag / inet_diag, which is a different surface and is complete @@ -3190,7 +3195,7 @@ delivers them. | `ndmsg` decoder | `pkg/xtcpnl/xtcpnl_ndmsg.go` (229) | `DeserializeNdMsg` + `ParseNeigh`. This is the template every new family's struct decoder copies. It shipped with a `DeserializeNdMsgReflection` twin, since moved to `_test.go` β€” see Phase 0a below. | | pcap reader extension | `pkg/xtcpnl/xtcpnl_pcap.go` (+149) | Per-record netlink family access, which is what makes the Phase 0 "split per family in Go, not in tcpdump" decision cheap. | | Real event fixtures | `pkg/xtcpnl/testdata/7_1_4/` | 5 pcaps + 6 `ip -d` sidecars + `uname`, captured off an `nlmon` device in a microVM. The directory has since grown a `dumps/` subtree from a *second*, unrelated flavor β€” see the note below the table. | -| Capture flavor | `nix/microvms/*`, `nix/default.nix` | `nix run .#microvm-x86_64-nlmon-capture`. A runner, **not** a check β€” a nix check cannot write fixtures into the working tree. | +| Capture flavor | `nix/microvms/*`, `nix/default.nix` | The event oneshot `nix run .#microvm-x86_64-nlmon-capture` was retired in V401 (its product stays committed; the corpus is frozen); dumps are `nix run .#microvm-x86_64-netlink-dump-capture`. A runner, **not** a check β€” a nix check cannot write fixtures into the working tree. | `testdata/7_1_4/` now holds two corpora that share only a kernel version. The files listed above are the event capture from this commit. `dumps/` and @@ -6270,7 +6275,8 @@ error: it would be a comparator measuring one topology against an allowlist written for another, with every sentinel green. What is *not* shared is policy β€” which commands, which floors β€” which lives in `scripts/goip-parity.exp`. -**`ip monitor` is deliberately absent**, unlike `nlmon-capture`. For dumps it +**`ip monitor` is deliberately absent**, unlike the retired `nlmon-capture` +oneshot (V401). For dumps it multiplies deliveries, and a multicast notification inside a read-only capture window is a capture-hygiene FAILURE by the comparator's own design β€” so a monitor here would fail the run it was meant to observe. @@ -9713,9 +9719,9 @@ a checklist so a phase can be signed off against it. capture cannot supply β€” bit saturation and a distinct value per field. - [ ] **Positive fixtures are real `nlmon` captures** committed under `pkg/xtcpnl/testdata//`, generated by - `nix run .#microvm-x86_64-nlmon-capture` (events) or - `nix run .#microvm-x86_64-netlink-dump-capture` (dumps) β€” **not** - hand-assembled + `nix run .#microvm-x86_64-netlink-dump-capture` (dumps; the events + oneshot was retired in V401 β€” the committed `7_1_4` event corpus is + frozen) β€” **not** hand-assembled bytes. Constructed bytes are for truncation and malformed-input rows only. See [fixture provenance](coverage-expansion.md#fixture-provenance-real-captures-not-hand-assembled-bytes). - [ ] The capture path for the family exists **before** its decoder: kernel @@ -10231,7 +10237,7 @@ nix build .#checks.x86_64-linux.upstream-pins -L nix run .#check-upstream-pins # regenerate the fixtures (run from the repo root; separate corpora, separate runs) -nix run .#microvm-x86_64-nlmon-capture # events +# The events oneshot was retired in V401; the 7_1_4 event corpus is frozen. nix run .#microvm-x86_64-netlink-dump-capture # dumps ``` diff --git a/docs/netlink/goip-parity-events-status.md b/docs/netlink/goip-parity-events-status.md index 7361e48a8..b047074ba 100644 --- a/docs/netlink/goip-parity-events-status.md +++ b/docs/netlink/goip-parity-events-status.md @@ -1,6 +1,6 @@ # goip ↔ `ip` parity events: implementation status -**Last updated:** 2026-11-25 +**Last updated:** 2026-12-01 **Summary:** - The design and the task plan are in [goip-parity-events.md](goip-parity-events.md). This document tracks progress against them. @@ -24,8 +24,7 @@ - EG1-T01 is done (V393–V396): the monitor row kind landed in three halves β€” the `Command` table's fields (V393), the driver's monitor flow with the helper's monitor-only tool split (V394), the comparator's monitor branch (V395) β€” and the section's gate ran green through the harness three times, every run `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`; the rows gate (V396) on their first two clean live runs, the ungated surface `addr show dynamic` alone again. - EG1-T02 is done (V398–V399): the thirteen rows β€” the EP1 twelve's remainder and the two refusals β€” landed with the `netnsid` setup step (the nsid rows print the netns name, the driver's NSW), and the section's gate ran twice: the first `GOIP_PARITY_OVERALL_PASS` with thirteen `PASS` and two `WARN`s, both the canary retry's Deleted stanzas on the goip side the attach race hit β€” the retry prints four stanza shapes (V399's measurement: the mcast stanza, the /32 autojoin stanza, the local route, the IGMP neighbor on 224.0.0.22), not the one V395 knew β€” and the fixed comparator's rerun clean throughout (fifteen `PASS`, `HYGIENE_PASS`, `CONTROL_NOISY 1` β€” the all row's unpinned d0 MAC, the corpus's own evseq-mixed pre, mirrored β€” `UNGATED_CLEAN`). The thirteen stay ungated: they pass clean, the gated set unchanged. O5/O9/O10 regenerated with no drift. - EG2-T01 is done (V400): the seventeen offline rows β€” the fourteen crafted blobs at `=1` (the bond partner states, the actor-stays-u8 pair, the P14 reason u32s, the three metrics shapes), hibyte and hionly at `=0` (the only two whose versions print differently, goip held to the committed `.ip720` record β€” the measurement of record, the guest carrying no 7.2.0 `ip`; T03 gates that knob against the real binary), and the text refusal β€” plus the pcap corner: `evnhb-bucket.nl`, what `nlcapgen monfile -pcap` writes from the committed capture (notifications only, 3 of 16 messages), with goldens measured at all four sides byte-identical β€” a plan correction on the record: the render is the corpus `.out`'s lines modulo `-d`'s detail words and the ifname (`if3`, the no-sandbox-index rule's own class; the corpus `.out`'s `c0` its own VM's name). The gate: the section's live run β€” `GOIP_PARITY_OVERALL_PASS`, thirty-two `PASS` (the EG1 fifteen and the seventeen), `HYGIENE_PASS`, `CONTROL_NOISY 1` (the all row's d0 MAC, EG1-T02's own accepted noise), `UNGATED_CLEAN`; the seventeen stay ungated, one clean run of the two V393's rule wants. The docs check names the corner's four files (the blob file index grows `evnhb-bucket` and `notnetlink`); O5/O9/O10 regenerated with no drift. -- The first tasks left, in order (Tier EG, the plans now in [goip-parity-events.md](goip-parity-events.md#tier-eg-goip-and-the-matrix)): - 1. [EG2-T02](goip-parity-events.md#eg2-t02-the-tier-closes) β€” the tier closes, answering the two follow-up decisions the plan leaves to it (the kernel spread for events; the oneshot's retirement). +- EG2-T02 is done (V401): the tier closes. Both decisions answered β€” the kernel spread **deferred** (the ten old-only attributes all device-, path- or filter-mask-conditional, their fill conditionals byte-identical between the corpora's kernels; nine of the ten decoder-read, none needing a second kernel) and `nlmon-capture` **retired** (the product committed, the machinery superseded, nothing gated or checked boots it; `flake.nix`'s header, `nix/README.md`'s fixture table and `docs/netlink/collection.md` name it). The thirty monitor rows gated β€” the thirteen live (V398–V399) and the seventeen offline (V400), each on its own landing's first clean run and EG2-T02's second β€” the section's gate clean throughout (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1` + `UNGATED_CLEAN`, both the second run and the gated rerun), the ungated surface `addr show dynamic` alone, the earned/gated set-equality pair both directions. O5/O9/O10 regenerated, no drift; both full suites; gofmt, vet, the nine checks and `test-focused-goip`; the docs check; the full run (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1168` + `UNGATED_CLEAN`, all 1495 commands β€” the first attempt's 12000 s timeout a loaded-host artifact, the rerun at `--timeout 36000` clean); the whole-repo `test-go-race` (its one red under the loaded host, `dockermeta`'s `TestTenantBodySize` 10 s deadline, green on the quiet host). Two pre-existing main reds from gotc commits fixed in the same task: the write-gate test's type map and the upstream index's two tc write notes. Tier EG is closed. ## Contents @@ -48,7 +47,7 @@ |---|---|---|---|---| | [Tier EC](goip-parity-events.md#tier-ec-captures) | the event rows, both versions, verdiff | EC4-T01 | done | V383 | | [Tier EP](goip-parity-events.md#tier-ep-replay-and-parsers) | O10 and the crafted monitor files | closed at V392 | done | V384–V392 | -| [Tier EG](goip-parity-events.md#tier-eg-goip-and-the-matrix) | the monitor section | EG2-T02 | in progress | V391–V400 | +| [Tier EG](goip-parity-events.md#tier-eg-goip-and-the-matrix) | the monitor section | EG2-T02 | done | V391–V401 | | [Tier UB](goip-parity-events.md#tier-ub-the-iproute2-findings-record) | the three owed notes, the index, the check, the procedure | UB0-T03 | done | V376, DOC035–DOC037 | ## Task checklist @@ -70,7 +69,7 @@ | [x] | [EP2-T02](goip-parity-events.md#ep2-t02-the-blobs) | the blobs | done | V390 | | [ ] | [EP2-T03](goip-parity-events.md#ep2-t03-test-goip-monitorfile) | `test-goip-monitorfile` | done | V392 | | [x] | [EG1](goip-parity-events.md#tier-eg-goip-and-the-matrix) | the monitor section | done | V393–V399 | -| [ ] | [EG2](goip-parity-events.md#tier-eg-goip-and-the-matrix) | the offline section | EG2-T01 done | V400 | +| [x] | [EG2](goip-parity-events.md#tier-eg-goip-and-the-matrix) | the offline section | done | V400–V401 | | [x] | [UB0-T01](goip-parity-events.md#ub0-t01-the-three-owed-notes) | the three owed notes | done | DOC036 | | [x] | [UB0-T02](goip-parity-events.md#ub0-t02-the-index-and-the-check) | the index, `test-goip-docs` | done | V376 | | [x] | [UB0-T03](goip-parity-events.md#ub0-t03-the-findings-procedure) | the findings procedure | done | DOC037 | @@ -107,7 +106,7 @@ | V398 | 2026-11-28 | EG1-T02: the thirteen monitor rows and the netnsid step | both full suites (`go test -count=1 ./...` and `-tags goip_write ./...`); `go vet -tags goip_write ./...`; the checks lint-baseline, gofmt, nix-fmt, go-vet, test-goip-docs, test-goip-monitorfile, test-focused-goip, vm-lib-exp, cli-help-smoke-goip-parity; the section's first live run - `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`, thirteen `PASS`, two `WARN`, `HYGIENE_PASS`, `CONTROL_NOISY 11` | The `Command` table grows the thirteen rows - the EP1 twelve's remainder (`dad`, `route autoconf`, `neigh v4`, `nexthop bucket`, `netconf del`, `rule v4`, `stats l3`, `nsid live`, `prefix route ra`, `acaddress anycast`, `all mixed`) and the two refusals (`maddress esrch`, `nsid eexist`, both `MonitorExpectRC: 1`) - each the ev row's own Setup, Trigger and until-EREs, `Floor 1`, `Canary c0`. The nsid rows print the netns name (goip implements the name walk), so the driver grows the `netnsid` setup step - evSelfID's own shape - and its quoting comments now name the nsid rows' shell-escaped `$`/`"`. TestCommandTable grows the rc rule (every monitor row declares 0 or 1; the refusal rows 1), the thirteen in the ungated set, and the sysctl corner (RA rows 2, netconf-del/anycast/all-mixed 1); `writeCleanMonitorRow` writes the declared rc. The two `WARN`s - `monitor_address_dad`, `monitor_all_mixed` - are one noise: the canary retry's Deleted stanzas on the goip side the attach race hit, the same blocks the neigh and prefix rows' D_control carried on their ip_a sides (4 and 6, `CONTROL_NOISY 11` total). The findings are the comparator's own gap - V395's collapse knew one of the retry's stanza shapes - closed in V399 | `d069d3a11` | | V399 | 2026-11-28 | the canary retry's four stanza shapes; the section's gate clean | the monitor tests (TestCollapseCanary, TestCompareMonitorWithControl, 15 rows); both full suites; the checks lint-baseline, test-goip-docs, test-goip-monitorfile, test-focused-goip, vm-lib-exp, go-vet, gofmt, nix-fmt, cli-help-smoke-goip-parity; O5/O9/O10 regenerated (`-update-ws-*`), no drift; the section's second live run - `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`, fifteen `PASS`, `HYGIENE_PASS`, `CONTROL_NOISY 1`, `UNGATED_CLEAN` | The measured fix: the retry's `ip addr del` prints four stanza shapes, not the one V395's collapse knew - the mcast stanza, the `/32` autojoin stanza its RTM_NEWADDR prints, the local route the address brings, and the NOARP neighbor on `224.0.0.22` (the IGMPv3 report group the autojoin solicits, RFC 3376) on the canary device. `collapseCanary` drops every Deleted canary block and keeps the last run of consecutive undeleted canary blocks - the join the helper's loop broke on - which degenerates to V395's keep-last for the link rows' mcast-only shape; `isCanaryStanza` takes the canary device (the IGMP anchor, plumbed through `CompareMonitorWithControl` - the row's `Canary` field) and `isDeletedStanza` reads the `Deleted` prefix under the `all` banner. The join's own rendered text stays compared; the retry's twins go. The V398 capture's four shapes are the fixtures (each monitor kind's retry collapses to its join - the dad, prefix, neigh and all rows) and the two live `WARN`s are regression cases. The fixed comparator, run over the first live run's captured artifacts, passes all fifteen rows with no findings - the neigh and prefix rows' D_control dropped to 0 with it - and the second live run ran clean throughout (the `CONTROL_NOISY 1` is the all row's unpinned d0 MAC, the corpus's own evseq-mixed pre, mirrored; D_control subtracts it). The thirteen rows stay ungated: they pass clean, the gated set unchanged | `23399edcf` | | V400 | 2026-11-30 | EG2-T01: the offline rows, the section's gate green | both full suites (`go test -count=1 ./...` and `-tags goip_write ./...`); `go vet -tags goip_write ./...`; the checks lint-baseline, gofmt, nix-fmt, go-vet, test-goip-docs, test-goip-monitorfile, test-focused-goip, vm-lib-exp, cli-help-smoke-goip-parity; O5/O9/O10 regenerated, no drift; the section's live run - `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`, thirty-two `PASS`, `HYGIENE_PASS`, `CONTROL_NOISY 1`, `UNGATED_CLEAN` | The monitor-file row kind: the `Command` table's `Monfile`/`Knob`/`Golden` (the row format's thirteenth field), the comparator's `compareMonfileRow` (the rc rule - agree, then equal the declared one; the stderr rule - rc 0 ↔ empty, rc β‰  0 ↔ non-empty, never compared; the golden comparison naming the side, the golden and the first differing line; a `-` golden three-side equality, the monitor rows' own shape), `expectedFiles`' goldens per side (the ip sides always `.ip730`, the goip side the record its `Knob` names - the `.ip720` goldens the measurement of record for the `=0` rows, the guest carrying no 7.2.0 `ip`, T03's check what gates that knob against the real binary), and the driver's `capture_monfile_triple` (a fresh namespace per side, the Setup steps, `xtcp2-nlcap mon` running `ip -d monitor file` twice around `goip -d monitor file` at the knob - the first run's `MISSED FLOOR`, the input read against the console's CWD rather than the capture dir, the driver fix on the record). Seventeen rows: the bond partner states (hibyte and hionly at `=0`, the versions' u16 `319 <…,>` vs u8 `63` prints the rows' whole point; the rest `=1`), the actor-stays-u8 pair, the P14 reason u32s, the three metrics shapes (the plan's one padding row measured into all three committed shapes), the text refusal (`MonitorExpectRC: 1`) and the pcap corner - `evnhb-bucket.nl`, `nlcapgen monfile -pcap`'s 232-byte notifications-only write (3 of the capture's 16 messages; `TestMonfileCommittedPcap` the regeneration golden, T03's spec-golden check skipping a `.nl` with no `.spec`), its goldens measured at all four sides byte-identical. A plan correction on the record: the corner's render is the corpus `.out`'s lines modulo `-d`'s detail words and the ifname - ifindex 3 misses in an empty namespace, `if3` (the no-sandbox-index rule's own class), the corpus `.out`'s `c0` its own VM's name. The seventeen stay ungated, one clean live run of the two V393's rule wants; the gated set unchanged | this commit | - +| V401 | 2026-12-01 | EG2-T02: the tier closes β€” the spread deferred, the oneshot retired, the thirty gated | Decision 1, the kernel spread: the probe (a throwaway over both corpora, deleted after measurement) walked every route event in the five oneshot pcaps (kernel 7.1) and the thirty-three `ws/ev*` rows (kernel 7.3.1) and found ten old-only attributes, none kernel-conditional. Family 16: `IFLA_NUM_VF` (21), `IFLA_ALT_IFNAME` (54), `IFLA_PROTO_DOWN_REASON` (56), `IFLA_PARENT_DEV_NAME` (57), all four on the oneshot VM's boot NIC `ens4` only β€” NUM_VF needs `ext_filter_mask & RTEXT_FILTER_VF` (`net/core/rtnetlink.c`, `rtnl_fill_vf`) and notifications build with `ext_filter_mask=0` (`rtmsg_ifinfo`, rtnetlink.c:4633-4639), so its two carriers that pass the flags-only `IsRtnetlinkNotification` discriminator are unicast replies; ALT_IFNAME fills from the device's alt name nodes, PROTO_DOWN_REASON only when the reason bits are non-zero, PARENT_DEV_NAME only when `dev->dev.parent` exists. Family 17: `IFLA_LINK` (5), the veth pair only (`nla_put_iflink` β€” a dummy's iflink is its own ifindex). Families 20/21: `IFA_PROTO` (11), every carrier value 3 (`IFAPROT_KERNEL_LL`, AF_INET6 β€” the kernel-autoconf'd IPv6 link-local adds and dels, the new corpus's adds all static), plus `IFA_RT_PRIORITY` (9) and `IFA_BROADCAST` (4) on unicast replies (`inet_fill_ifaddr`, devinet.c:1764-1771, each filling only when its ifa field is non-zero). Families 24/25: `RTA_NH_ID` (30, `fib_dump_info`: only when `fi->nh`) and `RTA_GATEWAY` (5, the nexthop's gateway). The fill conditionals are byte-identical between v7.1 and v7.3 (rtnetlink.c: NUM_VF 1676β†’1725, ALT_IFNAME 1945β†’2000, PROTO_DOWN_REASON 1988β†’2048, PARENT_DEV 2199β†’2264, IFLA_LINK 1860β†’1914; devinet.c:1764/1768/1771 unchanged; fib_semantics.c: RTA_NH_ID 1764β†’1794, RTA_GATEWAY 1603β†’1635). Nine of the ten are decoder-read (`linkAltNames`, `setProtoDownReason`, `ParentDevName`, `Link`, `IfaProto`, `RtPriority`, `Broadcast`, `RtaNhID`, `Gateway`; only NUM_VF is not) β€” the spread stays deferred until a decoder branch or a capture needs a second kernel. Decision 2: `nlmon-capture` retired β€” the product stays committed (the base event corpus), the machinery (WARMUP=3 sleeps, no bind wait, `--immediate-mode`, `-B 32768`, the `ss -x` stop sentinel, the drop-count readback, the floors) predates every driven-machinery fix, nothing gated or checked boots it (`netlink-capture.nix`'s shared helper stays); `flake.nix`'s header, `nix/README.md`'s fixture table and `docs/netlink/collection.md` name the retirement; `mkVm.nix` loses the flavor, `lib.nix` its `mkNlmonCaptureRunner`, `default.nix` and `nix/default.nix` the attrsets, and three Go provenance comments updated. The tier's own work: the thirty monitor rows gated (the allowlist's `gated_commands` 1464β†’1494, the earned list, `TestUngatedSurfaceIsNotVacuous`'s expected down to `addr show dynamic` alone, `TestMonitorRowsGated` pinning all thirty-two), each cohort on its own landing's first clean `--section monitor` run and EG2-T02's second (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1` + `UNGATED_CLEAN`), the gated rerun the same. Gates: O5/O9/O10 regenerated (0 sends, 0 differs, no row moved away from `same`); both full suites; gofmt; `go vet -tags goip_write`; the nine checks; `test-focused-goip`; the docs check; the full run at `--timeout 36000` (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1168` + `UNGATED_CLEAN`, 1495 commands β€” the first attempt's 12000 s FATAL a loaded-host artifact, other tenants' clang-tidy batch and a foreign VM at load 76; the quiet-host rerun clean); the whole-repo `test-go-race` (its one red under that load β€” `dockermeta`'s `TestTenantBodySize`, a 10 s deadline on a 68 MiB local stream β€” green on the quiet host, both isolated and in the check). Two pre-existing main reds from gotc commits that landed after EG2-T01's runs fixed in the same task: `TestBuildWriteRequestAdmitsOnlyListedWrites` (`cba42d462` added RTM_NEW/DELTFILTER and RTM_NEW/DELCHAIN to `IsAdmittedWriteType` but not the test's map; the four pairs added, `tc/tc_filter.c:752-803` cited) and the upstream index (`8b707c8b1`; `iproute2-tc-filter-write.md` and `iproute2-tc-ematch-write.md` listed). coverage-status.md's two "never compared live" spots updated β€” the matrix now drives the monitor section | this commit | ## Decision log - **Decided: the event corpus is rows in the workbench, not a rebuilt `nlmon-capture` oneshot (2026-11-13, from the plan's own findings).** The oneshot's shape is the recorded reason the driven machinery exists ("a rebuild per attempt makes that a chore rather than a question"; no stop path), and every corpus since the addr plan has been rows. The oneshot's retirement is a follow-up decision, not this increment's. @@ -138,3 +137,5 @@ - **Measured by V391 (2026-11-25): goip's live monitor prints `ip`'s lines, and the monitor rows' control noise is three classes.** The `evlink-carrier` probe β€” three fresh namespaces, `ip`/`goip` at the parity release/`ip`, the canary, the `r0p down; up` trigger β€” found goip's live stdout differing from `ip`'s only in the addresses derived from each namespace's random veth MAC. The noise the comparator must handle is measured, not guessed: the canary retry's Deleted+join pair (whichever side the race hits), the random MAC and its solicited-node mcast line (the existing MAC rule), and the carrier transient β€” the r0p line after the up settling asynchronously, `state LOWERLAYERDOWN` with `NO-CARRIER` against `state UP`, one run measuring the two `ip` controls catching each shape. The transient is D_control itself: a real control disagreement, subtracted, and the goip row accepted while inside it. And the refusal rows' rc is the helper's own discipline β€” `rc=1` when the trigger fails β€” not the trigger's rc; the plan's "exits the trigger's rc" was corrected to the measured record (`rc 1, errno ESRCH, refused_by kernel`). - **Measured by EP1-T01 (2026-11-25, V384): the O10 goal is met at the baseline β€” goip's monitor prints every event row's `.out` byte for byte.** The plan's "what it buys" β€” "every event render goip prints becomes replay-grounded" β€” was already true when the harness first ran: 66 rows, both roots, 0 differences, the lacks list empty. The events plan's fact 3 ("rendered but never compared") closed with the comparison finding nothing: the render path the earlier arcs built covers every family the corpus holds. The delivery filter the plan said to "measure, not guess" was likewise already measured β€” A1-T02's `replayNotifications`/`replayDumpEnd` (source_monitor.go), which the seven old rows proved and the 66 confirm; neither filter class the plan named (lacks, extras) held a single row. What O10 adds is the gate itself: a new event row whose render gaps goip now fails the golden until it is fixed or recorded, and a regression in any render fails it the same way β€” the harness's red check proved both directions the day it was written (a doctored golden fails naming the row). - **Measured by EP2-T01 (2026-11-25, V389): the `.out`-matching replay invocation is plain `ip monitor file`, not `-d`.** The plan's gate text said `ip -d monitor file`, but the row's own monitor ran without `-d` (`xtcp2-nl-ipmon` builds `ip `), and the probe measured the difference: `-d` adds `scope global proto unspec` to the `RTM_NEWNEXTHOP` line at both versions, so the `-d` replay is not the `.out` β€” the plain one is, byte for byte at both. The same probe measured the plan's other prediction true: outside the row's namespace the same `.nl` prints `3: if3` (`ll_index_to_name`'s `if%u` fallback β€” `ll_link_get` miss, `if_indextoname` miss), so the T03 check's sandbox goldens carry `ifN`-style names and the namespace is the only place the names resolve. Both are recorded in the plan's gate text, which now names the plain invocation. +- **Decided at EG's close (2026-11-30, V401): the kernel spread for events is deferred β€” no decoder branch depends on a kernel-conditional attribute, because none exists to depend on.** The probe (a throwaway over both corpora, deleted after measurement) walked every route event in the five oneshot pcaps (the base corpus, kernel 7.1) and the thirty-three `ws/ev*` rows (kernel 7.3.1), one nest level, and found ten old-only attributes, each named against the uapi enums. Family 16 (RTM_NEWLINK): `IFLA_NUM_VF` (21), `IFLA_ALT_IFNAME` (54), `IFLA_PROTO_DOWN_REASON` (56) and `IFLA_PARENT_DEV_NAME` (57) β€” all four riding only on the oneshot VM's boot NIC `ens4`. NUM_VF needs `ext_filter_mask & RTEXT_FILTER_VF` (`net/core/rtnetlink.c`, `rtnl_fill_vf`) and notifications build with a literal `ext_filter_mask=0` (`rtmsg_ifinfo`, rtnetlink.c:4633-4639), so its two carriers that pass the flags-only `IsRtnetlinkNotification` discriminator are unicast replies, not notifications; ALT_IFNAME fills from the device's alt name nodes (`rtnl_fill_alt_ifnames`), PROTO_DOWN_REASON only when the reason bits are non-zero, PARENT_DEV_NAME only when `dev->dev.parent` exists β€” a virtio NIC has one, a veth or a dummy does not. Family 17 (RTM_DELLINK): `IFLA_LINK` (5) only on the oneshot's veth pair (`nla_put_iflink` β€” a dummy's iflink is its own ifindex). Families 20/21 (RTM_NEWADDR/DELADDR): `IFA_PROTO` (11) β€” every carrier value 3, `IFAPROT_KERNEL_LL`, AF_INET6: the kernel-autoconf'd IPv6 link-local adds and dels, the new corpus's adds all static β€” plus `IFA_RT_PRIORITY` (9) and `IFA_BROADCAST` (4) on unicast replies (`inet_fill_ifaddr`, devinet.c:1764-1771: each fills only when its ifa field is non-zero). Families 24/25 (RTM_NEWROUTE/DELROUTE): `RTA_NH_ID` (30, `fib_dump_info`: only when `fi->nh` is set) and `RTA_GATEWAY` (5, `fib_nh_flags_fill`: only when the nexthop has a gateway). None is kernel-conditional: the fill conditionals are byte-identical between the corpora's kernels, v7.1 and v7.3 (rtnetlink.c: NUM_VF 1676β†’1725, ALT_IFNAME 1945β†’2000, PROTO_DOWN_REASON 1988β†’2048, PARENT_DEV 2199β†’2264, IFLA_LINK 1860β†’1914; devinet.c:1764/1768/1771 unchanged; fib_semantics.c: RTA_NH_ID 1764β†’1794, RTA_GATEWAY 1603β†’1635). Nine of the ten are decoder-read β€” `linkAltNames` (IFLA_ALT_IFNAME), `setProtoDownReason`, `ParentDevName`, `Link`, `IfaProto`, `RtPriority`, `Broadcast`, `RtaNhID`, `Gateway`; only NUM_VF is not β€” and none needs a second kernel to ground its branch. +- **Decided at EG's close (2026-11-30, V401): `nlmon-capture` is retired.** Its product stays committed (`pkg/xtcpnl/testdata/7_1_4/netlink_route_events*.pcap`, the base event corpus, frozen); its machinery β€” `WARMUP=3` sleeps, none of the bind wait, `--immediate-mode`, `-B 32768`, the `ss -x` stop sentinel, the drop-count readback or the floors β€” predates every driven-machinery fix; and nothing gated or checked boots it (the `netlink-capture.nix` helper stays: shared by the workbench and the mkVm capture flow). New event shapes are captured as the goip-parity VM's `ev*` rows. `flake.nix`'s header, `nix/README.md`'s fixture table and `docs/netlink/collection.md` name the retirement in the same task. diff --git a/docs/netlink/goip-parity-events.md b/docs/netlink/goip-parity-events.md index 5c3d1958a..b1fc3c42c 100644 --- a/docs/netlink/goip-parity-events.md +++ b/docs/netlink/goip-parity-events.md @@ -374,6 +374,8 @@ Done (V400). Seventeen rows: the bond partner states β€” fast, slow, zero, all, The gates: O5/O9/O10 regenerated, `differs` and `sends` at 0, no row moved away from `same`; the full suites; the checks; the docs. The two decisions the plan's follow-ups leave to EG's close, answered in the task's own ledger row: the kernel spread for events (whether any decoder branch depends on a kernel-conditional attribute first β€” if none does, the spread is deferred with the reason recorded) and the oneshot's retirement (whether `nlmon-capture` stays as the one baked-in, zero-driver capture; if it goes, `flake.nix`'s header, `nix/README.md`'s fixture table and `docs/netlink/collection.md` name the retirement in the same task). +Done (V401). Both decisions answered, the measurements in the ledger row and the decision log: the **kernel spread is deferred** β€” the probe over both corpora found ten old-only attributes, every one device-, path- or filter-mask-conditional, its fill conditional byte-identical between the corpora's kernels (v7.1 and v7.3), so no decoder branch depends on a kernel-conditional attribute because none exists to depend on β€” and **`nlmon-capture` is retired**, its product staying committed and the three docs naming it. The thirty monitor rows gate: the thirteen live and the seventeen offline, each on its own landing's first clean `--section monitor` run and EG2-T02's second (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1` + `UNGATED_CLEAN` both times), the gated rerun clean, the ungated surface `addr show dynamic` alone. The tier's gates all hold: O5/O9/O10 regenerated with no drift, both full suites, gofmt, vet, the nine checks, `test-focused-goip`, the docs check, the full run (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1168` + `UNGATED_CLEAN`, all 1495 commands; the first attempt's 12000 s timeout a loaded-host artifact β€” the rerun at `--timeout 36000` on the quiet host finished clean), and the whole-repo `test-go-race`. Two pre-existing main reds, both from gotc commits that landed after EG2-T01's runs, fixed in the same task: the write-gate test's `admittedWriteTypes` map (the four tc write types) and the upstream index (gotc's two tc write notes). + ## Tier UB: the iproute2 findings record Can start immediately; UB0-T01 is debt already owed, not new work. @@ -411,8 +413,19 @@ A section of `upstream/README.md`, written once, that says when a note is owed, ## Follow-ups after Tier EG -- **Kernel spread for events.** The rdma capture's per-kernel suffix pattern (`microvm-x86_64-rdma-capture-6_1` …) applied to the event rows, so notification attribute presence is grounded across kernels the way the sock_diag and rdma corpora are. Decide at EG's close whether any decoder branch depends on a kernel-conditional attribute first. -- **The oneshot's retirement.** Once `ev*` rows hold everything `nlmon-capture` captures, decide whether the flavor stays (as the one baked-in, zero-driver capture) or is retired. `flake.nix`'s header, `nix/README.md`'s fixture table and `docs/netlink/collection.md` name it either way; that update is part of the task that decides it. +- **Kernel spread for events β€” decided at EG's close (V401): deferred.** No decoder + branch depends on a kernel-conditional attribute, because none exists to depend + on: the probe over both corpora found ten old-only attributes, and every one is + device-, path- or filter-mask-conditional, its fill conditional identical between + the corpora's kernels. Nine of the ten are decoder-read, and none needs a second + kernel to ground its branch β€” the measurements and citations are the ledger + row's. The spread stays deferred until a decoder branch or a capture needs one. +- **The oneshot's retirement β€” decided at EG's close (V401): retired.** The `ev*` + rows hold everything new the corpus needs, the oneshot's machinery predates + every driven-machinery fix, and nothing gated or checked boots it. The product + stays committed (`pkg/xtcpnl/testdata/7_1_4/netlink_route_events*.pcap`, the + base event corpus); `flake.nix`'s header, `nix/README.md`'s fixture table and + `docs/netlink/collection.md` name the retirement. - **`RTM_NEWNDUSEROPT`.** A custom subscriber and a decoder, daemon-side, if locality ever needs RA options; the exclusion above records where it would go. - **A `pkgsCross.s390x` monitorfile check**, if the note-documented procedure proves its keep across further findings. diff --git a/docs/netlink/upstream/README.md b/docs/netlink/upstream/README.md index 2bf989165..31e3f5fec 100644 --- a/docs/netlink/upstream/README.md +++ b/docs/netlink/upstream/README.md @@ -32,6 +32,8 @@ found by a capture, reproduced, fixed, tested, reviewed β€” and ready to send. | [iproute2-tc-sched.md](iproute2-tc-sched.md) | Scheduling qdisc text-only fields, inconsistent keys, hard newlines and reads past arrays | 7.2.0; later status in note | see note | `ws/tcsched/`, increment 15 | not yet; drafts | | [iproute2-tc-aqm.md](iproute2-tc-aqm.md) | AQM printer spacing, text-only fields, unchecked gred and cake reads and u32 wraps | 7.2.0; later status in note | see note | `ws/tcaqm/`, increment 16 | not yet; drafts | | [iproute2-tc-write.md](iproute2-tc-write.md) | Qdisc and class write help, argument consumption, silent failures and diagnostics | 7.2.0; later status in note | see note | `ws/tcqwrite/`, increment 17 | not yet; drafts | +| [iproute2-tc-filter-write.md](iproute2-tc-filter-write.md) | Filter and chain writes: narrowed selectors, a renamed check, sticky cookies and a realm cache that answers with the wrong number β€” W64–W122, K49–K55 | 7.2.0; later status in note | see note | `ws/tcfwrite/` (183 rows), increment 20 | not yet; drafts | +| [iproute2-tc-ematch-write.md](iproute2-tc-ematch-write.md) | The ematch grammar's write path: a lexer that shares one buffer among its tokens, a parser that undoes what it never took, and state that outlives the line β€” W123–W155, K56–K62 | 7.2.0; later status in note | see note (every finding present at HEAD) | `ws/tcematch/` (257 rows), increment 21 | not yet; drafts | | [bug-classes.md](bug-classes.md) | not a finding report but the working checklist: the dozen recurring shapes the ~70 recorded bugs fall into, run over the target code before every conversion increment captures | β€” | β€” | every increment's plan since 6 (`bridge`) | not for sending | The bond series' artifacts, all against `e11870d5`: diff --git a/flake.nix b/flake.nix index 189d040b3..3d80856c3 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,11 @@ # nix run .#microvm-x86_64-goip-parity # ip vs goip netlink comparison (needs /dev/kvm) # # Capturing netlink fixtures β€” use the microVM, not the host: +# (RETIRED, V401: microvm-x86_64-nlmon-capture, the rtnetlink EVENT capture +# oneshot β€” its product, the 7_1_4 event corpus, stays committed at +# pkg/xtcpnl/testdata/7_1_4/netlink_route_events*.pcap; the driven +# goip-parity rows are the event path now. See +# docs/netlink/goip-parity-events.md, EG2-T02.) # nix run .#microvm-x86_64-netlink-dump-capture # THE SANCTIONED CAPTURE PATH. Boots a root guest, drives it over serial # with tcl/expect, captures in a clean namespace with no side traffic, diff --git a/internal/goipparity/commands_test.go b/internal/goipparity/commands_test.go index 85960d0b9..399629849 100644 --- a/internal/goipparity/commands_test.go +++ b/internal/goipparity/commands_test.go @@ -1246,7 +1246,10 @@ func TestUngatedSurfaceIsNotVacuous(t *testing.T) { // - the seventeen `xfrm state` write rows G7-T02 added, likewise β€” // see TestXfrmStateRows; // - the two monitor rows EG1-T01 added, the harness's first, on their - // first two clean live runs β€” see TestMonitorRowsGated. + // first two clean live runs β€” see TestMonitorRowsGated; + // - the thirteen live monitor rows EG1-T02 added and the seventeen + // offline ones EG2-T01 added, on their own landing's first clean run + // and EG2-T02's second (V401) β€” see TestMonitorRowsGated. // // The last four were the permanent set, measured divergent on the wire; // TestPermanentWireDivergences records that it is empty. @@ -1271,44 +1274,6 @@ func TestUngatedSurfaceIsNotVacuous(t *testing.T) { // held out by design. expected := []string{ "addr show dynamic", - // The two monitor rows EG1-T01 added (V393, commands.go) gated on - // their first two clean live runs β€” see TestMonitorRowsGated. The - // thirteen EG1-T02 added (V398) hold this list until theirs, the - // two refusal rows (esrch, eexist) last: the kernel's refusal is the - // freshest shape the section holds. - "monitor address maddress dad", - "monitor route maddress autoconf", - "monitor neigh maddress v4", - "monitor nexthop maddress bucket", - "monitor netconf maddress del", - "monitor rule maddress v4", - "monitor stats maddress l3", - "monitor nsid maddress live", - "monitor prefix route maddress ra", - "monitor acaddress maddress anycast", - "monitor all mixed", - "monitor maddress esrch", - "monitor nsid maddress eexist", - // The seventeen EG2-T01 added (the offline rows) hold this list until - // theirs, the text refusal last: the refusal is the section's own - // negative, and the crafted rows land in the table's order. - "monitor file bond-partner-fast.nl", - "monitor file bond-partner-slow.nl", - "monitor file bond-partner-zero.nl", - "monitor file bond-partner-all.nl", - "monitor file bond-partner-hibyte.nl", - "monitor file bond-partner-hionly.nl", - "monitor file bond-partner-absent.nl", - "monitor file bond-partner-trunc1.nl", - "monitor file bond-actor-u8.nl", - "monitor file linkpd-0009.nl", - "monitor file linkpd-0100.nl", - "monitor file linkpd-80000001.nl", - "monitor file route-metrics-nested.nl", - "monitor file route-metrics-overlong.nl", - "monitor file route-metrics-v038pad.nl", - "monitor file evnhb-bucket.nl", - "monitor file notnetlink.txt", } tests := []struct { @@ -1381,14 +1346,16 @@ func TestUngatedSurfaceIsNotVacuous(t *testing.T) { } } -// TestMonitorRowsGated pins the two monitor rows' gating, the harness's first -// (EG1-T01's own): GOIP_PARITY_PASS on a monitor row is the three sides' -// stdout agreement after the canary collapse, a shape no pcap holds, so this -// is the readable statement that the rows the clean runs earned are the rows -// the gate holds. They gated on their first two clean live runs, and the -// ungated surface they left is `addr show dynamic` alone. +// TestMonitorRowsGated pins the monitor rows' gating β€” the harness's first +// two (EG1-T01's own), the thirteen live rows EG1-T02 added and the seventeen +// offline ones EG2-T01 added: GOIP_PARITY_PASS on a monitor row is the three +// sides' stdout agreement after the canary collapse, a shape no pcap holds, +// so this is the readable statement that the rows the clean runs earned are +// the rows the gate holds. Each cohort gated on its own landing's first +// clean `--section monitor` run and EG2-T02's second (V401), and the ungated +// surface they left is `addr show dynamic` alone. // -// go test ./internal/goipparity/ -run TestMonitorRowsGated +// go test ./internal/goiparity/ -run TestMonitorRowsGated func TestMonitorRowsGated(t *testing.T) { al, err := nlparity.EmbeddedAllowlist() if err != nil { @@ -1413,11 +1380,57 @@ func TestMonitorRowsGated(t *testing.T) { } }) } - // The gated rows are the monitor shape, so a row renamed or re-shaped - // without this test being told fails here, not on a live run. - for _, name := range []string{ + // The two EG1-T01 rows above are the table's own; the thirty that + // followed gate the same way, each on its own landing's first clean run + // and EG2-T02's second (V398-V401). The thirteen live rows carry the + // monitor shape; the seventeen offline ones the monfile shape, their + // crafted blobs replayed through `ip/goip monitor file`. + live := []string{ + "monitor address maddress dad", + "monitor route maddress autoconf", + "monitor neigh maddress v4", + "monitor nexthop maddress bucket", + "monitor netconf maddress del", + "monitor rule maddress v4", + "monitor stats maddress l3", + "monitor nsid maddress live", + "monitor prefix route maddress ra", + "monitor acaddress maddress anycast", + "monitor all mixed", + "monitor maddress esrch", + "monitor nsid maddress eexist", + } + offline := []string{ + "monitor file bond-partner-fast.nl", + "monitor file bond-partner-slow.nl", + "monitor file bond-partner-zero.nl", + "monitor file bond-partner-all.nl", + "monitor file bond-partner-hibyte.nl", + "monitor file bond-partner-hionly.nl", + "monitor file bond-partner-absent.nl", + "monitor file bond-partner-trunc1.nl", + "monitor file bond-actor-u8.nl", + "monitor file linkpd-0009.nl", + "monitor file linkpd-0100.nl", + "monitor file linkpd-80000001.nl", + "monitor file route-metrics-nested.nl", + "monitor file route-metrics-overlong.nl", + "monitor file route-metrics-v038pad.nl", + "monitor file evnhb-bucket.nl", + "monitor file notnetlink.txt", + } + for _, name := range append(live, offline...) { + t.Run("positive: "+name+" is gated", func(t *testing.T) { + if !al.IsGated(name) { + t.Errorf("%q: IsGated() = false, want the earned gating", name) + } + }) + } + // The gated rows are the monitor and monfile shapes, so a row renamed or + // re-shaped without this test being told fails here, not on a live run. + for _, name := range append([]string{ "monitor link maddress carrier", "monitor link maddress admin", - } { + }, live...) { c, lookupErr := Lookup(name) if lookupErr != nil { t.Fatalf("Lookup(%q): %v", name, lookupErr) @@ -1426,6 +1439,15 @@ func TestMonitorRowsGated(t *testing.T) { t.Errorf("%q: Monitor = false, want the monitor shape", name) } } + for _, name := range offline { + c, lookupErr := Lookup(name) + if lookupErr != nil { + t.Fatalf("Lookup(%q): %v", name, lookupErr) + } + if !c.Monfile { + t.Errorf("%q: Monfile = false, want the monfile shape", name) + } + } } // TestObjectGatingStatus pins, per command, the production gating decision runs diff --git a/nix/README.md b/nix/README.md index 12ae14e4c..d451fee69 100644 --- a/nix/README.md +++ b/nix/README.md @@ -393,7 +393,9 @@ prefer the verdict/lifecycle apps for verification. The raw base package is - `clickhouse-http`, `clickhouse-pipeline`, `clickhouse-pipeline-rate`, `clickhouse-pipeline-stress`, `clickhouse-pipeline-parquet`. - `s3parquet-pipeline`, `s3parquet-long`, `s3parquet-stress`, `s3parquet-lowfreq`, plus the six `s3parquet-stress-*` variants above. - `valkey`, `tcp-sink`, `udp-sink`, `unix-sink`, `unixgram-sink`, `nats`, `nsq`. -- `nlmon-capture`, `netlink-dump-capture`, `goip-parity`, `link-write-capture`, `lacp-a`, `lacp-b`. +- `netlink-dump-capture`, `goip-parity`, `link-write-capture`, `lacp-a`, `lacp-b`. + (The `nlmon-capture` oneshot was retired in V401 β€” see + `docs/netlink/goip-parity-events.md`, EG2-T02.) An app may share a raw package name but execute a different wrapper. For example, building `microvm-x86_64-goip-parity` prepares the guest; running that @@ -409,7 +411,6 @@ capture destinations can replace existing fixtures, not just append new ones. | App (`nix run path:.#NAME -- ARGS`) | Capture or verification | Output / useful arguments | |---|---|---| -| `microvm-x86_64-nlmon-capture` | rtnetlink link/address/route/neighbor events | `pkg/xtcpnl/testdata//`; `--out DIR`, `--timeout SECONDS` | | `microvm-x86_64-netlink-dump-capture` | Clean RTM_GET dump corpus, matching text/JSON sidecars, optional bridge/veth mesh | `/dumps/`; `--out DIR`, `--timeout SECONDS`, `--skip-mesh` | | `microvm-x86_64-link-write-capture` | Bond/LACP readbacks with a real partner in two guest namespaces | `/link-write/`; `--out DIR`, `--timeout SECONDS` | | `microvm-x86_64-lacp-pair-capture` | LACP partner in a second VM over virtio-net links, including link loss/recovery | `/link-write/lacp-pair/`; `--out DIR`, `--timeout SECONDS` | diff --git a/nix/default.nix b/nix/default.nix index aa1ff6d02..fe8e028c3 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1113,7 +1113,6 @@ in microvm-x86_64-s3parquet-stress = microvms.vmsS3ParquetStress.x86_64; microvm-x86_64-s3parquet-lowfreq = microvms.vmsS3ParquetLowfreq.x86_64; microvm-x86_64-capcheck-fail = microvms.vmsCapCheckFail.x86_64; - microvm-x86_64-nlmon-capture = microvms.vmsNlmonCapture.x86_64; microvm-x86_64-netlink-dump-capture = microvms.vmsNetlinkDumpCapture.x86_64; # Boots nothing under `nix build`: mkVm.nix returns # config.microvm.declaredRunner, so this builds the guest closure and @@ -1579,22 +1578,6 @@ in program = "${microvms.socketScale.x86_64.runner}/bin/xtcp2-socket-scale-x86_64"; }; - # rtnetlink EVENT capture: boots a quiet root microvm (no xtcp2 daemon), - # triggers link up/down + addr add/del + route add/del + neigh add/del on a - # veth pair, records them off an nlmon device, and writes the pcap plus the - # `ip -d` sidecars into pkg/xtcpnl/testdata//. Run from the - # repo root. Pass `--timeout ` to bound the wait or `--out ` to - # override the destination. Not in `nix flake check` β€” it needs /dev/kvm and - # it writes to the working tree, neither of which a check can do. - # - # Its sibling below captures DUMPS in the same controlled guest. Between - # them they are the fixture source; `nix run .#capture-netlink-fixtures` - # captures dumps on the HOST and is now only a diagnostic fallback. - microvm-x86_64-nlmon-capture = { - type = "app"; - program = "${microvms.nlmonCapture.x86_64.runner}/bin/xtcp2-nlmon-capture-x86_64"; - }; - # rtnetlink DUMP capture: boots the same quiet root microvm, then drives it # over the serial console with expect rather than running a baked-in # oneshot. Builds a dummy-only topology in a throwaway netns β€” chosen so @@ -1603,7 +1586,8 @@ in # dump off an nlmon device in that namespace, records the matching `ip -d` # and `ip -j` sidecars, and writes the lot into # pkg/xtcpnl/testdata//dumps/ β€” a subdirectory, because five - # sidecar names collide with the event set above and mean something + # sidecar names collide with the committed event set (the retired + # nlmon-capture oneshot's, V401) and mean something # different in each. A second, advisory set (bridge + veth, under # dumps/mesh/) carries the IFLA_MASTER / IFLA_LINKINFO replies the clean # set deliberately cannot produce; `--skip-mesh` omits it. diff --git a/nix/microvms/default.nix b/nix/microvms/default.nix index 2d8ce9f71..2d5042532 100644 --- a/nix/microvms/default.nix +++ b/nix/microvms/default.nix @@ -570,30 +570,11 @@ let sink = "socket-scale"; }; - # nlmon-capture: root VM that triggers a scripted sequence of real kernel - # network events, captures them off an nlmon device, emits the pcap + - # sidecars over the serial console, then powers off. No xtcp2 daemon β€” a - # netlink-silent guest is the whole point (see mkVm.nix isNlmonCapture). - mkOneNlmonCapture = - arch: - import ./mkVm.nix { - inherit - pkgs - lib - microvm - nixpkgs - arch - xtcp2Package - xtcp2AllPackage - ipfeedCollectorPackage - ; - sink = "nlmon-capture"; - }; - # netlink-dump-capture: root VM that records RTM_GET* DUMP requests and their # replies into pcaps, with the `ip -d` / `ip -j` sidecars those fixtures are # checked against, then emits the lot over the serial console and powers off. - # Unlike nlmon-capture the sequence is not baked in β€” the host drives it with + # Unlike the retired nlmon-capture oneshot (V401) the sequence is not baked + # in β€” the host drives it with # scripts/capture-netlink-dumps.exp. See mkVm.nix isNetlinkDumpCapture. mkOneNetlinkDumpCapture = mkOneNetlinkDumpCaptureOn null; @@ -801,8 +782,6 @@ let vmsSocketScale = lib.genAttrs constants.supportedArchs mkOneSocketScale; - vmsNlmonCapture = lib.genAttrs constants.supportedArchs mkOneNlmonCapture; - vmsNetlinkDumpCapture = lib.genAttrs constants.supportedArchs mkOneNetlinkDumpCapture; vmsGoipParity = lib.genAttrs constants.supportedArchs mkOneGoipParity; @@ -1073,17 +1052,6 @@ let }; }); - # rtnetlink event-capture runner: boots the nlmon-capture VM, waits for - # NLCAP_DONE (or --timeout), scrapes the base64 pcap blob off the serial - # console and writes it into pkg/xtcpnl/testdata//. Must be a - # runner, not a check β€” see mkNlmonCaptureRunner's comment. - nlmonCapture = lib.genAttrs constants.supportedArchs (arch: { - runner = microvmLib.mkNlmonCaptureRunner { - inherit arch; - vm = vmsNlmonCapture.${arch}; - }; - }); - # Golden-record runner: boots the s3parquet-golden VM, scrubs the one # object it emits and writes pkg/xtcp/testdata/golden//. A # runner, not a check β€” see mkGoldenCaptureRunner's comment. @@ -1401,7 +1369,6 @@ in vmsCapCheckFail vmsDiscoveryBench vmsSocketScale - vmsNlmonCapture vmsNetlinkDumpCapture vmsGoipParity vmsLinkWriteCapture @@ -1413,7 +1380,6 @@ in s3parquetLong discoveryBench socketScale - nlmonCapture goldenCapture tcpFamilies netlinkDumpCapture diff --git a/nix/microvms/lib.nix b/nix/microvms/lib.nix index 1b68cff5b..35de3a7ac 100644 --- a/nix/microvms/lib.nix +++ b/nix/microvms/lib.nix @@ -986,218 +986,17 @@ rec { ''; }; - # mkNlmonCaptureRunner β€” host runner for the nlmon-capture flavor. - # - # Same shape as mkDiscoveryBenchRunner (boot, tail both consoles, wait for a - # DONE sentinel or --timeout, power off), plus the coverage extractor's - # base64 scrape: the guest tars the pcap + sidecars between - # XTCP2_NLCAP_DUMP_START/_END markers and this unpacks them into the working - # tree so the fixtures can be committed. - # - # This is a runner (app), not a check, and it has to be: a nix check's - # $TMPDIR is private, its source is a read-only store copy, and its result is - # binary-cached β€” you would get a stale pcap and no way to write the real one - # into pkg/xtcpnl/testdata/. (/dev/kvm alone would not stop it: a check that - # declares requiredSystemFeatures = [ "kvm" ] gets it, as the vm-* checks do.) - mkNlmonCaptureRunner = - { - arch, - vm, - }: - let - cfg = constants.architectures.${arch}; - in - pkgs.writeShellApplication { - name = "xtcp2-nlmon-capture-${arch}"; - runtimeInputs = with pkgs; [ - coreutils - gawk - gnugrep - gnused - gnutar - gzip - netcat-gnu - procps - ]; - text = '' - set -u - - TIMEOUT_SEC=600 - OUT_DIR="" - while [ $# -gt 0 ]; do - case "$1" in - --timeout) TIMEOUT_SEC="$2"; shift 2 ;; - --timeout=*) TIMEOUT_SEC="''${1#--timeout=}"; shift ;; - --out) OUT_DIR="$2"; shift 2 ;; - --out=*) OUT_DIR="''${1#--out=}"; shift ;; - -h|--help) - echo "usage: $0 [--timeout ] [--out ]" - echo " Boots the nlmon-capture microvm, triggers a scripted" - echo " sequence of real kernel network events (link up/down," - echo " addr add/del, route add/del, neigh add/del), captures" - echo " them off an nlmon device, extracts the pcap + sidecars," - echo " then powers off." - echo "" - echo " --out defaults to pkg/xtcpnl/testdata/," - echo " e.g. pkg/xtcpnl/testdata/7_1_8, and must be run from the" - echo " xtcp2 repo root." - exit 0 - ;; - *) echo "unknown arg: $1" >&2; exit 1 ;; - esac - done - - # Same repo-root guard as nix/capture-netlink-fixtures.nix: the default - # output path is relative, so running from anywhere else would scatter - # a pkg/ tree into the current directory. - if [ ! -f flake.nix ] || [ ! -d pkg/xtcpnl ]; then - echo "nlmon-capture: run from the xtcp2 repo root" >&2 - exit 2 - fi - - SERIAL_PORT=${toString cfg.serialPort} - VIRTCON_PORT=${toString cfg.virtioPort} - LOG=$(mktemp -t xtcp2-nlmon-capture-XXXX.log) - - echo "================================================" - echo " xtcp2 microvm nlmon-capture β€” arch=${arch}" - echo " timeout: $TIMEOUT_SEC s" - echo " transcript: $LOG" - echo "================================================" - - QEMU_LOG="''${LOG}.qemu" - ${vm}/bin/microvm-run > "$QEMU_LOG" 2>&1 & - vm_pid=$! - - nc_serial_pid="" - nc_virtcon_pid="" - for _ in $(seq 1 30); do - if nc -z 127.0.0.1 "$SERIAL_PORT" 2>/dev/null; then - nc 127.0.0.1 "$SERIAL_PORT" >> "$LOG" 2>&1 & - nc_serial_pid=$! - break - fi - sleep 1 - done - for _ in $(seq 1 30); do - if nc -z 127.0.0.1 "$VIRTCON_PORT" 2>/dev/null; then - nc 127.0.0.1 "$VIRTCON_PORT" >> "$LOG" 2>&1 & - nc_virtcon_pid=$! - break - fi - sleep 1 - done - - trap ' - if kill -0 "$vm_pid" 2>/dev/null; then - ( printf "systemctl poweroff\n" | nc -q 1 127.0.0.1 "$SERIAL_PORT" ) >/dev/null 2>&1 || true - sleep 10 - kill "$vm_pid" 2>/dev/null || true - wait "$vm_pid" 2>/dev/null || true - fi - if [ -n "$nc_serial_pid" ] && kill -0 "$nc_serial_pid" 2>/dev/null; then - kill "$nc_serial_pid" 2>/dev/null || true - fi - if [ -n "$nc_virtcon_pid" ] && kill -0 "$nc_virtcon_pid" 2>/dev/null; then - kill "$nc_virtcon_pid" 2>/dev/null || true - fi - ' EXIT - - elapsed=0 - done_seen=0 - while [ "$elapsed" -lt "$TIMEOUT_SEC" ]; do - if ! kill -0 "$vm_pid" 2>/dev/null; then - echo "FATAL: qemu died at t=$elapsed s; tail of transcript:" - tail -n 40 "$LOG" - exit 2 - fi - if grep -q 'NLCAP_DONE' "$LOG" 2>/dev/null; then - done_seen=1 - break - fi - if grep -q 'NLCAP_ERR' "$LOG" 2>/dev/null; then - echo "FATAL: guest reported NLCAP_ERR:" - grep -E 'NLCAP_ERR' "$LOG" || true - exit 2 - fi - sleep 5 - elapsed=$((elapsed + 5)) - done - - if [ "$done_seen" -ne 1 ]; then - echo "FATAL: NLCAP_DONE not seen within $TIMEOUT_SEC s" - tail -n 40 "$LOG" 2>/dev/null || true - exit 2 - fi - - echo "" - echo "================================================" - echo " trigger sequence (as executed in the guest)" - echo "================================================" - grep -E 'NLCAP_PHASE|NLCAP_RUN_FAIL|NLCAP_PACKETS' "$LOG" 2>/dev/null || true - - # Extract the tar|gzip|base64 blob. systemd routes the unit's - # StandardOutput=journal+console, which prefixes every line with - # `[TIME] [PID]: `; strip that before decoding. The regex - # is deliberately generic rather than hard-coding the unit name β€” a - # base64 line can never begin with `[`, so it cannot over-match. - STAGE=$(mktemp -d -t xtcp2-nlcap-XXXX) - if grep -q 'XTCP2_NLCAP_DUMP_START' "$LOG" \ - && grep -q 'XTCP2_NLCAP_DUMP_END' "$LOG"; then - awk '/XTCP2_NLCAP_DUMP_START/{flag=1;next} /XTCP2_NLCAP_DUMP_END/{flag=0} flag' "$LOG" \ - | sed -E 's/^\[[^]]*\] [A-Za-z0-9_.@-]+\[[0-9]+\]: //' \ - | tr -d '\r\n ' \ - | base64 -d 2>/dev/null \ - | gzip -dc 2>/dev/null \ - | tar x -C "$STAGE" 2>/dev/null || true - else - echo "FATAL: no XTCP2_NLCAP_DUMP block in the transcript" - exit 2 - fi - - if [ ! -s "$STAGE/netlink_route_events.pcap" ]; then - echo "FATAL: extracted blob has no netlink_route_events.pcap" - echo " staged files:" - ls -la "$STAGE" || true - exit 2 - fi - - # Version the output by the GUEST kernel, not the host's β€” the fixture - # documents the kernel that produced it. The guest's `uname -a` sidecar - # is the only reliable source for that. - if [ -z "$OUT_DIR" ]; then - VER=$(awk '{print $3}' "$STAGE/uname" | cut -d- -f1 | tr . _) - if [ -z "$VER" ]; then - echo "FATAL: could not derive a kernel version from the uname sidecar" - exit 2 - fi - OUT_DIR="pkg/xtcpnl/testdata/$VER" - fi - - mkdir -p "$OUT_DIR" - cp -f "$STAGE"/* "$OUT_DIR"/ - - echo "" - echo "================================================" - echo " wrote fixtures to $OUT_DIR" - echo "================================================" - ls -la "$OUT_DIR" - echo "" - echo "Full transcript kept at: $LOG" - echo "PASS: rtnetlink event capture complete" - exit 0 - ''; - }; - # mkGoldenCaptureRunner β€” host runner for the s3parquet-golden flavor. # - # mkNlmonCaptureRunner's shape: boot, tail both consoles, wait for - # GOLDEN_DONE (or GOLDEN_ERR, or --timeout), scrape the base64 block between + # The retired nlmon-capture runner's shape (V401): boot, tail both consoles, + # wait for GOLDEN_DONE (or GOLDEN_ERR, or --timeout), scrape the base64 block between # XTCP2_GOLDEN_DUMP_START/_END. The block holds the raw Parquet object, with # the guest's real addresses, so it is unpacked only into a mktemp directory # (removed on exit); what reaches the tree is xtcp2-golden's scrubbed copy, # its normalized JSONL and the manifest, checked with `xtcp2-golden check`. - # A runner and not a check, for mkNlmonCaptureRunner's reasons. + # A runner and not a check, for the retired nlmon-capture runner's + # reasons (V401: a check's $TMPDIR is private, its result is + # binary-cached). mkGoldenCaptureRunner = { arch, @@ -1314,7 +1113,8 @@ rec { } # extract_dump DIR: unpack the guest's XTCP2_GOLDEN_DUMP block into # DIR. Strip journal+console's `[TIME] ident[PID]: ` prefix before - # decoding, as mkNlmonCaptureRunner does. + # decoding, as the retired nlmon-capture runner's extractor did + # (V401). extract_dump() { mkdir -p "$1" awk '/XTCP2_GOLDEN_DUMP_START/{flag=1;next} /XTCP2_GOLDEN_DUMP_END/{flag=0} flag' "$LOG" \ @@ -1438,8 +1238,8 @@ rec { # mkFamiliesRunner β€” host runner for the s3parquet-families flavor: boot, # tail both consoles, wait for FAMILIES_DONE (or FAMILIES_ERR, or # --timeout), print the guest's ROW lines and fail on any ROW ... FAIL. - # A runner and not a check, for mkNlmonCaptureRunner's reasons (no - # /dev/kvm in the sandbox). + # A runner and not a check, for the retired nlmon-capture runner's + # reasons (V401; no /dev/kvm in the sandbox). mkFamiliesRunner = { arch, @@ -1579,8 +1379,9 @@ rec { # others do - the two would fight over the console. Diagnostics come off the # virtio console instead, which nothing else is using. # - # A runner and not a check, for mkNlmonCaptureRunner's reasons (no /dev/kvm - # in the sandbox, binary-cached results, a read-only source copy) plus one of + # A runner and not a check, for the retired nlmon-capture runner's + # reasons (V401; no /dev/kvm in the sandbox, binary-cached results, a + # read-only source copy) plus one of # its own: the point of the run is to write files into the working tree. mkNetlinkDumpCaptureRunner = { @@ -2626,8 +2427,9 @@ rec { # exfil problem mask a parity failure, or worse, report one that did not # happen. # - # Not a check, for mkNlmonCaptureRunner's reasons (no /dev/kvm in the nix - # sandbox, binary-cached results) plus the fixed SERIAL_PORT, which means it + # Not a check, for the retired nlmon-capture runner's reasons (V401; no + # /dev/kvm in the nix sandbox, binary-cached results) plus the fixed + # SERIAL_PORT, which means it # cannot run concurrently with any other VM and so belongs in the sequential # integration list rather than in `nix flake check`. mkGoipParityRunner = diff --git a/nix/microvms/mkVm.nix b/nix/microvms/mkVm.nix index 3c04b8ff9..599e8aa7c 100644 --- a/nix/microvms/mkVm.nix +++ b/nix/microvms/mkVm.nix @@ -276,21 +276,29 @@ let # 10^5 sockets (tools/sockfill), a SYN flood, and a namespace flood. The run # script starts and stops xtcp2 itself, so services.xtcp2 is off. isSocketScale = sink == "socket-scale"; - # nlmon-capture = a root VM whose only job is to record REAL rtnetlink - # NOTIFICATIONS (link up/down, addr add/del, route add/del, neigh add/del) - # into a pcap, base64 it out over the serial console, and power off. + # RETIRED (V401): the nlmon-capture oneshot is gone. It was a root VM + # whose only job was to record REAL rtnetlink NOTIFICATIONS (link up/down, + # addr add/del, route add/del, neigh add/del) into a pcap, base64 it out + # over the serial console, and power off. Its product is committed and stays + # β€” pkg/xtcpnl/testdata/7_1_4/netlink_route_events*.pcap, the base event + # corpus β€” but the flavor itself predates every driven-machinery fix + # (WARMUP sleeps, no bind wait, no immediate mode, no ring buffer, no stop + # sentinel, no drop-count readback, no floors), so re-running it regenerates + # nothing the corpus compares against. The event shapes are the goip-parity + # VM's `ev*` rows now; the decision and the reason are recorded in + # docs/netlink/goip-parity-events.md (EG2-T02). # - # Why a VM and not the existing host script (nix/capture-netlink-fixtures.nix): + # Why it was a VM and not the host script (nix/capture-netlink-fixtures.nix): # `nlmon` mirrors EVERY netlink datagram in its namespace, so on a real # workstation the capture is buried in NetworkManager / nl80211 / systemd # chatter β€” the host script's `ether[14:2]==0` filter exists solely to survive # that. A guest we control is quiet, so the events we trigger are the events # we capture. It also needs no sudo. # - # This flavor captures EVENTS. Its sibling below captures DUMPS. They used + # It captured EVENTS. Its sibling below captures DUMPS. They used # to be split guest-vs-host, which is no longer true - see # isNetlinkDumpCapture and docs/netlink/collection.md. - isNlmonCapture = sink == "nlmon-capture"; + # # netlink-dump-capture = a root VM whose only job is to record RTM_GET* # DUMP requests and their replies into pcaps, with the `ip -d` / `ip -j` # sidecars that are those fixtures' source of truth, then base64 the lot out @@ -317,8 +325,8 @@ let # to run the same nixpkgs. # - No sudo. # - # Unlike nlmon-capture, the sequence is NOT baked in as a systemd oneshot: - # the host drives it over the console with expect, so the capture set can be + # Unlike the retired nlmon-capture oneshot (V401), the sequence is NOT + # baked in as a systemd service: the host drives it over the console with expect, so the capture set can be # changed without rebuilding the VM. See nix/microvms/netlink-capture.nix # (mechanism) and scripts/capture-netlink-dumps.exp (policy). isNetlinkDumpCapture = sink == "netlink-dump-capture"; @@ -339,7 +347,8 @@ let # (scripts/netlink-topology.exp), the same expect library. What differs is # policy, which lives in scripts/goip-parity.exp. # - # `ip monitor` is deliberately NOT started here, unlike nlmon-capture: for + # `ip monitor` is deliberately NOT started here, unlike the retired + # nlmon-capture oneshot (V401): for # dumps it multiplies deliveries, and a multicast notification inside a # read-only capture window is a capture-hygiene FAILURE by the comparator's # design - so a monitor would fail the run it was meant to observe. @@ -405,15 +414,11 @@ let # the guest shape alone: it captures nothing, but a daemon on the partner # would be one more thing that is not the switch it stands in for. isNetlinkQuiet = - isNlmonCapture - || isNetlinkDumpCapture - || isGoipParity - || isLinkWriteCapture - || isLacpPair - || isNlcapWorkbench; - # The ones that are driven over the serial console by an expect script, as - # opposed to nlmon-capture's baked-in oneshot. These are the ones that need - # `xtcp2-nlcap` on the guest PATH. + isNetlinkDumpCapture || isGoipParity || isLinkWriteCapture || isLacpPair || isNlcapWorkbench; + # The ones that are driven over the serial console by an expect script β€” + # every netlink flavor since the nlmon-capture oneshot retired (V401); its + # baked-in sequence is why the contrast used to need naming. These are the + # ones that need `xtcp2-nlcap` on the guest PATH. isNetlinkDriven = isNetlinkDumpCapture || isGoipParity || isLinkWriteCapture || isLacpA; # The VM's identity: hostname (which also names microvm.nix's QMP socket, @@ -2104,219 +2109,6 @@ let text = builtins.readFile ./scripts/socket-scale-run.sh; }; - # nlmon-capture flavor: record REAL rtnetlink notifications into a pcap. - # - # The guest is quiet by construction β€” services.xtcp2 is disabled for this - # flavor (below), so the daemon's periodic RTM_GETLINK/GETADDR/GETROUTE dumps - # cannot drown the events. `ip` itself still issues an RTM_GET* dump before - # most subcommands, so the capture IS a mix of solicited replies and - # unsolicited events; that is expected and is filtered in Go, not in BPF. - # The separation is done on nlmsg_flags by xtcpnl.IsRtnetlinkNotification - # (NLM_F_REQUEST clear and NLM_F_MULTI clear) β€” NOT on nlmsg_pid/nlmsg_seq, - # which looks right and is not; see that function and - # pkg/xtcpnl/xtcpnl_extract_event_fixtures_test.go. - # - # Output leaves the VM the same way coverage does: tar | gzip -n | base64 -w0 - # between sentinel lines on the serial console (see self-test.nix's coverage - # dump and lib.nix's extractor). gzip -n keeps the blob byte-reproducible by - # omitting the mtime. - nlmonCaptureRunScript = pkgs.writeShellApplication { - name = "nlmon-capture-run"; - runtimeInputs = with pkgs; [ - coreutils - gnutar - gzip - iproute2 - kmod - tcpdump - ]; - text = '' - OUT=/tmp/nlcap - PCAP="$OUT/netlink_route_events.pcap" - TRIGGERS="$OUT/nlcap_triggers" - IFACE=nlmon0 - # Seconds to let tcpdump bind before the first trigger. A miss here costs - # the whole first phase, and boot is the one moment the VM is busy. - WARMUP=''${NLCAP_WARMUP:-3} - - mkdir -p "$OUT" - : > "$TRIGGERS" - - echo "NLCAP_START" - - # run logs every trigger to the console AND to a committed sidecar, then - # tolerates its failure. Tolerance is required, not defensive: one phase - # deliberately deletes a route that does not exist so the capture contains - # a genuine NLMSG_ERROR, and errexit would otherwise kill the unit before - # the pcap is flushed. - run() { - echo "NLCAP_RUN $*" | tee -a "$TRIGGERS" - if "$@"; then - : - else - echo "NLCAP_RUN_FAIL rc=$? $*" | tee -a "$TRIGGERS" - fi - } - - phase() { - echo "NLCAP_PHASE $1" | tee -a "$TRIGGERS" - } - - run modprobe nlmon - run ip link add "$IFACE" type nlmon - run ip link set dev "$IFACE" up - - # The NETLINK_ROUTE filter (family at offset 14-15 of the 16-byte Linux - # SLL cooked header, NETLINK_ROUTE == 0) is cheap and documents intent - # even in a quiet guest. -U flushes per packet so a SIGINT loses nothing. - tcpdump -i "$IFACE" -w "$PCAP" -U -q 'ether[14:2]==0' >/dev/null 2>&1 & - tp=$! - - # `ip monitor` here is load-bearing, not decoration. - # - # nlmon mirrors netlink datagrams that are actually DELIVERED, and the - # kernel only generates a multicast notification when some socket has - # joined the relevant RTNLGRP_* group. A group with no subscriber - # produces no traffic at all, so nlmon records nothing. This guest has a - # subscriber for link/addr/route (systemd) but none for RTNLGRP_NEIGH β€” - # so without this line, `ip neigh add/del` put our REQUESTS on the wire - # and not a single RTM_NEWNEIGH/RTM_DELNEIGH notification, and the - # neighbour fixture came out empty. `ip monitor all` joins every group - # the four families need. - # - # Its decoded output is kept as a sidecar: an ordered, human-readable - # ground truth for the events in the pcap β€” the event-side counterpart - # to the ip_link_n / ip_addr_n sidecars the dump fixtures cite. - ip -t monitor all label > "$OUT/ip_monitor_all" 2>&1 & - mon=$! - - sleep "$WARMUP" - - # ── link: create, carrier loss, carrier restore, admin down/up ───────── - # A veth pair is the only cheap way to produce a REAL carrier transition: - # downing the peer clears IFF_RUNNING on nlcap0 while IFF_UP stays set, - # which is exactly the case LinkInfo.IsCarrierDown exists to distinguish - # from LinkInfo.IsAdminDown. - phase link - run ip link add nlcap0 type veth peer name nlcap1 - run ip link set dev nlcap0 up - run ip link set dev nlcap1 up - sleep 1 - run ip link set dev nlcap1 down - sleep 1 - run ip link set dev nlcap1 up - sleep 1 - run ip link set dev nlcap0 down - sleep 1 - run ip link set dev nlcap0 up - sleep 1 - # A dummy add/del gives a second ARPHRD type and a clean RTM_DELLINK - # that is not entangled with a veth peer. - run ip link add nlcapd0 type dummy - run ip link set dev nlcapd0 up - run ip link del nlcapd0 - sleep 1 - - # ── addr: IPv4 /24 and IPv6 /64, added then removed ──────────────────── - phase addr - run ip addr add 192.0.2.1/24 dev nlcap0 - run ip -6 addr add 2001:db8::1/64 dev nlcap0 - # IPv6 DAD holds the address tentative for ~1 s; wait so the RTM_NEWADDR - # for the final (non-tentative) state is in the capture too. - sleep 2 - run ip addr del 192.0.2.1/24 dev nlcap0 - run ip -6 addr del 2001:db8::1/64 dev nlcap0 - sleep 1 - - # ── route: on-link, via-gateway, non-main table, blackhole, IPv6 ─────── - # The addresses go back on first: an on-link or via-gateway route needs a - # matching prefix on the device or the add fails with ENETUNREACH. - phase route - run ip addr add 192.0.2.1/24 dev nlcap0 - run ip -6 addr add 2001:db8::1/64 dev nlcap0 - sleep 2 - run ip route add 198.51.100.0/24 dev nlcap0 - run ip route del 198.51.100.0/24 dev nlcap0 - run ip route add 203.0.113.0/24 via 192.0.2.254 dev nlcap0 - run ip route del 203.0.113.0/24 via 192.0.2.254 dev nlcap0 - # table 100 exercises RTA_TABLE: rtm_table is 8-bit, so any id above 255 - # arrives in the attribute instead. 100 fits in the header; the attribute - # is present regardless, which is what the parser reads. - run ip route add 198.18.0.0/24 dev nlcap0 table 100 - run ip route del 198.18.0.0/24 dev nlcap0 table 100 - # blackhole exercises rtm_type != RTN_UNICAST with no oif. - run ip route add blackhole 198.19.0.0/24 - run ip route del blackhole 198.19.0.0/24 - run ip -6 route add 2001:db8:1::/64 dev nlcap0 - run ip -6 route del 2001:db8:1::/64 dev nlcap0 - sleep 1 - - # ── neigh: add permanent, transition to stale, delete; v4 and v6 ─────── - phase neigh - run ip neigh add 192.0.2.50 lladdr 02:00:00:00:00:01 dev nlcap0 nud permanent - sleep 1 - run ip neigh change 192.0.2.50 lladdr 02:00:00:00:00:01 dev nlcap0 nud stale - sleep 1 - run ip neigh del 192.0.2.50 dev nlcap0 - run ip -6 neigh add 2001:db8::50 lladdr 02:00:00:00:00:02 dev nlcap0 nud permanent - sleep 1 - run ip -6 neigh del 2001:db8::50 dev nlcap0 - sleep 1 - - # ── deliberate negative: delete a route that does not exist ──────────── - # Produces a real NLMSG_ERROR (-ESRCH) in the capture, so the parser's - # "not an event" path has a genuine fixture rather than a synthetic one. - phase error - run ip route del 203.0.113.99/32 - - # ── sidecars, taken BEFORE teardown ──────────────────────────────────── - # The dump fixtures cite ip_link_n / ip_addr_n line numbers as their - # source of truth; keep that for events by recording the state while - # nlcap0 still exists and is configured. - phase sidecars - uname -a > "$OUT/uname" - ip -d link show > "$OUT/ip_link_n" - ip -d addr show > "$OUT/ip_addr_n" - ip -d route show table all > "$OUT/ip_route_table_all_n" - ip -d neigh show > "$OUT/ip_neigh_n" - - # ── teardown: RTM_DELLINK for both ends of the pair ──────────────────── - phase teardown - run ip link del nlcap0 - sleep 2 - - # Stop the subscriber first so its last notifications are already on the - # wire when tcpdump stops, then SIGINT tcpdump β€” SIGINT (not SIGTERM) is - # what tcpdump treats as "stop and flush". - kill "$mon" 2>/dev/null || true - wait "$mon" 2>/dev/null || true - kill -INT "$tp" 2>/dev/null || true - wait "$tp" 2>/dev/null || true - - if [ ! -s "$PCAP" ]; then - echo "NLCAP_ERR capture is missing or empty: $PCAP" - exit 1 - fi - - # `tcpdump --count` reports the packet count directly. Do NOT count lines - # of `tcpdump -q` output instead: on DLT_NETLINK it prints several lines - # per packet, which reported 13249 for a 384-packet capture. - pkts="$(tcpdump --count -r "$PCAP" 2>&1 | tail -n 1 || true)" - echo "NLCAP_PACKETS $pkts" - echo "NLCAP_EVENTS $(grep -c . "$OUT/ip_monitor_all" 2>/dev/null || echo 0) decoded by ip monitor" - - # Drop the monitor before dumping so the blob is not chasing its own tail. - ip link del "$IFACE" 2>/dev/null || true - - echo "XTCP2_NLCAP_DUMP_START" - tar c -C "$OUT" . | gzip -n | base64 -w0 - echo - echo "XTCP2_NLCAP_DUMP_END" - - echo "NLCAP_DONE" - ''; - }; - # The three long-running s3parquet flavors (long/stress/lowfreq) share one # production parquetβ†’S3 (Garage) config β€” 64 MiB flush, 5s timeout, Pyroscope leak # diagnosis streaming to the in-VM server β€” and differ ONLY in poll frequency @@ -4735,38 +4527,6 @@ in ''; }; - # nlmon-capture flavor: trigger a scripted sequence of real kernel - # network events on boot, capture them off an nlmon device, emit the - # pcap + sidecars as a base64 blob on the serial console, then let the - # host runner power the VM off. - systemd.services.nlmon-capture-run = lib.mkIf isNlmonCapture { - description = "xtcp2 β€” rtnetlink event capture (nlmon)"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - path = with pkgs; [ - iproute2 - coreutils - kmod - tcpdump - ]; - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - # CAP_NET_ADMIN creates the nlmon/veth/dummy links and edits the - # route + neighbour tables; CAP_NET_RAW is what tcpdump needs to - # open the capture socket. CAP_SYS_MODULE covers the `modprobe` - # fallback when boot.kernelModules has not already loaded nlmon. - AmbientCapabilities = [ - "CAP_NET_ADMIN" - "CAP_NET_RAW" - "CAP_SYS_MODULE" - ]; - ExecStart = "${nlmonCaptureRunScript}/bin/nlmon-capture-run"; - StandardOutput = "journal+console"; - StandardError = "journal+console"; - }; - }; - environment.systemPackages = (with pkgs; [ coreutils @@ -4780,16 +4540,6 @@ in systemd ]) ++ lib.optionals isTcpStress (with pkgs; [ docker ]) - # nlmon-capture tars + gzips + base64s the pcap out over the console, - # and modprobes nlmon; none of those are in the base set above. - ++ lib.optionals isNlmonCapture ( - with pkgs; - [ - kmod - gzip - gnutar - ] - ) # The two driven flavors need the same exfil tools, plus the helper # itself: each driver's first act is `command -v xtcp2-nlcap`, and it # aborts naming this entry if the helper is not here. iproute2 and diff --git a/nix/microvms/netlink-capture.nix b/nix/microvms/netlink-capture.nix index 022841f3a..06fee00b0 100644 --- a/nix/microvms/netlink-capture.nix +++ b/nix/microvms/netlink-capture.nix @@ -48,8 +48,8 @@ # # WHY THE SPLIT IS THIS WAY ROUND # -# The existing nlmon-capture flavor puts the whole capture sequence in a -# systemd oneshot baked into the VM. That is the right shape for a +# The retired nlmon-capture oneshot (V401) put the whole capture sequence in +# a systemd service baked into the VM. That was the right shape for a # fire-and-forget event capture, and the wrong shape here, for two reasons: # # - Changing the sequence means rebuilding the VM. A capture set is @@ -2802,7 +2802,8 @@ pkgs.writeShellApplication { # pack # # tar | gzip -n | base64, between sentinels, the same exfil path coverage - # and nlmon-capture use. `gzip -n` omits the mtime so the blob is + # and the retired nlmon-capture oneshot (V401) used. `gzip -n` omits the + # mtime so the blob is # byte-reproducible for an unchanged capture. # # base64 is WRAPPED, not `-w0`. The host side reads the console with diff --git a/nix/microvms/scripts/goip-parity.exp b/nix/microvms/scripts/goip-parity.exp index e5e98258d..3121e8241 100644 --- a/nix/microvms/scripts/goip-parity.exp +++ b/nix/microvms/scripts/goip-parity.exp @@ -69,8 +69,8 @@ # # NO `ip monitor`, DELIBERATELY β€” EXCEPT IN THE MONITOR SECTION # -# The nlmon-capture flavor starts `ip -t monitor all` because its subject is -# notifications. Here it would be actively harmful: for dumps it multiplies +# The retired nlmon-capture oneshot (V401) started `ip -t monitor all` +# because its subject was notifications. Here it would be actively harmful: for dumps it multiplies # deliveries, and every extra socket in the namespace is another portid the # comparator's attribution has to discard. A multicast notification inside a # read-only capture window is a capture-hygiene FAILURE by design diff --git a/nix/microvms/scripts/vm-lib.exp b/nix/microvms/scripts/vm-lib.exp index d07a01859..2516ce761 100644 --- a/nix/microvms/scripts/vm-lib.exp +++ b/nix/microvms/scripts/vm-lib.exp @@ -14,7 +14,8 @@ # Every other runner in nix/microvms/lib.nix drives the guest the same way: # `nc` the serial port into a transcript file, then poll it with `grep` for a # sentinel. That is fine for a fire-and-forget guest that runs one systemd -# oneshot and prints a DONE line, which is what nlmon-capture is. It is not +# oneshot and prints a DONE line, which is what the retired nlmon-capture +# oneshot was (V401). It is not # fine for a capture sequence, because the host has no way to know a guest # command FINISHED - only that some text appeared. The existing capture # scripts paper over that with `sleep 1` / `sleep 2` / `WARMUP=3`, and diff --git a/pkg/nlparity/goip-parity-allowlist.json b/pkg/nlparity/goip-parity-allowlist.json index b9be9c092..43503fb46 100644 --- a/pkg/nlparity/goip-parity-allowlist.json +++ b/pkg/nlparity/goip-parity-allowlist.json @@ -1155,7 +1155,17 @@ "first with CONTROL_NOISY 4, the carrier transient D_control subtracts. The", "run before them WARNed both rows on the comparator's own keep-first bug,", "the readiness join dropped for its Deleted twin, which the keep-last", - "collapse fixed. The ungated surface is `addr show dynamic` alone again." + "collapse fixed. The ungated surface is `addr show dynamic` alone again.", + "", + "EG1-T02 and EG2-T01 (goip-parity-events.md) gate their thirty monitor", + "rows on the two consecutive clean `--section monitor` runs each: the", + "thirteen live rows (V398-V399) - dad, autoconf, v4, bucket, del, rule", + "v4, l3, live, ra, anycast, all mixed, and the two refusals (esrch,", + "eexist) - and the seventeen offline rows (V400) - the bond partner", + "states, the actor-stays-u8 pair, the P14 reason u32s, the three metrics", + "shapes, evnhb-bucket.nl and notnetlink.txt. Each row's second clean run", + "is EG2-T02's (V401); the first was its own landing's. The ungated", + "surface is `addr show dynamic` alone, as it has been since V396." ], "_note_version_skew": [ "Empty since 2026-10-21, when the pin moved from iproute2 7.1.0 to 7.2.0", @@ -1203,19 +1213,19 @@ "command": "link set dev d0 netns c1mv", "locus": "request:RTM_NEWLINK:IFLA_NET_NS_FD:write", "kind": "accepted-divergence", - "reason": "NX2. `ip link set|add \u2026 netns NAME|PATH|PID` opens the namespace (netns_get_fd, lib/namespace.c) and sends IFLA_NET_NS_FD, the descriptor of that open file in the sender, at the keyword's place (iplink_parse, ip/iplink.c): fd 4 in ip (linkns/ec-002, ec-003 and add-index ip.pcap), whatever slot is free in goip: fd 6 in the NX2 VM runs. It is the netns set entry's reason on RTM_NEWLINK: the kernel resolves either number to the same namespace, and matching ip's would mean padding goip's table. Every other attribute, IFLA_NEW_IFINDEX and IFLA_IFNAME among them, is compared and not covered here." + "reason": "NX2. `ip link set|add … netns NAME|PATH|PID` opens the namespace (netns_get_fd, lib/namespace.c) and sends IFLA_NET_NS_FD, the descriptor of that open file in the sender, at the keyword's place (iplink_parse, ip/iplink.c): fd 4 in ip (linkns/ec-002, ec-003 and add-index ip.pcap), whatever slot is free in goip: fd 6 in the NX2 VM runs. It is the netns set entry's reason on RTM_NEWLINK: the kernel resolves either number to the same namespace, and matching ip's would mean padding goip's table. Every other attribute, IFLA_NEW_IFINDEX and IFLA_IFNAME among them, is compared and not covered here." }, { "command": "link set dev d0 netns /proc/self/ns/net", "locus": "request:RTM_NEWLINK:IFLA_NET_NS_FD:write", "kind": "accepted-divergence", - "reason": "NX2. `ip link set|add \u2026 netns NAME|PATH|PID` opens the namespace (netns_get_fd, lib/namespace.c) and sends IFLA_NET_NS_FD, the descriptor of that open file in the sender, at the keyword's place (iplink_parse, ip/iplink.c): fd 4 in ip (linkns/ec-002, ec-003 and add-index ip.pcap), whatever slot is free in goip: fd 6 in the NX2 VM runs. It is the netns set entry's reason on RTM_NEWLINK: the kernel resolves either number to the same namespace, and matching ip's would mean padding goip's table. Every other attribute, IFLA_NEW_IFINDEX and IFLA_IFNAME among them, is compared and not covered here." + "reason": "NX2. `ip link set|add … netns NAME|PATH|PID` opens the namespace (netns_get_fd, lib/namespace.c) and sends IFLA_NET_NS_FD, the descriptor of that open file in the sender, at the keyword's place (iplink_parse, ip/iplink.c): fd 4 in ip (linkns/ec-002, ec-003 and add-index ip.pcap), whatever slot is free in goip: fd 6 in the NX2 VM runs. It is the netns set entry's reason on RTM_NEWLINK: the kernel resolves either number to the same namespace, and matching ip's would mean padding goip's table. Every other attribute, IFLA_NEW_IFINDEX and IFLA_IFNAME among them, is compared and not covered here." }, { "command": "link add d9 netns c1mv index 100 type dummy", "locus": "request:RTM_NEWLINK:IFLA_NET_NS_FD:write", "kind": "accepted-divergence", - "reason": "NX2. `ip link set|add \u2026 netns NAME|PATH|PID` opens the namespace (netns_get_fd, lib/namespace.c) and sends IFLA_NET_NS_FD, the descriptor of that open file in the sender, at the keyword's place (iplink_parse, ip/iplink.c): fd 4 in ip (linkns/ec-002, ec-003 and add-index ip.pcap), whatever slot is free in goip: fd 6 in the NX2 VM runs. It is the netns set entry's reason on RTM_NEWLINK: the kernel resolves either number to the same namespace, and matching ip's would mean padding goip's table. Every other attribute, IFLA_NEW_IFINDEX and IFLA_IFNAME among them, is compared and not covered here." + "reason": "NX2. `ip link set|add … netns NAME|PATH|PID` opens the namespace (netns_get_fd, lib/namespace.c) and sends IFLA_NET_NS_FD, the descriptor of that open file in the sender, at the keyword's place (iplink_parse, ip/iplink.c): fd 4 in ip (linkns/ec-002, ec-003 and add-index ip.pcap), whatever slot is free in goip: fd 6 in the NX2 VM runs. It is the netns set entry's reason on RTM_NEWLINK: the kernel resolves either number to the same namespace, and matching ip's would mean padding goip's table. Every other attribute, IFLA_NEW_IFINDEX and IFLA_IFNAME among them, is compared and not covered here." } ], "gated_commands": [ @@ -2682,6 +2692,36 @@ "-M route get 100", "-M route get 100 as 200", "monitor link maddress carrier", - "monitor link maddress admin" + "monitor link maddress admin", + "monitor address maddress dad", + "monitor route maddress autoconf", + "monitor neigh maddress v4", + "monitor nexthop maddress bucket", + "monitor netconf maddress del", + "monitor rule maddress v4", + "monitor stats maddress l3", + "monitor nsid maddress live", + "monitor prefix route maddress ra", + "monitor acaddress maddress anycast", + "monitor all mixed", + "monitor maddress esrch", + "monitor nsid maddress eexist", + "monitor file bond-partner-fast.nl", + "monitor file bond-partner-slow.nl", + "monitor file bond-partner-zero.nl", + "monitor file bond-partner-all.nl", + "monitor file bond-partner-hibyte.nl", + "monitor file bond-partner-hionly.nl", + "monitor file bond-partner-absent.nl", + "monitor file bond-partner-trunc1.nl", + "monitor file bond-actor-u8.nl", + "monitor file linkpd-0009.nl", + "monitor file linkpd-0100.nl", + "monitor file linkpd-80000001.nl", + "monitor file route-metrics-nested.nl", + "monitor file route-metrics-overlong.nl", + "monitor file route-metrics-v038pad.nl", + "monitor file evnhb-bucket.nl", + "monitor file notnetlink.txt" ] } diff --git a/pkg/nlparity/nlparity_allowlist_test.go b/pkg/nlparity/nlparity_allowlist_test.go index ecf820cb1..1e870f1e7 100644 --- a/pkg/nlparity/nlparity_allowlist_test.go +++ b/pkg/nlparity/nlparity_allowlist_test.go @@ -2007,6 +2007,40 @@ func TestAllowlistCommitted(t *testing.T) { // (goip-parity-events-status.md, V395). "monitor link maddress carrier", "monitor link maddress admin", + // The thirty that follow (EG1-T02's thirteen live rows, EG2-T01's + // seventeen offline rows) gated on the two consecutive clean + // `--section monitor` runs each: their own landing's first run and + // EG2-T02's (V401) second (goip-parity-events-status.md, V398-V401). + "monitor address maddress dad", + "monitor route maddress autoconf", + "monitor neigh maddress v4", + "monitor nexthop maddress bucket", + "monitor netconf maddress del", + "monitor rule maddress v4", + "monitor stats maddress l3", + "monitor nsid maddress live", + "monitor prefix route maddress ra", + "monitor acaddress maddress anycast", + "monitor all mixed", + "monitor maddress esrch", + "monitor nsid maddress eexist", + "monitor file bond-partner-fast.nl", + "monitor file bond-partner-slow.nl", + "monitor file bond-partner-zero.nl", + "monitor file bond-partner-all.nl", + "monitor file bond-partner-hibyte.nl", + "monitor file bond-partner-hionly.nl", + "monitor file bond-partner-absent.nl", + "monitor file bond-partner-trunc1.nl", + "monitor file bond-actor-u8.nl", + "monitor file linkpd-0009.nl", + "monitor file linkpd-0100.nl", + "monitor file linkpd-80000001.nl", + "monitor file route-metrics-nested.nl", + "monitor file route-metrics-overlong.nl", + "monitor file route-metrics-v038pad.nl", + "monitor file evnhb-bucket.nl", + "monitor file notnetlink.txt", } tests := []struct { diff --git a/pkg/xtcpnl/testdata_test.go b/pkg/xtcpnl/testdata_test.go index acbe59c56..6b48e65f0 100644 --- a/pkg/xtcpnl/testdata_test.go +++ b/pkg/xtcpnl/testdata_test.go @@ -150,7 +150,8 @@ const ( tdRouteGetRouteDump_7_1_8 = tdBase + "/7_1_8/netlink_route_getroute_dump.pcap" // 7.1.4 rtnetlink EVENT captures (nlmon, NETLINK_ROUTE only), produced by - // `nix run .#microvm-x86_64-nlmon-capture`. 7_1_4 is the microVM's guest + // the retired nlmon-capture oneshot (V401; the app is gone, the corpus + // frozen). 7_1_4 is the microVM's guest // kernel, not this host's β€” the fixture is versioned by the kernel that // actually emitted the bytes. // diff --git a/pkg/xtcpnl/xtcpnl_extract_event_fixtures_test.go b/pkg/xtcpnl/xtcpnl_extract_event_fixtures_test.go index e944642ee..22682a69a 100644 --- a/pkg/xtcpnl/xtcpnl_extract_event_fixtures_test.go +++ b/pkg/xtcpnl/xtcpnl_extract_event_fixtures_test.go @@ -10,7 +10,7 @@ import ( ) // TestExtractEventFixtures slices the bulk nlmon EVENT capture under -// testdata/7_1_4/ (produced by `nix run .#microvm-x86_64-nlmon-capture`) into +// testdata/7_1_4/ (produced by the retired nlmon-capture oneshot, V401) into // one clean per-family pcap each, which the event tests read. // // Why a generator, and why the filtering is not optional: the bulk capture is diff --git a/pkg/xtcpnl/xtcpnl_rtnetlink_events_realfixtures_test.go b/pkg/xtcpnl/xtcpnl_rtnetlink_events_realfixtures_test.go index fa3bc251e..69a84dbb3 100644 --- a/pkg/xtcpnl/xtcpnl_rtnetlink_events_realfixtures_test.go +++ b/pkg/xtcpnl/xtcpnl_rtnetlink_events_realfixtures_test.go @@ -14,8 +14,8 @@ import ( // Real-fixture assertions for the rtnetlink event parsers. // // The fixtures under testdata/7_1_4/ are real kernel bytes captured off an -// nlmon device inside the hermetic microVM -// (`nix run .#microvm-x86_64-nlmon-capture`), sliced per family by +// nlmon device inside the hermetic microVM (the retired nlmon-capture +// oneshot, V401), sliced per family by // TestExtractEventFixtures. 7_1_4 is the guest kernel. // // Two kinds of assertion, for two different reasons: diff --git a/pkg/xtcpnl/xtcpnl_write_gate_test.go b/pkg/xtcpnl/xtcpnl_write_gate_test.go index d91ee399c..86befcdad 100644 --- a/pkg/xtcpnl/xtcpnl_write_gate_test.go +++ b/pkg/xtcpnl/xtcpnl_write_gate_test.go @@ -28,7 +28,8 @@ import ( // RTM_SETLINK with token set and del (G4-T03), and RTM_NEWNSID with netns // set (G4-T04); `link set` still sends RTM_NEWLINK. The qdisc and class // pairs joined with gotc's tc write builder (gotc 17P), whose parity target -// is the captured ws/tcqwrite corpus. +// is the captured ws/tcqwrite corpus, and the filter and chain pairs with it +// β€” tc_filter_modify's sends (tc/tc_filter.c:752-803). var admittedWriteTypes = map[uint16]bool{ uint16(unix.RTM_NEWROUTE): true, uint16(unix.RTM_DELROUTE): true, @@ -54,6 +55,10 @@ var admittedWriteTypes = map[uint16]bool{ uint16(unix.RTM_DELQDISC): true, uint16(unix.RTM_NEWTCLASS): true, uint16(unix.RTM_DELTCLASS): true, + uint16(unix.RTM_NEWTFILTER): true, + uint16(unix.RTM_DELTFILTER): true, + uint16(unix.RTM_NEWCHAIN): true, + uint16(unix.RTM_DELCHAIN): true, } // TestBuildWriteRequestAdmitsOnlyListedWrites walks every named rtnetlink type From 4151689bcb22a19f9be2c08b4fac6b1f93fb35a0 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Tue, 1 Dec 2026 05:12:00 -0800 Subject: [PATCH 2/3] docs(upstream): list gotc 22P's action-write note, the merge's third index gap --- docs/netlink/goip-parity-events-status.md | 2 +- docs/netlink/upstream/README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/netlink/goip-parity-events-status.md b/docs/netlink/goip-parity-events-status.md index b047074ba..7f60f81e9 100644 --- a/docs/netlink/goip-parity-events-status.md +++ b/docs/netlink/goip-parity-events-status.md @@ -106,7 +106,7 @@ | V398 | 2026-11-28 | EG1-T02: the thirteen monitor rows and the netnsid step | both full suites (`go test -count=1 ./...` and `-tags goip_write ./...`); `go vet -tags goip_write ./...`; the checks lint-baseline, gofmt, nix-fmt, go-vet, test-goip-docs, test-goip-monitorfile, test-focused-goip, vm-lib-exp, cli-help-smoke-goip-parity; the section's first live run - `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`, thirteen `PASS`, two `WARN`, `HYGIENE_PASS`, `CONTROL_NOISY 11` | The `Command` table grows the thirteen rows - the EP1 twelve's remainder (`dad`, `route autoconf`, `neigh v4`, `nexthop bucket`, `netconf del`, `rule v4`, `stats l3`, `nsid live`, `prefix route ra`, `acaddress anycast`, `all mixed`) and the two refusals (`maddress esrch`, `nsid eexist`, both `MonitorExpectRC: 1`) - each the ev row's own Setup, Trigger and until-EREs, `Floor 1`, `Canary c0`. The nsid rows print the netns name (goip implements the name walk), so the driver grows the `netnsid` setup step - evSelfID's own shape - and its quoting comments now name the nsid rows' shell-escaped `$`/`"`. TestCommandTable grows the rc rule (every monitor row declares 0 or 1; the refusal rows 1), the thirteen in the ungated set, and the sysctl corner (RA rows 2, netconf-del/anycast/all-mixed 1); `writeCleanMonitorRow` writes the declared rc. The two `WARN`s - `monitor_address_dad`, `monitor_all_mixed` - are one noise: the canary retry's Deleted stanzas on the goip side the attach race hit, the same blocks the neigh and prefix rows' D_control carried on their ip_a sides (4 and 6, `CONTROL_NOISY 11` total). The findings are the comparator's own gap - V395's collapse knew one of the retry's stanza shapes - closed in V399 | `d069d3a11` | | V399 | 2026-11-28 | the canary retry's four stanza shapes; the section's gate clean | the monitor tests (TestCollapseCanary, TestCompareMonitorWithControl, 15 rows); both full suites; the checks lint-baseline, test-goip-docs, test-goip-monitorfile, test-focused-goip, vm-lib-exp, go-vet, gofmt, nix-fmt, cli-help-smoke-goip-parity; O5/O9/O10 regenerated (`-update-ws-*`), no drift; the section's second live run - `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`, fifteen `PASS`, `HYGIENE_PASS`, `CONTROL_NOISY 1`, `UNGATED_CLEAN` | The measured fix: the retry's `ip addr del` prints four stanza shapes, not the one V395's collapse knew - the mcast stanza, the `/32` autojoin stanza its RTM_NEWADDR prints, the local route the address brings, and the NOARP neighbor on `224.0.0.22` (the IGMPv3 report group the autojoin solicits, RFC 3376) on the canary device. `collapseCanary` drops every Deleted canary block and keeps the last run of consecutive undeleted canary blocks - the join the helper's loop broke on - which degenerates to V395's keep-last for the link rows' mcast-only shape; `isCanaryStanza` takes the canary device (the IGMP anchor, plumbed through `CompareMonitorWithControl` - the row's `Canary` field) and `isDeletedStanza` reads the `Deleted` prefix under the `all` banner. The join's own rendered text stays compared; the retry's twins go. The V398 capture's four shapes are the fixtures (each monitor kind's retry collapses to its join - the dad, prefix, neigh and all rows) and the two live `WARN`s are regression cases. The fixed comparator, run over the first live run's captured artifacts, passes all fifteen rows with no findings - the neigh and prefix rows' D_control dropped to 0 with it - and the second live run ran clean throughout (the `CONTROL_NOISY 1` is the all row's unpinned d0 MAC, the corpus's own evseq-mixed pre, mirrored; D_control subtracts it). The thirteen rows stay ungated: they pass clean, the gated set unchanged | `23399edcf` | | V400 | 2026-11-30 | EG2-T01: the offline rows, the section's gate green | both full suites (`go test -count=1 ./...` and `-tags goip_write ./...`); `go vet -tags goip_write ./...`; the checks lint-baseline, gofmt, nix-fmt, go-vet, test-goip-docs, test-goip-monitorfile, test-focused-goip, vm-lib-exp, cli-help-smoke-goip-parity; O5/O9/O10 regenerated, no drift; the section's live run - `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`, thirty-two `PASS`, `HYGIENE_PASS`, `CONTROL_NOISY 1`, `UNGATED_CLEAN` | The monitor-file row kind: the `Command` table's `Monfile`/`Knob`/`Golden` (the row format's thirteenth field), the comparator's `compareMonfileRow` (the rc rule - agree, then equal the declared one; the stderr rule - rc 0 ↔ empty, rc β‰  0 ↔ non-empty, never compared; the golden comparison naming the side, the golden and the first differing line; a `-` golden three-side equality, the monitor rows' own shape), `expectedFiles`' goldens per side (the ip sides always `.ip730`, the goip side the record its `Knob` names - the `.ip720` goldens the measurement of record for the `=0` rows, the guest carrying no 7.2.0 `ip`, T03's check what gates that knob against the real binary), and the driver's `capture_monfile_triple` (a fresh namespace per side, the Setup steps, `xtcp2-nlcap mon` running `ip -d monitor file` twice around `goip -d monitor file` at the knob - the first run's `MISSED FLOOR`, the input read against the console's CWD rather than the capture dir, the driver fix on the record). Seventeen rows: the bond partner states (hibyte and hionly at `=0`, the versions' u16 `319 <…,>` vs u8 `63` prints the rows' whole point; the rest `=1`), the actor-stays-u8 pair, the P14 reason u32s, the three metrics shapes (the plan's one padding row measured into all three committed shapes), the text refusal (`MonitorExpectRC: 1`) and the pcap corner - `evnhb-bucket.nl`, `nlcapgen monfile -pcap`'s 232-byte notifications-only write (3 of the capture's 16 messages; `TestMonfileCommittedPcap` the regeneration golden, T03's spec-golden check skipping a `.nl` with no `.spec`), its goldens measured at all four sides byte-identical. A plan correction on the record: the corner's render is the corpus `.out`'s lines modulo `-d`'s detail words and the ifname - ifindex 3 misses in an empty namespace, `if3` (the no-sandbox-index rule's own class), the corpus `.out`'s `c0` its own VM's name. The seventeen stay ungated, one clean live run of the two V393's rule wants; the gated set unchanged | this commit | -| V401 | 2026-12-01 | EG2-T02: the tier closes β€” the spread deferred, the oneshot retired, the thirty gated | Decision 1, the kernel spread: the probe (a throwaway over both corpora, deleted after measurement) walked every route event in the five oneshot pcaps (kernel 7.1) and the thirty-three `ws/ev*` rows (kernel 7.3.1) and found ten old-only attributes, none kernel-conditional. Family 16: `IFLA_NUM_VF` (21), `IFLA_ALT_IFNAME` (54), `IFLA_PROTO_DOWN_REASON` (56), `IFLA_PARENT_DEV_NAME` (57), all four on the oneshot VM's boot NIC `ens4` only β€” NUM_VF needs `ext_filter_mask & RTEXT_FILTER_VF` (`net/core/rtnetlink.c`, `rtnl_fill_vf`) and notifications build with `ext_filter_mask=0` (`rtmsg_ifinfo`, rtnetlink.c:4633-4639), so its two carriers that pass the flags-only `IsRtnetlinkNotification` discriminator are unicast replies; ALT_IFNAME fills from the device's alt name nodes, PROTO_DOWN_REASON only when the reason bits are non-zero, PARENT_DEV_NAME only when `dev->dev.parent` exists. Family 17: `IFLA_LINK` (5), the veth pair only (`nla_put_iflink` β€” a dummy's iflink is its own ifindex). Families 20/21: `IFA_PROTO` (11), every carrier value 3 (`IFAPROT_KERNEL_LL`, AF_INET6 β€” the kernel-autoconf'd IPv6 link-local adds and dels, the new corpus's adds all static), plus `IFA_RT_PRIORITY` (9) and `IFA_BROADCAST` (4) on unicast replies (`inet_fill_ifaddr`, devinet.c:1764-1771, each filling only when its ifa field is non-zero). Families 24/25: `RTA_NH_ID` (30, `fib_dump_info`: only when `fi->nh`) and `RTA_GATEWAY` (5, the nexthop's gateway). The fill conditionals are byte-identical between v7.1 and v7.3 (rtnetlink.c: NUM_VF 1676β†’1725, ALT_IFNAME 1945β†’2000, PROTO_DOWN_REASON 1988β†’2048, PARENT_DEV 2199β†’2264, IFLA_LINK 1860β†’1914; devinet.c:1764/1768/1771 unchanged; fib_semantics.c: RTA_NH_ID 1764β†’1794, RTA_GATEWAY 1603β†’1635). Nine of the ten are decoder-read (`linkAltNames`, `setProtoDownReason`, `ParentDevName`, `Link`, `IfaProto`, `RtPriority`, `Broadcast`, `RtaNhID`, `Gateway`; only NUM_VF is not) β€” the spread stays deferred until a decoder branch or a capture needs a second kernel. Decision 2: `nlmon-capture` retired β€” the product stays committed (the base event corpus), the machinery (WARMUP=3 sleeps, no bind wait, `--immediate-mode`, `-B 32768`, the `ss -x` stop sentinel, the drop-count readback, the floors) predates every driven-machinery fix, nothing gated or checked boots it (`netlink-capture.nix`'s shared helper stays); `flake.nix`'s header, `nix/README.md`'s fixture table and `docs/netlink/collection.md` name the retirement; `mkVm.nix` loses the flavor, `lib.nix` its `mkNlmonCaptureRunner`, `default.nix` and `nix/default.nix` the attrsets, and three Go provenance comments updated. The tier's own work: the thirty monitor rows gated (the allowlist's `gated_commands` 1464β†’1494, the earned list, `TestUngatedSurfaceIsNotVacuous`'s expected down to `addr show dynamic` alone, `TestMonitorRowsGated` pinning all thirty-two), each cohort on its own landing's first clean `--section monitor` run and EG2-T02's second (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1` + `UNGATED_CLEAN`), the gated rerun the same. Gates: O5/O9/O10 regenerated (0 sends, 0 differs, no row moved away from `same`); both full suites; gofmt; `go vet -tags goip_write`; the nine checks; `test-focused-goip`; the docs check; the full run at `--timeout 36000` (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1168` + `UNGATED_CLEAN`, 1495 commands β€” the first attempt's 12000 s FATAL a loaded-host artifact, other tenants' clang-tidy batch and a foreign VM at load 76; the quiet-host rerun clean); the whole-repo `test-go-race` (its one red under that load β€” `dockermeta`'s `TestTenantBodySize`, a 10 s deadline on a 68 MiB local stream β€” green on the quiet host, both isolated and in the check). Two pre-existing main reds from gotc commits that landed after EG2-T01's runs fixed in the same task: `TestBuildWriteRequestAdmitsOnlyListedWrites` (`cba42d462` added RTM_NEW/DELTFILTER and RTM_NEW/DELCHAIN to `IsAdmittedWriteType` but not the test's map; the four pairs added, `tc/tc_filter.c:752-803` cited) and the upstream index (`8b707c8b1`; `iproute2-tc-filter-write.md` and `iproute2-tc-ematch-write.md` listed). coverage-status.md's two "never compared live" spots updated β€” the matrix now drives the monitor section | this commit | +| V401 | 2026-12-01 | EG2-T02: the tier closes β€” the spread deferred, the oneshot retired, the thirty gated | Decision 1, the kernel spread: the probe (a throwaway over both corpora, deleted after measurement) walked every route event in the five oneshot pcaps (kernel 7.1) and the thirty-three `ws/ev*` rows (kernel 7.3.1) and found ten old-only attributes, none kernel-conditional. Family 16: `IFLA_NUM_VF` (21), `IFLA_ALT_IFNAME` (54), `IFLA_PROTO_DOWN_REASON` (56), `IFLA_PARENT_DEV_NAME` (57), all four on the oneshot VM's boot NIC `ens4` only β€” NUM_VF needs `ext_filter_mask & RTEXT_FILTER_VF` (`net/core/rtnetlink.c`, `rtnl_fill_vf`) and notifications build with `ext_filter_mask=0` (`rtmsg_ifinfo`, rtnetlink.c:4633-4639), so its two carriers that pass the flags-only `IsRtnetlinkNotification` discriminator are unicast replies; ALT_IFNAME fills from the device's alt name nodes, PROTO_DOWN_REASON only when the reason bits are non-zero, PARENT_DEV_NAME only when `dev->dev.parent` exists. Family 17: `IFLA_LINK` (5), the veth pair only (`nla_put_iflink` β€” a dummy's iflink is its own ifindex). Families 20/21: `IFA_PROTO` (11), every carrier value 3 (`IFAPROT_KERNEL_LL`, AF_INET6 β€” the kernel-autoconf'd IPv6 link-local adds and dels, the new corpus's adds all static), plus `IFA_RT_PRIORITY` (9) and `IFA_BROADCAST` (4) on unicast replies (`inet_fill_ifaddr`, devinet.c:1764-1771, each filling only when its ifa field is non-zero). Families 24/25: `RTA_NH_ID` (30, `fib_dump_info`: only when `fi->nh`) and `RTA_GATEWAY` (5, the nexthop's gateway). The fill conditionals are byte-identical between v7.1 and v7.3 (rtnetlink.c: NUM_VF 1676β†’1725, ALT_IFNAME 1945β†’2000, PROTO_DOWN_REASON 1988β†’2048, PARENT_DEV 2199β†’2264, IFLA_LINK 1860β†’1914; devinet.c:1764/1768/1771 unchanged; fib_semantics.c: RTA_NH_ID 1764β†’1794, RTA_GATEWAY 1603β†’1635). Nine of the ten are decoder-read (`linkAltNames`, `setProtoDownReason`, `ParentDevName`, `Link`, `IfaProto`, `RtPriority`, `Broadcast`, `RtaNhID`, `Gateway`; only NUM_VF is not) β€” the spread stays deferred until a decoder branch or a capture needs a second kernel. Decision 2: `nlmon-capture` retired β€” the product stays committed (the base event corpus), the machinery (WARMUP=3 sleeps, no bind wait, `--immediate-mode`, `-B 32768`, the `ss -x` stop sentinel, the drop-count readback, the floors) predates every driven-machinery fix, nothing gated or checked boots it (`netlink-capture.nix`'s shared helper stays); `flake.nix`'s header, `nix/README.md`'s fixture table and `docs/netlink/collection.md` name the retirement; `mkVm.nix` loses the flavor, `lib.nix` its `mkNlmonCaptureRunner`, `default.nix` and `nix/default.nix` the attrsets, and three Go provenance comments updated. The tier's own work: the thirty monitor rows gated (the allowlist's `gated_commands` 1464β†’1494, the earned list, `TestUngatedSurfaceIsNotVacuous`'s expected down to `addr show dynamic` alone, `TestMonitorRowsGated` pinning all thirty-two), each cohort on its own landing's first clean `--section monitor` run and EG2-T02's second (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1` + `UNGATED_CLEAN`), the gated rerun the same. Gates: O5/O9/O10 regenerated (0 sends, 0 differs, no row moved away from `same`); both full suites; gofmt; `go vet -tags goip_write`; the nine checks; `test-focused-goip`; the docs check; the full run at `--timeout 36000` (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1168` + `UNGATED_CLEAN`, 1495 commands β€” the first attempt's 12000 s FATAL a loaded-host artifact, other tenants' clang-tidy batch and a foreign VM at load 76; the quiet-host rerun clean); the whole-repo `test-go-race` (its one red under that load β€” `dockermeta`'s `TestTenantBodySize`, a 10 s deadline on a 68 MiB local stream β€” green on the quiet host, both isolated and in the check). Two pre-existing main reds from gotc commits that landed after EG2-T01's runs fixed in the same task: `TestBuildWriteRequestAdmitsOnlyListedWrites` (`cba42d462` added RTM_NEW/DELTFILTER and RTM_NEW/DELCHAIN to `IsAdmittedWriteType` but not the test's map; the four pairs added, `tc/tc_filter.c:752-803` cited) and the upstream index (`8b707c8b1`; `iproute2-tc-filter-write.md` and `iproute2-tc-ematch-write.md` listed; the merge of PR #375 added a third, gotc 22P's `iproute2-tc-action-write.md`, listed with it). coverage-status.md's two "never compared live" spots updated β€” the matrix now drives the monitor section | this commit | ## Decision log - **Decided: the event corpus is rows in the workbench, not a rebuilt `nlmon-capture` oneshot (2026-11-13, from the plan's own findings).** The oneshot's shape is the recorded reason the driven machinery exists ("a rebuild per attempt makes that a chore rather than a question"; no stop path), and every corpus since the addr plan has been rows. The oneshot's retirement is a follow-up decision, not this increment's. diff --git a/docs/netlink/upstream/README.md b/docs/netlink/upstream/README.md index 31e3f5fec..33aa43313 100644 --- a/docs/netlink/upstream/README.md +++ b/docs/netlink/upstream/README.md @@ -34,6 +34,7 @@ found by a capture, reproduced, fixed, tested, reviewed β€” and ready to send. | [iproute2-tc-write.md](iproute2-tc-write.md) | Qdisc and class write help, argument consumption, silent failures and diagnostics | 7.2.0; later status in note | see note | `ws/tcqwrite/`, increment 17 | not yet; drafts | | [iproute2-tc-filter-write.md](iproute2-tc-filter-write.md) | Filter and chain writes: narrowed selectors, a renamed check, sticky cookies and a realm cache that answers with the wrong number β€” W64–W122, K49–K55 | 7.2.0; later status in note | see note | `ws/tcfwrite/` (183 rows), increment 20 | not yet; drafts | | [iproute2-tc-ematch-write.md](iproute2-tc-ematch-write.md) | The ematch grammar's write path: a lexer that shares one buffer among its tokens, a parser that undoes what it never took, and state that outlives the line β€” W123–W155, K56–K62 | 7.2.0; later status in note | see note (every finding present at HEAD) | `ws/tcematch/` (257 rows), increment 21 | not yet; drafts | +| [iproute2-tc-action-write.md](iproute2-tc-action-write.md) | `tc action` writes: parsers that hand unknown words to the next action, a copy that sends the environment, and "0 means unset" | 7.2.0; later status in note | see note | `ws/tcactwrite/` (363 rows), increment 22 | not yet; drafts | | [bug-classes.md](bug-classes.md) | not a finding report but the working checklist: the dozen recurring shapes the ~70 recorded bugs fall into, run over the target code before every conversion increment captures | β€” | β€” | every increment's plan since 6 (`bridge`) | not for sending | The bond series' artifacts, all against `e11870d5`: From c32bcd62e410c5fa74da2dc9287944fd4a304ee4 Mon Sep 17 00:00:00 2001 From: randomizedcoder Date: Tue, 1 Dec 2026 08:22:31 -0800 Subject: [PATCH 3/3] docs(goip-parity): record the merged-tree re-verification in V401 (the PR #375 merge) --- docs/netlink/goip-parity-events-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/netlink/goip-parity-events-status.md b/docs/netlink/goip-parity-events-status.md index 7f60f81e9..e007f2b01 100644 --- a/docs/netlink/goip-parity-events-status.md +++ b/docs/netlink/goip-parity-events-status.md @@ -106,7 +106,7 @@ | V398 | 2026-11-28 | EG1-T02: the thirteen monitor rows and the netnsid step | both full suites (`go test -count=1 ./...` and `-tags goip_write ./...`); `go vet -tags goip_write ./...`; the checks lint-baseline, gofmt, nix-fmt, go-vet, test-goip-docs, test-goip-monitorfile, test-focused-goip, vm-lib-exp, cli-help-smoke-goip-parity; the section's first live run - `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`, thirteen `PASS`, two `WARN`, `HYGIENE_PASS`, `CONTROL_NOISY 11` | The `Command` table grows the thirteen rows - the EP1 twelve's remainder (`dad`, `route autoconf`, `neigh v4`, `nexthop bucket`, `netconf del`, `rule v4`, `stats l3`, `nsid live`, `prefix route ra`, `acaddress anycast`, `all mixed`) and the two refusals (`maddress esrch`, `nsid eexist`, both `MonitorExpectRC: 1`) - each the ev row's own Setup, Trigger and until-EREs, `Floor 1`, `Canary c0`. The nsid rows print the netns name (goip implements the name walk), so the driver grows the `netnsid` setup step - evSelfID's own shape - and its quoting comments now name the nsid rows' shell-escaped `$`/`"`. TestCommandTable grows the rc rule (every monitor row declares 0 or 1; the refusal rows 1), the thirteen in the ungated set, and the sysctl corner (RA rows 2, netconf-del/anycast/all-mixed 1); `writeCleanMonitorRow` writes the declared rc. The two `WARN`s - `monitor_address_dad`, `monitor_all_mixed` - are one noise: the canary retry's Deleted stanzas on the goip side the attach race hit, the same blocks the neigh and prefix rows' D_control carried on their ip_a sides (4 and 6, `CONTROL_NOISY 11` total). The findings are the comparator's own gap - V395's collapse knew one of the retry's stanza shapes - closed in V399 | `d069d3a11` | | V399 | 2026-11-28 | the canary retry's four stanza shapes; the section's gate clean | the monitor tests (TestCollapseCanary, TestCompareMonitorWithControl, 15 rows); both full suites; the checks lint-baseline, test-goip-docs, test-goip-monitorfile, test-focused-goip, vm-lib-exp, go-vet, gofmt, nix-fmt, cli-help-smoke-goip-parity; O5/O9/O10 regenerated (`-update-ws-*`), no drift; the section's second live run - `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`, fifteen `PASS`, `HYGIENE_PASS`, `CONTROL_NOISY 1`, `UNGATED_CLEAN` | The measured fix: the retry's `ip addr del` prints four stanza shapes, not the one V395's collapse knew - the mcast stanza, the `/32` autojoin stanza its RTM_NEWADDR prints, the local route the address brings, and the NOARP neighbor on `224.0.0.22` (the IGMPv3 report group the autojoin solicits, RFC 3376) on the canary device. `collapseCanary` drops every Deleted canary block and keeps the last run of consecutive undeleted canary blocks - the join the helper's loop broke on - which degenerates to V395's keep-last for the link rows' mcast-only shape; `isCanaryStanza` takes the canary device (the IGMP anchor, plumbed through `CompareMonitorWithControl` - the row's `Canary` field) and `isDeletedStanza` reads the `Deleted` prefix under the `all` banner. The join's own rendered text stays compared; the retry's twins go. The V398 capture's four shapes are the fixtures (each monitor kind's retry collapses to its join - the dad, prefix, neigh and all rows) and the two live `WARN`s are regression cases. The fixed comparator, run over the first live run's captured artifacts, passes all fifteen rows with no findings - the neigh and prefix rows' D_control dropped to 0 with it - and the second live run ran clean throughout (the `CONTROL_NOISY 1` is the all row's unpinned d0 MAC, the corpus's own evseq-mixed pre, mirrored; D_control subtracts it). The thirteen rows stay ungated: they pass clean, the gated set unchanged | `23399edcf` | | V400 | 2026-11-30 | EG2-T01: the offline rows, the section's gate green | both full suites (`go test -count=1 ./...` and `-tags goip_write ./...`); `go vet -tags goip_write ./...`; the checks lint-baseline, gofmt, nix-fmt, go-vet, test-goip-docs, test-goip-monitorfile, test-focused-goip, vm-lib-exp, cli-help-smoke-goip-parity; O5/O9/O10 regenerated, no drift; the section's live run - `GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS`, thirty-two `PASS`, `HYGIENE_PASS`, `CONTROL_NOISY 1`, `UNGATED_CLEAN` | The monitor-file row kind: the `Command` table's `Monfile`/`Knob`/`Golden` (the row format's thirteenth field), the comparator's `compareMonfileRow` (the rc rule - agree, then equal the declared one; the stderr rule - rc 0 ↔ empty, rc β‰  0 ↔ non-empty, never compared; the golden comparison naming the side, the golden and the first differing line; a `-` golden three-side equality, the monitor rows' own shape), `expectedFiles`' goldens per side (the ip sides always `.ip730`, the goip side the record its `Knob` names - the `.ip720` goldens the measurement of record for the `=0` rows, the guest carrying no 7.2.0 `ip`, T03's check what gates that knob against the real binary), and the driver's `capture_monfile_triple` (a fresh namespace per side, the Setup steps, `xtcp2-nlcap mon` running `ip -d monitor file` twice around `goip -d monitor file` at the knob - the first run's `MISSED FLOOR`, the input read against the console's CWD rather than the capture dir, the driver fix on the record). Seventeen rows: the bond partner states (hibyte and hionly at `=0`, the versions' u16 `319 <…,>` vs u8 `63` prints the rows' whole point; the rest `=1`), the actor-stays-u8 pair, the P14 reason u32s, the three metrics shapes (the plan's one padding row measured into all three committed shapes), the text refusal (`MonitorExpectRC: 1`) and the pcap corner - `evnhb-bucket.nl`, `nlcapgen monfile -pcap`'s 232-byte notifications-only write (3 of the capture's 16 messages; `TestMonfileCommittedPcap` the regeneration golden, T03's spec-golden check skipping a `.nl` with no `.spec`), its goldens measured at all four sides byte-identical. A plan correction on the record: the corner's render is the corpus `.out`'s lines modulo `-d`'s detail words and the ifname - ifindex 3 misses in an empty namespace, `if3` (the no-sandbox-index rule's own class), the corpus `.out`'s `c0` its own VM's name. The seventeen stay ungated, one clean live run of the two V393's rule wants; the gated set unchanged | this commit | -| V401 | 2026-12-01 | EG2-T02: the tier closes β€” the spread deferred, the oneshot retired, the thirty gated | Decision 1, the kernel spread: the probe (a throwaway over both corpora, deleted after measurement) walked every route event in the five oneshot pcaps (kernel 7.1) and the thirty-three `ws/ev*` rows (kernel 7.3.1) and found ten old-only attributes, none kernel-conditional. Family 16: `IFLA_NUM_VF` (21), `IFLA_ALT_IFNAME` (54), `IFLA_PROTO_DOWN_REASON` (56), `IFLA_PARENT_DEV_NAME` (57), all four on the oneshot VM's boot NIC `ens4` only β€” NUM_VF needs `ext_filter_mask & RTEXT_FILTER_VF` (`net/core/rtnetlink.c`, `rtnl_fill_vf`) and notifications build with `ext_filter_mask=0` (`rtmsg_ifinfo`, rtnetlink.c:4633-4639), so its two carriers that pass the flags-only `IsRtnetlinkNotification` discriminator are unicast replies; ALT_IFNAME fills from the device's alt name nodes, PROTO_DOWN_REASON only when the reason bits are non-zero, PARENT_DEV_NAME only when `dev->dev.parent` exists. Family 17: `IFLA_LINK` (5), the veth pair only (`nla_put_iflink` β€” a dummy's iflink is its own ifindex). Families 20/21: `IFA_PROTO` (11), every carrier value 3 (`IFAPROT_KERNEL_LL`, AF_INET6 β€” the kernel-autoconf'd IPv6 link-local adds and dels, the new corpus's adds all static), plus `IFA_RT_PRIORITY` (9) and `IFA_BROADCAST` (4) on unicast replies (`inet_fill_ifaddr`, devinet.c:1764-1771, each filling only when its ifa field is non-zero). Families 24/25: `RTA_NH_ID` (30, `fib_dump_info`: only when `fi->nh`) and `RTA_GATEWAY` (5, the nexthop's gateway). The fill conditionals are byte-identical between v7.1 and v7.3 (rtnetlink.c: NUM_VF 1676β†’1725, ALT_IFNAME 1945β†’2000, PROTO_DOWN_REASON 1988β†’2048, PARENT_DEV 2199β†’2264, IFLA_LINK 1860β†’1914; devinet.c:1764/1768/1771 unchanged; fib_semantics.c: RTA_NH_ID 1764β†’1794, RTA_GATEWAY 1603β†’1635). Nine of the ten are decoder-read (`linkAltNames`, `setProtoDownReason`, `ParentDevName`, `Link`, `IfaProto`, `RtPriority`, `Broadcast`, `RtaNhID`, `Gateway`; only NUM_VF is not) β€” the spread stays deferred until a decoder branch or a capture needs a second kernel. Decision 2: `nlmon-capture` retired β€” the product stays committed (the base event corpus), the machinery (WARMUP=3 sleeps, no bind wait, `--immediate-mode`, `-B 32768`, the `ss -x` stop sentinel, the drop-count readback, the floors) predates every driven-machinery fix, nothing gated or checked boots it (`netlink-capture.nix`'s shared helper stays); `flake.nix`'s header, `nix/README.md`'s fixture table and `docs/netlink/collection.md` name the retirement; `mkVm.nix` loses the flavor, `lib.nix` its `mkNlmonCaptureRunner`, `default.nix` and `nix/default.nix` the attrsets, and three Go provenance comments updated. The tier's own work: the thirty monitor rows gated (the allowlist's `gated_commands` 1464β†’1494, the earned list, `TestUngatedSurfaceIsNotVacuous`'s expected down to `addr show dynamic` alone, `TestMonitorRowsGated` pinning all thirty-two), each cohort on its own landing's first clean `--section monitor` run and EG2-T02's second (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1` + `UNGATED_CLEAN`), the gated rerun the same. Gates: O5/O9/O10 regenerated (0 sends, 0 differs, no row moved away from `same`); both full suites; gofmt; `go vet -tags goip_write`; the nine checks; `test-focused-goip`; the docs check; the full run at `--timeout 36000` (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1168` + `UNGATED_CLEAN`, 1495 commands β€” the first attempt's 12000 s FATAL a loaded-host artifact, other tenants' clang-tidy batch and a foreign VM at load 76; the quiet-host rerun clean); the whole-repo `test-go-race` (its one red under that load β€” `dockermeta`'s `TestTenantBodySize`, a 10 s deadline on a 68 MiB local stream β€” green on the quiet host, both isolated and in the check). Two pre-existing main reds from gotc commits that landed after EG2-T01's runs fixed in the same task: `TestBuildWriteRequestAdmitsOnlyListedWrites` (`cba42d462` added RTM_NEW/DELTFILTER and RTM_NEW/DELCHAIN to `IsAdmittedWriteType` but not the test's map; the four pairs added, `tc/tc_filter.c:752-803` cited) and the upstream index (`8b707c8b1`; `iproute2-tc-filter-write.md` and `iproute2-tc-ematch-write.md` listed; the merge of PR #375 added a third, gotc 22P's `iproute2-tc-action-write.md`, listed with it). coverage-status.md's two "never compared live" spots updated β€” the matrix now drives the monitor section | this commit | +| V401 | 2026-12-01 | EG2-T02: the tier closes β€” the spread deferred, the oneshot retired, the thirty gated | Decision 1, the kernel spread: the probe (a throwaway over both corpora, deleted after measurement) walked every route event in the five oneshot pcaps (kernel 7.1) and the thirty-three `ws/ev*` rows (kernel 7.3.1) and found ten old-only attributes, none kernel-conditional. Family 16: `IFLA_NUM_VF` (21), `IFLA_ALT_IFNAME` (54), `IFLA_PROTO_DOWN_REASON` (56), `IFLA_PARENT_DEV_NAME` (57), all four on the oneshot VM's boot NIC `ens4` only β€” NUM_VF needs `ext_filter_mask & RTEXT_FILTER_VF` (`net/core/rtnetlink.c`, `rtnl_fill_vf`) and notifications build with `ext_filter_mask=0` (`rtmsg_ifinfo`, rtnetlink.c:4633-4639), so its two carriers that pass the flags-only `IsRtnetlinkNotification` discriminator are unicast replies; ALT_IFNAME fills from the device's alt name nodes, PROTO_DOWN_REASON only when the reason bits are non-zero, PARENT_DEV_NAME only when `dev->dev.parent` exists. Family 17: `IFLA_LINK` (5), the veth pair only (`nla_put_iflink` β€” a dummy's iflink is its own ifindex). Families 20/21: `IFA_PROTO` (11), every carrier value 3 (`IFAPROT_KERNEL_LL`, AF_INET6 β€” the kernel-autoconf'd IPv6 link-local adds and dels, the new corpus's adds all static), plus `IFA_RT_PRIORITY` (9) and `IFA_BROADCAST` (4) on unicast replies (`inet_fill_ifaddr`, devinet.c:1764-1771, each filling only when its ifa field is non-zero). Families 24/25: `RTA_NH_ID` (30, `fib_dump_info`: only when `fi->nh`) and `RTA_GATEWAY` (5, the nexthop's gateway). The fill conditionals are byte-identical between v7.1 and v7.3 (rtnetlink.c: NUM_VF 1676β†’1725, ALT_IFNAME 1945β†’2000, PROTO_DOWN_REASON 1988β†’2048, PARENT_DEV 2199β†’2264, IFLA_LINK 1860β†’1914; devinet.c:1764/1768/1771 unchanged; fib_semantics.c: RTA_NH_ID 1764β†’1794, RTA_GATEWAY 1603β†’1635). Nine of the ten are decoder-read (`linkAltNames`, `setProtoDownReason`, `ParentDevName`, `Link`, `IfaProto`, `RtPriority`, `Broadcast`, `RtaNhID`, `Gateway`; only NUM_VF is not) β€” the spread stays deferred until a decoder branch or a capture needs a second kernel. Decision 2: `nlmon-capture` retired β€” the product stays committed (the base event corpus), the machinery (WARMUP=3 sleeps, no bind wait, `--immediate-mode`, `-B 32768`, the `ss -x` stop sentinel, the drop-count readback, the floors) predates every driven-machinery fix, nothing gated or checked boots it (`netlink-capture.nix`'s shared helper stays); `flake.nix`'s header, `nix/README.md`'s fixture table and `docs/netlink/collection.md` name the retirement; `mkVm.nix` loses the flavor, `lib.nix` its `mkNlmonCaptureRunner`, `default.nix` and `nix/default.nix` the attrsets, and three Go provenance comments updated. The tier's own work: the thirty monitor rows gated (the allowlist's `gated_commands` 1464β†’1494, the earned list, `TestUngatedSurfaceIsNotVacuous`'s expected down to `addr show dynamic` alone, `TestMonitorRowsGated` pinning all thirty-two), each cohort on its own landing's first clean `--section monitor` run and EG2-T02's second (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1` + `UNGATED_CLEAN`), the gated rerun the same. Gates: O5/O9/O10 regenerated (0 sends, 0 differs, no row moved away from `same`); both full suites; gofmt; `go vet -tags goip_write`; the nine checks; `test-focused-goip`; the docs check; the full run at `--timeout 36000` (`GOIP_PARITY_OVERALL_PASS` + `GOIP_PARITY_DRIVER_PASS` + `HYGIENE_PASS` + `CONTROL_NOISY 1168` + `UNGATED_CLEAN`, 1495 commands β€” the first attempt's 12000 s FATAL a loaded-host artifact, other tenants' clang-tidy batch and a foreign VM at load 76; the quiet-host rerun clean); the whole-repo `test-go-race` (its one red under that load β€” `dockermeta`'s `TestTenantBodySize`, a 10 s deadline on a 68 MiB local stream β€” green on the quiet host, both isolated and in the check). Two pre-existing main reds from gotc commits that landed after EG2-T01's runs fixed in the same task: `TestBuildWriteRequestAdmitsOnlyListedWrites` (`cba42d462` added RTM_NEW/DELTFILTER and RTM_NEW/DELCHAIN to `IsAdmittedWriteType` but not the test's map; the four pairs added, `tc/tc_filter.c:752-803` cited) and the upstream index (`8b707c8b1`; `iproute2-tc-filter-write.md` and `iproute2-tc-ematch-write.md` listed; the merge of PR #375 added a third, gotc 22P's `iproute2-tc-action-write.md`, listed with it). coverage-status.md's two "never compared live" spots updated β€” the matrix now drives the monitor section. The PR's merge with the main that moved under it (PR #375, gotc's action writes) re-verified on the merged tree: one conflict, the write-gate test's map (the four filter/chain pairs beside gotc 22P's action pair), both suites, the nine checks, test-focused-goip, the docs check (a third index gap, gotc 22P's action-write note, listed in the merge), the section run and the full run (the same markers, CONTROL_NOISY 1167) and the whole-repo test-go-race, all green | this commit | ## Decision log - **Decided: the event corpus is rows in the workbench, not a rebuilt `nlmon-capture` oneshot (2026-11-13, from the plan's own findings).** The oneshot's shape is the recorded reason the driven machinery exists ("a rebuild per attempt makes that a chore rather than a question"; no stop path), and every corpus since the addr plan has been rows. The oneshot's retirement is a follow-up decision, not this increment's.