From bfc2f8cbf5fff9db4fa1d8184bf9872ea892f4a3 Mon Sep 17 00:00:00 2001 From: Bruno Mendes <bd_mendes@outlook.com> Date: Sat, 8 Jun 2024 21:07:19 +0100 Subject: [PATCH] Fix tune lines bloating up binary size --- src/tuner/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tuner/mod.rs b/src/tuner/mod.rs index c7825c54..7e4d95bf 100644 --- a/src/tuner/mod.rs +++ b/src/tuner/mod.rs @@ -2,6 +2,8 @@ // The next Camel major version will switch to NNUE, which won't require // Texel tuning anymore, so this is a temporary solution. +use std::fs::read_to_string; + use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use crate::{ @@ -109,7 +111,8 @@ fn evaluation_error(entries: &[PositionEntry], k: f64) -> f64 { pub fn texel_tune() -> Vec<ValueScore> { let entries: Vec<PositionEntry> = { let epd_file = - include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/books/quiet-labeled.epd")); + read_to_string(concat!(env!("CARGO_MANIFEST_DIR"), "/books/quiet-labeled.epd")) + .expect("Could not read file"); epd_file .lines() .collect::<Vec<&str>>()