PGG106 / Alexandria

bitboard chess engine
GNU General Public License v3.0
97 stars 26 forks source link

Clean Nnue updates #304

Closed PGG106 closed 8 months ago

PGG106 commented 10 months ago

typedef std::vector<std::pair<std::size_t, std::size_t>> so it looks less stupid. Rewrite the entire inference to just iterate over the change lists, IE:

using CiekceISveryCool = std::vector<std::pair<std::size_t, std::size_t>>;

void NNUE::update(NNUE::accumulator& board_accumulator, PleaseCiekce& NNUEAdd, PleaseCiekce& NNUESub) {
    for (const auto [whiteAddIdx, blackAddIdx] : NNUEAdd) {
        add(board_accumulator, whiteAddIdx, blackAddIdx);
    }

    for (const auto [whiteSubIdx, blackSubIdx] : NNUESub) {
        sub(board_accumulator, whiteSubIdx, blackSubIdx);
    }

    // Reset the add and sub vectors
    NNUEAdd.clear();
    NNUESub.clear();
}

what is actually left to do: what a proper sub and add function.

PGG106 commented 8 months ago

consensus is this isn't doable without sacrificing performance, therefore it's time to give up.