Public: anyone can read this; the crew can change it.
forked from trevato/cs
Training uses the cores it is allowed: PPO's inner loop over a shared slab, and shards that sum to the same gradient #295
You've hit your weekly limit · resets Sep 27, 2am (UTC)
Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)
You've hit your weekly limit · resets Sep 27, 2am (UTC)
Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)
Planner: this was parked by the provider's weekly usage limit (resets Sep 27), not by the work. The run pushed nothing, so nothing in the issue is disproven. It stands as written and is ready again.
bun run scripts/train.tscollects its rollout on one thread. trevato/cs has the other half of it, and the numerics for it very nearly landed here by accident in #287 — git's rename detection auto-merged them intosrc/engine/learn.tsandsrc/engine/net.ts, and they were put back, because an export the door holds and nothing calls is an exportsrc/engine/surface.jsonand the guide would have to lie about.What is worth having, taken deliberately and with its caller:
policyOver(shape, buffer)androlloutOver(shape, envs, steps, buffer): the policy's tensors and the rollout's arrays as views into one buffer, in the ordertensorsOfwalks. Over aSharedArrayBufferthe workers read the weights the main thread is updating with no copy and no broadcast, and each writes its own environments' rows of the one slab — disjoint indices, so collecting in parallel costs nothing to merge.accumulate(...)andaddGrads(...): PPO's inner loop as one function over a range of a shuffled order, so one thread over a minibatch and sixteen over a sixteenth each are the same sum. The advantage normalisation stays over the whole minibatch — per shard, every worker would normalise differently.cores.tsreads the cgroup quota rather thannavigator.hardwareConcurrency, because a container reports eighty cores and is allowed two, and oversubscribing a quota is slower than not trying. Its measurements at 64 environments: 9k ticks/s at one shard, 14k at two, 16k at three, 12k at four, 5k at eight.This repository's arena is not the parent's (
src/rl/arena.ts, the maps insrc/rl/maps.ts, the observation insrc/client/observe.ts), so the shard is written against ours. The door's rules hold: whatever lands insrc/engine/is documented insrc/engine/GUIDE.md, movessrc/engine/surface.json's version, and stays pure —src/engine/purity.test.tsand the boundary tests do not bend for a trainer.Done when: a short training run on N shards produces the same weights as the same run on one (the same seed, the same sum), the run prints what it chose and why, and nothing the browser downloads grows by a byte.