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).
WEAVE.c (libdog): rgakey qsort + gmap group map, old :819-842; DFS
probe per pop in PUSH_CHILDREN, old :869-887. Bench test/WEAVE04.c.seen guard semantics kept, stack stays 2*nu+1).gtok[];
per-token-parent cstart/ccnt arrays replace per-pop gmap probes (ROOT
group kept addressable via a colliding idh, as before).WEAVEMerge from git HEAD symbol-renamed via
objcopy, linked beside the new one; 96 scenarios x 6 merges (both arg orders,
chained re-merges, deletes, N=1..5000) memcmp'd — 0 mismatches.$sort/rga_cmp.cstart/ccnt child runs; probe-free PUSH_CHILDREN.TEST_CXX_FLAGS "-g", empty CMAKE_BUILD_TYPE), so
CI times an unshipped build; WEAVE04's ratio gate is disabled pending that.~/src/libdog has M WEAVE.c (uncommitted; rga_cmp/$sort(sks…) absent in the worktree copy, still present in HEAD 79612854); the WEAVE04 ratio-gate disable is ALREADY landed (commented out at test/WEAVE04.c:135). Only T5 (land) remains.