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

A small pod keeps room for the forge: a cell gets the pod's memory less the forge's own #12354

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A cell now gets at most min(75% of the pod's `memory.max`, the pod less 192 MiB). On a small pod the check hits its limit before the forge does.

shipped production is serving it deploy ce719ab

opened this

A cell now gets at most min(75% of the pod's memory.max, the pod less 192 MiB). On a small pod the check hits its limit before the forge does.

  • Ceiling values: memoryCeiling in src/apps/contain.ts gives 192 MiB on a 384 MiB pod, 320 on 512, 64 on 256 and 1536 on 2 GiB. These are asserted in test/memory-ceiling.test.ts.
  • Forge's own room: FORGE_OWN_MIB = 192, from the 170 MiB at rest measured in the issue plus headroom. The calculation sits in a new podShareMiB.
  • Warning text: the "declares memory … grants at most …" warning now says the pod ceiling is "less the forge's own 192 MiB". The old wording would have misdescribed the new ceiling.
  • Not done: FORGE_CELL_MEMORY_MAX_MIB still wins when it is set, so an operator can override the room on purpose. I also left the child-forge size ceiling (OWN_SIZE_SHARE) as it was.
  • Tests run: tsc --noEmit, scripts/gate.ts, the memory-ceiling test and four related memory/limit suites all pass here (the four are settings-check-memory, cell-kernel-limits, memory-hold, boundary-tenancy-limits). I did not run the whole suite; the forge's check does that on push.
  • How to try it: run bun test test/memory-ceiling.test.ts.

Closes #12346

commented

A cell now gets at most min(75% of the pod's memory.max, the pod less 192 MiB). On a small pod the check hits its limit before the forge does.

  • Ceiling values: memoryCeiling in src/apps/contain.ts gives 192 MiB on a 384 MiB pod, 320 on 512, 64 on 256 and 1536 on 2 GiB. These are asserted in test/memory-ceiling.test.ts.
  • Forge's own room: FORGE_OWN_MIB = 192, from the 170 MiB at rest measured in the issue plus headroom. The calculation sits in a new podShareMiB.
  • Warning text: the "declares memory … grants at most …" warning now says the pod ceiling is "less the forge's own 192 MiB". The old wording would have misdescribed the new ceiling.
  • Not done: FORGE_CELL_MEMORY_MAX_MIB still wins when it is set, so an operator can override the room on purpose. I also left the child-forge size ceiling (OWN_SIZE_SHARE) as it was.
  • Tests run: tsc --noEmit, scripts/gate.ts, the memory-ceiling test and four related memory/limit suites all pass here (the four are settings-check-memory, cell-kernel-limits, memory-hold, boundary-tenancy-limits). I did not run the whole suite; the forge's check does that on push.
  • How to try it: run bun test test/memory-ceiling.test.ts.
Approved

Approved. A cell now gets min(75% of pod memory, pod less 192 MiB), so on a small pod the check dies before the forge does. The change is small and single-purpose, and the new test asserts four pod sizes (384, 512, 256 and 2048 MiB) that would fail without it. The diff touches no web, TUI, input or auth paths and adds no dependency. The override via FORGE_CELL_MEMORY_MAX_MIB is kept, and the warning text is updated to match. I read the diff only; I did not fetch the preview or the screenshots.

Two things I would do next:

  1. Add a test for a pod at or below 192 MiB, where the Math.max(1, ...) floor gives a 1 MiB ceiling. Decide whether that is intended or whether the forge should say the pod is too small.
  2. Add the 192 MiB figure to the operator docs where FORGE_CELL_MEMORY_MAX_MIB is described, so an operator knows what the override replaces.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs