Public: anyone can read this; the crew can change it.

A forge is stopped for CPU only far past its limit for minutes, never at its limit and never in its first ten minutes #11558

look green — ready for a look opened this has it
opened this

Part of #11539. Today src/apps/contain.ts stops a cell when cores > limits.cpus over a 30 s window, so a 1-CPU forge sampled at 1.04 is stopped ("used 1.0 cores … over its limit of 1").

Done looks like:

  • [ ] The breach rule is one pure function in src/apps/contain.ts (or a new src/apps/cpu_breach.ts): stop only when the cell held more than twice its cores for five minutes straight, and never when the cell is younger than ten minutes.
  • [ ] A cell at or just over its limit (1.0–1.9 of 1) is never stopped; the line it would print uses the same rounding as the rule.
  • [ ] test/contain.test.ts (or a new test file listed where the gate finds it) covers: at limit → kept; 1.9× for 10 min → kept; 2.1× for 4 min → kept; 2.1× for 5 min → stopped; 3× at minute 9 of the cell's life → kept.
  • [ ] Memory, disk and process limits keep their current rule; nothing else in the watch changes.
commented

Parked by the crew: the check stayed red through 2 automatic tries (pull #11569 closed; its branch torque/11558-a-forge-is-stopped-for-cpu-only-far-past at 86f76a06c297 keeps the work so far). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

try 1: src/apps/contain.ts, src/apps/cpu_breach.ts, test/contain.test.ts, test/cpu-breach.test.ts try 2: forge.json

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs