Skip to content

Cap bounded robustness worker resources - #511

Merged
Anionix merged 1 commit into
mainfrom
codex/issue-301-worker-rlimits
Jul 24, 2026
Merged

Cap bounded robustness worker resources#511
Anionix merged 1 commit into
mainfrom
codex/issue-301-worker-rlimits

Conversation

@Anionix

@Anionix Anionix commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • apply non-raiseable worker limits before importing the heavyweight robustness graph
  • enforce Linux address space plus Unix file-size, open-file, and finite real-user process ceilings while preserving tighter inherited limits
  • record requested, child-confirmed effective, unsupported, and application-status evidence per case and per run
  • reject missing or contradictory child limit evidence as HARNESS_FAILED / UNCONFIRMED
  • record Darwin RLIMIT_AS as unsupported and track the remaining containment risk in [Accepted risk] Enforce bounded-worker memory containment on macOS #510

Research and lifecycle contract

  • Primary contracts: https://docs.python.org/3.12/library/resource.html and https://man7.org/linux/man-pages/man2/getrlimit.2.html
  • Limit setup failure remains incomplete, non-ranking evidence and never advances lifecycle state.
  • RLIMIT_NPROC is a real-user aggregate, not a per-worker child count; the 512 ceiling leaves headroom for existing runner processes and library threads while remaining finite.
  • Real UID 0 and Linux CAP_SYS_ADMIN / CAP_SYS_RESOURCE contexts record NPROC as unsupported because the kernel exemption makes the numeric limit unenforced.

Validation at exact SHA

Target: a64942fd17d6ac866f24fde77a3d60826e2b9cbe

  • pytest tests/test_robustness_limits.py tests/test_robustness_runner.py::test_default_worker_does_not_claim_unconfirmed_resource_limits tests/test_robustness_profile.py::test_public_cli_runs_and_reports_bounded_fixture: 6 passed
  • Ruff changed-file check: passed
  • ty focused implementation check: passed
  • Pyright 1.1.411: 0 errors
  • fixed-SHA spec review: no findings
  • fixed-SHA standards review: no findings
  • Lean: NO_LEAN (Python/config-only slice)

CI and review feedback incorporated

  • First exact-SHA run exposed Pyright narrowing errors; fixed with explicit typed validation.
  • Second exact-SHA run reached 600 passed / 3 skipped but showed RLIMIT_NPROC=32 blocked every Linux bounded worker. The real-user ceiling is now 512; tighter inherited caps still win.
  • Third exact-SHA run passed all checks. Pre-merge review then identified privileged Linux NPROC exemptions; those contexts now record the cap as unsupported instead of applied.

Diff note

The cohesive change is above the usual 250-line risk signal because the bootstrap boundary, evidence schema, report output, and success/failure/privilege regressions must land atomically; splitting them would create a dependent stacked PR, which this repository forbids.

Fixes #301
Refs #510

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 668e3ed3e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/format_bench/worker_limits.py Outdated
@Anionix
Anionix force-pushed the codex/issue-301-worker-rlimits branch 2 times, most recently from 859d991 to c578333 Compare July 24, 2026 09:56
@Anionix
Anionix force-pushed the codex/issue-301-worker-rlimits branch from c578333 to a64942f Compare July 24, 2026 10:11
@Anionix
Anionix merged commit 50cff19 into main Jul 24, 2026
6 checks passed
@Anionix
Anionix deleted the codex/issue-301-worker-rlimits branch July 24, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DFL-AUDIT-108] Memory/process/file limits

1 participant