{
  "version": 1,
  "language": "en",
  "title": "A block table maps a logical KV position",
  "description": "In this example, P=4 and Bᵣ=[5,2,8]. Logical positions map through a block-table entry to a physical KV block and offset. The p=6 lookup gives L1, physical block 2, offset 2. The free block pool has a separate allocation lifetime. It is not part of lookup.",
  "caption": "In this example, P=4 and B_r=[5,2,8]. Position p=6 maps to logical block 1, physical block 2 and offset 2. Lookup does not change the separate free pool. Allocation and reclamation of unreferenced blocks are different operations. The author made this explanatory diagram.",
  "alt": "PagedAttention flow: with P=4 and Bᵣ=[5,2,8], lookup p=6 gives logical block L1, physical KV block 2 and offset 2.",
  "sources": [
    {
      "path": "content/blog/2026-06-11_life-of-a-request-vllm/post.md",
      "sha256": "158aa77041646bca8aba059344c4b6b0a6b451329b4a423e9c8027db8ba0304a",
      "description": "Current article explanation, equations, assumptions and retained citations."
    },
    {
      "path": "research/dynamic-mechanisms-2026-10-21/before/content/blog/2026-06-11_life-of-a-request-vllm/illustrations/03-paged-kv-algorithm.svg",
      "sha256": "9ddb96f441b67cc36551e37c61de89a56f8ade20fefeebbad979a5db172cc40d",
      "description": "Frozen prior illustration; exact pre-migration bytes retained."
    },
    {
      "path": "content/blog/2026-06-11_life-of-a-request-vllm/illustrations/source-notes.json",
      "description": "Existing article illustration provenance, retained unchanged."
    }
  ],
  "limitations": [
    "The execution is an example. Playback duration is not measured runtime."
  ],
  "targets": {
    "logical0": {
      "id": "mechanism-logical0",
      "kind": "node",
      "label": "L0: 0 1 2 3"
    },
    "table0": {
      "id": "mechanism-table0",
      "kind": "node",
      "label": "0 → 5"
    },
    "physical0": {
      "id": "mechanism-physical0",
      "kind": "node",
      "label": "#5: 0 1 2 3"
    },
    "lookup0": {
      "id": "mechanism-lookup0",
      "kind": "edge",
      "label": "lookup0"
    },
    "physical-map0": {
      "id": "mechanism-physical-map0",
      "kind": "edge",
      "label": "physical-map0"
    },
    "logical1": {
      "id": "mechanism-logical1",
      "kind": "node",
      "label": "L1: 4 5 6 7"
    },
    "table1": {
      "id": "mechanism-table1",
      "kind": "node",
      "label": "1 → 2"
    },
    "physical1": {
      "id": "mechanism-physical1",
      "kind": "node",
      "label": "#2: 4 5 6 7"
    },
    "lookup1": {
      "id": "mechanism-lookup1",
      "kind": "edge",
      "label": "lookup1"
    },
    "physical-map1": {
      "id": "mechanism-physical-map1",
      "kind": "edge",
      "label": "physical-map1"
    },
    "logical2": {
      "id": "mechanism-logical2",
      "kind": "node",
      "label": "L2: 8 9 10 11"
    },
    "table2": {
      "id": "mechanism-table2",
      "kind": "node",
      "label": "2 → 8"
    },
    "physical2": {
      "id": "mechanism-physical2",
      "kind": "node",
      "label": "#8: 8 9 10 11"
    },
    "lookup2": {
      "id": "mechanism-lookup2",
      "kind": "edge",
      "label": "lookup2"
    },
    "physical-map2": {
      "id": "mechanism-physical-map2",
      "kind": "edge",
      "label": "physical-map2"
    },
    "pool": {
      "id": "mechanism-pool",
      "kind": "node",
      "label": "Free block pool"
    }
  },
  "stateLabels": {
    "stage": "Stage",
    "artifact": "Artifact"
  },
  "scenarios": [
    {
      "id": "address-p6",
      "title": "Find one existing cache address",
      "description": "This example maps one existing cache address.",
      "initial": {
        "stage": "Prepared",
        "artifact": "Inputs kept"
      },
      "unselected": [],
      "steps": [
        {
          "title": "Calculate logical block and offset",
          "description": "Calculate the logical block and offset.",
          "duration": 3000,
          "active": [
            "logical1"
          ],
          "paths": [],
          "state": {
            "stage": "Calculate logical block and offset",
            "artifact": "floor(6 / 4) = 1; offset = 2"
          }
        },
        {
          "title": "Read the block table",
          "description": "Read the block-table entry.",
          "duration": 3000,
          "active": [
            "table1"
          ],
          "paths": [
            "lookup1"
          ],
          "state": {
            "stage": "Read the block table",
            "artifact": "Bᵣ[1] = 2"
          }
        },
        {
          "title": "Calculate physical K/V address",
          "description": "Calculate the physical K/V address.",
          "duration": 3000,
          "active": [
            "physical1"
          ],
          "paths": [
            "physical-map1"
          ],
          "state": {
            "stage": "Calculate physical K/V address",
            "artifact": "Physical block 2, offset 2. Allocation is not necessary."
          }
        }
      ]
    }
  ]
}
