fix: 淘汰判定改直接读预计算表(2y/10y)——不再依赖已废弃的内存缓存,读表毫秒级

This commit is contained in:
xxm
2026-08-15 22:55:15 +08:00
parent a95566f2e0
commit db9f41ce50
+4 -10
View File
@@ -730,16 +730,10 @@ def api_research_strategies():
_elim_reason = None
try:
_b2, _b10 = _get_benchmarks()
if _b2 is not None and _b10 is not None and pt in ('2y', '10y'):
_r2 = _regime_winrates if pt == '2y' else None
_r10 = _regime_winrates if pt == '10y' else None
# 缓存里拿另一周期(命中才判定,未命中本轮跳过)
_slots_c = _regime_winrates_cache.get("slots") or {}
if _r2 is None and ('2y' in _slots_c):
_r2 = _slots_c['2y'][1]
if _r10 is None and ('10y' in _slots_c):
_r10 = _slots_c['10y'][1]
if _r2 is not None and _r10 is not None:
if _b2 is not None and _b10 is not None:
# 读表拿 2y/10y 温区数据(毫秒级,数据加工层预计算)
_r2 = _compute_regime_winrates_cached('2y', _approx_regime_universality)
_r10 = _compute_regime_winrates_cached('10y', _approx_regime_universality)
_v2 = _r2.get(s['version']) or {}
_v10 = _r10.get(s['version']) or {}
if _v2 and _v10: