)]}'
{
  "commit": "04f3bc01d12cf58c90a1bb68990f087fa3c3ed19",
  "tree": "5aac31928611ad1a493bb2eaf9a80dfd800722c7",
  "parents": [
    "e7ba8a7852611819ac42114ef7f22e470ebf7aa2"
  ],
  "author": {
    "name": "Todd Lipcon",
    "email": "tlipcon@google.com",
    "time": "Tue Mar 10 12:33:20 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Tue Mar 10 12:33:52 2026 -0700"
  },
  "message": "Fix hashtablez oversampling for SOO tables on repeated 0-\u003e1 element transitions\n\nCurrently, when an absl::flat_hash_set or flat_hash_map with SOO (Single Object Optimization) transitions from 0 to 1 element, it queries should_sample_soo() to determine if it should be sampled by hashtablez. If it is NOT sampled, it remains an SOO table. If that element is subsequently erased, the table goes back to 0 elements. The next time it goes from 0 to 1, it queries should_sample_soo() again.\n\nRepeated insert/erase cycles on an SOO table effectively evaluate the sampling logic hundreds of times, making it extremely likely that the table eventually gets sampled and moved to the heap. This causes hashtablez to vastly overstate the memory usage of such maps in production.\n\nThis CL fixes this by tracking whether an SOO table has already been evaluated for sampling, so it only evaluates the logic once per table object instance. Since SOO tables do not hash keys, they do not need the per-table generic seed value. This CL utilizes the lowest bit of the unused seed field within HashtableSize (accessed via data_ \u0026 1) to act as a flag soo_has_tried_sampling.\n\nWhen an SOO table transitions from 0 elements to 1 element, this bit is checked. If it is false, should_sample_soo() is queried and the bit is set to true. set_full_soo() and set_empty_soo() have been modified to preserve the soo_has_tried_sampling bit across erase or clear operations.\n\nPiperOrigin-RevId: 881570273\nChange-Id: Ia3b0eff8b3e137b0d162a207220a184923e3a2ca\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5e9a483ec46d55e44b8792e66ff64afdaf3105a4",
      "old_mode": 33188,
      "old_path": "absl/container/internal/raw_hash_set.h",
      "new_id": "1a9fa1d156c624a64adef5eb20077caf87b1eebd",
      "new_mode": 33188,
      "new_path": "absl/container/internal/raw_hash_set.h"
    },
    {
      "type": "modify",
      "old_id": "fd99b2c2ff08dd9f664c1bd48d1ad337d88eda38",
      "old_mode": 33188,
      "old_path": "absl/container/internal/raw_hash_set_test.cc",
      "new_id": "9c33e3c721ca30a0e7d48accdf3096422bd9f617",
      "new_mode": 33188,
      "new_path": "absl/container/internal/raw_hash_set_test.cc"
    }
  ]
}
