A stable in-place merge sort that operates bottom-up in three stages: sorting-network seeds for tiny groups, cache-based merges for small levels, and block-based merges for large levels using internal buffers borrowed from the array itself. Falls back to rotation merging when internal buffers cannot be extracted.
Instead of allocating a full-size merge buffer, the algorithm borrows a region of unique values from inside the array as scratch, then returns it afterward, achieving O(1) auxiliary space while preserving stability and O(n log n) time.