{
  "experiment": "T0-day45-mixed-source-passthrough",
  "date": "2026-12-01",
  "construction": "3 sources x 5 pages; A healthy 5-level outline, B zero outline (never set), C healthy 5-level outline; merged A+B+C = 15 pages; benchmark = 10 rows (A5 at pages 1-5, B0, C5 at pages 11-15)",
  "honest_rule": "row counts and pages read back from the saved merged files; nothing repaired",
  "pypdf_version": "6.20.0",
  "pymupdf_version": "PyMuPDF 1.28.2: Python bindings for the MuPDF 1.28.2 library.\nPython 3.12 running on linux (64-bit).\n",
  "source_readback": {
    "A": {
      "label": "A",
      "bookmarks": 5,
      "rows": [
        {
          "depth": 1,
          "title": "A Chapter",
          "page": 1
        },
        {
          "depth": 2,
          "title": "A Section",
          "page": 2
        },
        {
          "depth": 3,
          "title": "A Sub",
          "page": 3
        },
        {
          "depth": 4,
          "title": "A Sub-Sub",
          "page": 4
        },
        {
          "depth": 5,
          "title": "A Deep",
          "page": 5
        }
      ],
      "expected": 5
    },
    "B": {
      "label": "B",
      "bookmarks": 0,
      "rows": [],
      "expected": 0
    },
    "C": {
      "label": "C",
      "bookmarks": 5,
      "rows": [
        {
          "depth": 1,
          "title": "C Chapter",
          "page": 1
        },
        {
          "depth": 2,
          "title": "C Section",
          "page": 2
        },
        {
          "depth": 3,
          "title": "C Sub",
          "page": 3
        },
        {
          "depth": 4,
          "title": "C Sub-Sub",
          "page": 4
        },
        {
          "depth": 5,
          "title": "C Deep",
          "page": 5
        }
      ],
      "expected": 5
    }
  },
  "pypdf_append": {
    "merge_offsets": {
      "A": 0,
      "B": 5,
      "C": 10
    },
    "bookmarks_out": 10,
    "rows": [
      {
        "depth": 1,
        "title": "A Chapter",
        "page": 1
      },
      {
        "depth": 2,
        "title": "A Section",
        "page": 2
      },
      {
        "depth": 3,
        "title": "A Sub",
        "page": 3
      },
      {
        "depth": 4,
        "title": "A Sub-Sub",
        "page": 4
      },
      {
        "depth": 5,
        "title": "A Deep",
        "page": 5
      },
      {
        "depth": 1,
        "title": "C Chapter",
        "page": 11
      },
      {
        "depth": 2,
        "title": "C Section",
        "page": 12
      },
      {
        "depth": 3,
        "title": "C Sub",
        "page": 13
      },
      {
        "depth": 4,
        "title": "C Sub-Sub",
        "page": 14
      },
      {
        "depth": 5,
        "title": "C Deep",
        "page": 15
      }
    ],
    "checks": [
      {
        "depth": 1,
        "title": "A Chapter",
        "page": 1,
        "expected_page": 1,
        "page_match": true,
        "text_match": true
      },
      {
        "depth": 2,
        "title": "A Section",
        "page": 2,
        "expected_page": 2,
        "page_match": true,
        "text_match": true
      },
      {
        "depth": 3,
        "title": "A Sub",
        "page": 3,
        "expected_page": 3,
        "page_match": true,
        "text_match": true
      },
      {
        "depth": 4,
        "title": "A Sub-Sub",
        "page": 4,
        "expected_page": 4,
        "page_match": true,
        "text_match": true
      },
      {
        "depth": 5,
        "title": "A Deep",
        "page": 5,
        "expected_page": 5,
        "page_match": true,
        "text_match": true
      },
      {
        "depth": 1,
        "title": "C Chapter",
        "page": 11,
        "expected_page": 11,
        "page_match": true,
        "text_match": true
      },
      {
        "depth": 2,
        "title": "C Section",
        "page": 12,
        "expected_page": 12,
        "page_match": true,
        "text_match": true
      },
      {
        "depth": 3,
        "title": "C Sub",
        "page": 13,
        "expected_page": 13,
        "page_match": true,
        "text_match": true
      },
      {
        "depth": 4,
        "title": "C Sub-Sub",
        "page": 14,
        "expected_page": 14,
        "page_match": true,
        "text_match": true
      },
      {
        "depth": 5,
        "title": "C Deep",
        "page": 15,
        "expected_page": 15,
        "page_match": true,
        "text_match": true
      }
    ],
    "all_pages_match": true
  },
  "pymupdf_insert_pdf": {
    "bookmarks_out": 0,
    "rows": [],
    "file": "/tmp/d45/merged_pymupdf.pdf"
  },
  "pymupdf_set_toc_fix": {
    "bookmarks_out": 10,
    "rows": [
      [
        1,
        "A Chapter",
        1
      ],
      [
        2,
        "A Section",
        2
      ],
      [
        3,
        "A Sub",
        3
      ],
      [
        4,
        "A Sub-Sub",
        4
      ],
      [
        5,
        "A Deep",
        5
      ],
      [
        1,
        "C Chapter",
        11
      ],
      [
        2,
        "C Section",
        12
      ],
      [
        3,
        "C Sub",
        13
      ],
      [
        4,
        "C Sub-Sub",
        14
      ],
      [
        5,
        "C Deep",
        15
      ]
    ],
    "expected_rows_pages": [
      1,
      2,
      3,
      4,
      5,
      11,
      12,
      13,
      14,
      15
    ],
    "all_on_correct_pages": true
  },
  "summary": {
    "pypdf_append_bookmarks_out": 10,
    "pymupdf_insert_pdf_bookmarks_out": 0,
    "pymupdf_fix_bookmarks_out": 10,
    "benchmark": 10
  }
}