interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

GitHub aien-dev/aienux#450 (code only)

closed derived d5d50a42f975d2b0 #450

Imported from GitHub aien-dev/aienux#450 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base 659ddd2d7e3e140cb9bf942c3171cbd9cf3d092e · Head ab576476c7ce22077bad2094e251e4c5da5e1446

drakestapleton reviewed (COMMENTED) on 2026-10-30 11:18 UTC

Triage: blocked (draft; merge conflicts with main; needs on-hardware evidence)

  • Memory-safety review needed in native/net/aienos_rtl8127.c: the TX/RX descriptor rings live in a caller-supplied DMA window, so check that window's bounds and alignment, the descriptor length fields from the device, and RX buffer overrun handling.
  • The UDP boot report (aienos_report.c) and the listener parse network input; check lengths before copying.
  • Hardware claim: please attach a serial log from a real DGX Spark RTL8127 (PCI 10ec:8127) showing probe, link and a report received, plus the board name.

To be merge-ready: rebase, add hardware evidence, and leave draft.

Fetch it

A git bundle of the pull request's head, 73075 bytes.

curl -fsSL https://interplane.io/drakestapleton/aienux/patches/d5d50a42f975d2b0.bundle -o d5d50a42f975d2b0.bundle
git fetch d5d50a42f975d2b0.bundle refs/pull/450/head

Raw bundle · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/aienux
450
ab576476c7ce22077bad2094e251e4c5da5e1446
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":450,"url":"https://github.com/aien-dev/aienux/pull/450","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:26Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index e10cbfb7..661f7675 100644
--- a/.crumb
+++ b/.crumb
@@ -22,38 +22,38 @@
       "children": [
         {
           "digest": "41ab40c2d3b6bf2c002f46e749504ef1b072e6ddb67283f7857cfc5cb6da57a9",
-          "last_commit": "d701275",
+          "last_commit": "f45d00ad",
           "name": "crates",
           "purpose": "Directory crates. Purpose not yet described by a human."
         },
         {
-          "digest": "9264bacd541007f662024e3ff5d64419cb5b884c7d819aadecab4b8c4ffc536f",
-          "last_commit": "d701275",
+          "digest": "daf711a462896f1f611dc411a371f5e9ab75655cbaa61d5a350fd05b4f7cf252",
+          "last_commit": "87edb053",
           "name": "docs",
           "purpose": "Directory docs. Purpose not yet described by a human."
         },
         {
-          "digest": "220236525b9d03bf1f6c7bd065edcf54abfdb8125989c5cc3c26a5d0981cfac1",
-          "last_commit": "d701275",
+          "digest": "a3df5e330dbc133eabf28384a666ab69b0e7d4464d2cedb59fcf487eac7c5a5f",
+          "last_commit": "87edb053",
           "name": "native",
           "purpose": "Directory native. Purpose not yet described by a human."
         },
         {
-          "digest": "57c32a0629f9c7717240a2faf06cb6efaa374e386d5756dd184cf8fa208f45c7",
-          "last_commit": "d701275",
+          "digest": "1a86df6b3895affd02e0ab968914d2bb18f174bebec8206195c996fa75c71563",
+          "last_commit": "c4b8761e",
           "name": "scripts",
           "purpose": "Directory scripts. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:465c1d98cb60fa29e5bef246b20e3b2447c1e681e8ac0fd2b23e183e3793693b",
-      "compiled_at": "2026-10-26T15:58:42Z",
+      "children_root": "sha256:8a0facace7e5cacacc63c6f6f54cec206c482f47d224a9fa4839fd88867cc541",
+      "compiled_at": "2026-10-29T19:20:53Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:79bf80014956d708e86767a9345d58db15c76ffc850fac69a45749de92bfb644",
+      "digest": "sha256:7ae0e971bf5385b1ff66602ed096e128e426fc13e2b62fc4010d5dd988563ec3",
       "evidence_files": 216,
       "evidence_root": "sha256:88ba864f439c06750b936b281f5958c12cbfb47f3c0cc8024c2f58e442dfeb24",
-      "files": 3497,
-      "generated_at_commit": "aa54ee57f1d4a042ad123c16d5e7717070300ef9",
-      "source_tree": "sha256:88f70b1791fc06ff9edbde41245efe457cf9a250edb3b2d4b2d2f4422df5e36f"
+      "files": 3507,
+      "generated_at_commit": "d2d7ff2a7434a3ff7d75d8608bec9274f9f9dbca",
+      "source_tree": "sha256:2b947edf9dd38e0a0a19e739712c3881cb28b21bd8a3d8c86d54608f4d63d9b6"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/docs/.crumb b/docs/.crumb
index 822579bf..8acef18b 100644
--- a/docs/.crumb
+++ b/docs/.crumb
@@ -18,7 +18,7 @@
       "children": [
         {
           "digest": "477f9151be8ffe5662c59ab581ed6805379b4ed4da9ba10970d1864431f1cc3d",
-          "last_commit": "a088d776",
+          "last_commit": "f99c4b63",
           "name": "adr",
           "purpose": "Directory docs/adr. Purpose not yet described by a human."
         },
@@ -30,14 +30,14 @@
         }
       ],
       "children_root": "sha256:efb4a0449db172a441d8663f55ab48d6d81405e011961fd54213541c119b6852",
-      "compiled_at": "2026-10-26T15:49:35Z",
+      "compiled_at": "2026-10-29T19:20:53Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:9264bacd541007f662024e3ff5d64419cb5b884c7d819aadecab4b8c4ffc536f",
+      "digest": "sha256:daf711a462896f1f611dc411a371f5e9ab75655cbaa61d5a350fd05b4f7cf252",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 216,
-      "generated_at_commit": "d70127557fd45192a9f24fc092963f72f15e9e29",
-      "source_tree": "sha256:21fa8ff1b2de46cb43b1e7eef8c4bfd56fa5642edffc5b995a98c2a7feb158ae"
+      "files": 217,
+      "generated_at_commit": "d2d7ff2a7434a3ff7d75d8608bec9274f9f9dbca",
+      "source_tree": "sha256:bd135826d55a92dbe1b5813657d5a95f4c3130e2f85ce4a5505df19eb594d2f4"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/docs/SPARK_RTL8127.md b/docs/SPARK_RTL8127.md
new file mode 100644
index 00000000..fcbf794c
--- /dev/null
+++ b/docs/SPARK_RTL8127.md
@@ -0,0 +1,120 @@
+# Spark RTL8127 (Aienux driver notes, L198)
+
+Chip: Realtek RTL8127, PCI 10ec:8127 rev 05, Spark function 0007:01:00.0 (Linux interface enP7s7), 10 GbE copper.
+
+## Documentation status
+
+DOCS SILENT. Realtek publishes no register document for the RTL8127 (web search 2026-10-20).
+The Linux netdev patch adding RTL8127ATF to r8169 says so in plain words (Fabio Baltieri, 2025-11-17,
+https://lkml.iu.edu/2511.2/02128.html): "There's no public datasheet for the chip so this is just
+porting over the original vendor code".
+
+Read-only reference used for every register below: Realtek's out-of-tree Linux driver r8127
+v11.014.00, the same version the Spark runs (`modinfo r8127`: `version: 11.014.00-NAPI`), mirrored at
+github.com/openwrt/rtl8127 commit ec2f285, local copy `~/workspace/_ext/rtl8127-openwrt`.
+`r8127_n.c:N` and `r8127.h:N` below are line numbers at ec2f285. Nothing in this file was run on the chip.
+
+## Register facts taken from the reference (DOCUMENTED-BY-VENDOR-CODE, not confirmed on the chip)
+
+| What | Offset / bits | Source |
+|---|---|---|
+| MAC address | MAC0 0x00 (4 bytes), MAC4 0x04 (2 bytes) | r8127.h:1438 |
+| TX ring base | TxDescStartAddrLow 0x20, High 0x24 | r8127.h:1444 |
+| ChipCmd | 0x37: StopReq 0x80, CmdReset 0x10, CmdRxEnb 0x08, CmdTxEnb 0x04 | r8127.h:1452, 1639-1642 |
+| Interrupt mask/status (ISR version 1, no MSI-X) | IMR0_8125 0x38 (32 bit), ISR0_8125 0x3C (32 bit) | r8127.h IMR0_8125, r8127_n.c:4212, 4276 |
+| TX doorbell | TPPOLL_8125 0x90 | r8127.h TPPOLL_8125 |
+| TxConfig, RxConfig | 0x40, 0x44; RxConfig accept bits Err 0x20 Runt 0x10 Bcast 0x08 Mcast 0x04 MyPhys 0x02 AllPhys 0x01; DMA burst field shift 8 | r8127.h:1458-1459, 1657-1662, 1672 |
+| Cfg9346 (config unlock) | 0x50, unlock 0xC0, lock 0x00 | r8127.h:1461, 1647-1648 |
+| PHYstatus | 0x6C (16 bit): LinkStatus 0x02, FullDup 0x01, 10G 0x4000, 5G 0x1000, 2.5G 0x400, 1G 0x10, 100M 0x08, 10M 0x04; 0xffff = no device | r8127.h:1474, 1742-1754; r8127_n.c:4537-4547 |
+| MAC OCP window | MACOCP 0xB0: write `((addr/2) << 16) | value | 0x80000000`; read: write `(addr/2) << 16`, then read low 16 bits | r8127_n.c:3287-3314; r8127.h:1814-1817 |
+| MCUCmd_reg | 0xD3: Now_is_oob bit 7, Txfifo_empty bit 5, Rxfifo_empty bit 4 | r8127.h:1821-1823 |
+| TX descriptor format (MAC OCP) | 0xEB58 bits 1:0 = 01, "new tx desc format" (the 32-byte descriptor this driver uses) | r8127_n.c:14992-14996 |
+| RSS off, one RX queue | RSS_CTRL_8125 0x4500 = 0; Q_NUM_CTRL_8125 0x4800 bits 4:2 = ilog2(queues) = 0 | r8127.h:1553-1554; r8127_n.c:14983, 14876-14886 |
+| LL share FIFO ready | 0xD2 (16 bit) bit 9 | r8127_n.c:4872-4882 |
+| RxMaxSize | 0xDA | r8127.h |
+| CPlusCmd | 0xE0 | r8127.h |
+| IntrMitigate | 0xE2 (16 bit); FIFO-empty wait wants bits 0,1,8 all set | r8127_n.c:4111-4115 |
+| RX ring base | RxDescAddrLow 0xE4, High 0xE8 | r8127.h |
+| RX DV gate | 0xF2 bit 3 (set = gate closed) | r8127_n.c:4015-4027 |
+| Timer interrupts | 0x58, 0x5C, 0x8C, 0xF4 (all written 0) | r8127_n.c:4360-4368 |
+| RX descriptor type 4 enable | 0xD8 bit 1 (EnableRxDescV4_0) | r8127_n.c:15003-15010, r8127.h:1682 |
+
+
+| More registers | BACKUP_ADDR0_8125 0x19E0 (32 bit), BACKUP_ADDR1_8125 0x19E4 (16 bit): the MAC address Linux uses (it overrides MAC0) | r8127.h BACKUP_ADDR*, r8127_n.c:12418-12441 |
+| TX "no close" mode (version 6 on this chip) | software tail pointer SW_TAIL_PTR0_8125BP 0x0D30 (32-bit write of the free-running producer count), hardware close pointer HW_CLO_PTR0_8125BP 0x0D34 (32-bit read, count of closed descriptors, mask 0x7FFFFFFF); enabled by TxConfig bit 6 plus 0x20E4 bit 2 | r8127_n.c:12193, 12056-12072, 16412-16424, 654-664, 14965-15001; r8127.h:852 |
+| Classic TX doorbell (not used) | TPPOLL_8125 0x90, 32-bit write of BIT(queue) | r8127_n.c:16420-16422 |
+| TxConfig value | (TX_DMA_BURST_unlimited 7 << 8) | (InterFrameGap 3 << 24), then bit 6 for no-close | r8127_n.c:14958-14963 |
+| RxConfig value | chip table RCR: Rx_Fetch_Number_8 (bit 30) | Rx_Close_Multiple (bit 21) | RxCfg_pause_slot_en (bit 11) | EnableInnerVlan (bit 22) | EnableOuterVlan (bit 23) | (RX_DMA_BURST_512 5 << 8), plus accept bits | r8127_n.c:112-130, r8127.h:697-698, 1672-1681 |
+| RxMaxSize | 0xDA (16 bit) = rms | AcceppVlanPhys 0x8000 | r8127_n.c:14470-14473 |
+| Chip id | TxConfig & 0x7c800000 == 0x6C800000; TxConfig & 0x00700000: 0 = CFG_METHOD_1, 0x100000 = CFG_METHOD_2, other = METHOD_2 with "IC version unknown" | r8127_n.c:7210-7235 |
+| MMIO BAR | BAR 2, at least 256 bytes (R8127_REGS_SIZE); 64-bit DMA mask | r8127_n.c init_board (13406-13440), r8127.h:700 |
+
+OBSERVED on the Spark (Linux sysfs, read-only, 2026-10-20): BAR 0 = I/O 256 bytes, BAR 2 = 64-bit memory 0x6e900000..0x6e93ffff (256 KiB), revision 0x05.
+
+### Descriptors
+
+- TX descriptor: 32 bytes (`struct TxDesc` r8127.h:2056: opts1, opts2, addr u64, four reserved u32). opts1 = DescOwn bit 31 | RingEnd bit 30 (last slot) | FirstFrag bit 29 | LastFrag bit 28 | length.
+- RX descriptor: the Spark's build has RSS off (module version string has no "-RSS"; vendor Makefile default `ENABLE_RSS_SUPPORT = n`), so Linux runs RX descriptor type 1: 16 bytes, opts1 @0, opts2 @4, addr @8 (r8127.h:2066, r8127_n.c:12307-12310), and clears 0xD8 bit 1. Driver hands a slot to the chip by writing opts1 = DescOwn | RingEnd(if last) | buffer size (r8127_n.c:15263-15268). On completion: length = opts1 & 0x3fff including the 4-byte FCS (r8127_n.c:17098, 17119-17126); error = RxRES bit 21 (RWT bit 22, RUNT bit 20, CRC bit 19).
+- TX mode: the vendor Makefile default is `ENABLE_TX_NO_CLOSE = y` (Makefile:43), so INFERRED (medium-high) the Spark's Linux runs TX no-close. Aienux uses the same mode.
+
+### Bring-up order in the reference (what Aienux copies, and what it leaves out)
+
+Linux probe: exit_oob, powerup_pll, hw_init, hw_reset, get_mac_address (r8127_n.c:14328-14342). Linux open adds hw_ephy_config, hw_phy_config (PHY micro-code), hw_config, hw_start (r8127_n.c:11920-11925, 4691-4696).
+
+Aienux copies: exit_oob (without DASH, RealWoW and the UPS-resume PHY wait), hw_reset, MAC address read and rar_set, the hw_config steps that set rings, TxConfig, RxConfig, RxMaxSize, descriptor type, no-close mode and the RX DV gate, then hw_start (ChipCmd TE|RE). Interrupts stay masked (polled driver).
+
+Aienux leaves out, on purpose: MAC MCU patch code (hw_mac_mcu_config), PCIe EPHY tuning (hw_ephy_config_8127_1, dozens of magic values), PHY micro-code and PHY tuning (hw_phy_config), ASPM/CLKREQ, EEE, power-save, PTP, TCAM, RSS, and the long list of undocumented MAC OCP writes in hw_config (0xC0B6, 0xE614, 0xE63E, 0xC0B4, 0xEB6A, 0xEB50, 0xE056, 0xE040, 0xEA1C, 0xE0C0, 0xE052, 0xD430, 0xD40C, ...). The hope is that UEFI firmware (which has its own Realtek driver for PXE, Boot0003) already applied whatever the PHY needs. That hope is UNKNOWN until the attended boot.
+
+## What was built (L198)
+
+| Piece | File | Tested by |
+|---|---|---|
+| Driver core (polled, one DMA region, TX no-close, RX type 1, IRQs masked) | `native/net/aienos_rtl8127.{h,c}` | `native/net/tests/rtl8127_test.c` (chip model, `make -C native/net test`, also under ASan/UBSan in `make sanitize`) |
+| Boot report frames, tag `AIENUX-SPARK-REPORT`, UDP 47031 broadcast, iMac wire format | `native/net/aienos_report.{h,c}` | `rtl8127_test.c` (report sent through the driver and rebuilt from the model's wire), `scripts/ck_spark_report_test.sh` (loopback to the receiver) |
+| Receiver (now accepts the Spark tag, writes `spark-<run>.unauthenticated.txt`) | `native/kernel/tools/ck_imac_report_listen.c` | `scripts/ck_spark_report_test.sh`, `scripts/ck_imac_report_test.sh` |
+| Kernel binding: find 10ec:8127 in the multi-segment discovery, SMMU window first, BAR 2, init, link wait (10 s), report every 2 s for 20 s, receive count, release | `native/kernel/dev/rtl8127_bind.{h,c}`, called from `dev/devices.c` only in a `CK_RTL8127=1` build | `stage_test` case `test_rtl8127_bind` (absent, no SMMU: denied with memory decode and bus master off, bad BAR) |
+
+The chip model is written from the same vendor source as the driver. It proves the driver does what the
+reference does, stays inside its DMA region, survives hostile completions, and moves frames intact
+around both rings; it cannot prove the reference is right for this chip. A mutation pass (7 deliberate
+driver bugs: TX ring-end bit, MAC write without unlock, RX oversize check, FCS strip, close-pointer bound,
+interrupt mask, RX repost) was killed by the test every time.
+
+## UNKNOWN until attended boot #2 (nothing here has touched the chip)
+
+1. Whether the link comes up and frames flow without the parts Aienux leaves out: MAC MCU patch code,
+   PCIe EPHY tuning (`hw_ephy_config_8127_1`), PHY micro-code and PHY tuning (`hw_phy_config`), and the
+   undocumented MAC OCP writes in `hw_config`. Aienux relies on the state the UEFI firmware's Realtek
+   driver leaves. Most likely failure point. If link stays down, the boot log line
+   `rtl8127: link DOWN` says so and the chip is released.
+2. Whether the UEFI firmware binds the NIC on a normal (non-PXE) boot at all, and in which state it
+   leaves the PHY after ExitBootServices.
+3. Chip revision mapping: the Spark reports PCI revision 0x05; which TxConfig IC version that gives
+   (CFG_METHOD_1 or 2) is printed (`rtl8127: init ... tcr= mcfg=`), not known in advance.
+4. TX no-close on this chip: tail pointer 0x0D30 and close pointer 0x0D34 (version 6 registers) are taken
+   from the vendor's per-version table; that the close pointer restarts at 0 after a soft reset is the
+   vendor's assumption (Aienux reads a base instead and prints `clo_base=`). Both the tail it writes and
+   the closed count are taken relative to that base, so a nonzero base keeps them consistent (2026-10-24
+   review fix); whether the chip's fetch index really counts from that base is also UNKNOWN.
+5. RX descriptor type 1 with RSS off is what the vendor's default build runs (INFERRED from the module
+   version string, medium-high); not observed on the chip.
+6. The UPS-resume PHY wait in `exit_oob` is not done; Aienux only records `ups_resume=`.
+7. FIFO-empty, LL-share-FIFO and PHY-state waits: the vendor ignores timeouts; Aienux counts them
+   (`wait_timeouts=`). Their real durations are not measured.
+8. The MAC address source (BACKUP_ADDR at 0x19E0 vs MAC0) is printed; expected to match Linux's
+   enP7s7 address.
+9. SMMU: the RTL8127's stream on segment 7 must resolve through the IORT (`docs/GB10_IORT_DECODE.md`);
+   the confinement path has run on QEMU and host only. A denied grant prints
+   `dma_gate: rtl8127 denied` and the chip stays off.
+10. Whether ARM64 Normal Non-cacheable DMA memory (`ck_dma_alloc`) plus `ck_mb()` around every register
+   write is enough ordering for this chip's descriptor fetch (the vendor uses Linux coherent DMA and
+   `wmb()`).
+11. Autonegotiation time to 10G (the 10 s link wait is not measured).
+
+## How attended boot #2 uses it
+
+Build the full image with `make -C native/kernel full CK_RTL8127=1` (output `$(OUT)/full/BOOTAA64.EFI`; the binding call and the RAM console copy are added there; the core-only `make` image has no devices stage, so it never binds the NIC). On another machine
+on the same LAN, run `ck_imac_report_listen 47031 OUTDIR 120`
+(`make -C native/kernel imac-report-listen`); the Spark's log arrives as `OUTDIR/spark-<run>.unauthenticated.txt` (unauthenticated UDP, like the iMac's).
+The image never takes the chip out of the devices stage with DMA live: every path ends in
+`rtl8127: chip stop`, `dma_gate: rtl8127 bus master revoked`, `smmu: rtl8127 stream ... returned to abort`.
diff --git a/native/.crumb b/native/.crumb
index ea5b32e6..fd9cd4fd 100644
--- a/native/.crumb
+++ b/native/.crumb
@@ -50,13 +50,13 @@
       "children": [
         {
           "digest": "572990d31c305b2f2bf0e45de60b1380c41f5dd6d24e962c65261bec25028b9a",
-          "last_commit": "d7012755",
+          "last_commit": "f45d00ad",
           "name": "argus",
           "purpose": "Directory native/argus. Purpose not yet described by a human."
         },
         {
-          "digest": "8c80dd54cfd07aefd79ea4f1456325d66643317a9d3f74b967d9f710242fad42",
-          "last_commit": "41119ceb",
+          "digest": "091ba541cd2c52de96e29ff996bed1e39e4ac1a44ffacd6df076e30c56547eb2",
+          "last_commit": "c4b8761e",
           "name": "boot",
           "purpose": "Directory native/boot. Purpose not yet described by a human."
         },
@@ -79,8 +79,8 @@
           "purpose": "Directory native/disk. Purpose not yet described by a human."
         },
         {
-          "digest": "a5403bcaa92fcbea01f9907073a94127801891c012f049e59ecf212d833d3ff8",
-          "last_commit": "41119ceb",
+          "digest": "2012e30764af06eb1e01a36ab24d58e2339e25fd40f5b1ba90ca20d89c50ae8d",
+          "last_commit": "87edb053",
           "name": "kernel",
           "purpose": "Directory native/kernel. Purpose not yet described by a human."
         },
@@ -91,8 +91,8 @@
           "purpose": "Directory native/m5. Purpose not yet described by a human."
         },
         {
-          "digest": "f9c2453f4a79f6f4f27e6761cc2cdfc0431fb698be73a7f8869b5d6580e96d9d",
-          "last_commit": "f45d00ad",
+          "digest": "eca6d5cb48d78e40168815ff06122c85860714746afd12dc9402b893d64d9dec",
+          "last_commit": "87edb053",
           "name": "net",
           "purpose": "Directory native/net. Purpose not yet described by a human."
         },
@@ -109,15 +109,15 @@
           "purpose": "Directory native/store. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:bb4101d2fe074a88e1c3a40626d52c7021dc99f404d7cc7379c1341c385fd201",
-      "compiled_at": "2026-10-26T15:49:35Z",
+      "children_root": "sha256:fe9470c0d14dbf07bcd119351e40d874a697bd84412898509401bb14ed7e45d9",
+      "compiled_at": "2026-10-29T19:20:53Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:220236525b9d03bf1f6c7bd065edcf54abfdb8125989c5cc3c26a5d0981cfac1",
+      "digest": "sha256:a3df5e330dbc133eabf28384a666ab69b0e7d4464d2cedb59fcf487eac7c5a5f",
       "evidence_files": 4,
       "evidence_root": "sha256:e410b845507e00568e15b51a5797af32a97e0e4b8ab4e8487bb7c98e7e0cf335",
-      "files": 606,
-      "generated_at_commit": "d70127557fd45192a9f24fc092963f72f15e9e29",
-      "source_tree": "sha256:b9bda10cf627c0b1be956102d42ac49a86569a827d5cebb86db7f23536677257"
+      "files": 614,
+      "generated_at_commit": "d2d7ff2a7434a3ff7d75d8608bec9274f9f9dbca",
+      "source_tree": "sha256:7950c2463f5fdbfbed25e91065e5bf89d4e82673693005b3b591c2a4db790371"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/boot/.crumb b/native/boot/.crumb
index b5cbf7a5..d4336986 100644
--- a/native/boot/.crumb
+++ b/native/boot/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-26T14:20:54Z",
+      "compiled_at": "2026-10-29T19:20:53Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:8c80dd54cfd07aefd79ea4f1456325d66643317a9d3f74b967d9f710242fad42",
+      "digest": "sha256:091ba541cd2c52de96e29ff996bed1e39e4ac1a44ffacd6df076e30c56547eb2",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 26,
-      "generated_at_commit": "d13599d9b6251f30d3cd91b1e313a7e0c54e0f15",
-      "source_tree": "sha256:2187379d4d39ad8c5add5175769b80751ee1f12810c148cda16bf37c4beae06f"
+      "generated_at_commit": "d2d7ff2a7434a3ff7d75d8608bec9274f9f9dbca",
+      "source_tree": "sha256:0eb16bd95dd8b4dcadfee1d45b7776a6b99091a344791a2582e98c7f934bc22c"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/boot/efi_main.c b/native/boot/efi_main.c
index 47847391..8c7f79c2 100644
--- a/native/boot/efi_main.c
+++ b/native/boot/efi_main.c
@@ -66,7 +66,7 @@ void ck_boot_agent_cmd_find(EFI_HANDLE image, EFI_SYSTEM_TABLE *st);
 #ifdef CK_ARTIFACT_CARD
 void ck_boot_artifact_card_find(EFI_HANDLE image, EFI_SYSTEM_TABLE *st);
 #endif
-#ifdef CK_KLOG
+#if defined(CK_KLOG) && defined(CK_PI5) /* the card log slot is Pi 5 only; the Spark RTL8127 build keeps klog in RAM */
 void ck_boot_klog_find(EFI_HANDLE image, EFI_SYSTEM_TABLE *st);
 #endif
 void ck_boot_gop_find(EFI_SYSTEM_TABLE *st, struct ck_handoff *h);
@@ -158,7 +158,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *st)
     /* The yardstick model from the boot disk, while the firmware drivers are
      * still up (efi_model.c). Absent map: boot continues without a model. */
     ck_boot_model_load(image, st, h);
-#ifdef CK_KLOG
+#if defined(CK_KLOG) && defined(CK_PI5)
     /* Pi 5 build: find the card's log slot while Block I/O is still up (efi_klog.c). */
     ck_boot_klog_find(image, st);
 #endif
diff --git a/native/kernel/.crumb b/native/kernel/.crumb
index 0dafd85f..fb1e9ba2 100644
--- a/native/kernel/.crumb
+++ b/native/kernel/.crumb
@@ -63,8 +63,8 @@
           "purpose": "Directory native/kernel/core. Purpose not yet described by a human."
         },
         {
-          "digest": "eb3146a026248b54faa150003192fcc43ab2bd9b01d3c0d0c120c2d5bbe2b453",
-          "last_commit": "f45d00ad",
+          "digest": "7bcdc75e0cd05b68b6095db2278c52e19fabe3abf376243e7ec6775285a6deb8",
+          "last_commit": "87edb053",
           "name": "dev",
           "purpose": "Directory native/kernel/dev. Purpose not yet described by a human."
         },
@@ -81,33 +81,33 @@
           "purpose": "Directory native/kernel/mm. Purpose not yet described by a human."
         },
         {
-          "digest": "7d1c2af30b802a41a46b1b70250cdaa855ba8c579ce5c870de452980e161cbfb",
-          "last_commit": "f45d00ad",
+          "digest": "b270f8ea2da835177f60e6e3ab002efa787b2db4408f22b5a57ef3d53e517fe0",
+          "last_commit": "c4b8761e",
           "name": "svc",
           "purpose": "Directory native/kernel/svc. Purpose not yet described by a human."
         },
         {
           "digest": "3d8d13940b9e77faa860d813f783060abb1a4664080e76d2d28b0004ab739b5f",
-          "last_commit": "4b897d35",
+          "last_commit": "f45d00ad",
           "name": "tests",
           "purpose": "Directory native/kernel/tests. Purpose not yet described by a human."
         },
         {
-          "digest": "8d2be0298cc545f92db0a775b87769099a9fed6cc8cbe36add355be73bd4943d",
-          "last_commit": "4b897d35",
+          "digest": "d15b00ee52c39e8aa960027cbc33e8cf4880c6c3597c735ba4b123f3f0500603",
+          "last_commit": "c4b8761e",
           "name": "tools",
           "purpose": "Hosted (Linux-built) checkers for the native kernel, run by `make -C native/kernel test`; nothin"
         }
       ],
-      "children_root": "sha256:1abb490a30293d27f4d109e5a9320a947de33e5bce557c9606906794984e20c0",
-      "compiled_at": "2026-10-26T14:20:54Z",
+      "children_root": "sha256:1fbe37f127a42fa9b24cbb373af84d0d1f2a644a5cb241c3a58485c65ef0188d",
+      "compiled_at": "2026-10-29T19:20:53Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:a5403bcaa92fcbea01f9907073a94127801891c012f049e59ecf212d833d3ff8",
+      "digest": "sha256:2012e30764af06eb1e01a36ab24d58e2339e25fd40f5b1ba90ca20d89c50ae8d",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 421,
-      "generated_at_commit": "d13599d9b6251f30d3cd91b1e313a7e0c54e0f15",
-      "source_tree": "sha256:a887d43f2c32126bf4030db0c72a9505081cdc18b3c925b531aac1e235e0f389"
+      "files": 423,
+      "generated_at_commit": "d2d7ff2a7434a3ff7d75d8608bec9274f9f9dbca",
+      "source_tree": "sha256:6f8a2999a655d3ff61052d3330f222bdde16aee7b9ee47be08de89ce1b822e4d"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/Makefile b/native/kernel/Makefile
index d50191f3..ca2a4264 100644
--- a/native/kernel/Makefile
+++ b/native/kernel/Makefile
@@ -353,6 +353,20 @@ OUT ?= $(REPO)/target/native-kernel-pi5
 CK_EXTRA_CFLAGS += -DCK_PI5=1 -DCK_KLOG=1
 endif
 
+# Spark attended boot #2 (L198): `make full CK_RTL8127=1` ($(OUT)/full/BOOTAA64.EFI)
+# binds the Realtek RTL8127 10 GbE (dev/rtl8127_bind.c) in the devices stage and sends the console log as UDP
+# broadcasts (tag AIENUX-SPARK-REPORT, port 47031). Empty (default) in every
+# QEMU gate: the binding is compiled but never called.
+ifneq ($(strip $(CK_RTL8127)),)
+ifneq ($(strip $(CK_RTL8127)),1)
+$(error CK_RTL8127 must be empty or 1)
+endif
+ifneq ($(strip $(CK_PI5)),)
+$(error CK_RTL8127 cannot be combined with CK_PI5)
+endif
+CK_EXTRA_CFLAGS += -DCK_RTL8127=1 -DCK_KLOG=1
+endif
+
 # TEST-ONLY artifact source: CK_TEST_FWCFG_ARTIFACTS=1 compiles the QEMU fw_cfg
 # side channel (opt/aienos/artifacts) into the loader instead of the boot disk
 # Store. Every image built without it is checked to contain no fw_cfg artifact
@@ -884,6 +898,9 @@ ifeq ($(strip $(CK_PI5)),1)
 CORE_C += $(BOOT)/efi_klog.c $(KDIR)/core/pi5.c $(KDIR)/core/pi5_marker.c $(KDIR)/dev/disk_part.c $(KDIR)/core/klog.c $(KDIR)/core/klog_slot.c \
 	$(KDIR)/dev/pi5_wdt.c $(KDIR)/dev/pi5_rng.c $(NATIVE)/disk/disk.c $(NATIVE)/disk/disk_sdhci.c
 endif
+ifeq ($(strip $(CK_RTL8127)),1)
+CORE_C += $(KDIR)/core/klog.c
+endif
 ifeq ($(strip $(CK_PI5_PCIE)),1)
 CORE_C += $(KDIR)/dev/pi5_pcie.c $(KDIR)/dev/dma_window.c
 endif
diff --git a/native/kernel/README.md b/native/kernel/README.md
index 18164592..e1b1ef37 100644
--- a/native/kernel/README.md
+++ b/native/kernel/README.md
@@ -213,6 +213,17 @@ VT-d, receiving on the network, a store. QEMU (no BCM57766 there)
 qualifies nothing physical; copy the image to a FAT stick as
 `EFI/BOOT/BOOTX64.EFI` and start it from the Option-key boot picker.
 
+The Spark's Realtek RTL8127 10 GbE (10ec:8127, segment 7) has a driver core in
+`native/net/aienos_rtl8127.c` and a binding in `dev/rtl8127_bind.c` (L198): SMMU
+window first (no SMMU, no DMA), BAR 2, reset and bring-up from Realtek's Linux r8127
+v11.014.00 (no public datasheet: DOCS SILENT), link wait, then the console log
+(`core/klog.c` RAM copy) sent every 2 s for 20 s as UDP broadcasts in the iMac
+format with the tag `AIENUX-SPARK-REPORT`; the same `ck_imac_report_listen`
+writes it to `spark-<run>.unauthenticated.txt`. Only a `make full CK_RTL8127=1` image calls it; every QEMU
+gate image is unchanged. Tested against a chip model and on the host only;
+nothing has run on the chip. What attended boot #2 must confirm is listed in
+`docs/SPARK_RTL8127.md`.
+
 ## Raspberry Pi 5 image (AIENOS-PI5 step 1)
 
     make -C native/kernel pi5            # target/native-kernel-pi5/BOOTAA64.EFI (-DCK_PI5=1 -DCK_KLOG=1)
diff --git a/native/kernel/dev/.crumb b/native/kernel/dev/.crumb
index a91c0ebd..00c91af2 100644
--- a/native/kernel/dev/.crumb
+++ b/native/kernel/dev/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-24T04:15:32Z",
+      "compiled_at": "2026-10-24T23:41:02Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:eb3146a026248b54faa150003192fcc43ab2bd9b01d3c0d0c120c2d5bbe2b453",
+      "digest": "sha256:7bcdc75e0cd05b68b6095db2278c52e19fabe3abf376243e7ec6775285a6deb8",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 43,
-      "generated_at_commit": "621c9e6fe430ee689836bee3ee2689d7d32e0f7d",
-      "source_tree": "sha256:9db341c086c64aa37699da6fd2026b9f6c960a70a01c246b845b1ea240ea3824"
+      "files": 45,
+      "generated_at_commit": "87edb053b2f5ba274bb5ac73017266926da77846",
+      "source_tree": "sha256:a6d539157738a63536edca1f886b991461277251621da393ab9940ee294e4777"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/dev/devices.c b/native/kernel/dev/devices.c
index b22b678b..daa199e0 100644
--- a/native/kernel/dev/devices.c
+++ b/native/kernel/dev/devices.c
@@ -23,6 +23,11 @@
 #include "mmio_window.h"
 #include "virtio_net.h"
 #include "net_bind.h"
+#include "rtl8127_bind.h"
+#if CK_RTL8127
+#include "aienos_report.h"
+#include "../core/klog.h"
+#endif
 #include "xhci_fence.h"
 #include "usb_kbd.h"
 #include "../../boot/slot_format.h"
@@ -136,6 +141,20 @@ int ck_stage_devices(void)
     int netrc = (vrc == 0 && vf) ? ck_net_bind_selftest(vf, &caps) : 1;
     ck_printf("devices: pci=ok nvme=%s virtio_net=%s\n", g_nvme.bound ? "bound" : "unbound",
               vrc != 0 ? "caps-refused" : !vf ? "absent" : netrc == 0 ? "selftest-ok" : "selftest-failed");
+#if CK_RTL8127
+    /* Spark attended boot (L198): the RTL8127 report. Reported, never a
+     * devices-stage failure; the chip is released again before this returns. */
+    {
+        static pci_func rf;
+        static char rlog[NET_REPORT_MAX];
+        int rrc = ck_rtl8127_find(df, dn, &rf);
+        if (rrc == CK_RTL_OK) {
+            size_t rn = ck_klog_read(rlog, sizeof rlog);
+            rrc = ck_rtl8127_report(&rf, rlog, rn, 20);
+        }
+        ck_printf("devices: rtl8127=%s (rc=%d)\n", rrc == CK_RTL_OK ? "report-sent" : rrc == CK_RTL_ABSENT ? "absent" : "failed", rrc);
+    }
+#endif
     /* xHCI: DMA fence (bus master off before the gate, SMMU-confined grant or
      * fail-closed deny, halt, revoke, stream back to abort) with the operator
      * keyboard phase inside the grant (usb_kbd.c). Reported, never a
@@ -165,6 +184,8 @@ void ck_stage_quiesce(void)
 {
     int net_live = ck_net_live();
     if (net_live) ck_net_release();
+    int rtl_live = ck_rtl8127_live();
+    if (rtl_live) ck_rtl8127_release();
     int xhci_live = ck_xhci_live();
     if (xhci_live) ck_xhci_release();
     int was_live = g_nvme.pf && (g_nvme.bm_on || g_nvme.confined);
@@ -173,6 +194,7 @@ void ck_stage_quiesce(void)
     ck_printf("devices: quiesce before reset nvme=%s\n",
               !g_nvme.pf ? "none" : was_live ? "released-now" : "already-released");
     if (net_live) ck_printf("devices: quiesce before reset virtio_net=released-now\n");
+    if (rtl_live) ck_printf("devices: quiesce before reset rtl8127=released-now\n");
     if (xhci_live) ck_printf("devices: quiesce before reset xhci=released-now\n");
 }
 
diff --git a/native/kernel/dev/rtl8127_bind.c b/native/kernel/dev/rtl8127_bind.c
new file mode 100644
index 00000000..d0103bdf
--- /dev/null
+++ b/native/kernel/dev/rtl8127_bind.c
@@ -0,0 +1,196 @@
+/* rtl8127_bind.c -- RTL8127 binding and UDP boot report (see rtl8127_bind.h).
+ * Freestanding. */
+#include "rtl8127_bind.h"
+#include "aienos_report.h"
+#include "aienos_rtl8127.h"
+#include "ck.h"
+#include <string.h>
+
+#define ROUND_US 2000000u
+#define CLOSE_WAIT_US 100000u
+
+static struct {
+    pci_func fn;
+    const pci_func *pf;
+    volatile uint8_t *bar;
+    rtl_dev dev;
+    int bm_on, confined;
+    uint32_t stream_id;
+} g_rtl;
+/* ck_dma_alloc memory is never freed: allocate once, reuse on a later bind. */
+static uint8_t *g_mem;
+static uint64_t g_phys;
+static uint8_t frame[1600];
+static uint8_t rxbuf[RTL_RX_BUF]; /* every frame RMS 1522 lets through, VLAN tag included */
+
+static uint32_t o_read(void *ctx, uint32_t off, unsigned w)
+{
+    volatile uint8_t *p = (volatile uint8_t *)ctx + off;
+    if (w == 1) return *p;
+    if (w == 2) return *(volatile uint16_t *)p;
+    return *(volatile uint32_t *)p;
+}
+static void o_write(void *ctx, uint32_t off, unsigned w, uint32_t v)
+{
+    volatile uint8_t *p = (volatile uint8_t *)ctx + off;
+    ck_mb(); /* descriptors and buffers visible before the register write */
+    if (w == 1) *p = (uint8_t)v;
+    else if (w == 2) *(volatile uint16_t *)p = (uint16_t)v;
+    else *(volatile uint32_t *)p = v;
+    ck_mb();
+}
+static void o_delay(void *ctx, uint32_t us) { (void)ctx; ck_udelay(us); }
+static void o_barrier(void *ctx) { (void)ctx; ck_mb(); }
+
+int ck_rtl8127_live(void) { return g_rtl.pf && (g_rtl.bm_on || g_rtl.confined); }
+
+void ck_rtl8127_release(void)
+{
+    if (!g_rtl.pf) return;
+    if (g_rtl.bm_on) {
+        /* Only a chip rtl_init identified as an RTL8127 (mcfg set) is written to. */
+        if (g_rtl.bar && g_rtl.dev.mcfg)
+            ck_printf("rtl8127: chip stop %s\n", rtl_err_name(rtl_stop(&g_rtl.dev)));
+        else
+            ck_printf("rtl8127: chip stop skipped (not identified as an RTL8127, nothing written)\n");
+        if (pci_bus_master_off(g_rtl.pf) == 0) {
+            g_rtl.bm_on = 0;
+            ck_printf("dma_gate: rtl8127 bus master revoked\n");
+        } else
+            ck_printf("dma_gate: rtl8127 bus master revoke FAILED (command register still has BME)\n");
+    }
+    if (g_rtl.confined) {
+        int urc = ck_dma_unconfine(g_rtl.stream_id);
+        g_rtl.confined = 0;
+        ck_printf("smmu: rtl8127 stream 0x%x %s (rc=%d)\n", g_rtl.stream_id, urc == 0 ? "returned to abort" : "abort FAILED",
+                  urc);
+    }
+}
+
+int ck_rtl8127_find(const pci_found *found, uint32_t n, pci_func *out)
+{
+    if (!out) return CK_RTL_E_ARG;
+    for (uint32_t i = 0; found && i < n; i++) {
+        const pci_found *c = &found[i];
+        if (c->vendor != RTL_PCI_VENDOR || c->device != RTL_PCI_DEVICE) continue;
+        ck_printf("rtl8127: found seg %04x %02x:%02x.%u rev 0x%02x\n", c->segment, c->bus, c->dev, c->fn, c->revision);
+        pci_bus_access acc;
+        if (pci_stage_disc_access(c->segment, c->bus, &acc) || pci_func_from_found(out, c, &acc)) {
+            ck_printf("rtl8127: unavailable (cannot read the function as an endpoint; nothing written)\n");
+            return CK_RTL_E_ARG;
+        }
+        return CK_RTL_OK;
+    }
+    ck_printf("rtl8127: absent (no 10ec:8127 function)\n");
+    return CK_RTL_ABSENT;
+}
+
+/* Send every part once, then wait (bounded) for the chip to close them. */
+static int send_round(rtl_dev *d, const char *log, size_t len, uint64_t run, unsigned *failed)
+{
+    unsigned parts = net_report_parts(len);
+    for (unsigned p = 0; p < parts; p++) {
+        size_t n = net_report_frame(NET_REPORT_TAG_SPARK, d->mac, run, log, len, p, frame, sizeof frame);
+        rtl_err e = n ? rtl_tx(d, frame, n) : RTL_E_ARG;
+        uint64_t t0 = ck_time_us();
+        while (e == RTL_E_FULL && ck_time_us() - t0 < CLOSE_WAIT_US) {
+            if (rtl_tx_reclaim(d, 0) != RTL_OK) return -1;
+            e = rtl_tx(d, frame, n);
+        }
+        if (e != RTL_OK) {
+            (*failed)++;
+            if (e == RTL_E_DEVICE || e == RTL_E_BROKEN) return -1;
+        }
+    }
+    uint64_t t0 = ck_time_us();
+    while (rtl_tx_pending(d) && ck_time_us() - t0 < CLOSE_WAIT_US)
+        if (rtl_tx_reclaim(d, 0) != RTL_OK) return -1;
+    if (rtl_tx_pending(d)) (*failed)++;
+    return 0;
+}
+
+int ck_rtl8127_report(const pci_func *f, const char *log, size_t len, uint32_t seconds)
+{
+    if (!f || !log || !net_report_parts(len)) return CK_RTL_E_ARG;
+    if (ck_rtl8127_live()) ck_rtl8127_release();
+    memset(&g_rtl, 0, sizeof g_rtl);
+    g_rtl.fn = *f;
+    const pci_func *pf = g_rtl.pf = &g_rtl.fn;
+    const pci_bar *b = &pf->bar[RTL_MMIO_BAR];
+    if (b->io || !b->addr || b->size < RTL_MMIO_MIN) {
+        ck_printf("rtl8127: unavailable (BAR 2 not a memory BAR of at least 0x%x bytes)\n", (unsigned)RTL_MMIO_MIN);
+        return CK_RTL_E_ARG;
+    }
+    if (!g_mem) g_mem = ck_dma_alloc(RTL_MEM_SIZE, 4096, &g_phys);
+    if (!g_mem) {
+        ck_printf("rtl8127: unavailable (DMA allocation of %u bytes failed)\n", (unsigned)RTL_MEM_SIZE);
+        return CK_RTL_E_DMA;
+    }
+    uint32_t rid = ((uint32_t)pf->bus << 8) | ((uint32_t)pf->dev << 3) | (uint32_t)pf->fn;
+    uint64_t win = ((uint64_t)RTL_MEM_SIZE + 4095u) & ~(uint64_t)4095u;
+    struct ck_dma_confinement cf;
+    int src = ck_dma_confine(pf->segment, rid, g_phys, win, &cf);
+    if (src != 0) {
+        ck_printf("dma_gate: rtl8127 denied (%s rc=%d), bus master stays off\n",
+                  src == CK_SMMU_ABSENT ? "NoSmmu" : "SmmuNotReady", src);
+        return CK_RTL_E_DENIED;
+    }
+    g_rtl.confined = 1;
+    g_rtl.stream_id = cf.stream_id;
+    ck_printf("smmu_dma_window: rtl8127 only iova=0x%llx len=0x%llx rid=0x%x stream_id=0x%x\n",
+              (unsigned long long)cf.iova, (unsigned long long)cf.len, rid, cf.stream_id);
+    g_rtl.bar = (volatile uint8_t *)ck_mmio_map(b->addr, (size_t)b->size);
+    pci_enable(pf, 1);
+    g_rtl.bm_on = 1;
+    ck_printf("dma_gate: rtl8127 granted (Confined), bus master on\n");
+
+    rtl_ops ops = {(void *)g_rtl.bar, o_read, o_write, o_delay, o_barrier};
+    rtl_dev *d = &g_rtl.dev;
+    rtl_err e = rtl_init(d, &ops, g_mem, cf.iova, RTL_MEM_SIZE);
+    ck_printf("rtl8127: init %s tcr=0x%08x mcfg=%u ic_unknown=%u ups_resume=%u phy_state=%u wait_timeouts=%u\n",
+              rtl_err_name(e), d->tcr_id, d->mcfg, d->ic_unknown, d->ups_resume, d->phy_state, d->wait_timeouts);
+    if (e != RTL_OK) {
+        ck_rtl8127_release();
+        return CK_RTL_E_INIT;
+    }
+    ck_printf("rtl8127: mac %02x:%02x:%02x:%02x:%02x:%02x source=%s clo_base=%u\n", d->mac[0], d->mac[1], d->mac[2],
+              d->mac[3], d->mac[4], d->mac[5],
+              d->mac_source == RTL_MAC_BACKUP ? "backup" : d->mac_source == RTL_MAC_MAC0 ? "mac0" : "fallback",
+              d->clo_base);
+    uint32_t mbps = 0;
+    uint64_t t0 = ck_time_us();
+    while (!rtl_link(d, &mbps) && ck_time_us() - t0 < CK_RTL_LINK_WAIT_US) ck_udelay(1000);
+    ck_printf("rtl8127: link %s %u Mb/s after %u ms\n", mbps ? "up" : "DOWN", mbps,
+              (unsigned)((ck_time_us() - t0) / 1000u));
+    if (!mbps) {
+        ck_rtl8127_release();
+        return CK_RTL_E_LINK;
+    }
+    ck_printf("report: sending %u bytes to UDP port %u (broadcast, tag %s) every 2 s for %u s\n", (unsigned)len,
+              (unsigned)NET_REPORT_PORT, NET_REPORT_TAG_SPARK, seconds);
+    uint64_t run = ck_time_us() ^ (uint64_t)len << 48;
+    unsigned rounds = 0, failed = 0, rx = 0;
+    uint64_t start = ck_time_us(), next = start;
+    int broken = 0;
+    do {
+        if (ck_time_us() >= next) {
+            next += ROUND_US;
+            if (send_round(d, log, len, run, &failed)) {
+                broken = 1;
+                break;
+            }
+            rounds++;
+        }
+        size_t n = 0;
+        int got = 0;
+        if (rtl_rx(d, rxbuf, sizeof rxbuf, &n, &got) != RTL_OK) {
+            broken = 1;
+            break;
+        }
+        rx += (unsigned)got;
+    } while (ck_time_us() - start < (uint64_t)seconds * 1000000u);
+    ck_printf("report: rounds=%u parts=%u send_failures=%u rx_frames=%u rx_dropped=%u device=%s\n", rounds,
+              net_report_parts(len), failed, rx, d->rx_dropped, broken ? "BROKEN" : "ok");
+    ck_rtl8127_release();
+    return broken || failed || !rounds ? CK_RTL_E_TX : CK_RTL_OK;
+}
diff --git a/native/kernel/dev/rtl8127_bind.h b/native/kernel/dev/rtl8127_bind.h
new file mode 100644
index 00000000..0953ddf6
--- /dev/null
+++ b/native/kernel/dev/rtl8127_bind.h
@@ -0,0 +1,45 @@
+/* rtl8127_bind.h -- bind native/net's polled RTL8127 driver
+ * (aienos_rtl8127.c) to the Spark's Realtek 10 GbE function (10ec:8127,
+ * segment 7 on the DGX Spark) through ck.h services, and send the boot report
+ * as UDP broadcasts (native/net/aienos_report.c, tag AIENUX-SPARK-REPORT,
+ * port 47031) so attended boot #2 needs no photograph.
+ *
+ * DMA rule (same as NVMe and virtio-net): no SMMU confinement means no DMA.
+ * The driver's one region (rings + buffers, RTL_MEM_SIZE) is allocated first
+ * and becomes the stream's only SMMU window (ck_dma_confine); only then are
+ * memory decoding and bus mastering enabled. No SMMU, or an SMMU that did
+ * not come up: the chip stays off. There is no unconfined bypass.
+ *
+ * Built in every image; called from the devices stage only in a CK_RTL8127=1
+ * build (the attended-boot image), so QEMU images are unchanged. Never run
+ * on the chip yet: every register sequence is from the vendor driver
+ * (DOCS SILENT), UNKNOWNs in docs/SPARK_RTL8127.md. */
+#ifndef AIENOS_CK_RTL8127_BIND_H
+#define AIENOS_CK_RTL8127_BIND_H
+#include <stddef.h>
+#include <stdint.h>
+#include "pci.h"
+enum {
+    CK_RTL_OK = 0,
+    CK_RTL_ABSENT = -601,   /* no 10ec:8127 function in the discovery */
+    CK_RTL_E_ARG = -602,    /* bad function, BAR 2 not memory or too small, ECAM unmapped */
+    CK_RTL_E_DMA = -603,    /* DMA region allocation failed */
+    CK_RTL_E_DENIED = -604, /* no SMMU confinement: chip left off */
+    CK_RTL_E_INIT = -605,   /* rtl_init failed */
+    CK_RTL_E_LINK = -606,   /* no link within the wait */
+    CK_RTL_E_TX = -607,     /* a report frame could not be built, sent or closed */
+};
+#define CK_RTL_LINK_WAIT_US 10000000u /* autonegotiation at 10G can take seconds (not measured) */
+/* First 10ec:8127 function of the multi-segment discovery, read as an
+ * endpoint into *out. CK_RTL_ABSENT when there is none. */
+int ck_rtl8127_find(const pci_found *found, uint32_t n, pci_func *out);
+/* Gate, map BAR 2, rtl_init, wait for link, then send the report (log, len)
+ * every 2 s for `seconds` (at least one round), counting received frames.
+ * Always releases the chip (stop, bus master off, stream to abort) before it
+ * returns. Prints rtl8127:/dma_gate:/smmu: lines. */
+int ck_rtl8127_report(const pci_func *f, const char *log, size_t len, uint32_t seconds);
+/* Stop the chip, revoke bus mastering, return the stream to abort, if live.
+ * Idempotent. */
+void ck_rtl8127_release(void);
+int ck_rtl8127_live(void);
+#endif
diff --git a/native/kernel/stage.mk b/native/kernel/stage.mk
index f589a4ec..28ebe724 100644
--- a/native/kernel/stage.mk
+++ b/native/kernel/stage.mk
@@ -20,7 +20,7 @@ STAGE_OUT ?= $(abspath $(STAGE_DIR)/../../target/stage)
 
 # Own sources (image).
 STAGE_OWN_SRCS := $(STAGE_DIR)/dev/pci.c $(STAGE_DIR)/dev/mmio_window.c $(STAGE_DIR)/dev/disk_part.c $(STAGE_DIR)/dev/nvme_bind.c $(STAGE_DIR)/dev/nvme_shutdown.c $(STAGE_DIR)/dev/virtio_net.c \
-                  $(STAGE_DIR)/dev/net_bind.c $(STAGE_DIR)/dev/net_udp.c $(STAGE_DIR)/dev/xhci_fence.c \
+                  $(STAGE_DIR)/dev/net_bind.c $(STAGE_DIR)/dev/net_udp.c $(STAGE_DIR)/dev/rtl8127_bind.c $(STAGE_DIR)/dev/xhci_fence.c \
                   $(STAGE_DIR)/dev/usb_hid.c $(STAGE_DIR)/dev/usb_kbd.c \
                   $(STAGE_DIR)/dev/devices.c $(STAGE_DIR)/svc/security.c $(STAGE_DIR)/svc/store_boot.c \
                   $(STAGE_DIR)/svc/artifact_store.c $(STAGE_DIR)/svc/store_crash.c
@@ -36,7 +36,8 @@ STAGE_NATIVE_SRCS := \
   $(STAGE_NATIVE)/argus/argus_detect.c $(STAGE_NATIVE)/argus/argus_contain.c \
   $(STAGE_NATIVE)/argus/bridge/argus_aegis_bridge.c \
   $(STAGE_NATIVE)/capability/aienos_capability.c $(STAGE_NATIVE)/capability/aienos_contain.c \
-  $(STAGE_NATIVE)/net/aienos_virtio_pci.c $(STAGE_NATIVE)/net/aienos_virtio_net.c $(STAGE_NATIVE)/net/aienos_net.c
+  $(STAGE_NATIVE)/net/aienos_virtio_pci.c $(STAGE_NATIVE)/net/aienos_virtio_net.c $(STAGE_NATIVE)/net/aienos_net.c \
+  $(STAGE_NATIVE)/net/aienos_rtl8127.c $(STAGE_NATIVE)/net/aienos_report.c
 # Kernel-only glue: hosted-header stand-ins for capability/ARGUS + weak mem*.
 STAGE_KERNEL_SRCS := $(STAGE_DIR)/svc/ck_compat.c
 
diff --git a/native/kernel/svc/.crumb b/native/kernel/svc/.crumb
index 67d2a977..a79719ea 100644
--- a/native/kernel/svc/.crumb
+++ b/native/kernel/svc/.crumb
@@ -18,26 +18,26 @@
       "children": [
         {
           "digest": "d6868c343497f05846433dd6f9e76a5beb0f51a3a38e70fb9ad2c6518d5c9514",
-          "last_commit": "621c9e6f",
+          "last_commit": "f45d00ad",
           "name": "compat",
           "purpose": "Directory native/kernel/svc/compat. Purpose not yet described by a human."
         },
         {
-          "digest": "91a6ae336a5df4ce944ec31edfeb2b674f1c071e587d5a60dc9bf1b1a0a80623",
-          "last_commit": "621c9e6f",
+          "digest": "87774234b99cc7f66f23e08c1a56aeef6625a7d29f3f2c33051c17d8261f8013",
+          "last_commit": "c4b8761e",
           "name": "tests",
           "purpose": "Directory native/kernel/svc/tests. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:c71c48b54abadc66e4a5a90dee52a42e3470ed78cfe5315b5f17374a713eb0a6",
-      "compiled_at": "2026-10-24T04:15:32Z",
+      "children_root": "sha256:b5f2e881d66e2b98b907bb9d86e3dbf33a5c2e4681f01d62492187b98356f128",
+      "compiled_at": "2026-10-24T23:29:14Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:7d1c2af30b802a41a46b1b70250cdaa855ba8c579ce5c870de452980e161cbfb",
+      "digest": "sha256:b270f8ea2da835177f60e6e3ab002efa787b2db4408f22b5a57ef3d53e517fe0",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 48,
-      "generated_at_commit": "621c9e6fe430ee689836bee3ee2689d7d32e0f7d",
-      "source_tree": "sha256:9e7685744e849cda5cf6517e7b89db3fb2d6bf1b05081a8f13459c78aba44c29"
+      "generated_at_commit": "c4b8761ecdf4f8d29039e3a58913b7fbe2ea7e72",
+      "source_tree": "sha256:31b6aba758d7251fa789d5d79c738019fdad0287889e03164ae16a1d451432f8"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/svc/tests/.crumb b/native/kernel/svc/tests/.crumb
index 3160d3f7..9db593a7 100644
--- a/native/kernel/svc/tests/.crumb
+++ b/native/kernel/svc/tests/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-24T04:15:32Z",
+      "compiled_at": "2026-10-24T23:29:14Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:91a6ae336a5df4ce944ec31edfeb2b674f1c071e587d5a60dc9bf1b1a0a80623",
+      "digest": "sha256:87774234b99cc7f66f23e08c1a56aeef6625a7d29f3f2c33051c17d8261f8013",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 3,
-      "generated_at_commit": "621c9e6fe430ee689836bee3ee2689d7d32e0f7d",
-      "source_tree": "sha256:8941cfc898fa7450cd0596ba15e179d251303717ed1a95381d420113d590f05d"
+      "generated_at_commit": "c4b8761ecdf4f8d29039e3a58913b7fbe2ea7e72",
+      "source_tree": "sha256:25410258a181057658e78c890dd182a9abcfe9cda90f7d58e357574e144f45e9"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/svc/tests/stage_test.c b/native/kernel/svc/tests/stage_test.c
index 3b4c3cd0..09051f8b 100644
--- a/native/kernel/svc/tests/stage_test.c
+++ b/native/kernel/svc/tests/stage_test.c
@@ -41,6 +41,7 @@
 #include "cortex_journal.h"
 #include "sha256.h"
 #include "net_bind.h"
+#include "rtl8127_bind.h"
 #include "net_udp.h"
 #include "xhci_fence.h"
 #include "usb_hid.h"
@@ -1712,6 +1713,48 @@ static void test_net_udp(void)
 }
 
 
+/* RTL8127 binding (L198): absent device, and no SMMU in the host shim, both
+ * fail closed before the function gets memory decode or bus master. */
+static void test_rtl8127_bind(void)
+{
+    printf("  [rtl8127 bind without SMMU, host, not hardware]\n");
+    static pci_func rf;
+    static pci_found fd[2];
+    memset(fd, 0, sizeof fd);
+    fd[0].vendor = 0x1af4;
+    fd[0].device = 0x1041;
+    CHECK(ck_rtl8127_find(fd, 1, &rf) == CK_RTL_ABSENT);
+    CHECK(ck_rtl8127_find(NULL, 0, &rf) == CK_RTL_ABSENT);
+    CHECK(ck_rtl8127_find(fd, 1, NULL) == CK_RTL_E_ARG);
+    fd[1].vendor = 0x10ec;
+    fd[1].device = 0x8127;
+    fd[1].segment = 7;
+    fd[1].bus = 1;
+    CHECK(ck_rtl8127_find(fd, 2, &rf) == CK_RTL_E_ARG); /* no mapped ECAM for segment 7 in the host shim */
+
+    static uint8_t cfg[4096];
+    memset(cfg, 0, sizeof cfg);
+    memset(&rf, 0, sizeof rf);
+    rf.vendor = 0x10ec;
+    rf.device = 0x8127;
+    rf.segment = 7;
+    rf.bus = 1;
+    rf.cfg = cfg;
+    const char log[] = "boot report line\n";
+    CHECK(ck_rtl8127_report(&rf, log, sizeof log - 1, 1) == CK_RTL_E_ARG); /* BAR 2 missing */
+    rf.bar[2].addr = 0x6e900000u;
+    rf.bar[2].size = 0x40000u;
+    rf.bar[2].is64 = 1;
+    CHECK(ck_rtl8127_report(&rf, log, sizeof log - 1, 1) == CK_RTL_E_DENIED);
+    CHECK((pci_r16(rf.cfg, 4) & 0x6u) == 0); /* no MEM, no BM */
+    CHECK(ck_rtl8127_live() == 0);
+    ck_rtl8127_release(); /* idempotent */
+    CHECK(ck_rtl8127_report(NULL, log, 1, 1) == CK_RTL_E_ARG);
+    CHECK(ck_rtl8127_report(&rf, log, 0, 1) == CK_RTL_E_ARG);
+    rf.bar[2].size = 0x100u; /* the vendor minimum, below the registers this driver uses */
+    CHECK(ck_rtl8127_report(&rf, log, sizeof log - 1, 1) == CK_RTL_E_ARG);
+}
+
 /* ---------------- post-exit bus-master sweep + xHCI DMA fence ---------------- */
 
 static void test_xhci_fence(void)
@@ -2643,6 +2686,7 @@ int main(void)
     test_security();
     test_nvme_shutdown();
     test_net_udp();
+    test_rtl8127_bind();
     test_xhci_fence();
     test_usb_hid();
     printf("CK_STAGE_HOST: %s checks=%d failures=%d\n", failures ? "FAIL" : "PASS", checks, failures);
diff --git a/native/kernel/tools/.crumb b/native/kernel/tools/.crumb
index 25c24977..9b367b82 100644
--- a/native/kernel/tools/.crumb
+++ b/native/kernel/tools/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-26T14:20:54Z",
+      "compiled_at": "2026-10-29T19:20:53Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:8d2be0298cc545f92db0a775b87769099a9fed6cc8cbe36add355be73bd4943d",
+      "digest": "sha256:d15b00ee52c39e8aa960027cbc33e8cf4880c6c3597c735ba4b123f3f0500603",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 24,
-      "generated_at_commit": "d13599d9b6251f30d3cd91b1e313a7e0c54e0f15",
-      "source_tree": "sha256:8ab031d5de4a8b6e23831909c7ee40f364ad226f13c682b442d38d1ed4139acd"
+      "generated_at_commit": "d2d7ff2a7434a3ff7d75d8608bec9274f9f9dbca",
+      "source_tree": "sha256:7c24f05c263a4ee1c43e5ede048444bd0d77130ed992cd033b6096bed30decb4"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/kernel/tools/ck_imac_report_listen.c b/native/kernel/tools/ck_imac_report_listen.c
index 1db4def2..313c3cd6 100644
--- a/native/kernel/tools/ck_imac_report_listen.c
+++ b/native/kernel/tools/ck_imac_report_listen.c
@@ -33,6 +33,8 @@
  * of a run is in, the report is written once to
  * OUTDIR/imac-<run>.unauthenticated.txt and a line
  * "complete run=... auth=none bytes=... file=..." goes to OUTDIR/listen.log.
+ * The Spark's "AIENUX-SPARK-REPORT v=1 ..." header (same format, same
+ * unauthenticated status) is written to OUTDIR/spark-<run>.unauthenticated.txt.
  * Repeats of a finished run are counted, not rewritten. Anything else,
  * including the retired v=1 raw-console format, is logged as ignored.
  * Exit 0 at the deadline, 2 usage, 3 socket/bind error. */
@@ -51,6 +53,7 @@
 
 #define MAGIC "AIENOS-IMAC-REPORT v=2 auth=none "
 #define LEGACY "AIENOS-IMAC-REPORT v=1 "
+#define SPARK_MAGIC "AIENUX-SPARK-REPORT v=1 " /* Spark, native/net/aienos_report.c (L198) */
 #define UNAUTH_NOTE \
     "note: iMac reports are UNAUTHENTICATED UDP broadcasts (auth=none); anyone on the LAN can read or " \
     "forge one; never treat a report as a receipt, evidence or a command\n"
@@ -60,6 +63,7 @@
 
 struct run {
     char id[17];
+    const char *pfx; /* output file prefix: imac or spark */
     unsigned parts, total, have, done, repeats;
     unsigned char got[MAX_PARTS];
     unsigned char data[MAX_PARTS * CHUNK];
@@ -75,7 +79,7 @@ static double now_s(void)
     return (double)ts.tv_sec + (double)ts.tv_nsec / 1e9;
 }
 
-static struct run *find_run(const char *id, unsigned parts, unsigned total)
+static struct run *find_run(const char *id, unsigned parts, unsigned total, const char *pfx)
 {
     for (unsigned i = 0; i < nruns; i++)
         if (!strcmp(runs[i].id, id))
@@ -83,6 +87,7 @@ static struct run *find_run(const char *id, unsigned parts, unsigned total)
     struct run *r = &runs[nruns < MAX_RUNS ? nruns++ : (next_slot++ % MAX_RUNS)];
     memset(r, 0, sizeof *r);
     memcpy(r->id, id, 17);
+    r->pfx = pfx;
     r->parts = parts;
     r->total = total;
     return r;
@@ -101,7 +106,7 @@ static FILE *open_private(const char *path, int flags, const char *mode)
 static void finish_run(FILE *lg, const char *dir, struct run *r)
 {
     char path[4096];
-    snprintf(path, sizeof path, "%s/imac-%s.unauthenticated.txt", dir, r->id);
+    snprintf(path, sizeof path, "%s/%s-%s.unauthenticated.txt", dir, r->pfx, r->id);
     FILE *f = open_private(path, O_TRUNC, "w");
     if (!f || fwrite(r->data, 1, r->total, f) != r->total || fclose(f) != 0) {
         fprintf(lg, "write failed run=%s file=%s errno=%d (%s)\n", r->id, path, errno, strerror(errno));
@@ -172,10 +177,16 @@ int main(int argc, char **argv)
             fprintf(lg, "ignored from %s:%u len=%zd: retired v=1 raw-console report\n", fa, ntohs(from.sin_port), n);
             continue;
         }
-        if (!nl || (size_t)n < sizeof MAGIC - 1 || memcmp(in, MAGIC, sizeof MAGIC - 1) != 0 ||
-            sscanf((char *)in + sizeof MAGIC - 1, "run=%16[0-9a-f] part=%u/%u bytes=%u%n", id, &part, &parts, &total,
+        size_t ml = 0;
+        const char *pfx = 0;
+        if ((size_t)n >= sizeof MAGIC - 1 && !memcmp(in, MAGIC, sizeof MAGIC - 1))
+            ml = sizeof MAGIC - 1, pfx = "imac";
+        else if ((size_t)n >= sizeof SPARK_MAGIC - 1 && !memcmp(in, SPARK_MAGIC, sizeof SPARK_MAGIC - 1))
+            ml = sizeof SPARK_MAGIC - 1, pfx = "spark";
+        if (!nl || !ml ||
+            sscanf((char *)in + ml, "run=%16[0-9a-f] part=%u/%u bytes=%u%n", id, &part, &parts, &total,
                    &used) != 4 ||
-            strlen(id) != 16 || (unsigned char *)in + sizeof MAGIC - 1 + used != nl || !parts || parts > MAX_PARTS ||
+            strlen(id) != 16 || (unsigned char *)in + ml + used != nl || !parts || parts > MAX_PARTS ||
             part >= parts || total > parts * CHUNK || total <= (parts - 1) * CHUNK) {
             fprintf(lg, "ignored from %s:%u len=%zd\n", fa, ntohs(from.sin_port), n);
             continue;
@@ -186,7 +197,7 @@ int main(int argc, char **argv)
                     want);
             continue;
         }
-        struct run *r = find_run(id, parts, total);
+        struct run *r = find_run(id, parts, total, pfx);
         if (!r) {
             fprintf(lg, "ignored run=%s: part count or size changed\n", id);
             continue;
diff --git a/native/net/.crumb b/native/net/.crumb
index bb1af0a8..7360e042 100644
--- a/native/net/.crumb
+++ b/native/net/.crumb
@@ -23,21 +23,21 @@
           "purpose": "Directory native/net/receipts. Purpose not yet described by a human."
         },
         {
-          "digest": "28d6bda7d776a4245d19df1556e65e80f932e3f7a13855d708f613f4a20c5c12",
-          "last_commit": "621c9e6f",
+          "digest": "3550bd98277807014c71f67c99e2c542022f47aad10d511cbb6d35528bfac847",
+          "last_commit": "87edb053",
           "name": "tests",
           "purpose": "Directory native/net/tests. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:899cba0a6679b457029e534d176a5b0b1cf021cc05782951e29f4f9b7cbd2798",
-      "compiled_at": "2026-10-24T04:15:32Z",
+      "children_root": "sha256:6ea9dbff02f79c8d26aa7dd053c138ad5b9137d18a347eab9bdeea81171491af",
+      "compiled_at": "2026-10-24T23:41:02Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:f9c2453f4a79f6f4f27e6761cc2cdfc0431fb698be73a7f8869b5d6580e96d9d",
+      "digest": "sha256:eca6d5cb48d78e40168815ff06122c85860714746afd12dc9402b893d64d9dec",
       "evidence_files": 4,
       "evidence_root": "sha256:e410b845507e00568e15b51a5797af32a97e0e4b8ab4e8487bb7c98e7e0cf335",
-      "files": 29,
-      "generated_at_commit": "621c9e6fe430ee689836bee3ee2689d7d32e0f7d",
-      "source_tree": "sha256:1e15f1e8d7b90491dfd2bd42aab84b5a6f89b0f6af0ab8f05f2968e4fd8f9516"
+      "files": 35,
+      "generated_at_commit": "87edb053b2f5ba274bb5ac73017266926da77846",
+      "source_tree": "sha256:fd1affb7d05116b5496dbabdc116de0e6644d2d17ddf2c2b3840d833a04ca775"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/net/Makefile b/native/net/Makefile
index 12026b33..e4de86bf 100644
--- a/native/net/Makefile
+++ b/native/net/Makefile
@@ -4,7 +4,7 @@
 # Hosted only: native binding waits for a C kernel, production keys for M5.
 #
 #   make            build out/libaienos_net.a
-#   make test       protocol tests + control-transport loss/recovery + virtio-net
+#   make test       protocol tests + control-transport loss/recovery + virtio-net + RTL8127 chip model
 #                   (QEMU config dumps, simulated hostile device) + lib-checks
 #                   + diff-check (pinned C/Rust-reference agreement digest)
 #   make sanitize   the same tests under ASan+UBSan (Linux)
@@ -35,7 +35,7 @@ DIFF_DIGEST = 9ddf33a859ade2d92d0e86a213d29d682708b0ac308239a7b6f003dbf9a5cdfe
 # build (out/net_diff_ref). C-only pin, recorded 2026-10-01; no Rust run.
 DIFF_DIGEST_FIXED = 034151b28953e23cbcdc2b805885ea88887b3da52e46369e8c01bd5b276241cb
 
-SRCS = aienos_net.c aienos_virtio_pci.c aienos_virtio_net.c aienos_ctl.c x25519.c aienos_sec.c
+SRCS = aienos_net.c aienos_virtio_pci.c aienos_virtio_net.c aienos_ctl.c x25519.c aienos_sec.c aienos_rtl8127.c aienos_report.c
 # M6-B links (never edits) the in-house AES-GCM-SIV/HMAC and Ed25519 code.
 CRYPTO_SRCS = ../crypto/aes.c ../crypto/polyval.c ../crypto/gcm_siv.c ../crypto/hmac.c ../crypto/ct.c
 SIG_SRCS = ../sig/ed25519.c ../sig/sha512.c ../sig/ct.c
@@ -75,17 +75,20 @@ $(OUT)/vnet_test: tests/vnet_test.c $(LIB)
 	$(CC) $(CFLAGS) -o $@ $< $(LIB)
 $(OUT)/net_diff_ref: tests/net_diff.c $(SRCS) $(DEP_SRCS) $(wildcard *.h) | $(OUT)
 	$(CC) $(CFLAGS) -DAIENOS_VIRTIO_PCI_REFERENCE_COMPAT -o $@ tests/net_diff.c $(SRCS) $(DEP_SRCS)
+$(OUT)/rtl8127_test: tests/rtl8127_test.c $(LIB)
+	$(CC) $(CFLAGS) -o $@ $< $(LIB)
 $(OUT)/x25519_test: tests/x25519_test.c $(LIB)
 	$(CC) $(CFLAGS) -o $@ $< $(LIB)
 $(OUT)/sec_test: tests/sec_test.c $(LIB)
 	$(CC) $(CFLAGS) -o $@ $< $(LIB)
 
-test: lib-checks $(OUT)/net_test $(OUT)/ctl_test $(OUT)/vnet_test $(OUT)/x25519_test $(OUT)/sec_test diff-check
+test: lib-checks $(OUT)/net_test $(OUT)/ctl_test $(OUT)/vnet_test $(OUT)/rtl8127_test $(OUT)/x25519_test $(OUT)/sec_test diff-check
 	./$(OUT)/net_test $(SEED) $(ITERS)
 	./$(OUT)/ctl_test
 	./$(OUT)/x25519_test
 	./$(OUT)/sec_test
 	./$(OUT)/vnet_test
+	./$(OUT)/rtl8127_test
 
 # Protocol objects must not allocate, read a clock or do their own I/O.
 lib-checks: $(OBJS)
@@ -132,6 +135,8 @@ ifeq ($(shell uname -s),Linux)
 	ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./$(OUT)/sec_test_asan
 	$(CC) $(CFLAGS) $(SANFLAGS) -o $(OUT)/vnet_test_asan tests/vnet_test.c $(SRCS) $(DEP_SRCS)
 	ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./$(OUT)/vnet_test_asan
+	$(CC) $(CFLAGS) $(SANFLAGS) -o $(OUT)/rtl8127_test_asan tests/rtl8127_test.c $(SRCS) $(DEP_SRCS)
+	ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./$(OUT)/rtl8127_test_asan
 	@echo "NET_SANITIZE: PASS"
 else
 	@echo "sanitize: Linux only"
diff --git a/native/net/README.md b/native/net/README.md
index b4424afb..74e81e13 100644
--- a/native/net/README.md
+++ b/native/net/README.md
@@ -12,6 +12,8 @@ control-transport stub. No Rust, no Python, no heap, no outside library.
 | `aienos_ctl.{h,c}` | Control-transport stub: authenticated frames, ordered exactly-once delivery, retransmit, link-down. **TEST identity only.** The frame format is specified in the header. |
 | `x25519.{h,c}` | M6-B: X25519 (RFC 7748), constant-time ladder, small-order outputs refused. |
 | `aienos_sec.{h,c}` | M6-B: mutually authenticated secure control transport over the M6-A UDP framing. **TEST identities only.** The wire format is specified in the header. |
+| `aienos_rtl8127.{h,c}` | L198: driver core for the Spark's Realtek RTL8127 10 GbE (10ec:8127), polled, one DMA region, TX no-close, RX type 1, interrupts masked. Realtek publishes no datasheet (DOCS SILENT); written from Realtek's Linux r8127 v11.014.00. Tested only against a chip model (`tests/rtl8127_test.c`); never run on the chip. Details and the UNKNOWN list: `docs/SPARK_RTL8127.md`. |
+| `aienos_report.{h,c}` | L198: a boot report as UDP broadcast datagrams (the iMac wire format, tag as a parameter; the Spark uses `AIENUX-SPARK-REPORT`). |
 
 ## Tests (`make test`, `make sanitize`)
 
@@ -43,7 +45,7 @@ control-transport stub. No Rust, no Python, no heap, no outside library.
 
 ## Not claimed (deferred, with the dependency)
 
-- Physical binding (real NIC, interrupts): the virtio-net driver is bound in the C kernel by `native/kernel/dev/net_bind.c` (#200 d75a266 attach and split virtqueue driver, #203 9807281 kernel hook, NET gate PASS in QEMU only). It is polled (no IRQs) and uses TEST keys. Lane 31 negotiates and requires VIRTIO_F_ACCESS_PLATFORM so the NIC DMA should go through the SMMU window, and the NET gate script now checks that an out-of-window DMA is refused; QEMU PASS on this branch (receipt `evidence/ck_net_qemu_8bdbc2e46b85d04c422f9d2830c1c4b263e254b3cfecfe21ff0063c9e33c86e8.log`, forge log of `scripts/qemu_ck_net_test.sh`), QEMU only; hardware NOT_RUN. No physical NIC driver exists.
+- Physical binding (real NIC, interrupts): the virtio-net driver is bound in the C kernel by `native/kernel/dev/net_bind.c` (#200 d75a266 attach and split virtqueue driver, #203 9807281 kernel hook, NET gate PASS in QEMU only). It is polled (no IRQs) and uses TEST keys. Lane 31 negotiates and requires VIRTIO_F_ACCESS_PLATFORM so the NIC DMA should go through the SMMU window, and the NET gate script now checks that an out-of-window DMA is refused; QEMU PASS on this branch (receipt `evidence/ck_net_qemu_8bdbc2e46b85d04c422f9d2830c1c4b263e254b3cfecfe21ff0063c9e33c86e8.log`, forge log of `scripts/qemu_ck_net_test.sh`), QEMU only; hardware NOT_RUN. The Spark's RTL8127 driver (`aienos_rtl8127.c`, L198) exists but has run only against a chip model; it is bound by `native/kernel/dev/rtl8127_bind.c` only in a `CK_RTL8127=1` image, hardware NOT_RUN.
 - Production identity and keys: needs M5 (key hierarchy, TRUST-1). The M6-B
   secure transport below exists as hosted code but runs on TEST keys only. The stub refuses every identity kind except TEST, whose key is
   derived from a public label and so protects nothing against an attacker.
diff --git a/native/net/aienos_report.c b/native/net/aienos_report.c
new file mode 100644
index 00000000..6dd2ffcf
--- /dev/null
+++ b/native/net/aienos_report.c
@@ -0,0 +1,163 @@
+/* aienos_report.c -- see aienos_report.h. Built on the M6-A stack
+ * (aienos_net.c) for every layer below the header line. */
+#include "aienos_report.h"
+
+#include <string.h>
+
+#include "aienos_net.h"
+
+static const net_ipv4 ANY = {{0, 0, 0, 0}}, BCAST = {{255, 255, 255, 255}};
+
+static size_t tag_len(const char *tag)
+{
+    size_t n = 0;
+    while (tag && tag[n] && n <= NET_REPORT_TAG_MAX)
+        n++;
+    return tag && n && n <= NET_REPORT_TAG_MAX ? n : 0;
+}
+
+static void hex16(char *out, uint64_t v)
+{
+    for (int i = 15; i >= 0; i--, v >>= 4)
+        out[i] = "0123456789abcdef"[v & 15];
+}
+
+static size_t dec(char *out, unsigned long v)
+{
+    char t[20];
+    size_t n = 0, k = 0;
+    do
+        t[n++] = (char)('0' + v % 10);
+    while ((v /= 10) && n < sizeof t);
+    while (n)
+        out[k++] = t[--n];
+    return k;
+}
+
+unsigned net_report_parts(size_t len)
+{
+    if (!len || len > NET_REPORT_MAX)
+        return 0;
+    return (unsigned)((len + NET_REPORT_CHUNK - 1) / NET_REPORT_CHUNK);
+}
+
+size_t net_report_frame(const char *tag, const uint8_t mac[6], uint64_t run, const char *log, size_t len,
+                        unsigned part, uint8_t *out, size_t cap)
+{
+    uint8_t data[NET_REPORT_TAG_MAX + 96 + NET_REPORT_CHUNK], udp[8 + sizeof data], ip[20 + sizeof udp];
+    unsigned parts = net_report_parts(len);
+    size_t t = tag_len(tag);
+    if (!t || !mac || !log || !out || part >= parts)
+        return 0;
+    size_t off = (size_t)part * NET_REPORT_CHUNK;
+    size_t n = len - off < NET_REPORT_CHUNK ? len - off : NET_REPORT_CHUNK;
+    size_t h = 0;
+    memcpy(data, tag, t);
+    h += t;
+    memcpy(data + h, " v=1 run=", 9);
+    h += 9;
+    hex16((char *)data + h, run);
+    h += 16;
+    memcpy(data + h, " part=", 6);
+    h += 6;
+    h += dec((char *)data + h, part);
+    data[h++] = '/';
+    h += dec((char *)data + h, parts);
+    memcpy(data + h, " bytes=", 7);
+    h += 7;
+    h += dec((char *)data + h, (unsigned long)len);
+    data[h++] = '\n';
+    memcpy(data + h, log + off, n);
+
+    net_udp_header uh = {NET_REPORT_PORT, NET_REPORT_PORT};
+    size_t uw = 0, iw = 0, ew = 0;
+    if (net_udp_build(&uh, data, h + n, ANY, BCAST, udp, sizeof udp, &uw) != NET_OK)
+        return 0;
+    net_ipv4_header ih;
+    ih.dscp_ecn = 0;
+    ih.identification = (uint16_t)part;
+    ih.ttl = 1; /* this network only */
+    ih.protocol = NET_IPPROTO_UDP;
+    ih.source = ANY;
+    ih.destination = BCAST;
+    if (net_ipv4_build(&ih, udp, uw, ip, sizeof ip, &iw) != NET_OK)
+        return 0;
+    net_eth_frame e;
+    memset(e.destination.b, 0xff, 6);
+    memcpy(e.source.b, mac, 6);
+    e.ethertype = NET_ETHERTYPE_IPV4;
+    e.payload = ip;
+    e.payload_len = iw;
+    if (net_eth_build(&e, out, cap, &ew) != NET_OK)
+        return 0;
+    return ew;
+}
+
+/* Reads a decimal number ending at `stop`; -1 on no digits or overflow. */
+static long num(const uint8_t *p, size_t n, size_t *i, char stop)
+{
+    unsigned long v = 0;
+    size_t s = *i;
+    while (*i < n && p[*i] >= '0' && p[*i] <= '9' && *i - s < 9)
+        v = v * 10 + (unsigned long)(p[(*i)++] - '0');
+    if (*i == s || *i >= n || p[*i] != stop)
+        return -1;
+    (*i)++;
+    return (long)v;
+}
+
+static int lit(const uint8_t *p, size_t n, size_t *i, const char *s, size_t sn)
+{
+    if (n - *i < sn || memcmp(p + *i, s, sn) != 0)
+        return 0;
+    *i += sn;
+    return 1;
+}
+
+int net_report_parse(const char *tag, const uint8_t *frame, size_t n, net_report_part *out)
+{
+    size_t t = tag_len(tag);
+    if (!t || !frame || !out)
+        return -1;
+    net_eth_frame e;
+    if (net_eth_parse(frame, n, &e) != NET_OK || e.ethertype != NET_ETHERTYPE_IPV4)
+        return -2;
+    net_ipv4_header ih;
+    const uint8_t *ipp = 0, *up = 0;
+    size_t ipn = 0, un = 0;
+    if (net_ipv4_parse(e.payload, e.payload_len, &ih, &ipp, &ipn) != NET_OK || ih.protocol != NET_IPPROTO_UDP)
+        return -3;
+    net_udp_header uh;
+    if (net_udp_parse(ipp, ipn, ih.source, ih.destination, &uh, &up, &un) != NET_OK ||
+        uh.destination_port != NET_REPORT_PORT)
+        return -4;
+    size_t i = 0;
+    if (!lit(up, un, &i, tag, t) || !lit(up, un, &i, " v=1 run=", 9) || un - i < 16)
+        return -5;
+    uint64_t run = 0;
+    for (int k = 0; k < 16; k++) {
+        uint8_t c = up[i++];
+        unsigned v = c >= '0' && c <= '9' ? (unsigned)(c - '0') : c >= 'a' && c <= 'f' ? (unsigned)(c - 'a') + 10u : 16u;
+        if (v > 15)
+            return -5;
+        run = run << 4 | v;
+    }
+    long part, parts, total;
+    if (!lit(up, un, &i, " part=", 6) || (part = num(up, un, &i, '/')) < 0 || (parts = num(up, un, &i, ' ')) < 0 ||
+        !lit(up, un, &i, "bytes=", 6) || (total = num(up, un, &i, '\n')) < 0)
+        return -6;
+    if (net_report_parts((size_t)total) != (unsigned long)parts || part >= parts)
+        return -7;
+    size_t off = (size_t)part * NET_REPORT_CHUNK;
+    size_t want = (size_t)total - off < NET_REPORT_CHUNK ? (size_t)total - off : NET_REPORT_CHUNK;
+    if (un - i != want)
+        return -8;
+    out->run = run;
+    out->part = (unsigned)part;
+    out->parts = (unsigned)parts;
+    out->total = (size_t)total;
+    out->offset = off;
+    out->data = up + i;
+    out->len = want;
+    return 0;
+}
diff --git a/native/net/aienos_report.h b/native/net/aienos_report.h
new file mode 100644
index 00000000..f4df5128
--- /dev/null
+++ b/native/net/aienos_report.h
@@ -0,0 +1,40 @@
+/* aienos_report.h -- a machine's boot report as UDP broadcast datagrams, so
+ * the owner does not have to photograph the screen. Same wire format as the
+ * iMac report (native/kernel/x86/report_x86.c), with the first word as a
+ * parameter: each datagram goes from 0.0.0.0:PORT to 255.255.255.255:PORT in
+ * an Ethernet broadcast frame (TTL 1, nothing to configure or answer) and
+ * starts with one header line
+ *   "<TAG> v=1 run=<16 hex> part=<i>/<n> bytes=<total>\n"
+ * followed by bytes [i*CHUNK, i*CHUNK + CHUNK) of the report.
+ * Pure functions: no device, no clock, no heap. */
+#ifndef AIENOS_NET_REPORT_H
+#define AIENOS_NET_REPORT_H
+#include <stddef.h>
+#include <stdint.h>
+
+#define NET_REPORT_PORT 47031u   /* UDP, source and destination (the iMac's port) */
+#define NET_REPORT_CHUNK 1024u   /* report bytes per datagram */
+#define NET_REPORT_MAX 65536u    /* largest report */
+#define NET_REPORT_TAG_SPARK "AIENUX-SPARK-REPORT"
+#define NET_REPORT_TAG_MAX 32u
+
+typedef struct {
+    uint64_t run;
+    unsigned part, parts;
+    size_t total;            /* report bytes in all parts */
+    size_t offset;           /* where this part's data goes */
+    const uint8_t *data;     /* view into the frame */
+    size_t len;
+} net_report_part;
+
+/* Datagrams needed for a report of len bytes; 0 when len is 0 or too big. */
+unsigned net_report_parts(size_t len);
+/* Ethernet frame (no FCS) carrying part `part` of the report, broadcast from
+ * `mac`. Bytes written, 0 on a bad argument or a buffer too small. */
+size_t net_report_frame(const char *tag, const uint8_t mac[6], uint64_t run, const char *log, size_t len,
+                        unsigned part, uint8_t *out, size_t cap);
+/* Parse one received Ethernet frame. 0 and *out filled when it is a part of
+ * a `tag` report whose header, ports, checksums and lengths all agree;
+ * negative otherwise. */
+int net_report_parse(const char *tag, const uint8_t *frame, size_t n, net_report_part *out);
+#endif
diff --git a/native/net/aienos_rtl8127.c b/native/net/aienos_rtl8127.c
new file mode 100644
index 00000000..89e5fe28
--- /dev/null
+++ b/native/net/aienos_rtl8127.c
@@ -0,0 +1,434 @@
+/* RTL8127 driver core (see aienos_rtl8127.h). Freestanding: no heap, no
+ * clock, no libc beyond memcpy/memset. Line numbers in comments refer to
+ * Realtek r8127 v11.014.00 (github.com/openwrt/rtl8127 ec2f285), the only
+ * reference: Realtek publishes no register document (DOCS SILENT). */
+#include "aienos_rtl8127.h"
+
+#include <string.h>
+
+#define WAIT_LL_TRIES 10u          /* x100 us, r8127_n.c:4872-4882 */
+#define WAIT_FIFO_TRIES 3000u      /* x50 us, r8127_n.c:4100-4116 */
+#define WAIT_RESET_TRIES 100u      /* x100 us, r8127_n.c:4312-4318 */
+#define WAIT_OCP_TRIES 20000u      /* x1 us, R8127_CHANNEL_WAIT_COUNT */
+#define WAIT_PHY_STATE_TRIES 100u  /* x1 ms, r8127_n.c:7308-7318 */
+#define PHY_BMCR 0xA400u           /* MII BMCR via PHY OCP: page 0xA40, reg 0x10 */
+#define PHY_STATE 0xA420u          /* low 3 bits: 3 = powered up (r8127_n.c:7300-7304) */
+#define BMCR_ANENABLE 0x1000u      /* IEEE 802.3 22.2.4.1.4 */
+
+static const uint8_t fallback_mac[6] = {0x02, 0x41, 0x49, 0x45, 0x4e, 0x58}; /* locally administered */
+
+static uint32_t r8(rtl_dev *d, uint32_t o) { return d->ops.read(d->ops.ctx, o, 1); }
+static uint32_t r16(rtl_dev *d, uint32_t o) { return d->ops.read(d->ops.ctx, o, 2); }
+static uint32_t r32(rtl_dev *d, uint32_t o) { return d->ops.read(d->ops.ctx, o, 4); }
+static void w8(rtl_dev *d, uint32_t o, uint32_t v) { d->ops.write(d->ops.ctx, o, 1, v & 0xffu); }
+static void w16(rtl_dev *d, uint32_t o, uint32_t v) { d->ops.write(d->ops.ctx, o, 2, v & 0xffffu); }
+static void w32(rtl_dev *d, uint32_t o, uint32_t v) { d->ops.write(d->ops.ctx, o, 4, v); }
+static void delay(rtl_dev *d, uint32_t us) { d->ops.delay_us(d->ops.ctx, us); }
+
+/* MAC OCP: r8127_n.c:3287-3314 */
+static uint32_t ocp_rd(rtl_dev *d, uint32_t addr)
+{
+    w32(d, RTL_MACOCP, (addr / 2u) << 16);
+    return r32(d, RTL_MACOCP) & 0xffffu;
+}
+static void ocp_wr(rtl_dev *d, uint32_t addr, uint32_t v)
+{
+    w32(d, RTL_MACOCP, ((addr / 2u) << 16) | (v & 0xffffu) | RTL_OCP_WRITE);
+}
+
+/* PHY OCP: r8127_n.c:3057-3073 (write waits for the flag to clear), 3155-3167
+ * (read waits for the flag to set). */
+static void phy_wr(rtl_dev *d, uint32_t addr, uint32_t v)
+{
+    w32(d, RTL_PHYOCP, ((addr / 2u) << 16) | (v & 0xffffu) | RTL_OCP_WRITE);
+    for (uint32_t i = 0; i < WAIT_OCP_TRIES; i++) {
+        delay(d, 1);
+        if (!(r32(d, RTL_PHYOCP) & RTL_OCP_FLAG))
+            return;
+    }
+    d->wait_timeouts++;
+}
+static uint32_t phy_rd(rtl_dev *d, uint32_t addr)
+{
+    w32(d, RTL_PHYOCP, (addr / 2u) << 16);
+    for (uint32_t i = 0; i < WAIT_OCP_TRIES; i++) {
+        delay(d, 1);
+        if (r32(d, RTL_PHYOCP) & RTL_OCP_FLAG)
+            return r32(d, RTL_PHYOCP) & 0xffffu;
+    }
+    d->wait_timeouts++;
+    return 0xffffu;
+}
+
+static void wait_ll_share_fifo(rtl_dev *d) /* r8127_n.c:4872-4882 */
+{
+    for (uint32_t i = 0; i < WAIT_LL_TRIES; i++) {
+        delay(d, 100);
+        if (r16(d, RTL_LLFIFO) & 0x0200u)
+            return;
+    }
+    d->wait_timeouts++;
+}
+
+static void rx_filter_off(rtl_dev *d) /* r8127_n.c:4287-4293 */
+{
+    w32(d, RTL_RCR, r32(d, RTL_RCR) & ~RTL_RCR_ACCEPT_MASK);
+}
+
+/* r8127_n.c:4296-4321: gate RX, stop request, wait for both FIFOs and the
+ * mitigation idle bits, clear the stop request, soft reset, reset RCR. The
+ * vendor ignores a reset that never completes; this driver fails instead. */
+static rtl_err nic_reset(rtl_dev *d)
+{
+    rx_filter_off(d);
+    w8(d, RTL_RXDV_GATE, r8(d, RTL_RXDV_GATE) | 0x08u);
+    w8(d, RTL_CHIPCMD, r8(d, RTL_CHIPCMD) | RTL_CMD_STOPREQ);
+    delay(d, 200);
+    uint32_t i;
+    for (i = 0; i < WAIT_FIFO_TRIES; i++) {
+        delay(d, 50);
+        uint32_t want = RTL_MCU_TXFIFO_EMPTY | RTL_MCU_RXFIFO_EMPTY;
+        if ((r8(d, RTL_MCUCMD) & want) == want)
+            break;
+    }
+    if (i == WAIT_FIFO_TRIES)
+        d->wait_timeouts++;
+    for (i = 0; i < WAIT_FIFO_TRIES; i++) {
+        delay(d, 50);
+        if ((r16(d, RTL_INTRMIT) & 0x0103u) == 0x0103u)
+            break;
+    }
+    if (i == WAIT_FIFO_TRIES)
+        d->wait_timeouts++;
+    w8(d, RTL_CHIPCMD, r8(d, RTL_CHIPCMD) & (RTL_CMD_TXEN | RTL_CMD_RXEN));
+    w8(d, RTL_CHIPCMD, RTL_CMD_RESET);
+    for (i = 0; i < WAIT_RESET_TRIES; i++) {
+        delay(d, 100);
+        if (!(r8(d, RTL_CHIPCMD) & RTL_CMD_RESET))
+            break;
+    }
+    if (i == WAIT_RESET_TRIES)
+        return RTL_E_RESET_TIMEOUT;
+    w32(d, RTL_RCR, RTL_RCR_RESET);
+    return RTL_OK;
+}
+
+/* r8127_n.c:4507-4519 with ISR version 1 (no MSI-X): interrupt type set to
+ * version 1 (4324-4350), mask, acknowledge, timers off, then nic_reset. */
+static rtl_err hw_reset(rtl_dev *d)
+{
+    w8(d, RTL_INT_CFG0, r8(d, RTL_INT_CFG0) & ~0x61u);
+    w32(d, RTL_IMR0, 0);
+    w32(d, RTL_ISR0, r32(d, RTL_ISR0));
+    w32(d, RTL_TIMER_INT0, 0);
+    w32(d, RTL_TIMER_INT1, 0);
+    w32(d, RTL_TIMER_INT2, 0);
+    w32(d, RTL_TIMER_INT3, 0);
+    return nic_reset(d);
+}
+
+/* r8127_n.c:7340-7384 without DASH and RealWoW; the UPS-resume PHY wait is
+ * not done, only recorded (UNKNOWN on the chip). */
+static rtl_err exit_oob(rtl_dev *d)
+{
+    rx_filter_off(d);
+    ocp_wr(d, 0xC0BC, 0x00FF);
+    rtl_err e = nic_reset(d);
+    if (e != RTL_OK)
+        return e;
+    w8(d, RTL_MCUCMD, r8(d, RTL_MCUCMD) & ~RTL_MCU_NOW_IS_OOB);
+    ocp_wr(d, 0xE8DE, ocp_rd(d, 0xE8DE) & ~0x4000u);
+    wait_ll_share_fifo(d);
+    ocp_wr(d, 0xC0AA, 0x07D0);
+    ocp_wr(d, 0xC0A6, 0x01B5);
+    ocp_wr(d, 0xC01E, 0x5555);
+    wait_ll_share_fifo(d);
+    d->ups_resume = (ocp_rd(d, 0xD42C) & 0x0100u) ? 1 : 0;
+    return RTL_OK;
+}
+
+/* r8127_n.c:5512-5519 and 13306-13318: PLL on, PHY out of power-down with
+ * autonegotiation enabled, unless the board holds the PHY in disable mode
+ * (4029-4072: 0xF2 bit 5 and MAC OCP 0xDC04 bit 13 low). */
+static void powerup(rtl_dev *d)
+{
+    w8(d, RTL_PMCH, r8(d, RTL_PMCH) | 0xC0u);
+    if ((r8(d, RTL_RXDV_GATE) & 0x20u) && !(ocp_rd(d, 0xDC04) & 0x2000u))
+        return;
+    phy_wr(d, PHY_BMCR, BMCR_ANENABLE);
+    for (uint32_t i = 0; i < WAIT_PHY_STATE_TRIES; i++) {
+        d->phy_state = (uint8_t)(phy_rd(d, PHY_STATE) & 7u);
+        if (d->phy_state == 3)
+            return;
+        delay(d, 1000);
+    }
+    d->wait_timeouts++;
+}
+
+static int mac_valid(const uint8_t m[6])
+{
+    if (m[0] & 1u)
+        return 0; /* multicast */
+    return (m[0] | m[1] | m[2] | m[3] | m[4] | m[5]) != 0;
+}
+
+/* r8127_n.c:12418-12441 and 12482-12500 (rar_set). */
+static void read_mac(rtl_dev *d)
+{
+    uint8_t m[6];
+    uint32_t lo = r32(d, RTL_BACKUP_ADDR0), hi = r16(d, RTL_BACKUP_ADDR1);
+    for (int i = 0; i < 4; i++)
+        m[i] = (uint8_t)(lo >> (8 * i));
+    m[4] = (uint8_t)hi;
+    m[5] = (uint8_t)(hi >> 8);
+    d->mac_source = RTL_MAC_BACKUP;
+    if (!mac_valid(m)) {
+        for (uint32_t i = 0; i < 6; i++)
+            m[i] = (uint8_t)r8(d, RTL_MAC0 + i);
+        d->mac_source = RTL_MAC_MAC0;
+    }
+    if (!mac_valid(m)) {
+        memcpy(m, fallback_mac, 6);
+        d->mac_source = RTL_MAC_FALLBACK;
+    }
+    memcpy(d->mac, m, 6);
+    w8(d, RTL_CFG9346, r8(d, RTL_CFG9346) | RTL_CFG9346_UNLOCK);
+    w32(d, RTL_MAC0, (uint32_t)m[0] | (uint32_t)m[1] << 8 | (uint32_t)m[2] << 16 | (uint32_t)m[3] << 24);
+    w32(d, RTL_MAC4, (uint32_t)m[4] | (uint32_t)m[5] << 8);
+    w8(d, RTL_CFG9346, r8(d, RTL_CFG9346) & ~RTL_CFG9346_UNLOCK);
+}
+
+/* Descriptor words are little-endian; opts1 is one 32-bit store so the OWN
+ * bit and the length change together. */
+static volatile uint32_t *word(rtl_dev *d, size_t off) { return (volatile uint32_t *)(void *)(d->mem + off); }
+static uint32_t le(uint32_t v)
+{
+#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+    return __builtin_bswap32(v);
+#else
+    return v;
+#endif
+}
+
+static size_t txd(uint32_t i) { return RTL_OFF_TXD + (size_t)i * RTL_TXD_SIZE; }
+static size_t rxd(uint32_t i) { return RTL_OFF_RXD + (size_t)i * RTL_RXD_SIZE; }
+
+/* Give RX slot i to the chip: buffer address from the slot index, then
+ * opts1 = OWN | EOR (last slot) | size (r8127_n.c:15263-15268). */
+static void rx_post(rtl_dev *d, uint32_t i)
+{
+    uint64_t a = d->dma + RTL_OFF_RXBUF + (uint64_t)i * RTL_BUF_STRIDE;
+    *word(d, rxd(i) + 4) = 0;
+    *word(d, rxd(i) + 8) = le((uint32_t)a);
+    *word(d, rxd(i) + 12) = le((uint32_t)(a >> 32));
+    d->ops.barrier(d->ops.ctx);
+    *word(d, rxd(i)) = le(RTL_DESC_OWN | (i == RTL_RX_N - 1 ? RTL_DESC_EOR : 0) | RTL_RX_BUF);
+}
+
+size_t rtl_mem_size(void) { return RTL_MEM_SIZE; }
+
+rtl_err rtl_init(rtl_dev *d, const rtl_ops *ops, void *mem, uint64_t dma, size_t mem_len)
+{
+    if (!d || !ops || !ops->read || !ops->write || !ops->delay_us || !ops->barrier || !mem)
+        return RTL_E_ARG;
+    memset(d, 0, sizeof *d);
+    d->ops = *ops;
+    if (mem_len < RTL_MEM_SIZE || ((uintptr_t)mem & 4095u) || (dma & 4095u) || dma + mem_len < dma)
+        return RTL_E_MEM;
+    d->mem = mem;
+    d->dma = dma;
+    d->mem_len = mem_len;
+    memset(mem, 0, RTL_MEM_SIZE);
+
+    /* Identify (r8127_n.c:7210-7235) before writing anything. */
+    uint32_t tcr = r32(d, RTL_TCR);
+    d->tcr_id = tcr;
+    if (tcr == 0xffffffffu)
+        return RTL_E_ABSENT;
+    if ((tcr & RTL_TCR_ID_MASK) != RTL_TCR_ID_8127)
+        return RTL_E_CHIP;
+    uint32_t icver = tcr & RTL_TCR_ICVER_MASK;
+    d->mcfg = icver == 0 ? 1 : 2;
+    d->ic_unknown = icver != 0 && icver != 0x00100000u;
+
+    /* Probe order of r8127_n.c:14328-14342, then the parts of open/hw_config
+     * this driver needs (14935-15182, 15182-15190). */
+    rtl_err e = exit_oob(d);
+    if (e != RTL_OK)
+        return e;
+    powerup(d);
+    if ((e = hw_reset(d)) != RTL_OK)
+        return e;
+    read_mac(d);
+
+    for (uint32_t i = 0; i < RTL_TX_N; i++)
+        *word(d, txd(i)) = le(i == RTL_TX_N - 1 ? RTL_DESC_EOR : 0);
+    for (uint32_t i = 0; i < RTL_RX_N; i++)
+        rx_post(d, i);
+    d->ops.barrier(d->ops.ctx);
+
+    w8(d, RTL_CFG9346, r8(d, RTL_CFG9346) | RTL_CFG9346_UNLOCK);
+    uint64_t tx_ring = dma + RTL_OFF_TXD, rx_ring = dma + RTL_OFF_RXD;
+    w32(d, RTL_TNPDS_LO, (uint32_t)tx_ring); /* desc_addr_fill, 15585-15598 */
+    w32(d, RTL_TNPDS_HI, (uint32_t)(tx_ring >> 32));
+    w32(d, RTL_RDSAR_LO, (uint32_t)rx_ring);
+    w32(d, RTL_RDSAR_HI, (uint32_t)(rx_ring >> 32));
+    w32(d, RTL_TCR, RTL_TCR_VALUE); /* 14958-14963: burst, IFG, no-close bit 6 */
+    w32(d, RTL_RSS_CTRL, 0);                                          /* 14983: no RSS, one RX queue */
+    w16(d, RTL_Q_NUM_CTRL, r16(d, RTL_Q_NUM_CTRL) & ~0x001Cu);       /* 14876-14886: rx_q_num = ilog2(1) */
+    ocp_wr(d, RTL_OCP_TXDESC_FMT, (ocp_rd(d, RTL_OCP_TXDESC_FMT) & ~0x3u) | 0x1u); /* 14992-14996: 32 B TX desc */
+    w8(d, RTL_TXNOCLOSE_EN, r8(d, RTL_TXNOCLOSE_EN) | 0x04u);        /* 14998-15001 */
+    w8(d, RTL_RXDESC_TYPE, r8(d, RTL_RXDESC_TYPE) & ~0x02u);         /* 15003-15010: type 1 */
+    w16(d, RTL_RMS, RTL_RMS_VALUE | RTL_RMS_VLAN);                   /* 14470-14473 */
+    w8(d, RTL_RXDV_GATE, r8(d, RTL_RXDV_GATE) & ~0x08u);             /* 4023-4027 */
+    w32(d, RTL_RCR, RTL_RCR_CHIP | RTL_RCR_ACCEPT_BCAST | RTL_RCR_ACCEPT_MYPHYS);
+    w8(d, RTL_CFG9346, r8(d, RTL_CFG9346) & ~RTL_CFG9346_UNLOCK);
+
+    /* The vendor starts its close-pointer count at 0 after reset (4596-4605);
+     * this driver uses whatever the chip reports as its base instead. */
+    d->clo_base = r32(d, RTL_HW_CLO0) & RTL_CLO_MASK;
+    w8(d, RTL_CHIPCMD, RTL_CMD_TXEN | RTL_CMD_RXEN); /* hw_start, 15182-15190; IRQs stay masked */
+    d->ready = 1;
+    return RTL_OK;
+}
+
+int rtl_link(rtl_dev *d, uint32_t *mbps)
+{
+    if (mbps)
+        *mbps = 0;
+    if (!d || !d->ops.read)
+        return 0;
+    uint32_t s = r16(d, RTL_PHYSTATUS); /* r8127_n.c:4537-4547 */
+    if (s == 0xffffu || !(s & RTL_PHYS_LINK))
+        return 0;
+    if (mbps)
+        *mbps = (s & 0x4000u) ? 10000 : (s & 0x1000u) ? 5000 : (s & 0x0400u) ? 2500 : (s & 0x0010u) ? 1000
+              : (s & 0x0008u) ? 100 : (s & 0x0004u) ? 10 : 0;
+    return 1;
+}
+
+static rtl_err usable(rtl_dev *d)
+{
+    if (!d)
+        return RTL_E_ARG;
+    if (d->broken)
+        return RTL_E_BROKEN;
+    return d->ready ? RTL_OK : RTL_E_NOT_READY;
+}
+
+unsigned rtl_tx_pending(const rtl_dev *d) { return d ? d->tx_cur - d->tx_dirty : 0; }
+
+/* r8127_n.c:16427-16560 (one fragment) and the no-close doorbell 16412-16419. */
+rtl_err rtl_tx(rtl_dev *d, const uint8_t *frame, size_t len)
+{
+    rtl_err e = usable(d);
+    if (e != RTL_OK)
+        return e;
+    if (!frame || len < 14 || len > RTL_FRAME_MAX)
+        return RTL_E_ARG;
+    if (d->tx_cur - d->tx_dirty >= RTL_TX_N)
+        return RTL_E_FULL;
+    uint32_t i = d->tx_cur % RTL_TX_N;
+    size_t n = len < RTL_FRAME_MIN ? RTL_FRAME_MIN : len;
+    uint8_t *buf = d->mem + RTL_OFF_TXBUF + (size_t)i * RTL_BUF_STRIDE;
+    memcpy(buf, frame, len);
+    memset(buf + len, 0, n - len);
+    uint64_t a = d->dma + RTL_OFF_TXBUF + (uint64_t)i * RTL_BUF_STRIDE;
+    *word(d, txd(i) + 4) = 0;
+    *word(d, txd(i) + 8) = le((uint32_t)a);
+    *word(d, txd(i) + 12) = le((uint32_t)(a >> 32));
+    d->ops.barrier(d->ops.ctx);
+    *word(d, txd(i)) = le(RTL_DESC_OWN | RTL_DESC_FS | RTL_DESC_LS | (i == RTL_TX_N - 1 ? RTL_DESC_EOR : 0) |
+                          (uint32_t)n);
+    d->tx_cur++;
+    /* Same origin as the close pointer (clo_base), so tail - close = frames in flight. */
+    w32(d, RTL_SW_TAIL0, (d->clo_base + d->tx_cur) & RTL_CLO_MASK); /* write op orders the descriptor first */
+    return RTL_OK;
+}
+
+/* r8127_n.c:16590-16620: the closed count is the close pointer's advance. */
+rtl_err rtl_tx_reclaim(rtl_dev *d, unsigned *reclaimed)
+{
+    if (reclaimed)
+        *reclaimed = 0;
+    rtl_err e = usable(d);
+    if (e != RTL_OK)
+        return e;
+    uint32_t clo = r32(d, RTL_HW_CLO0);
+    uint32_t done = (clo - d->clo_base - d->tx_dirty) & RTL_CLO_MASK;
+    if (clo == 0xffffffffu || done > d->tx_cur - d->tx_dirty) {
+        d->broken = 1;
+        return RTL_E_DEVICE;
+    }
+    d->tx_dirty += done;
+    if (reclaimed)
+        *reclaimed = done;
+    return RTL_OK;
+}
+
+/* r8127_n.c:17036-17250 for one queue, type 1 descriptors, no fragments. */
+rtl_err rtl_rx(rtl_dev *d, uint8_t *out, size_t cap, size_t *len, int *got)
+{
+    if (got)
+        *got = 0;
+    if (len)
+        *len = 0;
+    rtl_err e = usable(d);
+    if (e != RTL_OK)
+        return e;
+    if (!out || !len || !got)
+        return RTL_E_ARG;
+    for (uint32_t tries = 0; tries < RTL_RX_N; tries++) {
+        uint32_t i = d->rx_cur % RTL_RX_N;
+        uint32_t s = le(*word(d, rxd(i)));
+        if (s & RTL_DESC_OWN)
+            return RTL_OK;
+        d->ops.barrier(d->ops.ctx);
+        uint32_t n = s & RTL_RX_LEN_MASK;
+        if (n > RTL_RX_BUF) {
+            d->broken = 1; /* the chip wrote past the size it was given */
+            return RTL_E_DEVICE;
+        }
+        int whole = (s & (RTL_DESC_FS | RTL_DESC_LS)) == (RTL_DESC_FS | RTL_DESC_LS);
+        size_t f = n >= 4 ? n - 4 : 0; /* FCS, r8127_n.c:17119-17126 */
+        if (!whole || (s & RTL_RX_RES) || n < 14 + 4 || cap < f) {
+            d->rx_dropped++; /* a frame too big for `cap` is dropped too, so the slot never blocks the ring */
+        } else {
+            memcpy(out, d->mem + RTL_OFF_RXBUF + (size_t)i * RTL_BUF_STRIDE, f);
+            *len = f;
+            *got = 1;
+        }
+        rx_post(d, i);
+        d->rx_cur++;
+        if (*got)
+            return RTL_OK;
+    }
+    return RTL_OK;
+}
+
+rtl_err rtl_stop(rtl_dev *d)
+{
+    if (!d || !d->ops.write)
+        return RTL_E_ARG;
+    if (!d->mcfg)
+        return RTL_E_NOT_READY; /* never identified as an RTL8127: write nothing */
+    d->ready = 0;
+    return hw_reset(d);
+}
+
+const char *rtl_err_name(rtl_err e)
+{
+    switch (e) {
+    case RTL_OK: return "OK";
+    case RTL_E_ARG: return "ARG";
+    case RTL_E_MEM: return "MEM";
+    case RTL_E_ABSENT: return "ABSENT";
+    case RTL_E_CHIP: return "CHIP";
+    case RTL_E_RESET_TIMEOUT: return "RESET_TIMEOUT";
+    case RTL_E_FULL: return "FULL";
+    case RTL_E_DEVICE: return "DEVICE";
+    case RTL_E_BROKEN: return "BROKEN";
+    case RTL_E_NOT_READY: return "NOT_READY";
+    }
+    return "?";
+}
diff --git a/native/net/aienos_rtl8127.h b/native/net/aienos_rtl8127.h
new file mode 100644
index 00000000..4f12075a
--- /dev/null
+++ b/native/net/aienos_rtl8127.h
@@ -0,0 +1,214 @@
+/* Realtek RTL8127 10 GbE (PCI 10ec:8127, the Spark's only wired NIC) driver
+ * core, polled, hosted-testable. Gap D5 of docs/SPARK_REPLACE_LINUX.md.
+ *
+ * DOCS SILENT: Realtek publishes no register document for this chip (see
+ * docs/SPARK_RTL8127.md). Every offset and bit below comes from Realtek's own
+ * Linux driver r8127 v11.014.00, the version the Spark runs, read-only at
+ * github.com/openwrt/rtl8127 ec2f285; comments cite r8127_n.c / r8127.h
+ * lines there. None of it has been run on the chip. The register sequences
+ * still UNKNOWN on the real chip are listed in docs/SPARK_RTL8127.md.
+ *
+ * Scope: MAC bring-up without the vendor's MCU patch code, PCIe EPHY tuning
+ * and PHY micro-code (Aienux relies on the state the UEFI firmware leaves),
+ * one TX queue in the vendor's "no close" mode (tail and close pointers, the
+ * vendor build default), one RX queue with type 1 descriptors (RSS off, as
+ * in the Spark's build), interrupts masked, no offloads, no jumbo frames.
+ *
+ * Device access goes through rtl_ops only: register reads and writes inside
+ * BAR 2, a microsecond delay, and a memory barrier. No heap, no clock, no
+ * I/O of its own. Both rings and every packet buffer live in ONE
+ * caller-provided region (mem, len) that the chip sees at bus address `dma`
+ * (the kernel makes it the device's only SMMU window). The driver writes
+ * every descriptor from its own index (never trusts a descriptor address the
+ * chip wrote back). Anything the chip reports is untrusted: a close pointer
+ * that runs ahead of what was posted, or an RX length larger than the
+ * buffer, marks the device broken (sticky); the caller must stop and
+ * re-init. */
+#ifndef AIENOS_RTL8127_H
+#define AIENOS_RTL8127_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#define RTL_PCI_VENDOR 0x10ecu
+#define RTL_PCI_DEVICE 0x8127u
+#define RTL_MMIO_BAR 2u            /* r8127_n.c init_board: BAR 2 is the MMIO region */
+#define RTL_MMIO_MIN 0x5000u       /* highest register used is 0x4800 (Q_NUM_CTRL); Spark BAR 2 is 256 KiB */
+
+/* Registers (offsets in BAR 2) */
+#define RTL_MAC0 0x00u             /* r8127.h:1438 */
+#define RTL_MAC4 0x04u
+#define RTL_TNPDS_LO 0x20u         /* TxDescStartAddrLow, r8127.h:1444 */
+#define RTL_TNPDS_HI 0x24u
+#define RTL_INT_CFG0 0x34u         /* INT_CFG0_8125: bit 0 enable, 5 auto-clear IMR, 6 avoid-miss */
+#define RTL_CHIPCMD 0x37u          /* r8127.h:1452 */
+#define RTL_IMR0 0x38u             /* IMR0_8125 (32 bit, ISR version 1) */
+#define RTL_ISR0 0x3Cu             /* ISR0_8125 */
+#define RTL_TCR 0x40u              /* TxConfig */
+#define RTL_RCR 0x44u              /* RxConfig */
+#define RTL_CFG9346 0x50u
+#define RTL_TIMER_INT0 0x58u       /* r8127_n.c:4360-4368 */
+#define RTL_TIMER_INT1 0x5Cu
+#define RTL_PHYSTATUS 0x6Cu        /* 16 bit */
+#define RTL_PMCH 0x6Fu
+#define RTL_TIMER_INT2 0x8Cu
+#define RTL_MACOCP 0xB0u           /* MAC OCP window, r8127_n.c:3287-3314 */
+#define RTL_PHYOCP 0xB8u           /* PHY OCP window, r8127_n.c:3057-3073 */
+#define RTL_LLFIFO 0xD2u           /* 16 bit, bit 9 = LL share FIFO ready */
+#define RTL_MCUCMD 0xD3u
+#define RTL_RXDESC_TYPE 0xD8u      /* bit 1 = RX descriptor type 4 */
+#define RTL_RMS 0xDAu              /* RxMaxSize, 16 bit */
+#define RTL_INTRMIT 0xE2u          /* IntrMitigate, 16 bit */
+#define RTL_RDSAR_LO 0xE4u         /* RxDescAddrLow */
+#define RTL_RDSAR_HI 0xE8u
+#define RTL_RXDV_GATE 0xF2u        /* bit 3 = gate closed */
+#define RTL_TIMER_INT3 0xF4u
+#define RTL_SW_TAIL0 0x0D30u       /* SW_TAIL_PTR0_8125BP, no-close version 6 */
+#define RTL_HW_CLO0 0x0D34u        /* HW_CLO_PTR0_8125BP */
+#define RTL_BACKUP_ADDR0 0x19E0u   /* 32 bit, the MAC address Linux uses */
+#define RTL_BACKUP_ADDR1 0x19E4u   /* 16 bit */
+#define RTL_TXNOCLOSE_EN 0x20E4u   /* bit 2 */
+#define RTL_RSS_CTRL 0x4500u       /* RSS_CTRL_8125, r8127.h:1553 */
+#define RTL_Q_NUM_CTRL 0x4800u     /* Q_NUM_CTRL_8125, r8127.h:1554; bits 4:2 = ilog2(RX queues) */
+#define RTL_OCP_TXDESC_FMT 0xEB58u /* MAC OCP, bits 1:0 = 01 "new tx desc format" (32 B), r8127_n.c:14992 */
+
+/* Bits */
+#define RTL_CMD_STOPREQ 0x80u
+#define RTL_CMD_RESET 0x10u
+#define RTL_CMD_RXEN 0x08u
+#define RTL_CMD_TXEN 0x04u
+#define RTL_CFG9346_UNLOCK 0xC0u
+#define RTL_RCR_ACCEPT_MASK 0x3Fu  /* Err Runt Bcast Mcast MyPhys AllPhys */
+#define RTL_RCR_ACCEPT_BCAST 0x08u
+#define RTL_RCR_ACCEPT_MYPHYS 0x02u
+/* Chip table RCR for RTL8127 (r8127_n.c:119-122): Rx_Fetch_Number_8 |
+ * Rx_Close_Multiple | RxCfg_pause_slot_en | EnableInnerVlan |
+ * EnableOuterVlan | RX_DMA_BURST_512 << 8 */
+#define RTL_RCR_CHIP 0x40E00D00u
+#define RTL_RCR_RESET 0x00000500u  /* RX_DMA_BURST_512 << 8, r8127_n.c:4320-4321 */
+/* TX_DMA_BURST_unlimited << 8 | InterFrameGap 3 << 24, plus bit 6 no-close */
+#define RTL_TCR_VALUE 0x03000740u
+#define RTL_TCR_ID_MASK 0x7c800000u
+#define RTL_TCR_ID_8127 0x6C800000u
+#define RTL_TCR_ICVER_MASK 0x00700000u
+#define RTL_MCU_NOW_IS_OOB 0x80u
+#define RTL_MCU_TXFIFO_EMPTY 0x20u
+#define RTL_MCU_RXFIFO_EMPTY 0x10u
+#define RTL_OCP_WRITE 0x80000000u
+#define RTL_OCP_FLAG 0x80000000u
+#define RTL_PHYS_LINK 0x0002u
+#define RTL_PHYS_FULLDUP 0x0001u
+#define RTL_RMS_VLAN 0x8000u       /* AcceppVlanPhys */
+
+/* Descriptors (little-endian in memory) */
+#define RTL_DESC_OWN 0x80000000u
+#define RTL_DESC_EOR 0x40000000u   /* RingEnd */
+#define RTL_DESC_FS 0x20000000u
+#define RTL_DESC_LS 0x10000000u
+#define RTL_RX_RES 0x00200000u     /* receive error summary (type 1) */
+#define RTL_RX_LEN_MASK 0x3FFFu    /* includes the 4-byte FCS */
+#define RTL_TXD_SIZE 32u           /* struct TxDesc, r8127.h:2056 */
+#define RTL_RXD_SIZE 16u           /* struct RxDesc (type 1), r8127.h:2066 */
+#define RTL_CLO_MASK 0x7FFFFFFFu   /* MAX_TX_NO_CLOSE_DESC_PTR_MASK_V4 */
+
+/* Ring geometry used by this driver */
+#define RTL_TX_N 16u
+#define RTL_RX_N 16u
+#define RTL_FRAME_MIN 60u          /* frames shorter than this are zero-padded */
+#define RTL_FRAME_MAX 1514u        /* Ethernet II without FCS, no VLAN tag */
+#define RTL_RX_BUF 1536u           /* posted RX buffer size */
+#define RTL_RMS_VALUE 1522u        /* 1514 + 4 VLAN + 4 FCS */
+#define RTL_BUF_STRIDE 2048u
+#define RTL_OFF_TXD 0u
+#define RTL_OFF_RXD 1024u
+#define RTL_OFF_TXBUF 4096u
+#define RTL_OFF_RXBUF (RTL_OFF_TXBUF + RTL_TX_N * RTL_BUF_STRIDE)
+#define RTL_MEM_SIZE (RTL_OFF_RXBUF + RTL_RX_N * RTL_BUF_STRIDE)
+
+typedef struct {
+    void *ctx;
+    /* width is 1, 2 or 4; off + width <= RTL_MMIO_MIN */
+    uint32_t (*read)(void *ctx, uint32_t off, unsigned width);
+    /* must make every earlier write to the shared region visible to the
+     * device before the register write (the kernel issues a barrier first) */
+    void (*write)(void *ctx, uint32_t off, unsigned width, uint32_t val);
+    void (*delay_us)(void *ctx, uint32_t us);
+    /* full memory barrier between descriptor reads and buffer reads */
+    void (*barrier)(void *ctx);
+} rtl_ops;
+
+typedef enum {
+    RTL_OK = 0,
+    RTL_E_ARG = 1,            /* NULL, frame too short/long, buffer too small */
+    RTL_E_MEM = 2,            /* region too small, misaligned, or bus range wraps */
+    RTL_E_ABSENT = 3,         /* registers read all ones: no device behind the BAR */
+    RTL_E_CHIP = 4,           /* TxConfig id is not an RTL8127 */
+    RTL_E_RESET_TIMEOUT = 5,  /* ChipCmd reset bit never cleared */
+    RTL_E_FULL = 6,           /* no free TX descriptor (reclaim first) */
+    RTL_E_DEVICE = 7,         /* hostile or broken completion; device is now broken */
+    RTL_E_BROKEN = 8,         /* sticky: an earlier RTL_E_DEVICE; stop and re-init */
+    RTL_E_NOT_READY = 9,      /* rtl_init has not succeeded */
+} rtl_err;
+
+typedef enum { RTL_MAC_BACKUP = 1, RTL_MAC_MAC0 = 2, RTL_MAC_FALLBACK = 3 } rtl_mac_source;
+
+typedef struct {
+    rtl_ops ops;
+    uint8_t *mem;
+    uint64_t dma;
+    size_t mem_len;
+    uint8_t ready;
+    uint8_t broken;
+    uint8_t mcfg;             /* 1 or 2 (CFG_METHOD_n), from TxConfig */
+    uint8_t ic_unknown;       /* TxConfig IC version neither 0 nor 1 */
+    uint8_t mac[6];
+    uint8_t mac_source;       /* rtl_mac_source */
+    uint8_t ups_resume;       /* MAC OCP 0xD42C bit 8 was set (not handled) */
+    uint8_t phy_state;        /* PHY OCP 0xA420 & 7 after power-up (3 = up) */
+    uint32_t tcr_id;          /* TxConfig as read before reset */
+    uint32_t wait_timeouts;   /* vendor waits that ran out (the vendor ignores them too) */
+    uint32_t tx_cur;          /* frames posted (free running) */
+    uint32_t tx_dirty;        /* frames known closed (free running) */
+    uint32_t clo_base;        /* hardware close pointer read after reset */
+    uint32_t rx_cur;          /* frames consumed (free running) */
+    uint32_t rx_dropped;      /* error, runt or multi-descriptor frames dropped */
+} rtl_dev;
+
+/* Bytes of shared region the driver needs (RTL_MEM_SIZE). */
+size_t rtl_mem_size(void);
+
+/* Identify, stop, reset and bring up the chip: exit OOB, reset, PHY power
+ * up, MAC address, rings, TX and RX enabled, interrupts masked. mem and dma
+ * must be 4096-byte aligned, mem_len >= rtl_mem_size(), dma + mem_len must
+ * not wrap. The region is zeroed. */
+rtl_err rtl_init(rtl_dev *d, const rtl_ops *ops, void *mem, uint64_t dma, size_t mem_len);
+
+/* Link state from PHYstatus: 1 up, 0 down or absent. *mbps (optional) gets
+ * 10000/5000/2500/1000/100/10, or 0 when down or unknown. */
+int rtl_link(rtl_dev *d, uint32_t *mbps);
+
+/* Copy one Ethernet frame (14..RTL_FRAME_MAX bytes, no FCS; padded to 60)
+ * into a free TX buffer, hand the descriptor to the chip, move the tail. */
+rtl_err rtl_tx(rtl_dev *d, const uint8_t *frame, size_t len);
+
+/* Consume TX completions from the close pointer; *reclaimed (optional). */
+rtl_err rtl_tx_reclaim(rtl_dev *d, unsigned *reclaimed);
+
+/* Frames posted and not yet closed. */
+unsigned rtl_tx_pending(const rtl_dev *d);
+
+/* Take at most one received frame: copies it (FCS stripped) to out, sets
+ * *len and *got = 1, and gives the buffer back to the chip. *got 0: nothing
+ * pending. Error, runt, multi-descriptor and larger-than-cap frames are
+ * dropped (counted in rx_dropped) and their slot is reposted. A cap of
+ * RTL_RX_BUF holds every frame the chip can deliver (VLAN tag included). */
+rtl_err rtl_rx(rtl_dev *d, uint8_t *out, size_t cap, size_t *len, int *got);
+
+/* Stop DMA (only on a chip rtl_init identified; RTL_E_NOT_READY otherwise,
+ * nothing written): mask interrupts, close the RX gate, stop request, wait for the
+ * FIFOs, soft reset. The rings are no longer in use when it returns OK. */
+rtl_err rtl_stop(rtl_dev *d);
+
+const char *rtl_err_name(rtl_err e);
+
+#endif
diff --git a/native/net/tests/.crumb b/native/net/tests/.crumb
index 503ef31a..2d8bdc9b 100644
--- a/native/net/tests/.crumb
+++ b/native/net/tests/.crumb
@@ -20,14 +20,14 @@
         }
       ],
       "children_root": "sha256:eefad7996e552393c5e8e30abc9d90b9ec8f10e51bef5b788e6131b1c76c0907",
-      "compiled_at": "2026-10-24T04:15:32Z",
+      "compiled_at": "2026-10-24T23:41:02Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:28d6bda7d776a4245d19df1556e65e80f932e3f7a13855d708f613f4a20c5c12",
+      "digest": "sha256:3550bd98277807014c71f67c99e2c542022f47aad10d511cbb6d35528bfac847",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 9,
-      "generated_at_commit": "621c9e6fe430ee689836bee3ee2689d7d32e0f7d",
-      "source_tree": "sha256:a90746b1d8069250318aba2d59bc93564083dadef533066c1f68984be466b308"
+      "files": 11,
+      "generated_at_commit": "87edb053b2f5ba274bb5ac73017266926da77846",
+      "source_tree": "sha256:4031a0cf2731bf60760cfb71d1d796a8d27bdf4cf79f68b9de36cfee91373a03"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/native/net/tests/report_send.c b/native/net/tests/report_send.c
new file mode 100644
index 00000000..d970d96a
--- /dev/null
+++ b/native/net/tests/report_send.c
@@ -0,0 +1,65 @@
+/* report_send.c -- host tool for scripts/ck_spark_report_test.sh: builds the
+ * Spark boot report frames with native/net/aienos_report.c exactly as the
+ * kernel does (net_report_frame), checks each with net_report_parse, and
+ * sends each frame's UDP payload to 127.0.0.1:PORT, last part first and
+ * every part twice, so the listener must reorder and ignore repeats.
+ *   report_send PORT INFILE */
+#define _POSIX_C_SOURCE 200809L
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include "../aienos_net.h"
+#include "../aienos_report.h"
+
+int main(int argc, char **argv)
+{
+    static char log[NET_REPORT_MAX + 1];
+    if (argc != 3)
+        return 2;
+    FILE *f = fopen(argv[2], "rb");
+    size_t len = f ? fread(log, 1, sizeof log, f) : 0;
+    if (f)
+        fclose(f);
+    unsigned parts = net_report_parts(len);
+    if (!parts) {
+        fprintf(stderr, "report_send: bad input length %zu\n", len);
+        return 1;
+    }
+    int s = socket(AF_INET, SOCK_DGRAM, 0);
+    struct sockaddr_in to;
+    memset(&to, 0, sizeof to);
+    to.sin_family = AF_INET;
+    to.sin_port = htons((uint16_t)atoi(argv[1]));
+    to.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+    static const uint8_t mac[6] = {0x48, 0x11, 0x22, 0x33, 0x44, 0x55};
+    for (int rep = 0; rep < 2; rep++)
+        for (unsigned k = 0; k < parts; k++) {
+            unsigned p = parts - 1 - k;
+            uint8_t fr[1600];
+            size_t n = net_report_frame(NET_REPORT_TAG_SPARK, mac, 0xfedcba9876543210ull, log, len, p, fr, sizeof fr);
+            net_report_part rp;
+            net_eth_frame e;
+            net_ipv4_header ih;
+            net_udp_header uh;
+            const uint8_t *ipp, *up;
+            size_t ipn, un;
+            if (!n || net_report_parse(NET_REPORT_TAG_SPARK, fr, n, &rp) || rp.part != p ||
+                net_eth_parse(fr, n, &e) || net_ipv4_parse(e.payload, e.payload_len, &ih, &ipp, &ipn) ||
+                net_udp_parse(ipp, ipn, ih.source, ih.destination, &uh, &up, &un)) {
+                fprintf(stderr, "report_send: part %u does not build or parse\n", p);
+                return 1;
+            }
+            if (sendto(s, up, un, 0, (struct sockaddr *)&to, sizeof to) != (ssize_t)un) {
+                perror("sendto");
+                return 1;
+            }
+        }
+    close(s);
+    printf("sent %u parts twice, %zu bytes\n", parts, len);
+    return 0;
+}
diff --git a/native/net/tests/rtl8127_test.c b/native/net/tests/rtl8127_test.c
new file mode 100644
index 00000000..c189778d
--- /dev/null
+++ b/native/net/tests/rtl8127_test.c
@@ -0,0 +1,677 @@
+/* rtl8127_test.c -- the RTL8127 driver core (aienos_rtl8127.c) against a chip
+ * model: a register array with the side effects the vendor reference relies
+ * on (reset bit, OCP windows, FIFO-empty bits, close pointer) and a ring
+ * simulator that walks the driver's TX and RX descriptors the way the chip
+ * would, refusing any DMA address outside the driver's region (the SMMU
+ * window on the Spark). The model is written from the same vendor source as
+ * the driver (DOCS SILENT); it checks that the driver does what the
+ * reference does, not that the reference is right for the chip.
+ * Prints RTL8127_MODEL: PASS / FAIL. */
+#include "../aienos_rtl8127.h"
+#include "../aienos_report.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int failures, checks;
+#define CHECK(c, ...)                                                    \
+    do {                                                                 \
+        checks++;                                                        \
+        if (!(c)) {                                                      \
+            failures++;                                                  \
+            printf("FAIL %s:%d: ", __FILE__, __LINE__);                  \
+            printf(__VA_ARGS__);                                         \
+            printf("\n");                                                \
+        }                                                                \
+    } while (0)
+
+/* ---- chip model ---- */
+typedef struct {
+    uint8_t reg[RTL_MMIO_MIN];
+    uint16_t ocp[0x8000];     /* MAC OCP space, by address/2 */
+    uint16_t phy[0x8000];     /* PHY OCP space, by address/2 */
+    uint32_t ocp_latch, phy_latch;
+    int phy_busy;             /* PHY OCP flag phase */
+    /* configuration */
+    uint32_t tcr_id;
+    int absent, reset_stuck, fifo_never_empty, clo_after_reset, hostile_clo;
+    /* DMA region the chip may touch (the SMMU window) */
+    uint8_t *mem;
+    uint64_t dma;
+    size_t len;
+    unsigned dma_faults;
+    /* ring state inside the chip */
+    uint32_t tx_hw, rx_hw, clo, tail;
+    uint32_t tx_origin;       /* close pointer after reset: tx_hw, clo and tail count from it */
+    int defer_tx;            /* close descriptors only when asked */
+    unsigned resets, writes, ocp_writes;
+    int mac_written_unlocked, mac_written_locked;
+    int enabled_before_rings; /* TE|RE written before both ring bases */
+    int tnpds_set, rdsar_set;
+    uint8_t tx_frames[64][RTL_FRAME_MAX + 64];
+    size_t tx_len[64];
+    unsigned tx_count;
+    unsigned rx_overflow;
+} chip;
+
+static chip C;
+
+static uint32_t get(uint32_t off, unsigned w)
+{
+    uint32_t v = 0;
+    for (unsigned i = 0; i < w; i++)
+        v |= (uint32_t)C.reg[off + i] << (8 * i);
+    return v;
+}
+static void put(uint32_t off, unsigned w, uint32_t v)
+{
+    for (unsigned i = 0; i < w; i++)
+        C.reg[off + i] = (uint8_t)(v >> (8 * i));
+}
+
+static uint8_t *dma_ptr(uint64_t a, size_t n)
+{
+    if (a < C.dma || a + n > C.dma + C.len || a + n < a) {
+        C.dma_faults++;
+        return 0;
+    }
+    return C.mem + (a - C.dma);
+}
+static uint32_t rd32le(const uint8_t *p) { return p[0] | p[1] << 8 | p[2] << 16 | (uint32_t)p[3] << 24; }
+static void wr32le(uint8_t *p, uint32_t v)
+{
+    for (int i = 0; i < 4; i++)
+        p[i] = (uint8_t)(v >> (8 * i));
+}
+static uint64_t ring_base(uint32_t lo)
+{
+    return (uint64_t)get(lo, 4) | (uint64_t)get(lo + 4, 4) << 32;
+}
+
+static void chip_reset_state(void)
+{
+    C.rx_hw = 0;
+    C.tx_hw = C.tx_origin = (uint32_t)C.clo_after_reset; /* the chip's TX index counts from its close base */
+    C.clo = (uint32_t)C.clo_after_reset;
+    C.tail = 0;
+    put(RTL_HW_CLO0, 4, C.clo);
+    C.resets++;
+}
+
+/* The chip fetches every descriptor between its index and the tail. */
+static void chip_tx_run(void)
+{
+    uint8_t *ring = dma_ptr(ring_base(RTL_TNPDS_LO), RTL_TX_N * RTL_TXD_SIZE);
+    if (!ring || !(get(RTL_CHIPCMD, 1) & RTL_CMD_TXEN))
+        return;
+    if (((C.tail - C.tx_hw) & RTL_CLO_MASK) > RTL_TX_N) {
+        C.dma_faults += 1000; /* tail more than a ring ahead of the chip: tail and close pointer disagree */
+        return;
+    }
+    while (C.tx_hw != (C.tail & RTL_CLO_MASK)) {
+        uint32_t slot = (C.tx_hw - C.tx_origin) % RTL_TX_N;
+        uint8_t *d = ring + slot * RTL_TXD_SIZE;
+        uint32_t o1 = rd32le(d);
+        if (!(o1 & RTL_DESC_OWN))
+            break;
+        uint64_t a = rd32le(d + 8) | (uint64_t)rd32le(d + 12) << 32;
+        size_t n = o1 & 0x3ffffu;
+        uint8_t *b = dma_ptr(a, n);
+        if (!b)
+            break;
+        if (C.tx_count < 64) {
+            memcpy(C.tx_frames[C.tx_count], b, n < sizeof C.tx_frames[0] ? n : sizeof C.tx_frames[0]);
+            C.tx_len[C.tx_count] = n;
+        }
+        C.tx_count++;
+        int eor = (o1 & RTL_DESC_EOR) != 0;
+        if (eor != (slot == RTL_TX_N - 1))
+            C.dma_faults += 1000; /* EOR on the wrong slot: flagged loudly */
+        C.tx_hw = (C.tx_hw + 1) & RTL_CLO_MASK;
+        if (!C.defer_tx)
+            C.clo++;
+    }
+    put(RTL_HW_CLO0, 4, C.clo & RTL_CLO_MASK);
+}
+
+static uint32_t m_read(void *ctx, uint32_t off, unsigned w)
+{
+    (void)ctx;
+    if (C.absent)
+        return w == 4 ? 0xffffffffu : w == 2 ? 0xffffu : 0xffu;
+    if (off + w > RTL_MMIO_MIN) {
+        C.dma_faults += 10000;
+        return 0;
+    }
+    if (off == RTL_CHIPCMD && (C.reg[off] & RTL_CMD_RESET) && !C.reset_stuck) {
+        C.reg[off] &= (uint8_t)~RTL_CMD_RESET; /* reset finishes on the first poll */
+        chip_reset_state();
+    }
+    if (off == RTL_MACOCP && w == 4)
+        return C.ocp[(C.ocp_latch >> 16) & 0x7fff];
+    if (off == RTL_PHYOCP && w == 4) {
+        if (C.phy_busy == 1) { /* write in flight: flag clears on first poll */
+            C.phy_busy = 0;
+            return 0;
+        }
+        if (C.phy_busy == 2) { /* read: flag set with data */
+            uint32_t a = (C.phy_latch >> 16) & 0x7fff;
+            uint32_t v = C.phy[a];
+            if (a == 0xA420u / 2) /* PHY state: 3 once BMCR has autoneg on */
+                v = (C.phy[0xA400u / 2] & 0x1000u) ? 3 : 1;
+            return RTL_OCP_FLAG | v;
+        }
+        return 0;
+    }
+    if (off == RTL_HW_CLO0 && C.hostile_clo)
+        return C.clo + 1000;
+    return get(off, w);
+}
+
+static void m_write(void *ctx, uint32_t off, unsigned w, uint32_t v)
+{
+    (void)ctx;
+    C.writes++;
+    if (C.absent)
+        return;
+    if (off + w > RTL_MMIO_MIN) {
+        C.dma_faults += 10000;
+        return;
+    }
+    switch (off) {
+    case RTL_MACOCP:
+        C.ocp_latch = v;
+        if (v & RTL_OCP_WRITE) {
+            C.ocp[(v >> 16) & 0x7fff] = (uint16_t)v;
+            C.ocp_writes++;
+        }
+        return;
+    case RTL_PHYOCP:
+        C.phy_latch = v;
+        if (v & RTL_OCP_WRITE) {
+            C.phy[(v >> 16) & 0x7fff] = (uint16_t)v;
+            C.phy_busy = 1;
+        } else
+            C.phy_busy = 2;
+        return;
+    case RTL_MAC0:
+    case RTL_MAC4:
+        if (w == 4) {
+            if ((get(RTL_CFG9346, 1) & RTL_CFG9346_UNLOCK) == RTL_CFG9346_UNLOCK)
+                C.mac_written_unlocked++;
+            else
+                C.mac_written_locked++;
+        }
+        break;
+    case RTL_TNPDS_LO:
+        C.tnpds_set = 1;
+        break;
+    case RTL_RDSAR_LO:
+        C.rdsar_set = 1;
+        break;
+    case RTL_SW_TAIL0:
+        put(off, w, v);
+        C.tail = v;
+        chip_tx_run();
+        return;
+    case RTL_CHIPCMD:
+        if ((v & (RTL_CMD_TXEN | RTL_CMD_RXEN)) == (RTL_CMD_TXEN | RTL_CMD_RXEN) && !(C.tnpds_set && C.rdsar_set))
+            C.enabled_before_rings = 1;
+        break;
+    case RTL_ISR0:
+        put(off, w, get(off, w) & ~v); /* write one to clear */
+        return;
+    }
+    put(off, w, v);
+}
+
+static void m_delay(void *ctx, uint32_t us) { (void)ctx, (void)us; }
+static void m_barrier(void *ctx) { (void)ctx; }
+static const rtl_ops OPS = {0, m_read, m_write, m_delay, m_barrier};
+
+/* Fixed registers of a freshly powered chip. */
+static void chip_init(uint8_t *mem, uint64_t dma, size_t len)
+{
+    memset(&C, 0, sizeof C);
+    C.mem = mem;
+    C.dma = dma;
+    C.len = len;
+    C.tcr_id = RTL_TCR_ID_8127 | 0x00100000u; /* CFG_METHOD_2 */
+    put(RTL_TCR, 4, C.tcr_id);
+    /* 0xD2 is 16 bit, so its bit 9 (LL share FIFO ready) is bit 1 of MCUCmd 0xD3 */
+    put(RTL_LLFIFO, 2, 0x0200);
+    C.reg[RTL_MCUCMD] |= RTL_MCU_TXFIFO_EMPTY | RTL_MCU_RXFIFO_EMPTY | RTL_MCU_NOW_IS_OOB;
+    put(RTL_INTRMIT, 2, 0x0103);
+    put(RTL_RXDESC_TYPE, 1, 0x02); /* type 4 left on by a previous owner */
+    put(RTL_TXNOCLOSE_EN, 1, 0);
+    put(RTL_RSS_CTRL, 4, 0x00000f01u);         /* RSS on from a previous owner */
+    put(RTL_Q_NUM_CTRL, 2, 0x0108u | 0x0008u); /* 4 RX queues (bits 4:2 = 2), other bits kept */
+    C.ocp[RTL_OCP_TXDESC_FMT / 2] = 0x8002u;   /* old 16-byte TX descriptor format selected */
+    put(RTL_RXDV_GATE, 1, 0);
+    put(RTL_PHYSTATUS, 2, 0x4000 | RTL_PHYS_LINK | RTL_PHYS_FULLDUP);
+    put(RTL_ISR0, 4, 0x00000085u);
+    put(RTL_IMR0, 4, 0xffffffffu);
+    put(RTL_BACKUP_ADDR0, 4, 0x33221100u ^ 0x01u); /* 00:11:22:33 after the flip below */
+    C.reg[RTL_BACKUP_ADDR0] = 0x48;               /* 48:11:22:33:44:55, unicast */
+    put(RTL_BACKUP_ADDR1, 2, 0x5544u);
+    for (int i = 0; i < 6; i++)
+        C.reg[RTL_MAC0 + i] = (uint8_t)(0xa0 + i);
+}
+
+/* Model receives a frame from the wire: needs a descriptor the chip owns,
+ * writes data + 4-byte FCS and the status word. */
+static int chip_rx(const uint8_t *f, size_t n, uint32_t extra_status, uint32_t force_len)
+{
+    uint8_t *ring = dma_ptr(ring_base(RTL_RDSAR_LO), RTL_RX_N * RTL_RXD_SIZE);
+    if (!ring || !(get(RTL_CHIPCMD, 1) & RTL_CMD_RXEN))
+        return -1;
+    uint8_t *d = ring + (C.rx_hw % RTL_RX_N) * RTL_RXD_SIZE;
+    uint32_t o1 = rd32le(d);
+    if (!(o1 & RTL_DESC_OWN)) {
+        C.rx_overflow++;
+        return -2;
+    }
+    uint32_t size = o1 & RTL_RX_LEN_MASK;
+    uint64_t a = rd32le(d + 8) | (uint64_t)rd32le(d + 12) << 32;
+    uint8_t *b = dma_ptr(a, size);
+    if (!b)
+        return -3;
+    if (n + 4 > size)
+        return -4;
+    memcpy(b, f, n);
+    memset(b + n, 0xcc, 4);
+    uint32_t l = force_len ? force_len : (uint32_t)(n + 4);
+    wr32le(d, RTL_DESC_FS | RTL_DESC_LS | extra_status | l);
+    C.rx_hw++;
+    return 0;
+}
+
+/* ---- helpers ---- */
+static uint8_t *region;
+static const uint64_t DMA = 0x0000004500000000ull; /* above 4 GiB: hi words used */
+
+static rtl_err up(rtl_dev *d)
+{
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    return rtl_init(d, &OPS, region, DMA, RTL_MEM_SIZE);
+}
+
+static void frame_fill(uint8_t *f, size_t n, unsigned seed)
+{
+    for (size_t i = 0; i < n; i++)
+        f[i] = (uint8_t)(seed * 31u + i * 7u);
+}
+
+/* ---- tests ---- */
+static void test_init(void)
+{
+    rtl_dev d;
+    rtl_err e = up(&d);
+    CHECK(e == RTL_OK, "init %s", rtl_err_name(e));
+    CHECK(d.ready && !d.broken, "ready");
+    CHECK(d.mcfg == 2 && !d.ic_unknown, "mcfg %u", d.mcfg);
+    static const uint8_t want[6] = {0x48, 0x11, 0x22, 0x33, 0x44, 0x55};
+    CHECK(memcmp(d.mac, want, 6) == 0 && d.mac_source == RTL_MAC_BACKUP, "mac from backup");
+    CHECK(get(RTL_MAC0, 4) == 0x33221148u && get(RTL_MAC4, 2) == 0x5544u, "rar_set wrote the address");
+    CHECK(C.mac_written_unlocked == 2 && C.mac_written_locked == 0, "MAC written only while Cfg9346 unlocked");
+    CHECK((get(RTL_CFG9346, 1) & RTL_CFG9346_UNLOCK) == 0, "Cfg9346 locked at the end");
+    CHECK(ring_base(RTL_TNPDS_LO) == DMA + RTL_OFF_TXD, "TX ring base");
+    CHECK(ring_base(RTL_RDSAR_LO) == DMA + RTL_OFF_RXD, "RX ring base");
+    CHECK(!C.enabled_before_rings, "TE|RE only after ring bases");
+    CHECK(get(RTL_TCR, 4) == RTL_TCR_VALUE, "TCR 0x%08x", get(RTL_TCR, 4));
+    CHECK(get(RTL_RCR, 4) == (RTL_RCR_CHIP | RTL_RCR_ACCEPT_BCAST | RTL_RCR_ACCEPT_MYPHYS), "RCR");
+    CHECK(get(RTL_RMS, 2) == (RTL_RMS_VALUE | RTL_RMS_VLAN), "RMS");
+    CHECK(get(RTL_TXNOCLOSE_EN, 1) & 0x04, "no-close enabled");
+    CHECK(C.ocp[RTL_OCP_TXDESC_FMT / 2] == 0x8001u, "32-byte TX descriptor format, other bits kept (0x%04x)",
+          C.ocp[RTL_OCP_TXDESC_FMT / 2]);
+    CHECK(get(RTL_RSS_CTRL, 4) == 0, "RSS off");
+    CHECK(get(RTL_Q_NUM_CTRL, 2) == 0x0100u, "one RX queue, other bits kept (0x%04x)", get(RTL_Q_NUM_CTRL, 2));
+    CHECK(!(get(RTL_RXDESC_TYPE, 1) & 0x02), "RX descriptor type 1");
+    CHECK(!(get(RTL_RXDV_GATE, 1) & 0x08), "RX DV gate open");
+    CHECK(get(RTL_IMR0, 4) == 0, "interrupts masked");
+    CHECK(get(RTL_ISR0, 4) == 0, "interrupt status acknowledged");
+    CHECK(!(get(RTL_INT_CFG0, 1) & 0x61), "interrupt type 1");
+    CHECK(get(RTL_CHIPCMD, 1) == (RTL_CMD_TXEN | RTL_CMD_RXEN), "TE|RE");
+    CHECK(!(get(RTL_MCUCMD, 1) & RTL_MCU_NOW_IS_OOB), "now_is_oob cleared");
+    CHECK(C.ocp[0xC0BC / 2] == 0x00FF && C.ocp[0xC0AA / 2] == 0x07D0 && C.ocp[0xC0A6 / 2] == 0x01B5 &&
+              C.ocp[0xC01E / 2] == 0x5555,
+          "exit_oob MAC OCP values");
+    CHECK(C.phy[0xA400 / 2] == 0x1000 && d.phy_state == 3, "PHY powered up, autoneg on");
+    CHECK((get(RTL_PMCH, 1) & 0xC0) == 0xC0, "PLL on");
+    CHECK(C.resets == 2, "two soft resets (exit_oob, hw_reset): %u", C.resets);
+    CHECK(d.wait_timeouts == 0, "no wait ran out: %u", d.wait_timeouts);
+    for (uint32_t i = 0; i < RTL_RX_N; i++) {
+        const uint8_t *x = region + RTL_OFF_RXD + i * RTL_RXD_SIZE;
+        uint32_t o1 = rd32le(x);
+        uint64_t a = rd32le(x + 8) | (uint64_t)rd32le(x + 12) << 32;
+        CHECK((o1 & RTL_DESC_OWN) && (o1 & RTL_RX_LEN_MASK) == RTL_RX_BUF, "RX slot %u posted", i);
+        CHECK(((o1 & RTL_DESC_EOR) != 0) == (i == RTL_RX_N - 1), "EOR only on the last RX slot");
+        CHECK(a == DMA + RTL_OFF_RXBUF + (uint64_t)i * RTL_BUF_STRIDE, "RX buffer address %u", i);
+    }
+    uint32_t mbps = 0;
+    CHECK(rtl_link(&d, &mbps) == 1 && mbps == 10000, "link up 10G");
+    CHECK(C.dma_faults == 0, "no DMA outside the window");
+}
+
+static void test_refusals(void)
+{
+    rtl_dev d;
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    C.absent = 1;
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE) == RTL_E_ABSENT, "absent");
+    CHECK(C.writes == 0, "nothing written to an absent device");
+    CHECK(rtl_tx(&d, (const uint8_t *)"0123456789abcdef", 16) == RTL_E_NOT_READY, "tx before init");
+
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    put(RTL_TCR, 4, 0x54000000u); /* an RTL8125 id */
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE) == RTL_E_CHIP, "wrong chip");
+    CHECK(C.writes == 0, "nothing written to a wrong chip");
+    CHECK(rtl_stop(&d) == RTL_E_NOT_READY && C.writes == 0, "stop writes nothing to a wrong chip");
+
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    put(RTL_TCR, 4, RTL_TCR_ID_8127 | 0x00300000u);
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE) == RTL_OK && d.ic_unknown && d.mcfg == 2, "unknown IC ver");
+
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    C.reset_stuck = 1;
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE) == RTL_E_RESET_TIMEOUT, "reset timeout");
+    CHECK(!d.ready, "not ready after a reset timeout");
+
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    C.fifo_never_empty = 1;
+    put(RTL_MCUCMD, 1, 0);
+    put(RTL_INTRMIT, 2, 0);
+    put(RTL_LLFIFO, 2, 0);
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE) == RTL_OK && d.wait_timeouts == 2 * 2 + 2,
+          "FIFO waits counted, not fatal (vendor ignores them): %u", d.wait_timeouts);
+
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    CHECK(rtl_init(&d, &OPS, region + 16, DMA, RTL_MEM_SIZE) == RTL_E_MEM, "misaligned mem");
+    CHECK(rtl_init(&d, &OPS, region, DMA + 256, RTL_MEM_SIZE) == RTL_E_MEM, "misaligned dma");
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE - 1) == RTL_E_MEM, "short region");
+    CHECK(rtl_init(&d, &OPS, region, 0xfffffffffffff000ull, RTL_MEM_SIZE) == RTL_E_MEM, "bus range wraps");
+    CHECK(C.writes == 0, "no register writes on a bad region");
+    rtl_ops bad = OPS;
+    bad.barrier = 0;
+    CHECK(rtl_init(&d, &bad, region, DMA, RTL_MEM_SIZE) == RTL_E_ARG, "missing op");
+}
+
+static void test_mac_sources(void)
+{
+    rtl_dev d;
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    put(RTL_BACKUP_ADDR0, 4, 0);
+    put(RTL_BACKUP_ADDR1, 2, 0);
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE) == RTL_OK && d.mac_source == RTL_MAC_MAC0 && d.mac[0] == 0xa0,
+          "MAC0 when the backup address is zero");
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    put(RTL_BACKUP_ADDR0, 4, 0x000000ffu); /* multicast */
+    for (int i = 0; i < 6; i++)
+        C.reg[RTL_MAC0 + i] = 0xff;
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE) == RTL_OK && d.mac_source == RTL_MAC_FALLBACK &&
+              (d.mac[0] & 2) && !(d.mac[0] & 1),
+          "locally administered fallback");
+}
+
+static void test_tx(void)
+{
+    rtl_dev d;
+    CHECK(up(&d) == RTL_OK, "up");
+    uint8_t f[RTL_FRAME_MAX];
+    frame_fill(f, sizeof f, 1);
+    CHECK(rtl_tx(&d, f, 13) == RTL_E_ARG && rtl_tx(&d, f, RTL_FRAME_MAX + 1) == RTL_E_ARG, "length bounds");
+    CHECK(rtl_tx(&d, f, 42) == RTL_OK, "short frame");
+    CHECK(C.tx_count == 1 && C.tx_len[0] == 60 && memcmp(C.tx_frames[0], f, 42) == 0, "sent and padded to 60");
+    int zero = 1;
+    for (int i = 42; i < 60; i++)
+        zero &= C.tx_frames[0][i] == 0;
+    CHECK(zero, "padding is zero");
+    CHECK(get(RTL_SW_TAIL0, 4) == 1, "tail moved to 1");
+    unsigned r = 0;
+    CHECK(rtl_tx_reclaim(&d, &r) == RTL_OK && r == 1 && rtl_tx_pending(&d) == 0, "reclaimed 1");
+
+    /* Ring full with completions held back, then released. */
+    C.defer_tx = 1;
+    for (unsigned i = 0; i < RTL_TX_N; i++)
+        CHECK(rtl_tx(&d, f, 100 + i) == RTL_OK, "post %u", i);
+    CHECK(rtl_tx(&d, f, 100) == RTL_E_FULL, "full");
+    CHECK(rtl_tx_reclaim(&d, &r) == RTL_OK && r == 0, "nothing closed yet");
+    C.clo += 5;
+    put(RTL_HW_CLO0, 4, C.clo);
+    CHECK(rtl_tx_reclaim(&d, &r) == RTL_OK && r == 5 && rtl_tx_pending(&d) == RTL_TX_N - 5, "5 closed");
+    C.defer_tx = 0;
+    C.clo += RTL_TX_N - 5;
+    put(RTL_HW_CLO0, 4, C.clo);
+    CHECK(rtl_tx_reclaim(&d, &r) == RTL_OK && rtl_tx_pending(&d) == 0, "all closed");
+
+    /* Many trips around the ring: every frame arrives intact, in order. */
+    unsigned before = C.tx_count, bad = 0;
+    for (unsigned k = 0; k < 200; k++) {
+        size_t n = 60 + (k * 37u) % (RTL_FRAME_MAX - 60);
+        frame_fill(f, n, k);
+        if (rtl_tx(&d, f, n) != RTL_OK) {
+            bad++;
+            continue;
+        }
+        unsigned idx = C.tx_count - 1;
+        if (idx < 64 && (C.tx_len[idx] != n || memcmp(C.tx_frames[idx], f, n) != 0))
+            bad++;
+        if (rtl_tx_reclaim(&d, &r) != RTL_OK || r != 1)
+            bad++;
+        if (C.tx_count >= 64)
+            C.tx_count = 0, before = 0;
+    }
+    (void)before;
+    CHECK(bad == 0, "200 frames around the ring: %u bad", bad);
+    CHECK(C.dma_faults == 0, "TX stayed in the window (faults %u)", C.dma_faults);
+}
+
+static void test_tx_hostile(void)
+{
+    rtl_dev d;
+    CHECK(up(&d) == RTL_OK, "up");
+    uint8_t f[64] = {0};
+    CHECK(rtl_tx(&d, f, 60) == RTL_OK, "tx");
+    C.hostile_clo = 1;
+    CHECK(rtl_tx_reclaim(&d, 0) == RTL_E_DEVICE && d.broken, "close pointer ahead of posted");
+    CHECK(rtl_tx(&d, f, 60) == RTL_E_BROKEN, "sticky on tx");
+    size_t n;
+    int got;
+    uint8_t out[RTL_FRAME_MAX];
+    CHECK(rtl_rx(&d, out, sizeof out, &n, &got) == RTL_E_BROKEN, "sticky on rx");
+    C.hostile_clo = 0;
+    CHECK(rtl_stop(&d) == RTL_OK && !d.ready, "stop");
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE) == RTL_OK && !d.broken, "re-init clears broken");
+
+    /* A close-pointer base the chip did not reset to zero. */
+    chip_init(region, DMA, RTL_MEM_SIZE);
+    C.clo_after_reset = 7;
+    CHECK(rtl_init(&d, &OPS, region, DMA, RTL_MEM_SIZE) == RTL_OK && d.clo_base == 7, "close base 7");
+    unsigned r = 0;
+    CHECK(rtl_tx(&d, f, 60) == RTL_OK && rtl_tx_reclaim(&d, &r) == RTL_OK && r == 1, "reclaim with base 7");
+    CHECK(get(RTL_SW_TAIL0, 4) == 8 && C.tx_count == 1 && C.dma_faults == 0, "tail counts from base 7 (tail %u)",
+          get(RTL_SW_TAIL0, 4));
+    for (unsigned k = 0; k < 3 * RTL_TX_N; k++)
+        if (rtl_tx(&d, f, 60) != RTL_OK || rtl_tx_reclaim(&d, 0) != RTL_OK) {
+            CHECK(0, "round %u with base 7", k);
+            break;
+        }
+    CHECK(C.tx_count == 1 + 3 * RTL_TX_N && C.dma_faults == 0, "three rings of frames with base 7 (%u sent)",
+          C.tx_count);
+}
+
+static void test_rx(void)
+{
+    rtl_dev d;
+    CHECK(up(&d) == RTL_OK, "up");
+    uint8_t f[RTL_FRAME_MAX], out[RTL_FRAME_MAX];
+    size_t n = 0;
+    int got = 1;
+    CHECK(rtl_rx(&d, out, sizeof out, &n, &got) == RTL_OK && !got, "nothing pending");
+    unsigned bad = 0;
+    for (unsigned k = 0; k < 100; k++) {
+        size_t len = 14 + (k * 53u) % (RTL_FRAME_MAX - 14);
+        frame_fill(f, len, k + 7);
+        if (chip_rx(f, len, 0, 0) != 0) {
+            bad++;
+            continue;
+        }
+        if (rtl_rx(&d, out, sizeof out, &n, &got) != RTL_OK || !got || n != len || memcmp(out, f, len) != 0)
+            bad++;
+    }
+    CHECK(bad == 0, "100 frames around the RX ring: %u bad", bad);
+
+    /* Errors, runts and split frames are dropped and the slot reposted. */
+    frame_fill(f, 100, 3);
+    CHECK(chip_rx(f, 100, RTL_RX_RES, 0) == 0, "inject error frame");
+    CHECK(chip_rx(f, 10, 0, 0) == 0, "inject runt");
+    CHECK(chip_rx(f, 100, 0, 0) == 0, "inject good");
+    uint8_t *ring = region + RTL_OFF_RXD;
+    uint32_t slot = (d.rx_cur + 2) % RTL_RX_N; /* the third frame: error, runt, then this one */
+    wr32le(ring + slot * RTL_RXD_SIZE, rd32le(ring + slot * RTL_RXD_SIZE) & ~RTL_DESC_LS); /* not last */
+    uint8_t f2[100];
+    frame_fill(f2, 100, 4);
+    CHECK(chip_rx(f2, 100, 0, 0) == 0, "inject good 2");
+    unsigned dropped = d.rx_dropped;
+    CHECK(rtl_rx(&d, out, sizeof out, &n, &got) == RTL_OK && got && n == 100 && memcmp(out, f2, 100) == 0,
+          "good 2 after drops");
+    CHECK(d.rx_dropped == dropped + 3, "error frame, runt and split frame dropped");
+
+    /* Output buffer smaller than the frame: dropped and reposted, the ring keeps moving. */
+    CHECK(chip_rx(f, 100, 0, 0) == 0, "inject for small cap");
+    dropped = d.rx_dropped;
+    CHECK(rtl_rx(&d, out, 50, &n, &got) == RTL_OK && !got && d.rx_dropped == dropped + 1, "cap too small: dropped");
+    CHECK(chip_rx(f2, 100, 0, 0) == 0, "inject after small cap");
+    CHECK(rtl_rx(&d, out, sizeof out, &n, &got) == RTL_OK && got && n == 100 && memcmp(out, f2, 100) == 0,
+          "next frame still arrives");
+
+    /* Largest frame RMS 1522 lets through: 1518 bytes (VLAN tag) without FCS. */
+    static uint8_t big[RTL_RX_BUF], bigout[RTL_RX_BUF];
+    frame_fill(big, 1518, 9);
+    CHECK(chip_rx(big, 1518, 0, 0) == 0, "inject 1518-byte frame");
+    CHECK(rtl_rx(&d, bigout, sizeof bigout, &n, &got) == RTL_OK && got && n == 1518 && memcmp(bigout, big, 1518) == 0,
+          "1518-byte frame received whole");
+
+    /* Overflow: the chip finds no free slot when the driver never reads. */
+    for (unsigned i = 0; i < RTL_RX_N + 3; i++)
+        chip_rx(f, 64, 0, 0);
+    CHECK(C.rx_overflow == 3, "chip saw 3 overflows");
+    unsigned taken = 0;
+    while (rtl_rx(&d, out, sizeof out, &n, &got) == RTL_OK && got)
+        taken++;
+    CHECK(taken == RTL_RX_N, "driver drained %u", taken);
+    CHECK(chip_rx(f, 64, 0, 0) == 0, "ring usable after drain");
+
+    /* Hostile length: more than the buffer the chip was given. */
+    CHECK(rtl_rx(&d, out, sizeof out, &n, &got) == RTL_OK && got, "drain");
+    CHECK(chip_rx(f, 64, 0, RTL_RX_BUF + 4) == 0, "inject oversize length");
+    CHECK(rtl_rx(&d, out, sizeof out, &n, &got) == RTL_E_DEVICE && d.broken, "oversize length breaks the device");
+    CHECK(C.dma_faults == 0, "RX stayed in the window (faults %u)", C.dma_faults);
+}
+
+/* Seeded random: the chip writes random status words into RX descriptors it
+ * does not own; the driver must never return a length beyond the buffer. */
+static void test_rx_random(void)
+{
+    rtl_dev d;
+    uint8_t out[RTL_FRAME_MAX];
+    unsigned long seed = 0x8127;
+    unsigned breaks = 0, frames = 0;
+    for (unsigned round = 0; round < 2000; round++) {
+        if (up(&d) != RTL_OK) {
+            CHECK(0, "up");
+            return;
+        }
+        for (unsigned k = 0; k < 40; k++) {
+            seed = seed * 6364136223846793005ul + 1442695040888963407ul;
+            uint32_t s = (uint32_t)(seed >> 32) & ~RTL_DESC_OWN;
+            uint32_t i = d.rx_cur % RTL_RX_N;
+            wr32le(region + RTL_OFF_RXD + i * RTL_RXD_SIZE, s);
+            size_t n = 0;
+            int got = 0;
+            rtl_err e = rtl_rx(&d, out, sizeof out, &n, &got);
+            if (e == RTL_E_DEVICE) {
+                breaks++;
+                break;
+            }
+            if (e != RTL_OK || (got && (n > RTL_RX_BUF - 4 || n < 14))) {
+                CHECK(0, "random status 0x%08x gave %s n=%zu", s, rtl_err_name(e), n);
+                return;
+            }
+            frames += (unsigned)got;
+        }
+    }
+    CHECK(breaks > 0 && frames > 0, "random statuses: %u frames, %u breaks", frames, breaks);
+}
+
+static void test_link(void)
+{
+    rtl_dev d;
+    CHECK(up(&d) == RTL_OK, "up");
+    uint32_t m = 1;
+    put(RTL_PHYSTATUS, 2, 0);
+    CHECK(rtl_link(&d, &m) == 0 && m == 0, "down");
+    put(RTL_PHYSTATUS, 2, 0x0400 | RTL_PHYS_LINK);
+    CHECK(rtl_link(&d, &m) == 1 && m == 2500, "2.5G");
+    put(RTL_PHYSTATUS, 2, 0x0010 | RTL_PHYS_LINK);
+    CHECK(rtl_link(&d, &m) == 1 && m == 1000, "1G");
+    put(RTL_PHYSTATUS, 2, 0xffff);
+    CHECK(rtl_link(&d, &m) == 0, "all ones is down");
+}
+
+/* The boot report travels through the driver: every frame the chip puts on
+ * the wire must parse back to the report bytes. */
+static void test_report_over_driver(void)
+{
+    rtl_dev d;
+    CHECK(up(&d) == RTL_OK, "up");
+    static char log[5000];
+    for (size_t i = 0; i < sizeof log; i++)
+        log[i] = (char)('a' + i % 26);
+    unsigned parts = net_report_parts(sizeof log);
+    CHECK(parts == 5, "parts %u", parts);
+    uint8_t fr[1600];
+    C.tx_count = 0;
+    for (unsigned p = 0; p < parts; p++) {
+        size_t n = net_report_frame(NET_REPORT_TAG_SPARK, d.mac, 0x1122334455667788ull, log, sizeof log, p, fr,
+                                    sizeof fr);
+        CHECK(n > 0 && rtl_tx(&d, fr, n) == RTL_OK, "part %u", p);
+        rtl_tx_reclaim(&d, 0);
+    }
+    char back[sizeof log];
+    size_t got = 0;
+    for (unsigned p = 0; p < parts && p < C.tx_count; p++) {
+        net_report_part rp;
+        int rc = net_report_parse(NET_REPORT_TAG_SPARK, C.tx_frames[p], C.tx_len[p], &rp);
+        CHECK(rc == 0 && rp.part == p && rp.parts == parts && rp.total == sizeof log && rp.run == 0x1122334455667788ull,
+              "parse part %u rc=%d", p, rc);
+        if (rc == 0 && rp.offset + rp.len <= sizeof back) {
+            memcpy(back + rp.offset, rp.data, rp.len);
+            got += rp.len;
+        }
+    }
+    CHECK(got == sizeof log && memcmp(back, log, sizeof log) == 0, "report rebuilt from the wire");
+    CHECK(memcmp(C.tx_frames[0], "\xff\xff\xff\xff\xff\xff", 6) == 0 && memcmp(C.tx_frames[0] + 6, d.mac, 6) == 0,
+          "broadcast from the chip's MAC");
+}
+
+int main(void)
+{
+    region = aligned_alloc(4096, RTL_MEM_SIZE);
+    if (!region)
+        return 2;
+    test_init();
+    test_refusals();
+    test_mac_sources();
+    test_tx();
+    test_tx_hostile();
+    test_rx();
+    test_rx_random();
+    test_link();
+    test_report_over_driver();
+    free(region);
+    printf("RTL8127_MODEL: %s (%d checks, %d failures)\n", failures ? "FAIL" : "PASS", checks, failures);
+    return failures ? 1 : 0;
+}
diff --git a/scripts/.crumb b/scripts/.crumb
index 0788b32b..c876b0b4 100644
--- a/scripts/.crumb
+++ b/scripts/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-26T15:49:35Z",
+      "compiled_at": "2026-10-29T19:20:53Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:57c32a0629f9c7717240a2faf06cb6efaa374e386d5756dd184cf8fa208f45c7",
+      "digest": "sha256:1a86df6b3895affd02e0ab968914d2bb18f174bebec8206195c996fa75c71563",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 120,
-      "generated_at_commit": "d70127557fd45192a9f24fc092963f72f15e9e29",
-      "source_tree": "sha256:28a326cb9997df5ea51dc2dba1b5d4375795fe0fe65abe4ece055f4876b9b1dc"
+      "files": 121,
+      "generated_at_commit": "d2d7ff2a7434a3ff7d75d8608bec9274f9f9dbca",
+      "source_tree": "sha256:fb38230244cdb18a2b900d3e82808b24ef0eee9a6595f4fce862d53271a006b9"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/scripts/ck_spark_report_test.sh b/scripts/ck_spark_report_test.sh
new file mode 100755
index 00000000..b0147448
--- /dev/null
+++ b/scripts/ck_spark_report_test.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+# ck_spark_report_test.sh -- host test of the Spark boot report (L198): frames
+# built by native/net/aienos_report.c (tag AIENUX-SPARK-REPORT) for a 40 KiB
+# report, sent out of order and twice over loopback to the shared receiver
+# tools/ck_imac_report_listen.c, which must rebuild it byte for byte as
+# spark-<run>.unauthenticated.txt and still accept the iMac's parts (scripts/ck_imac_report_test.sh).
+# Hosted only; the RTL8127 itself is covered by native/net tests/rtl8127_test.c.
+# Ends with "AIENUX_SPARK_REPORT: PASS" or "AIENUX_SPARK_REPORT: FAIL <why>".
+set -u
+cd "$(dirname "$0")/.."
+K=native/kernel
+N=native/net
+W=$(mktemp -d "${TMPDIR:-/tmp}/ck_spark_report.XXXXXX")
+trap 'kill $LP 2>/dev/null; rm -rf "$W"' EXIT
+LP=
+fail() { echo "AIENUX_SPARK_REPORT: FAIL $*"; exit 1; }
+CC=${HOSTCC:-cc}
+CF="-std=gnu11 -O2 -Wall -Wextra -Werror"
+$CC $CF -o "$W/listen" $K/tools/ck_imac_report_listen.c || fail "listener does not build"
+$CC $CF -o "$W/send" $N/tests/report_send.c $N/aienos_report.c $N/aienos_net.c || fail "sender does not build"
+i=0
+while [ $i -lt 40960 ]; do printf 'spark boot report line %05d\n' $((i / 29)); i=$((i + 29)); done | head -c 40960 > "$W/sent.txt"
+PORT=$((47900 + $$ % 90))
+mkdir -p "$W/out"
+"$W/listen" $PORT "$W/out" 20 &
+LP=$!
+i=0
+until grep -q "^ready port=$PORT" "$W/out/listen.log" 2>/dev/null; do
+    i=$((i + 1)); [ $i -gt 50 ] && fail "listener not ready: $(cat "$W/out/listen.log" 2>/dev/null)"
+    sleep 0.1
+done
+"$W/send" $PORT "$W/sent.txt" >/dev/null || fail "send"
+i=0
+until grep -q "^complete run=fedcba9876543210 " "$W/out/listen.log"; do
+    i=$((i + 1)); [ $i -gt 50 ] && fail "report not completed: $(cat "$W/out/listen.log")"
+    sleep 0.1
+done
+cmp -s "$W/sent.txt" "$W/out/spark-fedcba9876543210.unauthenticated.txt" || fail "rebuilt report differs"
+[ "$(grep -c '^complete ' "$W/out/listen.log")" = 1 ] || fail "report written more than once"
+grep -q '^ignored' "$W/out/listen.log" && fail "listener ignored a valid part"
+echo "AIENUX_SPARK_REPORT: PASS"