)]}'
{
  "commit": "540008c4aa3f6a2c6e55a054a33f24bd85144d97",
  "tree": "04d901586f52d7a333dcabdd706cad1c2e2edde2",
  "parents": [
    "42f300cbf843982f52e3ee73d35c5d17f4a84d71"
  ],
  "author": {
    "name": "Alex Vasile",
    "email": "48962821+Alex-Vasile@users.noreply.github.com",
    "time": "Mon Jun 29 09:01:46 2026 -0400"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Jun 29 15:01:46 2026 +0200"
  },
  "message": "[Metal] Fix indirect dispatch offset for sub-allocated parameter buffers (#24644)\n\niree_hal_metal_command_buffer_prepare_dispatch resolved the\nindirect-dispatch workgroup-count buffer offset as just\nconfig.workgroup_count_ref.offset, dropping\niree_hal_buffer_byte_offset(buffer) -- the base offset of the parameter\nbuffer within its backing allocation. This is inconsistent with the\nsibling descriptor path in the same function (which adds byte_offset)\nand with every other backend: Vulkan and amdgpu route all offsets\nthrough a shared resolver that adds byte_offset, and the local HAL\nresolves through iree_hal_buffer_map_range. When the indirect-parameter\nbuffer is a sub-allocation with a non-zero base offset, the dispatch\nread the three workgroup-count uint32s from the wrong address and ran a\nwrong grid.\n\nThe bug was latent because the Metal allocator returns standalone root\nbuffers (byte_offset\u003d\u003d0) and the cross-backend CTS indirect-parameters\ntests allocate the parameter buffer directly at offset 0.\n\nAdd byte_offset so the source offset matches the descriptor path and the\nother backends:\nworkgroups_offset \u003d\niree_hal_buffer_byte_offset(config.workgroup_count_ref.buffer) +\nconfig.workgroup_count_ref.offset;\n\nAdds CTS regression test\nDispatchIndirectParametersTest.SubAllocatedParameterBuffer, which\nreferences the workgroup counts through an iree_hal_buffer_subspan at a\nnon-zero base offset (placing deliberately-wrong counts at offset 0 so a\nbase-offset drop reads a deterministic grid instead of garbage). This is\nthe only test shape that catches the bug, and it exercises it on every\nbackend that supports sub-allocated buffers (Metal, Vulkan, amdgpu).\n\nSigned-off-by: Alex Vasile\n\u003c48962821+Alex-Vasile@users.noreply.github.com\u003e\n\nSigned-off-by: Alex Vasile \u003c48962821+Alex-Vasile@users.noreply.github.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9ece631b4d187d09d3ef9fe1f9b0ddd3e9da5b5e",
      "old_mode": 33188,
      "old_path": "runtime/src/iree/hal/cts/command_buffer/dispatch_indirect_parameters_test.cc",
      "new_id": "7cd5e38086254209437d28df291f65fd7a5396ee",
      "new_mode": 33188,
      "new_path": "runtime/src/iree/hal/cts/command_buffer/dispatch_indirect_parameters_test.cc"
    },
    {
      "type": "modify",
      "old_id": "30ccaf2fe3ad5a12265ba81e70198ebf0619d481",
      "old_mode": 33188,
      "old_path": "runtime/src/iree/hal/drivers/metal/direct_command_buffer.m",
      "new_id": "e009c5a53f0618bf79adfaa00da9f3e9526963b8",
      "new_mode": 33188,
      "new_path": "runtime/src/iree/hal/drivers/metal/direct_command_buffer.m"
    }
  ]
}
