)]}'
{
  "commit": "f7cde200320e0800e4fcc5cea399e9faef50f8d4",
  "tree": "9de25c2e08a87ec131c5e41dc8ed04670b12e3c4",
  "parents": [
    "83880beea997e435f56de9cab08929e213732025"
  ],
  "author": {
    "name": "Tomasz Kamiński",
    "email": "tkaminsk@redhat.com",
    "time": "Tue Jun 30 09:46:07 2026 +0200"
  },
  "committer": {
    "name": "Tomasz Kamiński",
    "email": "tkaminsk@redhat.com",
    "time": "Wed Jul 01 15:35:10 2026 +0200"
  },
  "message": "libstdc++: Cascade wall-time saves in lazy expansion seeding [PR124853]\n\nWhen _M_get_sys_info seeds a Zone line by looking up the active rule\njust before info.begin, the previous code interpreted each rule in\nisolation against ri.offset() (the line\u0027s standard offset alone),\nignoring the running save accumulated by earlier rules in the same\nyear. For most zones this gives the right answer because the search\nonly matters when no rule has fired yet, but for zones whose rule\nset has wall-time rules whose effective firing time depends on a\nprior rule\u0027s save it produces wrong answers.\n\nCanonical case: Europe/Paris around 1945.  France\u0027s rules\n\n  R Fr 1945 o - Apr 2  2 2 M\n  R Fr 1945 o - Sep 16 3 0 -\n\nboth use plain wall time. In Paris\u0027s stdoff\u003d1 frame, the September\nrule\u0027s at_time of 03:00 wall translates to UT Sep 16 02:00 if no\nprior save is applied, but to UT Sep 16 00:00 once the running save\nof 2h from the April rule is taken into account.  When seeding a\nsys_info whose info.begin falls between those two values, the simple\nsearch picks the April rule (save\u003d2 → CEMT, total offset 3h) when\nthe correct answer is the September rule (save\u003d0 → CET, total offset\n1h). libstdc++ reports this as a sustained CEMT stretch where zic\nand libc agree on CET.\n\nTo address above the finding algorithm, is now expanded to collect\nthree rule transitions around specified time t, while continuing to\nignore the save.\n* curr_tran: transition happening before or at time t,\n* prev_tran: transition preceding above transition,\n* next_tran: transition happening after time t.\n\nThis collects sufficient information to adjust the start_time (if\nWall time is used) for curr_tran (save of prev_tran) and next_tran\n(save of curr_tran). Assuming that applying save value does not\nchange order of transition (cascading save would be ill-defined\notherwise), after the adjustment the actual active rule is:\n * next_tran.rule: if the adjustment pushed next_tran.when to\n   time before or at t, which happen for positive save (see\n   test_positive),\n * prev_tran.rule: if adjustment pushed curr_tran.when to time\n   after time t, which happens for negative save (see test_negative),\n * curr_tran.rule.\n\nFor the time at the start (Jan/1) or end of the year (December/31),\nfor each rule, in addition to transition in year of t, we check\ntransitions in previous or next year respectively (years in range\n[first_year, last_year]). This handle rules whose firing (specified\nin local time) crosses a year boundary due to a large stdoff or save.\nOne example is Pacific/Auckland\u0027s 1946 Jan 1 rule, in stdoff\u003d12h,\nfires at 1945-12-31 11:30 UT, see test_next_year.\n\nThe fallback \"earliest STD rule\" logic is preserved for the case\nwhere no rule has fired yet, but is extracted to separate function.\nThis lookup is optimized, by searching the rules by name, from, and\nsave in that order, grouping std rules in given year together.\n\n\tPR libstdc++/124853\n\nlibstdc++-v3/ChangeLog:\n\n\t* src/c++20/tzdb.cc\n\t(time_zone::_M_get_sys_info): Extract code blocks to\n\tseparate functions, and invoke them.\n\t(\u003cunnamed\u003e::find_active_rule): Modify algorithm to\n\thandle cascading saves.\n\t(\u003cunnamed\u003e::find_first_std): Simplified implementation\n\tbenefiting from reordering of rules.\n\t(chrono::reload_tzdb): Sort rules by name, from and save.\n\t* testsuite/std/time/time_zone/wall_cascade.cc: New test.\n\nReviewed-by: Tomasz Kamiński \u003ctkaminsk@redhat.com\u003e\nCo-authored-by: Álvaro Begué \u003calvaro.begue@gmail.com\u003e\nSigned-off-by: Tomasz Kamiński \u003ctkaminsk@redhat.com\u003e\nSigned-off-by: Álvaro Begué \u003calvaro.begue@gmail.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "83aca103a5f65b2adc2c5a30b02836770dfe43cd",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/src/c++20/tzdb.cc",
      "new_id": "751370325d76bc1d7bebd56a6735da9d2338679a",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/src/c++20/tzdb.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2707e3fcd331fa3ef664957b7c5323811cbea941",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/testsuite/std/time/time_zone/wall_cascade.cc"
    }
  ]
}
