)]}'
{
  "commit": "dd731f0682ad58aca034f2244a7507d9af5deecd",
  "tree": "5fe7c0d97259ba69e4f591c85fef5ee18923416e",
  "parents": [
    "8e924b6e15bcc7d151f0f4a6d41ebc9da0672a52"
  ],
  "author": {
    "name": "Leonardo de Moura",
    "email": "leomoura@amazon.com",
    "time": "Tue Nov 17 01:02:26 2026 +0000"
  },
  "committer": {
    "name": "Leonardo de Moura",
    "email": "leomoura@amazon.com",
    "time": "Tue Nov 17 01:02:26 2026 +0000"
  },
  "message": "fix: do not evaluate left shifts with huge shift amounts\n\nThis PR adds the option `shiftLeft.threshold` (default: 65536). `whnf`, `simp`, and `grind` no longer evaluate a left shift of literals when the shift amount is above this threshold, and report a warning instead, as they already do for exponents above `exponentiation.threshold`. Previously, a shift amount of 2^32 or more aborted the Lean process with `INTERNAL PANIC: Nat.shiftl exponent is too big`, e.g., in `example : (1 \u003c\u003c\u003c 4294967296 : Nat) \u003d 0 :\u003d by simp`. `cbv` and the compiler use the same bound as a constant.\n\nThe runtime implementation of `Nat.shiftLeft` panics when the shifted value is not `0` and the shift amount does not fit in 32 bits, and several procedures evaluated `\u003c\u003c\u003c` on `Nat`, `Int`, `Fin`, and `BitVec` literals without checking the shift amount. The new functions `isSafeShiftLeft` and `checkShiftLeft` accept a shift when the shifted value is `0`, or the shift amount is at most the threshold and fits in 32 bits. They are now used by `Meta.reduceNat?`, the `Nat`, `Fin`, and `BitVec` shift simprocs, the `grind` propagators for `Nat` and `BitVec` shifts, `Sym` ground evaluation (new field `EvalStepConfig.maxShiftLeft`), and the LCNF constant folder (`natShiftLeftThreshold`).\n\nCloses #15193\n\nCo-Authored-By: Claude Fable 5.2 \u003cnoreply@anthropic.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "77538a5cf1842772272391b7ee01bef3d9aabed2",
      "old_mode": 33188,
      "old_path": "src/Lean/Compiler/LCNF/Simp/ConstantFold.lean",
      "new_id": "5ce43afafd8bda5801642e186172760e4771f244",
      "new_mode": 33188,
      "new_path": "src/Lean/Compiler/LCNF/Simp/ConstantFold.lean"
    },
    {
      "type": "modify",
      "old_id": "3d48b6daadddbfdf13c1261342e2c8f37c6613c8",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta/Sym/DSimp/EvalGround.lean",
      "new_id": "321b817f2f9d750592698bd6b186353e31b8bbba",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/Sym/DSimp/EvalGround.lean"
    },
    {
      "type": "modify",
      "old_id": "ded914973b52c2b00833ad7aaa902b00dd0c464d",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta/Sym/Simp/EvalGround.lean",
      "new_id": "d7c3093fc08de854dadcd745b9d6510240fe5eb8",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/Sym/Simp/EvalGround.lean"
    },
    {
      "type": "modify",
      "old_id": "d13bed63d1ce3eadfda69328b554f07997a1013c",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta/Tactic/Grind/Arith/Propagate.lean",
      "new_id": "6c97ba01d3d301cb79bf834b24330d91531557db",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/Tactic/Grind/Arith/Propagate.lean"
    },
    {
      "type": "modify",
      "old_id": "29a009eb183a4dcb6821eed77363dbe585185407",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta/Tactic/Grind/BitVec.lean",
      "new_id": "7bf5d665720bff6437b1c9d5d8a319a869b7c844",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/Tactic/Grind/BitVec.lean"
    },
    {
      "type": "modify",
      "old_id": "360cd9f6c4906fa96b2a35aabd9c12938705572b",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta/Tactic/Simp/BuiltinSimprocs/BitVec.lean",
      "new_id": "39085ea68e6e8e89a38186d5f398f76480d12f3e",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/Tactic/Simp/BuiltinSimprocs/BitVec.lean"
    },
    {
      "type": "modify",
      "old_id": "7da39fce15b706b3c15eaf2daad576eb72ac220b",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta/Tactic/Simp/BuiltinSimprocs/Fin.lean",
      "new_id": "54edf6030884cb6d650a47418430e608b01150cd",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/Tactic/Simp/BuiltinSimprocs/Fin.lean"
    },
    {
      "type": "modify",
      "old_id": "e67ebeae11e714c27c3f0123866ff04ec784cbc1",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta/Tactic/Simp/BuiltinSimprocs/Nat.lean",
      "new_id": "491a2776d7e9def85ff714113249677c68b9e8fe",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/Tactic/Simp/BuiltinSimprocs/Nat.lean"
    },
    {
      "type": "modify",
      "old_id": "39ce5a2886bc5d95e5b74546e1551b59f662a0a4",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta/WHNF.lean",
      "new_id": "08e6d919b41cf56eb207faacf7ab27d334b0cbee",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/WHNF.lean"
    },
    {
      "type": "modify",
      "old_id": "b8eecd8dee2d59f07b9719cada19ee0d66adde49",
      "old_mode": 33188,
      "old_path": "src/Lean/Util/SafeExponentiation.lean",
      "new_id": "275e4dfe4a8e1de207d67ed7b0741d44a665a308",
      "new_mode": 33188,
      "new_path": "src/Lean/Util/SafeExponentiation.lean"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7163cc356951e258b38087a06c3acc1a886fae7e",
      "new_mode": 33188,
      "new_path": "tests/elab/grind_safeShiftLeft.lean"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a346a6f5ea9e874e0cb0f4cba6bb0d063de39f3f",
      "new_mode": 33188,
      "new_path": "tests/elab/safeShiftLeft.lean"
    }
  ]
}
