Weight persistence + background training thread #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#13
What to build
Make training survive restarts and run without blocking play. After this slice, the bot is production-ready: it trains asynchronously, persists weights atomically, and resumes learning after any crash or restart.
End-to-end slice:
.npyper tensor via Arraymancer'swrite_npy/read_npy. One file per weight tensor per directory.moveDir(rename) to final path. Incomplete temp dirs deleted on startup.weights/latest/: saved every round.weights/checkpoint_1/,checkpoint_2/,checkpoint_3/— saved every 50 rounds, rotating.latest/→ fall back to newest checkpoint → fall back to random init.weights/tmp_*directories from prior crashes.Acceptance criteria
weights/latest/every roundBlocked by
Resolved in
f27b023. Atomic .npy weight save/load (temp dir + rename), weights/latest/ every round, 3 rotating checkpoints every 50 rounds, startup loading chain (latest→checkpoint→random), stale temp cleanup, background training thread with atomic pointer swap and stale pass dropping. Training progress shown in game UI pera8ee2a8.