)]}'
{
  "commit": "57e7a8de342dc20d16859d4eda45bb960b4d18b5",
  "tree": "89d0bcd12bfd62e6fc19c39d0ba2fdd0b1f2ad76",
  "parents": [
    "36341ba9ba53096a5c4cc7fe69be577430f69d04"
  ],
  "author": {
    "name": "Henry Schreiner",
    "email": "HenrySchreinerIII@gmail.com",
    "time": "Sun Jul 26 06:14:56 2026 -0400"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sun Jul 26 03:14:56 2026 -0700"
  },
  "message": "fix(stl_bind): correct __delitem__ for negative-step slices and re-enable contiguous erase fast path (#6088)\n\n* fix(stl_bind): correct __delitem__ for negative-step slices and re-enable contiguous erase fast path\n\nThe slice __delitem__ binding advanced the erase index by step - 1 for\nall steps. That correction is only valid for positive steps, where\nerasing shifts later elements down by one. For negative steps the\nvisited indices are strictly decreasing and erasing never shifts them,\nso the extra -1 deleted the wrong elements (e.g. del v[::-2] on\n[0,1,2,3] yielded [1,2] instead of [0,2]) and del v[::-1] walked off the\nfront of the vector (v.begin() - 1, observed SIGBUS).\n\nSwitch to the signed slice::compute overload so negative steps stay\nsigned, advance by step for negative steps and step - 1 for positive\nones, and drop the \u0026\u0026 false that had disabled the O(n) contiguous fast\npath since 2016.\n\nAssisted-by: ClaudeCode:claude-fable-5\n\n* refactor: address review — static_cast and parametrized test\n\nUse static_cast instead of a C-style cast for the slice.compute() size\nargument, and convert the __delitem__ slice test to\npytest.mark.parametrize over the slice cases.\n\nAssisted-by: ClaudeCode:claude-fable-5\n\n* test(stl_bind): cover slice deletion edge cases\n\n* fix(stl_bind): erase strided slices in descending order\n\n* Eliminate a variable and avoid redundant index increment (i + 1, ++i).\n\nThe control flow handles all relevant boundaries:\n\n- slicelength \u003d\u003d 0: excluded by the outer guard.\n- slicelength \u003d\u003d 1: erases once, decrements to zero, and breaks without touching start.\n- Larger slices: updates start exactly when another erase remains.\n- slicelength cannot underflow because the loop exits when it reaches zero.\n- Mutating slicelength is harmless because it is not used afterward.\n- The potentially dangerous final start +\u003d step remains eliminated.\n\nIt also removes the separate loop counter. The compiler would probably\noptimize the former i + 1, ++i mechanics away, but the new source expresses\nthe real state more directly: \"number of erasures remaining.\"\n\nThe unconditional while (true) is safe because entry is strictly guarded by\nslicelength \u003e 0, and the decrement guarantees eventual termination.\n\n---------\n\nCo-authored-by: Ralf W. Grosse-Kunstleve \u003crgrossekunst@nvidia.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8202300c703f4eab94a552afd1f506d9dccb6780",
      "old_mode": 33188,
      "old_path": "include/pybind11/stl_bind.h",
      "new_id": "360c2cd7bc252c5eb1385f50c6bea0f2dc666763",
      "new_mode": 33188,
      "new_path": "include/pybind11/stl_bind.h"
    },
    {
      "type": "modify",
      "old_id": "518f2df2b6dde1628866372eb35d4ca181dce70e",
      "old_mode": 33188,
      "old_path": "tests/test_stl_binders.py",
      "new_id": "edc6d28924ea4ca6dd0e5d2d249a0e267421d160",
      "new_mode": 33188,
      "new_path": "tests/test_stl_binders.py"
    }
  ]
}
