shorten = target => {
    let p = target;
    // Find the most-resolved value for p.
    while (forwardedPromiseToPromise.has(p)) {
      p = forwardedPromiseToPromise.get(p);
    }
    const presence = promiseToPresence.get(p);
    if (presence) {
      // Presences are final, so it is ok to propagate
      // this upstream.
      while (!objectIs(target, p)) {
        const parent = forwardedPromiseToPromise.get(target);
        forwardedPromiseToPromise.delete(target);
        promiseToPendingHandler.delete(target);
        promiseToPresence.set(target, presence);
        target = parent;
      }
    } else {
      // We propagate p and remove all other pending handlers
      // upstream.
      // Note that everything except presences is covered here.
      while (!objectIs(target, p)) {
        const parent = forwardedPromiseToPromise.get(target);
        forwardedPromiseToPromise.set(target, p);
        promiseToPendingHandler.delete(target);
        target = parent;
      }
    }
    return target;
  }
You can imagine a forest of trees in which the roots of each tree is an
unresolved HandledPromise or a non-Promise, and each node's parent is the
HandledPromise to which it was forwarded.  We maintain that mapping of
forwarded HandledPromise to its resolution in forwardedPromiseToPromise.

We use something like the description of "Find" with "Path splitting"
to propagate changes down to the children efficiently:
https://en.wikipedia.org/wiki/Disjoint-set_data_structure

@param {any} target Any value.
@returns {any} If the target was a HandledPromise, the most-resolved parent
of it, otherwise the target.