)]}'
{
  "commit": "b94a0a3234df5bbf6250c091d8b3e7d6d2ee49fe",
  "tree": "bf6810e5b0aa5a41ef3109a2cc600f9106addb96",
  "parents": [
    "afe7a30f57545e9da99f3741757861767274f3df"
  ],
  "author": {
    "name": "Zimuzo Ezeozue",
    "email": "zezeozue@google.com",
    "time": "Sat May 02 19:04:46 2026 +0100"
  },
  "committer": {
    "name": "Zimuzo Ezeozue",
    "email": "zezeozue@google.com",
    "time": "Sat May 02 19:04:46 2026 +0100"
  },
  "message": "tp: scope critical-path stack work per query\n\n`thread_executing_span_with_slice` previously eagerly built four\nwhole-trace tables at module load (per-root critical path,\nthread_state x flat-slice SPAN_LEFT_JOIN, the CP x slice intersect,\nand their joined cross product) plus a SPAN_JOIN over them. Every\nconsumer already takes a `(root_utid, ts, dur)` window, so this was\n~95 s of `INCLUDE PERFETTO MODULE` cost on a 17 MB trace for queries\nthat scope down to a single window.\n\nDrop the materialisations and the SPAN_JOIN. A new helper\n`_critical_path_relevant_spans(root_utid, ts, dur)` reproduces the\nsame intermediates lazily inside its body: the walk runs only over\nwakeup nodes overlapping the window, the SPAN_LEFT_JOINs are queried\nwith `utid` push-down, and the self x CP intersection is open-coded\n(`_interval_intersect!` was tried and was ~40x slower because its\ntwin evaluation interacts badly with the join-back to recover\ncolumns). `_critical_path_stack` materialises one helper pass to\namortise across its ten UNION-ALL references.\n\nOutput is bit-identical (all 82 TablesSched diff tests pass with no\nexpectation changes).\n\nPer-stage timings on `android_postboot_unlock.pftrace` (17 MB):\n\n  module load             ~95 s -\u003e ~12 s\n  narrow stack call       ~0.3 s -\u003e 1.3 s   (no upfront amortisation)\n  whole-trace stack call  ~0.3 s -\u003e 2.4 s   (\")\n  CP-Lite (reference)      0.3 s -\u003e 1.2 s\n\nA single CP-Stack click in a UI workflow is ~60x faster end-to-end\n(95.3 s -\u003e 1.6 s); breakeven for scripts is ~100 narrow calls.\n\nBug: 414534218\nChange-Id: I48a79ff17643fa0d9a8ec7083454f2abad249bd4\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "21dee4b8d0bd51ce2370885bff1fb9bcd0a4abaf",
      "old_mode": 33188,
      "old_path": "src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span_with_slice.sql",
      "new_id": "6e6bb08d213e57321a0e1a368af818eb7df9c35a",
      "new_mode": 33188,
      "new_path": "src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span_with_slice.sql"
    }
  ]
}
