Native magma --rl-bin transfer eval (closed and replay) - #6
Conversation
eval --backend magma reads BOLR and writes JSON actions. Replay locksteps blaze_cpu and Magma on the gated BOLR fields. test-eval-magma is the 32-tick harness. Camera stays compile-time 64x36 oc_pixel. 13-seed ladder not measured in this commit.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c01cf9b. Configure here.
| if (!replay) | ||
| magma_lane_fill(eval_magma_obs(mag[i]), i, cam, depth, edge, scal6, | ||
| pose, status, done_buf); | ||
| } |
There was a problem hiding this comment.
Replay ticks Magma after Blaze idles
High Severity
Replay still sends actions to Magma after a lane is finished or Blaze has set done. Blaze then idles while Magma keeps ticking, so the next gated compare reports DIVERGE even when the two sides matched until success, death, or the region-envelope stop. Batched seeds make this fire as soon as any sibling episode ends early.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c01cf9b. Configure here.
| if (replay) { | ||
| if (fns.step_full(env, act_rows, cfg->action_repeat, cam, depth, edge, | ||
| scal6, rew, done_buf, pose, status) != 0) | ||
| die("burn-in blaze step failed"); |
There was a problem hiding this comment.
die() orphans Magma child processes
Medium Severity
After Magma processes are spawned, several failures call die() instead of the fail cleanup that runs magma_close_n. Children inherit sibling pipe fds (no CLOEXEC) and SIGPIPE=IGN, so they do not exit when the parent vanishes. A failed nn_create, checkpoint load, or post-spawn alloc can leave dozens of ~193 MB magma_game processes hung.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit c01cf9b. Configure here.
|
Magma MATCH 56/65. Nine DIVERGE, all
Replay milestones equal cpu==cuda (policy reads blaze_cpu): t0:6, logs3:7, torches 0/13. Closed tries=5 is running on the same tmux chain. |
retrain_0821_best.bin closed Magma matches cpu and cuda (0/13 torches, t0:6 logs3:7). Replay MATCH 56/65; nine cam-px DIVERGE are not blessed. Gate 2 accept stays open.
|
Magma Side-by-side vs cpu (Mac) and cuda (gamer). Same protocol. Seed-by-seed match.
full chain (torches): 0/13. histogram t0:6, logs3:7. Replay (earlier): MATCH 56/65, 9 cam 1-5 px DIVERGE, not blessed. Gate 2 accept stays OPEN (0 torches). Docs: 358ea70.
|
Anvil is the faster CPU. Magma CPU, make test, tape replay, blaze M1/M2, and eval run there. Do not stage that work on gamer. Mac stays control plane and Metal.
Gamer ladder ALL_DONE. Dead net magma closed matches cpu and cuda. Replay MATCH 45/65. Gate 2 accept stays open.
|
Gamer ladder
Full four-eval chain:
Gate 2 accept stays OPEN. |


Native Magma transfer eval for the spawn-torch policy.
--rl-binis the Blaze policy camera (oc_pixel64x36). Magmawidth/heightstay 854x480. Camera size is compile-time. This is not a window/GPU mega-kernel swap and does not add a--rl-binresolution flag.What landed
blaze/rl/eval_magma.{h,c}: fork/execmagma_game --rl-bin --render off --pace unlimited --mobs off --snapshot-in. BOLR in, JSON act13 out. Look/craft/interact/smelt on sub-tick 0 ofaction_repeatonly.EvalMagmaObstwin,sizeof14628,_Static_assert64x36.eval --backend magma --transfer closed|replay(--magma-binoverride). Batched N Magma processes.--transfer closed: policy reads Magma BOLR.--transfer replay: policy reads blaze_cpu; same actions on Magma; first gated mismatch or MATCH. Gated fields: pose, inv, hotbar, coal, cam, depth, edge, dead, container (blocks/logs/tick excluded).make -C blaze/rl test-eval-magma(32 forward ticks, s10 t0). Not onmake test.How to run (from repo root)
Default
--tries 5.nn_sampleGumbel is batch-size dependent: n=1, n=13, and n=65 tables are not comparable. Magma RSS is ~193 MB; 65 processes need ~12.5 GB (gamer, not Mac).Measured (do not treat as Gate 2 accept)
Protocol: 13 seeds,
--stage 0, 5 tries x 6000 ticks,rng_seed=0,ni=seed_index*5+attempt, Gumbel n=65.retrain_0821_best.bincpu (Mac) == cuda (gamer) seed-by-seed:full chain (torches): 0/13; histogram t0:6, logs3:7.
ppo_ckpt_best.bincpu == cuda: t0:13, torches 0/13. Dead net.Magma tries=1 (Gumbel n=13, not comparable to the table above):
--transfer replay: MATCH, logs3.Comparable Magma tries=5 n=65 replay then closed is running on gamer (
eval-magma-ladder). This PR will get a docs commit when that table prints.Gate 2 accept stays OPEN. These nets place 0 torches on Magma.
Out of scope
Dragon-fight RL. Magma GPU tick. Changing
oc_pixel.Note
Medium Risk
Introduces a new multi-process eval path that drives live
magma_gameinstances and compares policy observations across backends; correctness and resource usage matter for transfer gates, but no auth or persistence changes.Overview
Adds native Magma transfer evaluation so checkpoints can be scored against
magma_game --rl-binwithout the removed Python eval scripts.New
eval_magma.{h,c}spawns onemagma_gamesubprocess per lane (JSON actions in, BOLR 64×36oc_pixelout), witheval --backend magma --transfer closed|replay. Closed feeds the policy from Magma observations; replay runs the net onblaze_cpuand replays the same actions on Magma, reporting MATCH/DIVERGE on gated fields (pose, inv, hotbar, coal, cam/depth/edge, dead, container).make -C blaze/rl test-eval-magmapins a 32-tick BOLR parity gate vsblaze_emit;eval-magmaruns the 13-seed closed ladder.Docs and ops shift Linux validation to anvil (not gamer for
make test, magma CPU, M1/M2, eval), update GATES row 2 with measured 13-seed numbers, and add Spawn → dragon ownership in the OPEN_DIVERGENCES files. Gate 2 accept remains open (0 torches on Magma).Reviewed by Cursor Bugbot for commit 479a2c4. Bugbot is set up for automated code reviews on this repo. Configure here.