From 7397a2d69fd4f0a6ce508103ddd589ac540b4786 Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 8 Jul 2026 11:14:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80=E5=B9=B3=E5=8F=B0=E9=80=89?= =?UTF-8?q?=E8=82=A1=E7=BC=BA=E6=8E=92=E5=90=8D=E5=AD=97=E6=AE=B5=E8=AF=8A?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fidc-core/src/platform_expr_strategy.rs | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index 17b0d61..ec93cb4 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -7042,6 +7042,8 @@ impl PlatformExprStrategy { 5, ); let mut candidates = Vec::new(); + let mut missing_rank_count = 0usize; + let mut missing_rank_examples = Vec::new(); for candidate in universe { let stock = self.selection_stock_state_with_factor_date( ctx, @@ -7064,11 +7066,9 @@ impl PlatformExprStrategy { } let rank_value = self.rank_value(ctx, day, &candidate, &stock)?; if !rank_value.is_finite() { - if diagnostics.len() < 12 { - diagnostics.push(format!( - "{} rejected by missing rank field", - candidate.symbol - )); + missing_rank_count += 1; + if missing_rank_examples.len() < 5 { + missing_rank_examples.push(candidate.symbol.clone()); } continue; } @@ -7114,6 +7114,13 @@ impl PlatformExprStrategy { break; } } + if selected.len() < limit && missing_rank_count > 0 && diagnostics.len() < 12 { + diagnostics.push(format!( + "rank_field_unavailable count={} examples={}", + missing_rank_count, + missing_rank_examples.join(",") + )); + } Ok((selected, diagnostics, risk_decisions)) } @@ -7709,6 +7716,8 @@ impl PlatformExprStrategy { ) -> Result<(Vec, Vec, usize, Vec), BacktestError> { let mut diagnostics = Vec::new(); let mut candidates = Vec::new(); + let mut missing_rank_count = 0usize; + let mut missing_rank_examples = Vec::new(); let quote_usage = self.stock_filter_quote_usage(); let selection_risk_deferral = if ctx.is_lagged_execution() { SelectionRiskDeferral::All @@ -7748,11 +7757,9 @@ impl PlatformExprStrategy { } let rank_value = self.rank_value(ctx, day, &candidate, &stock)?; if !rank_value.is_finite() { - if diagnostics.len() < 12 { - diagnostics.push(format!( - "{} quote_plan rejected by missing rank field", - candidate.symbol - )); + missing_rank_count += 1; + if missing_rank_examples.len() < 5 { + missing_rank_examples.push(candidate.symbol.clone()); } continue; } @@ -7812,6 +7819,17 @@ impl PlatformExprStrategy { break; } } + if (selected_symbols.len() < selection_limit + || quote_candidate_symbols.len() < quote_candidate_limit) + && missing_rank_count > 0 + && diagnostics.len() < 12 + { + diagnostics.push(format!( + "quote_plan_rank_field_unavailable count={} examples={}", + missing_rank_count, + missing_rank_examples.join(",") + )); + } Ok(( quote_candidate_symbols, selected_symbols,