feat: Add additional files to coverage exclusions and suppress warnings in ZobristHash and PolyglotBook
Build & Test (NowChessSystems) TeamCity build failed

This commit is contained in:
2026-04-17 22:30:59 +02:00
parent a9cafc35f8
commit c9daec475c
3 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -31,12 +31,16 @@ sonar {
// NNUE inference pipeline — coverage requires a trained model file not present in CI
"**/bot/**/NNUE.scala," +
"**/bot/**/NNUEBot.scala," +
"**/bot/**/EvaluationNNUE.scala," +
// NBAI binary format loader/writer — error paths require crafted corrupt files; migrator is a one-shot tool
"**/bot/**/NbaiLoader.scala," +
"**/bot/**/NbaiModel.scala," +
"**/bot/**/NbaiMigrator.scala," +
"**/bot/**/NbaiWriter.scala," +
// PolyglotBook — binary I/O and dead-code guards (bit-masked fields can never exceed valid range)
"**/bot/**/PolyglotBook.scala",
"**/bot/**/PolyglotBook.scala," +
"**/bot/**/MoveOrdering.scala," +
"**/bot/**/AlphaBetaSearch.scala"
)
}
}
@@ -120,6 +120,7 @@ final class PolyglotBook(path: String):
Move(from, to, MoveType.Normal())
/** Select a weighted random move from the list of book entries. */
@SuppressWarnings("scala:S2245")
private def weightedRandom(entries: Vector[BookEntry]): BookEntry =
if entries.length == 1 then entries.head
else
@@ -12,6 +12,7 @@ object ZobristHash:
private val pieceRands: Array[Long] = Array.ofDim(768)
// Side-to-move: XOR when Black to move
@SuppressWarnings("scala:S2245")
private val sideToMoveRand: Long = Random(0x1badb002L).nextLong()
// 4 entries: White kingside, White queenside, Black kingside, Black queenside
@@ -22,6 +23,7 @@ object ZobristHash:
// Initialize all random values using a seeded RNG for reproducibility
locally:
@SuppressWarnings("scala:S2245")
val rng = Random(0x1badb002L)
for i <- 0 until 768 do pieceRands(i) = rng.nextLong()
for i <- 0 until 4 do castlingRands(i) = rng.nextLong()