Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.97 KB

testing.md

File metadata and controls

53 lines (34 loc) · 1.97 KB

Testing

Quick start

sbt test

Runs the full ScalaTest suite: unit tests under src/test/scala/... plus heavier cases in the integration/ package. Tests are forked and serial (Test / parallelExecution := false) so LibTorch / JavaCPP natives stay stable.

Prefer Temurin / OpenJDK 21 locally and in CI. JDK 25+ has been seen to SIGSEGV mid-genmove with LibTorch in longer GTP sessions.

GitHub Actions (Linux): Dual-ResNet / LibTorch construction currently aborts on GHA runners with glibc malloc(): unaligned tcache chunk detected, after which forked sbt test hangs. CI therefore skips suites that construct or load Storch models (CI=true unless SCALPHAGO_NATIVE_TESTS=true). Run the full suite locally on macOS / a known-good Linux host.

Single suites

# Fast board / rules
sbt "testOnly org.deeplearning4j.scalphagozero.board.*"

# Agents / MCTS (mostly stubs; a few create tiny Dual-ResNets)
sbt "testOnly org.deeplearning4j.scalphagozero.agents.*"

# One integration suite
sbt "testOnly org.deeplearning4j.scalphagozero.integration.GtpIntegrationTest"
sbt "testOnly org.deeplearning4j.scalphagozero.integration.SelfPlayIntegrationTest"

Slow / native-heavy tests

These load Dual-ResNet checkpoints or run self-play and are slower than pure board/encoder tests:

  • integration/GtpIntegrationTest, ScalphaGoEngineTest
  • integration/SelfPlayIntegrationTest, TrainIntegrationTest, ModelSaveLoadIntegrationTest
  • ml/PolicyValueModelsTest, AgzFidelityTest (tiny net create), CUDA parity (StorchCudaParityTest)

There is no separate sbt IntegrationTest config; everything runs under sbt test.

Optional GPU

sbt -Dscalphago.cuda=true test

See gpu.md. GPU tests use assume(torch.cuda.isAvailable) where needed.

Coverage (soft)

sbt coverage test coverageReport

HTML report: target/scala-*/scoverage-report/index.html. CI uploads this as an artifact; there is no coverage floor yet.