Commit 94df650
committed
fix(magnetic-adviser): preserve ranking spread for single-filter scenarios
Two related fixes for the El Choker catalog adviser displaying score=100
on every returned magnetic when only one filter weight is active.
1. MagneticFilterImpedance dropped the dead-band clamp that collapsed
every in-band part to penalty=0. With identical raw scorings,
normalize_scoring's min==max branch returned 1.0 for every part,
wiping out the ranking. The dead band is meaningless for ranking
anyway because min-max normalization rescales to [0,1] and discards
any constant offset. The score is now the raw mean log10(Zact/Zreq),
which is monotonic and produces visible spread.
2. The catalogue overload of get_advised_magnetic now uses a stable
tiebreaker (lexicographic reference) when totalScoring values are
equal. std::sort on its own is unstable; equal-score blocks were
reordered between runs depending on input vector order, breaking
ranking determinism in the UI and tests.
Adds Test_CatalogueAdviser_Single_Filter_Ranking_Spread regression
test (smoke) which mutates a Web_1 catalogue Mas into 4 distinct turn
counts, runs the adviser with a single strict Impedance filter, and
asserts (a) underlying impedances differ, (b) >= 2 distinct scores,
(c) sort is monotonic.1 parent b508c94 commit 94df650
3 files changed
Lines changed: 109 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
375 | | - | |
376 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
377 | 385 | | |
378 | 386 | | |
379 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1920 | 1920 | | |
1921 | 1921 | | |
1922 | 1922 | | |
1923 | | - | |
| 1923 | + | |
1924 | 1924 | | |
1925 | 1925 | | |
1926 | | - | |
1927 | | - | |
1928 | | - | |
1929 | | - | |
1930 | | - | |
| 1926 | + | |
| 1927 | + | |
1931 | 1928 | | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
| 1929 | + | |
| 1930 | + | |
1935 | 1931 | | |
1936 | | - | |
| 1932 | + | |
1937 | 1933 | | |
1938 | | - | |
1939 | | - | |
1940 | | - | |
1941 | | - | |
1942 | | - | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
1943 | 1940 | | |
1944 | 1941 | | |
1945 | 1942 | | |
| |||
1953 | 1950 | | |
1954 | 1951 | | |
1955 | 1952 | | |
1956 | | - | |
| 1953 | + | |
1957 | 1954 | | |
1958 | 1955 | | |
1959 | | - | |
1960 | | - | |
| 1956 | + | |
1961 | 1957 | | |
1962 | 1958 | | |
1963 | 1959 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2608 | 2608 | | |
2609 | 2609 | | |
2610 | 2610 | | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
2611 | 2695 | | |
2612 | 2696 | | |
2613 | 2697 | | |
| |||
0 commit comments