diff --git a/crates/fidc-core/src/data.rs b/crates/fidc-core/src/data.rs index 177e41b..65dbcd2 100644 --- a/crates/fidc-core/src/data.rs +++ b/crates/fidc-core/src/data.rs @@ -5093,6 +5093,15 @@ mod tests { ) .unwrap(); + let lexical_symbols = ["000001.SZ", "000300.SH", "600000.SH"]; + let lexical_symbol_ids = lexical_symbols.map(|symbol| data.symbol_id(symbol).unwrap()); + assert!( + lexical_symbol_ids + .windows(2) + .all(|window| window[0] < window[1]), + "symbol ids are the stable lexical tie-break key" + ); + for symbol in ["000001.SZ", "600000.SH"] { let symbol_id = data.symbol_id(symbol).unwrap(); let day = data.daily_snapshot_view(date); diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index b477003..1da72eb 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -10301,15 +10301,7 @@ impl PlatformExprStrategy { .unwrap_or(std::cmp::Ordering::Equal) }; if ordering == std::cmp::Ordering::Equal { - let lhs_symbol = &universe_factor_day - .factor(lhs.0) - .expect("ranked candidate references missing factor row") - .symbol; - let rhs_symbol = &universe_factor_day - .factor(rhs.0) - .expect("ranked candidate references missing factor row") - .symbol; - lhs_symbol.cmp(rhs_symbol) + lhs.0.cmp(&rhs.0) } else { ordering } @@ -11028,15 +11020,7 @@ impl PlatformExprStrategy { .unwrap_or(std::cmp::Ordering::Equal) }; if ordering == std::cmp::Ordering::Equal { - let lhs_symbol = &universe_factor_day - .factor(lhs.0) - .expect("quote-plan candidate references missing factor row") - .symbol; - let rhs_symbol = &universe_factor_day - .factor(rhs.0) - .expect("quote-plan candidate references missing factor row") - .symbol; - lhs_symbol.cmp(rhs_symbol) + lhs.0.cmp(&rhs.0) } else { ordering }