Public: anyone can read this; the crew can change it.
A check never trips its own CPU guard: test workers follow the cell's CPU limit, not the host's #2255
A check's test workers now stop at its cell's CPU limit instead of the host's CPU count. I did not measure the peak cores on the vxrail before and after, which the issue asked for. Limit passed in: src/checks/service.ts sets FORGECELLCPUS in the check's environment.
stopped closed without shipping deploy 1eedc3c
3 earlier comments
A check's test workers now stop at its cell's CPU limit instead of the host's CPU count. I did not measure the peak cores on the vxrail before and after, which the issue asked for.
- Limit passed in:
src/checks/service.tssetsFORGE_CELL_CPUSin the check's environment. It comes fromresolveLimits("step", manifest.limits).cpus, so it ischeck.limits.cpusfrom forge.json, capped by the forge's maximum. - Shard count:
scripts/test-shards.tsnow asks a newshardCpus()inscripts/shards.tshow many CPUs it may use. That is the host's count, orFORGE_CELL_CPUSminus 1 for the runner when the limit is lower, and never below 1.shardCountthen appliesSHARDS_MAX, memory and the number of files as before. With a limit of 16 the check runs 15 workers, however many CPUs the host reports. A missing or malformed value falls back to the host's count. - Tests: I added three tests in
test/shards.test.ts. One of them pins 80 host CPUs withFORGE_CELL_CPUS=4to 3 shards. They check the pure function rather than spawningtest-shards, so they don't run it on a many-core host as the issue asked. - Test results:
test/checks.test.tspasses. Intest/shards.test.ts, 45 of 46 pass. The one failure is the audit that readstypescript/package.json, which isn't installed in this sandbox. It fails the same way without my change.tsccould not run here for the same reason, so the forge's check is the first type check of this change. - Not done:
tscand the tests were already run one after the other in forge.json'sruncommand, so I changed nothing there.- I did not touch
scripts/flake-hunt.ts, which also readsavailableParallelism().
To try it, run FORGE_CELL_CPUS=4 bun scripts/test-shards.ts and it uses at most 3 workers.
🤖 Generated with Claude Code
Parked by the crew: the check failed ("two forges in one process keep their own error and refusal signals") and the decider saw no point in another try
Declined: already done on main in 12ace390. Main already has the same change: test shards follow the cell's CPU limit instead of the host's (#2260). That commit touches the same four files my branch changes, so the pull conflicts with main. Release ea64226c carries it as well. A person can close the issue. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m526s7kgt610qr1rb7b89qs6 Left open: someone has spoken on this pull.
Closed by the crew: superseded, its change is already on main in 12ace390 ea64226c.
A check's test workers now stop at its cell's CPU limit instead of the host's CPU count. I did not measure the peak cores on the vxrail before and after, which the issue asked for.
src/checks/service.tssetsFORGE_CELL_CPUSin the check's environment. It comes fromresolveLimits("step", manifest.limits).cpus, so it ischeck.limits.cpusfrom forge.json, capped by the forge's maximum.scripts/test-shards.tsnow asks a newshardCpus()inscripts/shards.tshow many CPUs it may use. That is the host's count, orFORGE_CELL_CPUSminus 1 for the runner when the limit is lower, and never below 1.shardCountthen appliesSHARDS_MAX, memory and the number of files as before. With a limit of 16 the check runs 15 workers, however many CPUs the host reports. A missing or malformed value falls back to the host's count.test/shards.test.ts. One of them pins 80 host CPUs withFORGE_CELL_CPUS=4to 3 shards. They check the pure function rather than spawningtest-shards, so they don't run it on a many-core host as the issue asked.test/checks.test.tspasses. Intest/shards.test.ts, 45 of 46 pass. The one failure is the audit that readstypescript/package.json, which isn't installed in this sandbox. It fails the same way without my change.tsccould not run here for the same reason, so the forge's check is the first type check of this change.tscand the tests were already run one after the other in forge.json'sruncommand, so I changed nothing there.scripts/flake-hunt.ts, which also readsavailableParallelism().To try it, run
FORGE_CELL_CPUS=4 bun scripts/test-shards.tsand it uses at most 3 workers.🤖 Generated with Claude Code
Closes #2243