Merge "Optimize wedge partition selection." into nextgenv2