Files
leleka/crates
Pavlo RatushnyiandClaude Sonnet 5.5 0a3cda3769 residency: choose_swaps selects the victims it can pair instead of sorting every resident expert (same swaps, same order)
Per layer only min(candidates, residents) victims can pair; select_nth + a sort of those, with (value, expert) as the total order (= the earlier stable sort), and the
per-layer vectors are reused. Test: 40 random usage/resident cases with ties against the kept reference implementation, identical swaps and order for max_swaps 1/5/96/4096.
Micro timing (laptop, synthetic 46 % resident): 580 -> 480 us per call; one call per adaptation (every 4th round). Not measured on the 5090.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 01:52:08 +01:00
..