)]}'
{
  "commit": "f652cd614efdc7c10faea86cdc8da7cd96870aa1",
  "tree": "892c527fee596ea2057a6a2a2bb012e49abf80fa",
  "parents": [
    "de79344abe04cab8fe538cdd0f975f78d941cd24"
  ],
  "author": {
    "name": "Jacques Pienaar",
    "email": "jacques+gh@japienaar.info",
    "time": "Wed Aug 19 17:18:58 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Aug 19 15:18:58 2026 +0000"
  },
  "message": "[mlir][IR] Add transient scope support for resettable MLIRContext. (#217320)\n\nWe have cases where we have many context being used to compile\nindependent modules. Creating a context per ends up being rather\nexpensive and the only reason to not reuse contexts more is bloat over\ntime. This changes adds a \"transient\" scope which can be used for such\ncases. Initially I had tried a \"cheap fork\" approach for contexts, this\nis complimentary to that (that one allows for independent contexts\ncheaply), while this one is less invasive.\n\nIntroduce an overlay/layered state architecture in StorageUniquer and\nMLIRContext to enable efficient scoping and rollback of transient types,\nattributes, affine expressions, and distinct attributes added since\nentering a transient scope.\n\nWhen executing repeated compilation passes or running in long-lived\ncompiler services (e.g. JITs, servers, REPLs), allocating and destroying\nan MLIRContext incurs significant overhead (~3.7 ms per context) to\nre-register and load dialects. This change allows freezing an\ninitialized context as a base state and rolling back transient\ntypes/attributes in O(1) time without re-instantiating dialects or\nbuiltins.\n\nAssisted-By: Gemini",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6ab08d435f4b201e3d1a1098f14484fcc086deb2",
      "old_mode": 33188,
      "old_path": "mlir/docs/Bindings/Python.md",
      "new_id": "d04e266368cd1219eec59915fa4406b18c613540",
      "new_mode": 33188,
      "new_path": "mlir/docs/Bindings/Python.md"
    },
    {
      "type": "modify",
      "old_id": "71a674aacc5c0f27042ab45fd8e2522739ab3e4f",
      "old_mode": 33188,
      "old_path": "mlir/docs/CAPI.md",
      "new_id": "3f7f01740bf955b64b8b11cb0b29247a4d31e161",
      "new_mode": 33188,
      "new_path": "mlir/docs/CAPI.md"
    },
    {
      "type": "modify",
      "old_id": "5d9744462a4b1a0e1e219e36472f5d24fd847f2c",
      "old_mode": 33188,
      "old_path": "mlir/docs/DefiningDialects/AttributesAndTypes.md",
      "new_id": "18c24d6f431b6364d850c5982a55e9984a2a98ed",
      "new_mode": 33188,
      "new_path": "mlir/docs/DefiningDialects/AttributesAndTypes.md"
    },
    {
      "type": "modify",
      "old_id": "ac8ffbaf028b099c7804043586ebb95cfa01765d",
      "old_mode": 33188,
      "old_path": "mlir/include/mlir-c/IR.h",
      "new_id": "866d90e621384b399d8b1ede960a28d68b03a12f",
      "new_mode": 33188,
      "new_path": "mlir/include/mlir-c/IR.h"
    },
    {
      "type": "modify",
      "old_id": "12cd00b60215e63c87b3d1525fdb6cb939f9e4e6",
      "old_mode": 33188,
      "old_path": "mlir/include/mlir/IR/MLIRContext.h",
      "new_id": "ce195518066d95c19dccfde09e5be279ca5af61b",
      "new_mode": 33188,
      "new_path": "mlir/include/mlir/IR/MLIRContext.h"
    },
    {
      "type": "modify",
      "old_id": "b5f4df680ac698a3ab78d1f1f7a0cc7a9e445b61",
      "old_mode": 33188,
      "old_path": "mlir/include/mlir/Support/StorageUniquer.h",
      "new_id": "39018ebba106f9d9b64fb08ae7050b542a55068e",
      "new_mode": 33188,
      "new_path": "mlir/include/mlir/Support/StorageUniquer.h"
    },
    {
      "type": "modify",
      "old_id": "a1f88ec609e865fe128a05cec7141f2ba57ae8ed",
      "old_mode": 33188,
      "old_path": "mlir/include/mlir/Support/ThreadLocalCache.h",
      "new_id": "66041638b89a2484c4e0f515c8d122fbbba5c02a",
      "new_mode": 33188,
      "new_path": "mlir/include/mlir/Support/ThreadLocalCache.h"
    },
    {
      "type": "modify",
      "old_id": "40633505bd0964fdc65a4eede10e99a8a9aad28b",
      "old_mode": 33188,
      "old_path": "mlir/lib/Bindings/Python/IRCore.cpp",
      "new_id": "a19a2c8b1c7f6c5661c6d00ff8997d624ed7001d",
      "new_mode": 33188,
      "new_path": "mlir/lib/Bindings/Python/IRCore.cpp"
    },
    {
      "type": "modify",
      "old_id": "ef730b26cdd5d833781cac21f957f1a245178a89",
      "old_mode": 33188,
      "old_path": "mlir/lib/CAPI/IR/IR.cpp",
      "new_id": "f862efa420daa0db86fc66be42176c47ab98d661",
      "new_mode": 33188,
      "new_path": "mlir/lib/CAPI/IR/IR.cpp"
    },
    {
      "type": "modify",
      "old_id": "4b7e7dd5677e88ec139ba84b60770319bd9b1e2d",
      "old_mode": 33188,
      "old_path": "mlir/lib/IR/AttributeDetail.h",
      "new_id": "7da5f38d2e94047005d1a2e4e31f72c6eba29b0a",
      "new_mode": 33188,
      "new_path": "mlir/lib/IR/AttributeDetail.h"
    },
    {
      "type": "modify",
      "old_id": "da891a7e6e014ef9939df184737884419289d4ad",
      "old_mode": 33188,
      "old_path": "mlir/lib/IR/MLIRContext.cpp",
      "new_id": "06da14504a293600d45d2f7c4d4e60c8223ed2ec",
      "new_mode": 33188,
      "new_path": "mlir/lib/IR/MLIRContext.cpp"
    },
    {
      "type": "modify",
      "old_id": "ef7f19b9918d9c9d294c6e601eb381392b7f3885",
      "old_mode": 33188,
      "old_path": "mlir/lib/Support/StorageUniquer.cpp",
      "new_id": "1de660c22328f79fd3684c4e2e77b010aefa14a5",
      "new_mode": 33188,
      "new_path": "mlir/lib/Support/StorageUniquer.cpp"
    },
    {
      "type": "modify",
      "old_id": "886f38a6bf793c234155955d30c6a408b3b2cde4",
      "old_mode": 33188,
      "old_path": "mlir/python/mlir/_mlir_libs/__init__.py",
      "new_id": "a8b28a1d206781ce3c7481c8b53329cb32c17ec7",
      "new_mode": 33188,
      "new_path": "mlir/python/mlir/_mlir_libs/__init__.py"
    },
    {
      "type": "modify",
      "old_id": "caa6019e9e220b868aed5efebbe5075f875dd8fa",
      "old_mode": 33188,
      "old_path": "mlir/test/CAPI/ir.c",
      "new_id": "3e1e5f9d43d3c3d7aaf93e0dccddb6c44d8ae6b7",
      "new_mode": 33188,
      "new_path": "mlir/test/CAPI/ir.c"
    },
    {
      "type": "modify",
      "old_id": "230db8277c8e7802390d205da68522303fc8ae18",
      "old_mode": 33188,
      "old_path": "mlir/test/python/ir/context_lifecycle.py",
      "new_id": "e8f1c86023147d897e9b9118a66e06bf22f15ecc",
      "new_mode": 33188,
      "new_path": "mlir/test/python/ir/context_lifecycle.py"
    },
    {
      "type": "modify",
      "old_id": "5d9f9ceee97f3b849a5c22038b203ed575dd3085",
      "old_mode": 33188,
      "old_path": "mlir/test/python/ir/context_managers.py",
      "new_id": "3a7410ef293ab7a983d62780a4e5510a228ef733",
      "new_mode": 33188,
      "new_path": "mlir/test/python/ir/context_managers.py"
    },
    {
      "type": "modify",
      "old_id": "f5b522bb5cf22b138542d814ab390ada24ecd8ce",
      "old_mode": 33188,
      "old_path": "mlir/unittests/IR/CMakeLists.txt",
      "new_id": "560f10eb9815b3b641d09a36a4907fb50bd1de56",
      "new_mode": 33188,
      "new_path": "mlir/unittests/IR/CMakeLists.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "44427d1cae3be9a62d1332e67466f9a6b6491aba",
      "new_mode": 33188,
      "new_path": "mlir/unittests/IR/MLIRContextResetTest.cpp"
    },
    {
      "type": "modify",
      "old_id": "6db6783bb89f935b96868262417dfea71185046b",
      "old_mode": 33188,
      "old_path": "mlir/unittests/Support/StorageUniquerTest.cpp",
      "new_id": "f811a433713ddae8575079a5d5ef359a37c8816d",
      "new_mode": 33188,
      "new_path": "mlir/unittests/Support/StorageUniquerTest.cpp"
    }
  ]
}
