[perf_skottiewasm_lottieweb] Turn on skottie+wasm flush for a better comparison

This enables us to use the same termination checks as for lottie-web.

NoTry: true
Bug: skia:9237
Change-Id: I9d5d0c450196c3800020e12b45868c656cdcc46a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226858
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
diff --git a/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/lottie_web_perf.json b/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/lottie_web_perf.json
index 476905a..f1fb440 100644
--- a/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/lottie_web_perf.json
+++ b/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/lottie_web_perf.json
@@ -147,7 +147,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie1.json",
       "/path/to/tmp/json",
       "lottie-web"
@@ -172,18 +172,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
@@ -268,7 +267,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie2.json",
       "/path/to/tmp/json",
       "lottie-web"
@@ -293,18 +292,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
@@ -389,7 +387,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie3.json",
       "/path/to/tmp/json",
       "lottie-web"
@@ -414,18 +412,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
diff --git a/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/lottie_web_perf_trybot.json b/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/lottie_web_perf_trybot.json
index a920206..9b67355 100644
--- a/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/lottie_web_perf_trybot.json
+++ b/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/lottie_web_perf_trybot.json
@@ -149,7 +149,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie1.json",
       "/path/to/tmp/json",
       "lottie-web"
@@ -174,18 +174,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
@@ -270,7 +269,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie2.json",
       "/path/to/tmp/json",
       "lottie-web"
@@ -295,18 +294,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
@@ -391,7 +389,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie3.json",
       "/path/to/tmp/json",
       "lottie-web"
@@ -416,18 +414,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
diff --git a/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/skottie_wasm_perf.json b/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/skottie_wasm_perf.json
index fc439df..d529785 100644
--- a/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/skottie_wasm_perf.json
+++ b/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/skottie_wasm_perf.json
@@ -151,7 +151,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie1.json",
       "/path/to/tmp/json",
       "skottie-wasm"
@@ -176,18 +176,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
@@ -276,7 +275,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie2.json",
       "/path/to/tmp/json",
       "skottie-wasm"
@@ -301,18 +300,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
@@ -401,7 +399,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie3.json",
       "/path/to/tmp/json",
       "skottie-wasm"
@@ -426,18 +424,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
diff --git a/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/skottie_wasm_perf_trybot.json b/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/skottie_wasm_perf_trybot.json
index 772ec3a..ad11f98 100644
--- a/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/skottie_wasm_perf_trybot.json
+++ b/infra/bots/recipes/perf_skottiewasm_lottieweb.expected/skottie_wasm_perf_trybot.json
@@ -153,7 +153,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie1.json",
       "/path/to/tmp/json",
       "skottie-wasm"
@@ -178,18 +178,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
@@ -278,7 +277,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie2.json",
       "/path/to/tmp/json",
       "skottie-wasm"
@@ -303,18 +302,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
@@ -403,7 +401,7 @@
     "cmd": [
       "python",
       "-u",
-      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = []\nif renderer == 'skottie-wasm':\n  accepted_termination_statuses.extend(['main_frame_aborted'])\nelif renderer == 'lottie-web':\n  accepted_termination_statuses.extend(\n      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
+      "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\nwith open(trace_output, 'r') as f:\n  trace_json = json.load(f)\noutput_json_file = sys.argv[2]\nrenderer = sys.argv[3]  # Unused for now but might be useful in the future.\n\nerroneous_termination_statuses = [\n    'replaced_by_new_reporter_at_same_stage',\n    'did_not_produce_frame',\n]\naccepted_termination_statuses = [\n    'missed_frame',\n    'submitted_frame',\n    'main_frame_aborted'\n]\n\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_id_to_start_ts = {}\n# Will contain tuples of frame_ids and their duration.\ncompleted_frame_id_and_duration = []\nfor trace in trace_json['traceEvents']:\n  if 'PipelineReporter' in trace['name']:\n    frame_id = trace['id']\n    args = trace.get('args')\n    if args and args.get('step') == 'BeginImplFrameToSendBeginMainFrame':\n      frame_id_to_start_ts[frame_id] = trace['ts']\n    elif args and (args.get('termination_status') in\n                   accepted_termination_statuses):\n      if not frame_id_to_start_ts.get(frame_id):\n        print '[No start ts found for %s]' % frame_id\n        continue\n      current_frame_duration = trace['ts'] - frame_id_to_start_ts[frame_id]\n      total_frames += 1\n      completed_frame_id_and_duration.append(\n          (frame_id, current_frame_duration))\n      # We are done with this frame_id so remove it from the dict.\n      frame_id_to_start_ts.pop(frame_id)\n      print '%d (%s with %s): %d' % (\n          total_frames, frame_id, args['termination_status'],\n          current_frame_duration)\n    elif args and (args.get('termination_status') in\n                   erroneous_termination_statuses):\n      # Invalidate previously collected results for this frame_id.\n      if frame_id_to_start_ts.get(frame_id):\n        print '[Invalidating %s due to %s]' % (\n            frame_id, args['termination_status'])\n        frame_id_to_start_ts.pop(frame_id)\n\ntotal_completed_frames = len(completed_frame_id_and_duration)\nif total_completed_frames < 25:\n  raise Exception('Even with 2 loops found only %d frames' %\n                  total_completed_frames)\n\n# Get frame avg/min/max for the middle 25 frames.\nstart = (total_completed_frames - 25)/2\nprint 'Got %d total completed frames. Using start_index of %d.' % (\n    total_completed_frames, start)\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\nfor frame_id, duration in completed_frame_id_and_duration[start:start+25]:\n  frame_max = max(frame_max, duration)\n  frame_min = min(frame_min, duration) if frame_min else duration\n  frame_cumulative += duration\n\nperf_results = {}\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/25\nprint 'For 25 frames got: %s' % perf_results\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n  f.write(json.dumps(perf_results))\n",
       "[CLEANUP]/g3_try_tmp_1/lottie3.json",
       "/path/to/tmp/json",
       "skottie-wasm"
@@ -428,18 +426,17 @@
       "@@@STEP_LOG_LINE@python.inline@with open(trace_output, 'r') as f:@@@",
       "@@@STEP_LOG_LINE@python.inline@  trace_json = json.load(f)@@@",
       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[2]@@@",
-      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]@@@",
+      "@@@STEP_LOG_LINE@python.inline@renderer = sys.argv[3]  # Unused for now but might be useful in the future.@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@erroneous_termination_statuses = [@@@",
       "@@@STEP_LOG_LINE@python.inline@    'replaced_by_new_reporter_at_same_stage',@@@",
       "@@@STEP_LOG_LINE@python.inline@    'did_not_produce_frame',@@@",
       "@@@STEP_LOG_LINE@python.inline@]@@@",
-      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = []@@@",
-      "@@@STEP_LOG_LINE@python.inline@if renderer == 'skottie-wasm':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(['main_frame_aborted'])@@@",
-      "@@@STEP_LOG_LINE@python.inline@elif renderer == 'lottie-web':@@@",
-      "@@@STEP_LOG_LINE@python.inline@  accepted_termination_statuses.extend(@@@",
-      "@@@STEP_LOG_LINE@python.inline@      ['missed_frame', 'submitted_frame', 'main_frame_aborted'])@@@",
+      "@@@STEP_LOG_LINE@python.inline@accepted_termination_statuses = [@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'missed_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'submitted_frame',@@@",
+      "@@@STEP_LOG_LINE@python.inline@    'main_frame_aborted'@@@",
+      "@@@STEP_LOG_LINE@python.inline@]@@@",
       "@@@STEP_LOG_LINE@python.inline@@@@",
       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
diff --git a/infra/bots/recipes/perf_skottiewasm_lottieweb.py b/infra/bots/recipes/perf_skottiewasm_lottieweb.py
index ef9b4a3..b8aa573 100644
--- a/infra/bots/recipes/perf_skottiewasm_lottieweb.py
+++ b/infra/bots/recipes/perf_skottiewasm_lottieweb.py
@@ -173,18 +173,17 @@
   with open(trace_output, 'r') as f:
     trace_json = json.load(f)
   output_json_file = sys.argv[2]
-  renderer = sys.argv[3]
+  renderer = sys.argv[3]  # Unused for now but might be useful in the future.
 
   erroneous_termination_statuses = [
       'replaced_by_new_reporter_at_same_stage',
       'did_not_produce_frame',
   ]
-  accepted_termination_statuses = []
-  if renderer == 'skottie-wasm':
-    accepted_termination_statuses.extend(['main_frame_aborted'])
-  elif renderer == 'lottie-web':
-    accepted_termination_statuses.extend(
-        ['missed_frame', 'submitted_frame', 'main_frame_aborted'])
+  accepted_termination_statuses = [
+      'missed_frame',
+      'submitted_frame',
+      'main_frame_aborted'
+  ]
 
   current_frame_duration = 0
   total_frames = 0
diff --git a/tools/skottie-wasm-perf/skottie-wasm-perf.html b/tools/skottie-wasm-perf/skottie-wasm-perf.html
index 9009887..e63431e 100644
--- a/tools/skottie-wasm-perf/skottie-wasm-perf.html
+++ b/tools/skottie-wasm-perf/skottie-wasm-perf.html
@@ -39,9 +39,6 @@
     });
   })();
 
-  // Without flushing, nothing will show up on the screen, although
-  // everything else has been executed.
-  const shouldFlush = false;
   const maxFrames = 25;
   const maxLoops = 2;
 
@@ -93,10 +90,8 @@
                        fRight: 1000,
                        fBottom: 1000
                        });
+      surface.flush();
       console.log("Used seek: " + seek);
-      if (shouldFlush) {
-        surface.flush();
-      }
       seek += t_rate;
       frame++;
       window.requestAnimationFrame(drawFrame);