Reorder a TestForest so that, at every sibling level, cheaper tests come
first. A test's cost is its recorded baseline in the given map; a missing
baseline counts as 0, so an untimed test runs first. A subtree is ordered
by the minimum cost of any leaf it contains, so the group most likely to yield
a cheap early kill runs first.
This is a drop-in alternative to execution-order randomisation, legal under
exactly the same conditions. It mirrors randomiseTestForest: inside a
DoNotRandomiseExecutionOrder scope it leaves the whole subtree as-is at
every depth, and the caller only applies it when the suite's execution-order
randomisation is enabled.
Only sibling order changes. Wrapper nodes keep wrapping their own children,
so shared setup and teardown still run once per group and are never split.
The sort is stable, so equal-cost siblings keep their source order.
TestIds are assigned with the same scheme as flattenTestForestWith, purely
to look costs up; nothing downstream reads the ids of the reordered forest.
When this runs on a forest that filterTestForestByTrie has thinned, the
per-description sibling index of same-named siblings can shift relative to the
baseline map's keys. That degrades ordering quality for same-named siblings
only, never which tests run.