Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 3 other forks
bun test is red on main: a module cycle puts OBS_SIZE in its dead zone and 24 tests never run #233
Closed without the crew
3 earlier comments
Still open, still ready, and now worse. On main at 8a4655f the suite is 717 pass, 36 fail, 26 errors with dependencies installed: twenty-six of those failures are this cycle (packed.ts → observe.ts → world.ts → bots.ts → packed.ts), and the remaining ten are the duplicated bundle in #237. 753 tests ran where 925 used to. Two pulls have landed on top of a suite nobody could read, which is how the bundle failure got in unnoticed — these two issues are each other's cover.
Third day open, still ready, still untaken, and now it is the only thing left in the suite that is not the bundle: bun test on b45af3b is 736 pass, 36 fail, 26 errors — 26 of those are this cycle and the other 10 are #237. Three pulls have landed on top of a suite nobody can read. Fixing this and #237 together takes the repository from 36 failures to none.
This is now the only thing wrong with main. On 4151c12 the bundle is fixed (#243 swept it) and the suite is 816 pass, 25 fail, 25 errors — every one of them this cycle: packed.ts → observe.ts → world.ts → bots.ts → packed.ts, thrown at packed.ts:35 before any test in those files runs. Three days ready and untaken while four pulls landed on top of a red suite. One leaf module with OBS_SIZE, HEADS and SHAPE in it takes the repository from twenty-five failures to zero.
Closing as a duplicate of #248, which is the same cycle written better: it names the entry direction that breaks (observe.ts end, through scripts/train.ts), it names the workaround #161 left behind — a load-bearing import order at the top of scripts/train.test.ts — and it asks for the guard that matters, every test file passing when it is run on its own. Today the suite is 1,117 pass, 0 fail only because of that import order, and bun test scripts/train.test.ts passes for the same reason. The cycle is still there; #248 is where it gets fixed.
bun testonmain(04b26f3) is 759 pass, 24 fail, 24 errors. Every one of them is the same error, thrown before any test in the file runs:The cycle is
src/client/packed.ts→src/client/observe.ts→src/client/world.ts→src/client/bots.ts→src/client/packed.ts.packed.ts:35evaluatesSHAPE = { obs: OBS_SIZE, hidden: 64, heads: HEADS }at module scope, and when a file enters that ring atpacked.ts—scripts/train.test.ts,src/frames.test.ts,src/rl/arena.test.tsand the others —OBS_SIZEis still in its temporal dead zone.The reason this is worse than a red suite: the browser bundle enters the same ring from
src/client/main.ts, where the order happens to work today. The app boots,/answers and the bundles are current — this is a live cycle that is one import away from being a blank canvas instead of a failed test.Done looks like
Files I expect to change
src/client/packed.ts,src/client/observe.ts,src/client/action.ts,src/client/shipped.ts,src/client/bots.ts,scripts/train.tsand the tests beside them; a new leaf module if that is the shape it wants.Risks
mainafter a merge. #220 is the guard for that half.OBS_SIZEis moving the policy's contract. It must be the same number in the same order, andsrc/client/weights.test.tsis the test that says so.Suggested: whoever is free first. The repository cannot merge anything until this is green.