)]}'
{
  "commit": "551d82747225a02839a9e9509f2aba33c022b2a9",
  "tree": "eb386f6494a1a5037896a8d2979b30550e54767b",
  "parents": [
    "dc72c9b1d01d7a53cb913001e468ac72f00bee92"
  ],
  "author": {
    "name": "Laramie Leavitt",
    "email": "lar@google.com",
    "time": "Sun Nov 15 22:58:08 2026 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Nov 16 12:44:33 2026 -0800"
  },
  "message": "Fix overflow, tiny-mean, and cancellation bugs in absl::poisson_distribution.\n\n* Avoid integer overflow UB and `uint64_t` wraparound in Knuth / split-Knuth\n  sampling by checking `r \u003c\u003d p.emu_` before incrementing `result_type n` and\n  clamping immediately at `(max)()`. This prevents signed overflow UB on narrow\n  types (`int8_t`), wraparound on `uint64_t` / `absl::uint128`, and redundant\n  draws once saturated.\n* Sample tiny means (`mean \u003c 1e-4`, including `mean \u003d\u003d 0.0`) via exact\n  `bernoulli_distribution(-std::expm1(-mean))` and Poisson arrival-time\n  thinning (`rem \u003d std::log1p(v * std::expm1(rem))`). Previously\n  `std::exp(-mean)` rounded to `\u003e\u003d 1 - 2^-53` for all `0 \u003c mean \u003c 1.665e-16`,\n  returning `0` identically.\n* Eliminate catastrophic `O(mean * ln(mean))` cancellation in Stadlober\u0027s\n  ratio-of-uniforms acceptance test by evaluating\n  `ln(P(X \u003d x) / P(X \u003d mode)) \u003d g(x, mean) - g(mode, mean)` out-of-line in\n  `poisson_distribution.cc` via `StirlingLogFactorialRemainder` and an\n  exact small-`x` (`0..19`) log-factorial table, using a cancellation-free\n  series in `y \u003d (x - mean) / (x + mean)` for `|y| \u003c\u003d 0.1` and splitting\n  `floor(s * v / u + a_frac) + a_int`. This fixes mode acceptance clipping and\n  mean bias at `mean \u003d 1e10`, and raises the supported `mean` cap to `1e15`\n  (within IEEE-754 `double`\u0027s exact integer range `\u003c 2^53`).\n* Use `x \u003e\u003d static_cast\u003cdouble\u003e((max)())` when `IntType` has more precision\n  bits than `double` (`int64_t`, `uint64_t`, `absl::int128`, `absl::uint128`),\n  avoiding `[conv.fpint]` UB when `static_cast\u003cdouble\u003e((max)())` rounds up to a\n  power of two.\n\nPiperOrigin-RevId: 1022528503\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "253898d8c59e9dd9630f77429526db0b22328fda",
      "old_mode": 33188,
      "old_path": "CMake/AbseilDll.cmake",
      "new_id": "4b877d37f90682c8d41df788b79d592f59343409",
      "new_mode": 33188,
      "new_path": "CMake/AbseilDll.cmake"
    },
    {
      "type": "modify",
      "old_id": "42b59d3f3d31a6e6e633b6b9b65c7e54c4539653",
      "old_mode": 33188,
      "old_path": "absl/random/BUILD.bazel",
      "new_id": "2cd527ddd714e81f27152c4dc8b7104c0dae14ad",
      "new_mode": 33188,
      "new_path": "absl/random/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "b2c3fa2f87e0eae4e2735f1faea538d21d6b616a",
      "old_mode": 33188,
      "old_path": "absl/random/CMakeLists.txt",
      "new_id": "55669601bc6d6f086f51eb36e1ab2a95fa7a4641",
      "new_mode": 33188,
      "new_path": "absl/random/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "8f4f356a110e801e9c70bf2c35cc96fbdecb81c1",
      "old_mode": 33188,
      "old_path": "absl/random/internal/fastmath.h",
      "new_id": "d6170e885dd4049bc42876279ebc32b74f592a0e",
      "new_mode": 33188,
      "new_path": "absl/random/internal/fastmath.h"
    },
    {
      "type": "modify",
      "old_id": "cd33d7a2110efc8b57dc1ca257a8a220d86519ba",
      "old_mode": 33188,
      "old_path": "absl/random/internal/fastmath_test.cc",
      "new_id": "89f22f15e77d980eb212934f3c625dc02194e33c",
      "new_mode": 33188,
      "new_path": "absl/random/internal/fastmath_test.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0e5b234551c803a0cb1434a7ee97b068c6946295",
      "new_mode": 33188,
      "new_path": "absl/random/poisson_distribution.cc"
    },
    {
      "type": "modify",
      "old_id": "ae2e095be370ce6747ea5ede1bd41513d25392eb",
      "old_mode": 33188,
      "old_path": "absl/random/poisson_distribution.h",
      "new_id": "8c0ed1dc6ca2d2ddfa1d99fda597037117f6c93f",
      "new_mode": 33188,
      "new_path": "absl/random/poisson_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "e8ee36436283fc9991458e9ae8e8bc43608e399d",
      "old_mode": 33188,
      "old_path": "absl/random/poisson_distribution_test.cc",
      "new_id": "fa5d6a7cc0fae803e5b6b65767c825e0a567c0cc",
      "new_mode": 33188,
      "new_path": "absl/random/poisson_distribution_test.cc"
    }
  ]
}
