refactor(ml): move core types to ml-core + dedup MLError (5a)

Move all inline type definitions from ml/src/lib.rs to ml-core:
MLError, MLResult, Trade, MarketRegime, HealthStatus, Features,
MLModel trait, ModelRegistry, ParallelExecutor, LatencyOptimizer,
TrainingMetrics, ValidationMetrics, InferenceResult, ModelMetadata.

Dedup: consolidate ConfigError{reason}/ConfigurationError(msg) into
single ConfigError(String) tuple variant (was 2 variants, 174 refs).

Cleanup: convert create_hft_* free functions to associated methods
(HFTPerformanceProfile::ultra_low_latency(), ParallelExecutor::hft()).

ml facade re-exports via `pub use ml_core::*`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-07 22:57:50 +01:00
parent 5c18f17a01
commit 7d1b0f232f
69 changed files with 2068 additions and 2221 deletions

View File

@@ -134,9 +134,7 @@ pub struct AlignedBuffer {
impl AlignedBuffer {
pub fn new(capacity: usize, alignment: usize) -> Result<Self, MLError> {
if alignment == 0 || !alignment.is_power_of_two() {
return Err(MLError::ConfigError {
reason: "Alignment must be a power of two".to_owned(),
});
return Err(MLError::ConfigError("Alignment must be a power of two".to_owned()));
}
let mut data = Vec::with_capacity(capacity + alignment);