🤖 AI Summary
CognitionAI open-sourced blockdiff, a compact Rust tool and .bdiff file format that produces instant, block-level diffs and incremental snapshots for VM disk images. Built to power their otterlink hypervisor (used for their Devin coding VMs), blockdiff reduces snapshot creation from EC2-style tens of minutes to metadata-only operations taking milliseconds — e.g., a 20 GB snapshot created in ~200 ms — enabling fast forks, rollbacks, and sleep/wake with much smaller transfers and storage overhead. The project is available at github.com/CognitionAI/blockdiff.
Technically, blockdiff relies on filesystem metadata rather than scanning file contents: it reads file extent maps via the FIEMAP syscall, computes which logical extents of a target VM image differ from a base image, and emits a .bdiff that lists ranges and then points to the differing blocks. By leveraging Linux copy-on-write support (reflink) on XFS, the snapshot creation and apply operations are mostly “rewiring” of extents, not block copying, so the VM sees zero runtime overhead. The format is simple (header + ranges + padded data), implemented in a few hundred Rust lines, and purposely avoids slower alternatives (binary diffs, OverlayFS, ZFS, qcow2). Practical caveat: it requires a reflink-capable host filesystem and works with raw disk images.
Loading comments...
login to comment
loading comments...
no comments yet