Revert "Revert "Merge branch 'determine-partitions-improvements'""

This reverts commit 189b3e2b9bc3c79da9c98b805df624f024109469.