Cleanup comments and some code reorg.

passed STC:
https://tests.stockfishchess.org/tests/view/6536dc7dcc309ae83955b04d
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 58048 W: 14693 L: 14501 D: 28854
Ptnml(0-2): 200, 6399, 15595, 6669, 161

closes https://github.com/official-stockfish/Stockfish/pull/4846

No functional change
This commit is contained in:
Joost VandeVondele
2023-10-23 22:49:37 +02:00
parent d6a5c2b085
commit ec02714b62
8 changed files with 43 additions and 36 deletions
+2 -2
View File
@@ -407,8 +407,8 @@ bool save_eval(const std::optional<std::string>& filename) {
{
if (currentEvalFileName != EvalFileDefaultName)
{
msg =
"Failed to export a net. A non-embedded net can only be saved if the filename is specified";
msg = "Failed to export a net. "
"A non-embedded net can only be saved if the filename is specified";
sync_cout << msg << sync_endl;
return false;
+2 -1
View File
@@ -256,7 +256,8 @@ class AffineTransform {
else if constexpr (OutputDimensions == 1)
{
// We cannot use AVX512 for the last layer because there's only 32 inputs and the buffer is not padded to 64 elements.
// We cannot use AVX512 for the last layer because there are only 32 inputs
// and the buffer is not padded to 64 elements.
#if defined(USE_AVX2)
using vec_t = __m256i;
#define vec_setzero _mm256_setzero_si256
+2 -2
View File
@@ -113,8 +113,8 @@ struct Network {
ac_1.propagate(buffer.fc_1_out, buffer.ac_1_out);
fc_2.propagate(buffer.ac_1_out, buffer.fc_2_out);
// buffer.fc_0_out[FC_0_OUTPUTS] is such that 1.0 is equal to 127*(1<<WeightScaleBits) in quantized form
// but we want 1.0 to be equal to 600*OutputScale
// buffer.fc_0_out[FC_0_OUTPUTS] is such that 1.0 is equal to 127*(1<<WeightScaleBits) in
// quantized form, but we want 1.0 to be equal to 600*OutputScale
std::int32_t fwdOut =
int(buffer.fc_0_out[FC_0_OUTPUTS]) * (600 * OutputScale) / (127 * (1 << WeightScaleBits));
std::int32_t outputValue = buffer.fc_2_out[0] + fwdOut;
+4 -2
View File
@@ -338,8 +338,10 @@ class FeatureTransformer {
// NOTE: The parameter states_to_update is an array of position states, ending with nullptr.
// All states must be sequential, that is states_to_update[i] must either be reachable
// by repeatedly applying ->previous from states_to_update[i+1] or states_to_update[i] == nullptr.
// computed_st must be reachable by repeatedly applying ->previous on states_to_update[0], if not nullptr.
// by repeatedly applying ->previous from states_to_update[i+1] or
// states_to_update[i] == nullptr.
// computed_st must be reachable by repeatedly applying ->previous on
// states_to_update[0], if not nullptr.
template<Color Perspective, size_t N>
void update_accumulator_incremental(const Position& pos,
StateInfo* computed_st,