4B26P4BBEABLLGDY4IQS7QK6OW67EROEIQMHS36D2Z4TWDEK5Z2AC
TSJ7XPTOC6ATBEBQDJFYG4GVKVY3QSGL7KTO5PCAOSF2DM5APXMQC
CU3XNAGXZHXACBEDPM3THFT6AWAJ4HC5PXZM3Z72WWVMSHPOOXFQC
X3FYJUNL5ORLRC7TW3C5OMNZOX4JEWL73RXOQZLRKLAUBVNARIMAC
G4HJL4QLASCZBWYGCEXYYRBYL7UVX6ENELHRRBFB5UAXXGVVGZGQC
2TRWSYAHRLVT2V6FGRNHKYQZKFDCMKMJOI2G3HYMOVLSJMGSBFDQC
A46B5KNQFPTZEIL2JZKD2CQELGU3COE6FGTV2ABS5U7DVTVDGEBQC
FRUDIRWXGFOZERET3DNUNAZ5HSA3G32JZX6WMIXNGZOACTTCRIQAC
R5F5KMWWZ4VS67CSIWRNRM4LNPPXVXSQZLHEZMT6XZODV4AK2MBQC
RNEXG5IFDKMHSUR6RMNTI3Y32ORLVMZ6UJYKHLV2XBMT2QONBTVQC
XRCSCQWQKVYASIMAJO7JVUJXHXE44FZROCJPBW2BR7EE4RPEIBKAC
if (std.mem.eql(u8, input, "isready")) _ = try stdout.write("readyok\n");
if (std.mem.eql(u8, input, "isready")) {
if (search == null) {
search = Search.init(&gs) catch {
std.log.err("Unable to initialize Search interface, quitting...", .{});
std.os.exit(1);
};
}
_ = try stdout.write("readyok\n");
}
// var data: [3]nnue.NNUEdata = .{nnue.NNUEdata{
// .accumulator = nnue.Accumulator{
// .accumulation = [_][256]i16{[_]i16{0} ** 256} ** 2,
// .computedAccumulation = 0,
// },
// .dirtyPiece = nnue.DirtyPiece{
// .dirtyNum = 0,
// .pc = [_]c_int{0} ** 3,
// .from = [_]c_int{0} ** 3,
// .to = [_]c_int{0} ** 3,
// },
// }} ** 3;
if (!nnue_initialized) {
nnue.nnue_init(NNUE_FILE);
if (@as(c_int, 57) !=
nnue.nnue_evaluate_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"))
{
std.os.exit(1);
}
nnue_initialized = true;
// return @intCast(isize, nnue.nnue_evaluate_incremental(
// @enumToInt(gs.side),
// &sf_pieces,
// &sf_squares,
// @ptrCast([*c][*c]nnue.NNUEdata, &data),
// ));
return @intCast(isize, nnue.nnue_evaluate(@enumToInt(gs.side), &sf_pieces, &sf_squares));
}
pub fn init() !void {
nnue.nnue_init(NNUE_FILE);
if (@as(c_int, 57) !=
nnue.nnue_evaluate_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"))
{
return error.FailedToInitNNUE;