Two closing pieces for the SRDX 0.6.0 story. srdx_loopback (sigil-video 1ae6584) runs the complete Video-side frame pipeline in a single QEMU session without a network: fbtap_init → two-tone fill → fb_tap_commit/acquire → srdx_encode_frame (all 6 tiles dirty, shadow=0) → fb_tap_release → srdx_decode_frame to VESA framebuffer → pixel verify. magic=ok, nrects≥1, p_top=blue, p_bot=red — round-trip lossless PASS. srdx_persist.sg (sigil-fs fa0d206) bridges the in-memory SRDX frame ring to a VFS-backed persistence layer so host-advertise records and per-session resume blobs survive restarts — up to 8 sessions, ≤512 bytes each, ext2-backed, full A→F API round-trip PASS.
SRDX loopback: why it matters (1ae6584 — sigil-video)
Before SRDX can ship as a product, the encode/decode round-trip must be verifiable in isolation — without a network, without a remote peer, without a real display. The loopback test closes that loop.
What test_srdx_loopback.sg does:
fbtap_init(320, 240): registers the framebuffer tap at 320×240.- Two-tone fill: fills the top half of the framebuffer with blue, bottom half with red. This creates a predictable, verifiable pattern.
fb_tap_commit(0, 0, 319, 239): commits the full frame as dirty (dirty rect = full screen). Increments seq counter.fb_tap_acquire(): SRDX encode path acquires the buffer. Returns DRAM base (not error code 97 — frame is ready).srdx_encode_frame(): runs the full delta encoder. All 6 tiles are dirty (shadow=0 means no previous frame to diff against — first frame = all tiles dirty). Produces a compressed frame blob with nrects≥1.fb_tap_release(): releases the reader lock so the compositor can commit the next frame.srdx_decode_frame(0x500000): decodes the compressed blob and blits the result to the VESA framebuffer at 0x500000 (visible in QEMU screendump).- Pixel verify: checks
p_top(a pixel from the top half) = blue andp_bot(bottom half) = red. Verifies that the round-trip is lossless — the decoded framebuffer matches the original fill. - magic=ok, nrects≥1, p_top=blue, p_bot=red. SRDX-LOOPBACK-PASS.
What remains for the network leg
The remaining piece is the Cap<NetConn> transport slot. The loopback test confirms the full encode/decode pipeline is correct. When the kernel ships the network transport capability for SRDX (srdx_connect → actual socket), the loopback path slots in cleanly: replace srdx_decode_frame(local_fb) with srdx_send(conn) / srdx_recv(conn) → srdx_decode_frame(remote_fb). The encode/decode code is unchanged.
srdx_persist.sg: VFS-backed session persistence (fa0d206 — sigil-fs)
SRDX sessions have state that should survive a restart: the host advertise record (so remote peers can reconnect without re-scanning) and per-session resume blobs (so an interrupted session can resume from the last acknowledged frame seq, not from scratch).
srdx_persist.sg is the bridge between the in-memory srdx_store frame ring and the VFS. Mount-prefix-configurable at init time. All paths live under /<pfx>/srdx/.
Paths
API
srdx_persist_init(pfx, len): initialize, set the mount prefix, verify the VFS path is writeable.srdx_advertise(port, seq, hostname): write the host_adv record.srdx_load_adv(): read and parse the host_adv record.srdx_session_save(id, blob, len): write a resume blob for sessionid(0–7).srdx_session_load(id, buf, maxlen): read back a session blob.srdx_session_drop(id): delete the session file (session ended cleanly).
Test (srdx_persist_test.sg): mounts an ext2 volume in RAM at prefix "rw". Runs the full A→F round-trip: A=init, B=advertise, C=load_adv (verify matches), D=session_save(0), E=session_load(0) (verify matches), F=session_drop(0). Output: ABCDEF. PASS.
The SRDX 0.6.0 story so far
| Component | Layer | Status |
|---|---|---|
syscalls 109–112 (srdx_connect/send/listen/recv) | kernel | WIRED |
core/fbtap.sg — compositor tap | kernel | PASS |
srdx_encode_frame + delta encoder | video | PASS |
srdx_decode_frame + VESA blit | video | PASS |
test_srdx_loopback — round-trip lossless | video | LOOPBACK-PASS |
kbc-inject — HID reverse channel | drivers | PASS |
gameport / usb-hid-gamepad — gamepad reverse | drivers | PASS |
srdx_persist.sg — VFS session persistence | fs | PASS |
Cap<NetConn> transport (SRDX over real socket) | kernel | 0.6.x |
| RDP/VNC interop fallback layer | kernel/apps | RFC |
| 2→16 node mesh | kernel | 0.7.x |