{
  "slug": "zero-copy-source-lifetime",
  "title": "Linux zero-copy source lifetime: eight file-to-pipe checks",
  "summary": "40 file-to-pipe observations, plus 10 separate tee(2) checks, distinguish source stability from enqueue and consumer completion.",
  "published": "2026-10-18",
  "updated": "2026-10-18",
  "method": "Sequential one-page file-to-pipe tests; source mutation finishes before pipe consumption except the consume-first control.",
  "limits": [
    "One host and filesystem-magic label; not a filesystem comparison.",
    "Synthetic A/B/C payloads; measured API observations, not storage-fleet statistics.",
    "No TCP, MSG_ZEROCOPY, crash, power-loss, throughput or cache-eviction test.",
    "Mutation cases intentionally violate the documented sendfile source-lifetime requirement.",
    "A different supported path may copy data; post-mutation B/C results are observations, not a universal API guarantee."
  ],
  "license": "Hesela's original harness, generated observations and derived CSV are dedicated under CC0-1.0. Linked documentation and Linux source retain their own licenses and are not redistributed.",
  "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/",
  "downloadPath": "/data/zero-copy-source-lifetime.csv",
  "rawPath": "/research/zero-copy-lifetime.json",
  "codePath": "/research/zero-copy-lifetime.py",
  "generatorPath": "/research/build-zero-copy-dataset.py",
  "testsPath": "/research/test_zero_copy_lifetime.py",
  "validationTestsPath": "/research/test_zero_copy_dataset.py",
  "humanPage": "https://hesela.com/analyses/zero-copy-source-lifetime/",
  "rowCount": 40,
  "columns": [
    {
      "name": "repetition",
      "description": "Sequential repetition number; not an independent fleet sample."
    },
    {
      "name": "case",
      "description": "Named sequence defined by the Python harness."
    },
    {
      "name": "page_bytes",
      "description": "Requested and received payload length in bytes."
    },
    {
      "name": "enqueue_bytes",
      "description": "Successful file-to-pipe or buffered pipe-write return value in bytes."
    },
    {
      "name": "received_byte",
      "description": "Uniform ASCII byte observed at pipe consumption."
    },
    {
      "name": "path_byte",
      "description": "Uniform ASCII byte read by opening the source pathname after the operation."
    },
    {
      "name": "old_inode_byte",
      "description": "Uniform ASCII byte read through the original writable descriptor."
    },
    {
      "name": "path_same_inode",
      "description": "Whether device and inode identity still match the initial source."
    },
    {
      "name": "matches_before",
      "description": "Whether received SHA-256 equals the hash computed before enqueue."
    }
  ],
  "rows": [
    {
      "repetition": 1,
      "case": "buffered-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    },
    {
      "repetition": 1,
      "case": "sendfile-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 1,
      "case": "splice-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 1,
      "case": "sendfile-overwrite-fsync",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 1,
      "case": "sendfile-replace-path",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "A",
      "path_same_inode": false,
      "matches_before": true
    },
    {
      "repetition": 1,
      "case": "sendfile-replace-then-write-old",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "C",
      "path_byte": "B",
      "old_inode_byte": "C",
      "path_same_inode": false,
      "matches_before": false
    },
    {
      "repetition": 1,
      "case": "sendfile-close-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 1,
      "case": "sendfile-consume-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    },
    {
      "repetition": 2,
      "case": "buffered-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    },
    {
      "repetition": 2,
      "case": "sendfile-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 2,
      "case": "splice-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 2,
      "case": "sendfile-overwrite-fsync",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 2,
      "case": "sendfile-replace-path",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "A",
      "path_same_inode": false,
      "matches_before": true
    },
    {
      "repetition": 2,
      "case": "sendfile-replace-then-write-old",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "C",
      "path_byte": "B",
      "old_inode_byte": "C",
      "path_same_inode": false,
      "matches_before": false
    },
    {
      "repetition": 2,
      "case": "sendfile-close-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 2,
      "case": "sendfile-consume-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    },
    {
      "repetition": 3,
      "case": "buffered-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    },
    {
      "repetition": 3,
      "case": "sendfile-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 3,
      "case": "splice-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 3,
      "case": "sendfile-overwrite-fsync",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 3,
      "case": "sendfile-replace-path",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "A",
      "path_same_inode": false,
      "matches_before": true
    },
    {
      "repetition": 3,
      "case": "sendfile-replace-then-write-old",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "C",
      "path_byte": "B",
      "old_inode_byte": "C",
      "path_same_inode": false,
      "matches_before": false
    },
    {
      "repetition": 3,
      "case": "sendfile-close-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 3,
      "case": "sendfile-consume-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    },
    {
      "repetition": 4,
      "case": "buffered-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    },
    {
      "repetition": 4,
      "case": "sendfile-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 4,
      "case": "splice-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 4,
      "case": "sendfile-overwrite-fsync",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 4,
      "case": "sendfile-replace-path",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "A",
      "path_same_inode": false,
      "matches_before": true
    },
    {
      "repetition": 4,
      "case": "sendfile-replace-then-write-old",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "C",
      "path_byte": "B",
      "old_inode_byte": "C",
      "path_same_inode": false,
      "matches_before": false
    },
    {
      "repetition": 4,
      "case": "sendfile-close-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 4,
      "case": "sendfile-consume-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    },
    {
      "repetition": 5,
      "case": "buffered-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    },
    {
      "repetition": 5,
      "case": "sendfile-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 5,
      "case": "splice-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 5,
      "case": "sendfile-overwrite-fsync",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 5,
      "case": "sendfile-replace-path",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "A",
      "path_same_inode": false,
      "matches_before": true
    },
    {
      "repetition": 5,
      "case": "sendfile-replace-then-write-old",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "C",
      "path_byte": "B",
      "old_inode_byte": "C",
      "path_same_inode": false,
      "matches_before": false
    },
    {
      "repetition": 5,
      "case": "sendfile-close-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "B",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": false
    },
    {
      "repetition": 5,
      "case": "sendfile-consume-then-overwrite",
      "page_bytes": 4096,
      "enqueue_bytes": 4096,
      "received_byte": "A",
      "path_byte": "B",
      "old_inode_byte": "B",
      "path_same_inode": true,
      "matches_before": true
    }
  ],
  "environment": {
    "kernel": "6.8.0-146-generic",
    "machine": "x86_64",
    "python": "3.12.3",
    "filesystem_magic_label": "ext2/ext3"
  },
  "generatedAt": "2026-10-17T22:22:27.547266+00:00",
  "repetitions": 5,
  "citations": [
    {
      "id": "sendfile",
      "title": "Linux man-pages 6.19: sendfile(2), return value and source lifetime",
      "url": "https://man7.org/linux/man-pages/man2/sendfile.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "splice",
      "title": "Linux man-pages 6.19: splice(2), pipe buffers and flags",
      "url": "https://man7.org/linux/man-pages/man2/splice.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "filemap",
      "title": "Linux v6.8 mm/filemap.c: splice_folio_into_pipe and filemap_splice_read",
      "url": "https://github.com/torvalds/linux/blob/v6.8/mm/filemap.c#L2614-L2758",
      "accessed": "2026-10-17"
    },
    {
      "id": "rename",
      "title": "Linux man-pages 6.19: rename(2), replacement and open descriptors",
      "url": "https://man7.org/linux/man-pages/man2/rename.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "fsync",
      "title": "Linux man-pages 6.19: fsync(2), synchronization and directory entries",
      "url": "https://man7.org/linux/man-pages/man2/fsync.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "copy-path",
      "title": "Linux 6.12 documentation: splice and pipes, copy_splice_read",
      "url": "https://docs.kernel.org/6.12/filesystems/splice.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "msg-zerocopy",
      "title": "Linux kernel documentation: MSG_ZEROCOPY, notifications and deferred copies",
      "url": "https://docs.kernel.org/networking/msg_zerocopy.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "tee",
      "title": "Linux man-pages 6.19: tee(2), duplication without consuming and shared references",
      "url": "https://www.man7.org/linux/man-pages/man2/tee.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "io-lite",
      "title": "Pai, Druschel and Zwaenepoel: IO-Lite, OSDI 1999, sections 2.1, 2.5, 2.9 and 3",
      "url": "https://www.usenix.org/legacy/publications/library/proceedings/osdi99/full_papers/pai/pai_html/pai.html",
      "accessed": "2026-10-18"
    }
  ],
  "supplement": {
    "title": "tee(2) split-consumer observations",
    "rawPath": "/research/tee-source-lifetime.json",
    "codePath": "/research/tee-source-lifetime.py",
    "testsPath": "/research/test_tee_lifetime.py",
    "rowCount": 10,
    "sha256": {
      "tee-source-lifetime.json": "9b8254fee364d88b9a6910ee292dcb85532d5f5c19458899435fea6b12d02858",
      "tee-source-lifetime.py": "54c8a96b7d07ccccd510eedf513a545f3f48c8a0bbfc58107ae00fb08193261a",
      "test_tee_lifetime.py": "03675f358ec18789f701610f1f750551312cae39182fb83dd184753d016bb539"
    }
  },
  "sha256": {
    "raw": "e2a6d276726e89b64a66e20aef642e06782785aeef5c5832f194f1b05b585454",
    "csv": "e3e547f949a54fe8aa871df17291d4dbd1ae57e77dceb791b1bb5946dde68af0",
    "harness": "b67fb20a42c36fa650d83815895df8a980ad023beec0cb21029c59dd8915da39",
    "tests": "e2f5576dcf07fb31f4d34f6b3bd60ccecd59e41a25caed48fe575058af9dd308",
    "generator": "bf0fb7e7c445eddc0e1e60e5e4617f37b36e7b0b1867b6119916be0619db53db",
    "validationTests": "18fb12a7cdf6250923e8a60f5a2c421c96c97d30d069561a5c7ed5c00b050ffa"
  }
}
