The permutation that would sort the FIRST n elements of values, without ordering
the rest. perm comes back with exactly n entries (fewer if the array is shorter).
n is CLAMPED to the array size rather than being an error, so a caller whose n is
derived -- a fraction of a row count, a config value, a post-filter survivor count --
needs no min(n, size(v)) of their own. A negative n is still an error.
"The last n" is descending=.true., not a separate procedure.