DOG-017 MED: WEAVEMerge global qsort is ~half the merge; bucket by anchor instead

Retroactive ticket (2026-07-07 libdog WEAVE perf session). After DIS-047 removed the Pass-2 remover-union quadratic, a three-agent audit + phase profile of WEAVEMerge (libdog WEAVE.c) showed the RGA-linearise $sort(sks, rga_cmp) was still ~49% of merge wall time (musl smoothsort + an indirect call per compare; 79.9 ms of 164 ms at N=10k lines, -O2), plus ~19% more in the per-pop gmap hash probe of PUSH_CHILDREN. The emit DFS never needs a global order — only each anchor's sibling group contiguous and internally (cidx DESC, ord ASC)-sorted — so the sort is replaceable by O(nu) bucketing with byte-identical output. Also the n·log n term was the main superlinear creep behind DIS-047's WEAVE04 ratio gate (the gate itself proved VM-flaky on mac CI and was disabled the same session).

Input

Context

Goals

Constraints

WIP

Design decisions

TODOs

Blockers and bummers

Outcome