static async computeWithSharedTraceEngine(allFrameShiftEvents, mainFrameShiftEvents) {
    /** @param {LH.TraceEvent[]} events */
    const run = async (events) => {
      const processor = new TraceEngine.TraceProcessor({
        LayoutShifts: TraceEngine.TraceHandlers.LayoutShifts,
        Screenshots: TraceEngine.TraceHandlers.Screenshots,
      });
      await processor.parse(/** @type {import('@paulirish/trace_engine').Types.Events.Event[]} */ (
        events
      ), {});
      if (!processor.parsedTrace) {
        throw new Error('null trace engine result');
      }
      return processor.parsedTrace.LayoutShifts.sessionMaxScore;
    };
    const cumulativeLayoutShift = await run(allFrameShiftEvents.map(e => e.event));
    const cumulativeLayoutShiftMainFrame = await run(mainFrameShiftEvents.map(e => e.event));
    return {cumulativeLayoutShift, cumulativeLayoutShiftMainFrame};
  }
@param {LayoutShiftEvent[]} allFrameShiftEvents
@param {LayoutShiftEvent[]} mainFrameShiftEvents