)]}'
{
  "commit": "b9f89e3572f815eb141782f102fcfa0bba6a034c",
  "tree": "aa0cf1a132d06f70754efa67b467e023be4dc7db",
  "parents": [
    "55cf8fb38ae30c086458f28daa1e84ba4e24e501"
  ],
  "author": {
    "name": "Aaron Webster",
    "email": "AaronWebster@users.noreply.github.com",
    "time": "Wed Jun 03 22:19:34 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jun 03 22:19:34 2026 -0700"
  },
  "message": "Drop redundant Known() guard when discriminant is provably Known (#257)\n\nThe optimized switch block opens with\n\n    const auto emboss_reserved_switch_discrim \u003d \\${discriminant};\n    if (!emboss_reserved_switch_discrim.Known()) return false;\n\nThe Known() guard is a safety net: if reading the discriminant\nfailed, Ok() must return false. But fields_in_dependency_order\nguarantees the discriminant field is validated earlier in Ok(), and\nfor a non-conditional, non-virtual field of the current structure\nthe earlier \\`if (has_X().ValueOrDefault() \u0026\u0026 !X().Ok()) return false;\\`\nalready enforces X().Ok(). Past that point the Maybe\u003c\u003e wrapper around\nthe field read is provably Known and the extra guard is dead code.\n\n_is_discriminant_provably_known recognizes the safe shape — a\nsingle-segment field_reference to a non-conditional non-virtual field\nin the current structure\u0027s field list — and removes the guard in\nthat case. The detection is intentionally narrow; nested paths and\ncomputed discriminants keep the guard.\n\nOne line saved per qualifying switch — minor on hosted targets, but\non Thumb-2 and MicroBlaze this removes a load, a compare, and a\nconditional return per switch block, plus the constant-pool slot.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6d0de85bb9aad237f3a41c3def585c8e0f2ebf91",
      "old_mode": 33188,
      "old_path": "compiler/back_end/cpp/generated_code_templates",
      "new_id": "9e2c781893c5885fa3df41f3ac324c7d3558dc5e",
      "new_mode": 33188,
      "new_path": "compiler/back_end/cpp/generated_code_templates"
    },
    {
      "type": "modify",
      "old_id": "b3305d31988256e4c8fd5cd350f1e0f7b88ac801",
      "old_mode": 33188,
      "old_path": "compiler/back_end/cpp/header_generator.py",
      "new_id": "0342f92ad8b7f7f0965ffe2259868a15566d68de",
      "new_mode": 33188,
      "new_path": "compiler/back_end/cpp/header_generator.py"
    },
    {
      "type": "modify",
      "old_id": "f1111d519954bf3dfe46fd4e852888bc6ce20b84",
      "old_mode": 33188,
      "old_path": "testdata/golden_cpp/condition.emb.h",
      "new_id": "725fe8243cd3b736b63136ee5892a23f3b9b064a",
      "new_mode": 33188,
      "new_path": "testdata/golden_cpp/condition.emb.h"
    },
    {
      "type": "modify",
      "old_id": "8f5fef0544e3b9a01aed7f64a1fc8db0ffe8c031",
      "old_mode": 33188,
      "old_path": "testdata/golden_cpp/many_conditionals.emb.h",
      "new_id": "7f7ee7a92f989bd5daa01906a7205bc51f6d6596",
      "new_mode": 33188,
      "new_path": "testdata/golden_cpp/many_conditionals.emb.h"
    },
    {
      "type": "modify",
      "old_id": "b601bd7ab88e61a04e972dfd2506e863b8a6001c",
      "old_mode": 33188,
      "old_path": "testdata/golden_cpp/parameters.emb.h",
      "new_id": "586bfdc73207301fe4facb3f4f2d627fe86c7dca",
      "new_mode": 33188,
      "new_path": "testdata/golden_cpp/parameters.emb.h"
    }
  ]
}
