The following is the behavior of ECMP and LAG hashing at an LSR in the existing implementation. These are performed in two rounds.
The first round starts with the ECMP hash, which consists of an initial hash based on the source port/system IP address. Each label in the stack is then hashed separately with the result of the previous hash, up to a maximum of 16 labels. The net result is used to select which LSP next-hop to send the packet to using a modulo operation of the net result with the number of next-hops.
This same net result will feed to a second round of hashing if there is LAG on the egress port where the selected LSP has its NHLFE programmed.