)]}'
{
  "commit": "ad2b0acc93fd5b896c7f7b986fa792b642a2c059",
  "tree": "efff7ae4d66f5c8e5d004fe3ef9031b70798c32c",
  "parents": [
    "572ec16e51c5247db38dce85193d83c11a5d280a"
  ],
  "author": {
    "name": "Kevin Newton",
    "email": "kddnewton@gmail.com",
    "time": "Thu Nov 26 15:17:07 2026"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Nov 26 15:17:07 2026"
  },
  "message": "gh-155628: Add _Py_atomic_add_*_relaxed variants (#155630)\n\n* Add relaxed _Py_atomic_add_*\n\nAdd _Py_atomic_add_*_relaxed() for all arithmetic types supported by\n_Py_atomic_add_*(). The existing add operations are sequentially\nconsistent, which is stronger (and on ARM, measurably more\nexpensive) than necessary for uses like statistics counters and unique\nID allocation, where the add must be atomic but does not need to order\nsurrounding memory accesses.\n\nThe GCC/Clang backend uses __atomic_fetch_add() with __ATOMIC_RELAXED,\nand the standard C11/C++11 backend uses atomic_fetch_add_explicit()\nwith memory_order_relaxed. The MSVC backend uses the\n_InterlockedExchangeAdd*_nf (\"no fence\") intrinsics on ARM64; on x86\nand x64 those intrinsics do not exist, so it falls back to the plain\ninterlocked intrinsics, whose stronger ordering is a conforming\nimplementation of relaxed (x86 has no cheaper atomic\nread-modify-write). As with the sequentially consistent version, 64-bit\nadds on 32-bit x86 fall back to a compare-exchange loop.\n\n* Use a relaxed add for the module index allocator\n\n* Use relaxed adds for the GC allocation counter\n\n* Use relaxed adds for the lru_cache hit/miss counters\n\n* Use a relaxed add for the asyncio task name counter\n\n* Add relaxed _Py_atomic_compare_exchange\n\n* Use relaxed compare_exchange for gc young count",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0a11f7781f07e00db48d30d0f34ffb03da02ade8",
      "old_mode": 33188,
      "old_path": "Include/cpython/pyatomic.h",
      "new_id": "3115b9e08243722fc79d35d81124072642330377",
      "new_mode": 33188,
      "new_path": "Include/cpython/pyatomic.h"
    },
    {
      "type": "modify",
      "old_id": "c2441a1eb913920031c932b9423e262dbbbf2f84",
      "old_mode": 33188,
      "old_path": "Include/cpython/pyatomic_gcc.h",
      "new_id": "b0544c64490abd2d8bfbc631bcdedecc610b9786",
      "new_mode": 33188,
      "new_path": "Include/cpython/pyatomic_gcc.h"
    },
    {
      "type": "modify",
      "old_id": "ef5b6d2d71c5c09c99aaf38306d743532455ce42",
      "old_mode": 33188,
      "old_path": "Include/cpython/pyatomic_msc.h",
      "new_id": "c00c541dc62fdc5ad954085c59fcc6a791056a72",
      "new_mode": 33188,
      "new_path": "Include/cpython/pyatomic_msc.h"
    },
    {
      "type": "modify",
      "old_id": "b8540ff3baf20a6731cb0cb503edd2ba627187ee",
      "old_mode": 33188,
      "old_path": "Include/cpython/pyatomic_std.h",
      "new_id": "92a8cba1302c187cf17d91768cdacce7f029544f",
      "new_mode": 33188,
      "new_path": "Include/cpython/pyatomic_std.h"
    },
    {
      "type": "modify",
      "old_id": "31455f6b8153123fd6810015a9442afaaadea49e",
      "old_mode": 33188,
      "old_path": "Include/internal/pycore_pyatomic_ft_wrappers.h",
      "new_id": "de3a78ec02ec02d8c6671400e895ef80cf1673fe",
      "new_mode": 33188,
      "new_path": "Include/internal/pycore_pyatomic_ft_wrappers.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "023cad615ecdfc8cfa8118e53d764c007556e7d7",
      "new_mode": 33188,
      "new_path": "Misc/NEWS.d/next/C_API/2026-08-20-15-21-46.gh-issue-155628.9QggKx.rst"
    },
    {
      "type": "modify",
      "old_id": "0ab7682a5404230ae4c43701d11162af5a937f01",
      "old_mode": 33188,
      "old_path": "Modules/_asynciomodule.c",
      "new_id": "34594f515e6412eb046d8803877b66c9499fef84",
      "new_mode": 33188,
      "new_path": "Modules/_asynciomodule.c"
    },
    {
      "type": "modify",
      "old_id": "75b93d87e90a9996ec67fccd355b4b257941e62d",
      "old_mode": 33188,
      "old_path": "Modules/_functoolsmodule.c",
      "new_id": "7c02d8d7b3ee8aac9b80d7650a6f8528448fe31d",
      "new_mode": 33188,
      "new_path": "Modules/_functoolsmodule.c"
    },
    {
      "type": "modify",
      "old_id": "850de6f9c3366b134df5bf15e632137cd5cd9dd5",
      "old_mode": 33188,
      "old_path": "Modules/_testcapi/pyatomic.c",
      "new_id": "81947b55e9a81d2afc18374e279054212142f9bd",
      "new_mode": 33188,
      "new_path": "Modules/_testcapi/pyatomic.c"
    },
    {
      "type": "modify",
      "old_id": "0d27224e59b3da838c1da0ccfebac14e1e2be26a",
      "old_mode": 33188,
      "old_path": "Python/gc_free_threading.c",
      "new_id": "f5e7461cded9d6fbcdf6296ffb8d1ce38eb29546",
      "new_mode": 33188,
      "new_path": "Python/gc_free_threading.c"
    },
    {
      "type": "modify",
      "old_id": "7334be2e8f780044d9241d766f7f49055b62aa82",
      "old_mode": 33188,
      "old_path": "Python/import.c",
      "new_id": "23ca226adb78b05fbca3a5bde53dfcce3834d6eb",
      "new_mode": 33188,
      "new_path": "Python/import.c"
    },
    {
      "type": "modify",
      "old_id": "4c95669f9fa1b09c409ccbde6a1d640fad8994f2",
      "old_mode": 33188,
      "old_path": "Python/pystate.c",
      "new_id": "d253f4dd89310d2ca7f16c6dad45dc19f73b06f1",
      "new_mode": 33188,
      "new_path": "Python/pystate.c"
    }
  ]
}
