Repo Added
|
Files
913
|
Badge
Embed ▾
README BADGES
|
github
Expose Sabre heuristic configuration to Python (#12171) * Expose Sabre heuristic configuration to Python This exposes the entirety of the configuration of the Sabre heuristic to Python space, making it modifiable without recompilation. This includes some additional configuration options that were not previously easily modifiable, even with recompilation: - the base weight of the "basic" component can be adjusted - the weight of the "basic" and "lookahead" components can be adjusted to _either_ use a constant weight (previously not a thing) or use a weight that scales with the size of the set (previously the only option). - the "decay" component is now entirely separated from the "lookahead" component, so in theory you can now have a decay without a lookahead. This introduces a tracking `Vec` that stores the scores of _all_ the swaps encountered, rather than just dynamically keeping hold of the best swaps. This has a couple of benefits: - with the new dynamic structure for heuristics, this is rather more efficient because each heuristic component can be calculated in separate loops over the swaps, and we don't have to branch within the innermost loop. - it makes it possible in the future to try things like assigning probabilities to each swap and randomly choosing from _all_ of them, not just the best swaps. This is something I've actively wanted to try for quite some time. The default heuristics in the transpiler-pass creators for the `basic`, `lookahead` and `decay` strings are set to represent the same heuristics as before, and this commit is entirely RNG compatible with its predecessor (_technically_ for huge problems there's a possiblity that pulling out some divisions into multiplications by reciprocals will affect the floating-point maths enough to modify the swap selection). * Update for PyO3 0.21 * Increase documentation of heuristic components (cherry picked from commit 43d8372ef)
135 of 240 new or added lines in 7 files covered. (56.25%)
4 existing lines in 1 file now uncovered.66404 of 73907 relevant lines covered (89.85%)
229733.05 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|