)]}'
{
  "commit": "c8772b09da35d22de6845bdbd20611759d1445ca",
  "tree": "7f1cb759df9e8f10d678e43c8551679c859eade6",
  "parents": [
    "c96508349d9f121957292308c646b4a1fd53c507"
  ],
  "author": {
    "name": "Valentin Churavy",
    "email": "v.churavy@gmail.com",
    "time": "Fri Jun 12 21:35:41 2026 +0200"
  },
  "committer": {
    "name": "Valentin Churavy",
    "email": "v.churavy@gmail.com",
    "time": "Fri Jun 12 21:35:41 2026 +0200"
  },
  "message": "Support Julia 1.13\u0027s julia.atomicmodify pseudo-intrinsic\n\nJulia 1.13 (JuliaLang/julia#57010) emits atomic modify operations on\ninteger-typed pointer-free fields as a variadic pseudo-intrinsic\n\n  {old, new} \u003d julia.atomicmodify.iN.pAS(ptr, op, ordering, syncscope,\n                                         args...)\n\nwhich atomically performs old \u003d *ptr; new \u003d op(old, args...);\n*ptr \u003d new, and is only expanded to atomicrmw/cmpxchg by Julia\u0027s\nExpandAtomicModify pass after GC lowering. Previously these calls hit\nthe generic call differentiation path, which rejects variadic calls\nwith \"Number of arg operands !\u003d function parameters\".\n\nTypeAnalysis: unify the pointee of ptr with both result elements and\nanalyze op interprocedurally, relating the forwarded arguments with the\nmodified memory. This in particular lets activity analysis prove\natomic counter/lock manipulations inactive.\n\nAdjointGenerator: keep the pseudo-intrinsic intact in generated code\n(it must survive until Julia\u0027s expansion pass) and handle it akin to\natomicrmw:\n- fully inactive calls are replayed via the constant fallback,\n- non-differentiable (integer/pointer) modifications within duplicated\n  memory are replicated on the shadow location with the primal\n  arguments, keeping counters and lock states of shadow objects\n  consistent,\n- in forward mode, ops recognized as linear in (old, value)\n  (fadd/fsub/xchg through bitcasts) compute the tangent by applying the\n  same op to the shadow location and shadow value,\n- in reverse mode (with inactive result), fadd/fsub accumulate the\n  adjoint of the value operand from a load of the shadow location with\n  downgraded ordering (negated for fsub),\n- everything else reports \"Active atomic modify not yet handled\".\n\nCo-Authored-By: Claude Fable 5 \u003cnoreply@anthropic.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9bf8dc0885add674d6e76052d434fe7c06914670",
      "old_mode": 33188,
      "old_path": "enzyme/Enzyme/CallDerivatives.cpp",
      "new_id": "38700762387bddf744a6d814bb4d4e27401a4b51",
      "new_mode": 33188,
      "new_path": "enzyme/Enzyme/CallDerivatives.cpp"
    },
    {
      "type": "modify",
      "old_id": "68f8183e7565dcdc39f53bd9dba2df0c992c46da",
      "old_mode": 33188,
      "old_path": "enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp",
      "new_id": "70c6d3b39f1bf0524b780486f26d677fe747e1c3",
      "new_mode": 33188,
      "new_path": "enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "02f6a66b55de50830f5651d6c771e9d6cb71628d",
      "new_mode": 33188,
      "new_path": "enzyme/test/Enzyme/ForwardMode/jlatomicmodify.ll"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "86ce80a22ca2c6137817bcb90e674b09a9e1f5f6",
      "new_mode": 33188,
      "new_path": "enzyme/test/Enzyme/ReverseMode/jlatomicmodify.ll"
    }
  ]
}
