What's up😃 this is about list_ruin.rs from selector. It seems like the sampling logic could have side effects.
Problem
ListRuinMoveSelector can yield fewer moves than its configured moves_per_step when the working solution contains empty routes. The selector currently samples source entities from all routes. If an empty route is selected, no ruin move can be created and the attempt is dropped. As a result, moves_per_step behaves like a sampling-attempt budget rather than the number of ruin moves to generate.
For example, with one empty route, one non-empty route, and moves_per_step = 10, the selector may yield fewer than 10 moves depending on the RNG.
Test Coverage
The regression test uses the existing ListRuinMoveSelector test fixture with:
- one empty route
- one non-empty route
moves_per_step = 10
- a fixed seed
This test verifies:
- the selector yields exactly
moves_per_step moves when at least one non-empty route exists
- all yielded ruin moves target the non-empty route
- empty routes do not consume move-generation attempts
This captures the current mismatch between the configured move count and the actual yielded move count.
How to improve? - implementation direction
- fileter non-empty entities in advance.
- sample from non-empty entites
What's up😃 this is about
list_ruin.rsfrom selector. It seems like the sampling logic could have side effects.Problem
ListRuinMoveSelectorcan yield fewer moves than its configuredmoves_per_stepwhen the working solution contains empty routes. The selector currently samples source entities from all routes. If an empty route is selected, no ruin move can be created and the attempt is dropped. As a result,moves_per_stepbehaves like a sampling-attempt budget rather than the number of ruin moves to generate.For example, with one empty route, one non-empty route, and
moves_per_step = 10, the selector may yield fewer than 10 moves depending on the RNG.Test Coverage
The regression test uses the existing
ListRuinMoveSelectortest fixture with:moves_per_step = 10This test verifies:
moves_per_stepmoves when at least one non-empty route existsThis captures the current mismatch between the configured move count and the actual yielded move count.
How to improve? - implementation direction