Skip to content

feat(bench): run Frontier-Bench on Modal, where all 74 tasks fit - #1048

Merged
macanderson merged 1 commit into
mainfrom
frontier-modal-env
Aug 1, 2026
Merged

feat(bench): run Frontier-Bench on Modal, where all 74 tasks fit#1048
macanderson merged 1 commit into
mainfrom
frontier-modal-env

Conversation

@macanderson

@macanderson macanderson commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Follow-on to #1031. That PR landed the Frontier-Bench lane but it could only ever produce a development baseline — on this laptop's 10 GB / 6-CPU Docker VM the plan is 48 of 74. A submittable run must cover all 74 tasks, four of which want a GPU, without overriding any task's declared resources. No amount of scheduling fixes that; it needs a machine that can hand a container 32 GB and an H100 on demand.

FB_ENV now selects the backend. On modal the plan is 74/74 with zero exclusions.

FB_ENV=modal FB_CONCURRENCY=32 bench/evidence/frontier/fetch_dataset.sh

Three things change with the backend

Each because a docker assumption is false there, not merely cautious:

why
Nothing excluded for capacity Modal builds a sandbox per trial from that trial's own declared resources, so "does this task fit" is the wrong question. Carrying the laptop's exclusions over would produce a 48-task result that looks exactly like a complete one.
GPU tasks default to on Harbor passes each task's gpus/gpu_types straight through. Defaulting them off would silently drop the four tasks a submission is required to cover — the same plausible-wrong-number failure this lane exists to prevent, inverted. --no-allow-gpu still wins when said explicitly, which is why the flag is tri-state rather than store_true.
warm_images.sh skips The builds happen in the cloud; a local pull warms a cache no trial reads.

What does not change: the glibc-2.17 portability assert runs on both. Modal is a different scheduler, not a different libc — a binary that cannot exec would fail there the same way it did on 2026-07-31, as an ordinary reward-0 row.

Upload, opt-in

--upload is now wired behind FB_UPLOAD=1, private by default. The leaderboard requires publicly readable trials — CI re-derives every trial from the uploaded job and a maintainer's LLM judge reads every trajectory — so FB_UPLOAD_VISIBILITY=public publishes the agent's full reasoning and every command it ran, permanently. That is a deliberate act, and it must never be inherited from a shell that had it set for an earlier run.

Posture reporting

primary.sh now names every reason a run would be refused as a submission, not the first:

posture=development-baseline — not submittable: tier=small(needs-all) attempts=1(needs-5)
  excluded=26(needs-0) upload=off visibility=private(needs-public)

posture=submission-shaped

An operator who fixes one gap and reruns only to be told about the next has paid for a full run to learn something one line could have said.

Also

setup_venv.sh installs the modal extra and passes --clear, so it is idempotent — it previously failed the moment a venv existed, which is exactly when you want to run it (after changing the Harbor pin or adding an extra). Installing the extra unconditionally means switching backends is one variable rather than a rebuild, and lets the preflight tell "modal is not authenticated" apart from "the SDK was never installed" — different problems, different fixes.

Verified

  • Full Modal chain end to end: dataset fetch → plan 74/74, 0 excludedwarm_images.sh correctly skips.
  • Docker path unchanged: 48/74, same exclusions and reasons as before.
  • --no-allow-gpu on Modal → 70/74, so the operator override genuinely wins.
  • Modal auth confirmed live (~/.modal.toml, workspace reachable), and the preflight distinguishes missing-SDK from unauthenticated.
  • 27 planner tests (6 new for the backend), shell syntax + shellcheck clean.
  • Nothing under bench/harbor_adapter/ is touched — the digest-frozen tree stays untouched, same as feat(bench): a Frontier-Bench lane that keeps the adapter untouched #1031.

Not done

No paid trial has run. The sentinel now works against either backend but is still unexecuted; that is the next step and it costs money. A real submission is ~370 multi-hour trials with no spend cap — a four-figure decision that deserves the same preregistration the Terminal-Bench claim got. The upstream intake (PR #1405) is also still unmerged.

Summary by Sourcery

Add a selectable backend for Frontier-Bench runs (docker vs Modal), enabling full 74-task planning on Modal while keeping docker behavior unchanged, and wire upload posture and reporting around this.

New Features:

  • Introduce a Modal backend that provisions capacity per task, allowing plans that include all 74 Frontier-Bench tasks without host-based exclusions.
  • Expose backend selection, concurrency, and GPU allowance via CLI flags and FB_ENV/FB_CONCURRENCY/FB_ALLOW_GPU environment variables, with sensible defaults per backend.
  • Add opt-in upload controls (FB_UPLOAD and FB_UPLOAD_VISIBILITY) so runs can be explicitly published to Harbor Hub as public or kept private.
  • Record backend and upload posture in run output, and report overall submission posture including all reasons a run is or is not submittable.

Enhancements:

  • Make the planning logic support explicit concurrency overrides across backends and propagate the chosen backend into the plan metadata.
  • Refine preflight checks to validate the selected backend, including distinguishing missing Modal SDK from unauthenticated Modal credentials.
  • Update scripts (primary.sh, sentinel.sh, warm_images.sh) to respect the chosen backend, skipping local image warming and using the correct Harbor env as needed.
  • Improve documentation in README and SUBMISSION.md to describe backend choice, Modal workflow, hardware constraints, and submission posture.
  • Make setup_venv.sh idempotent by clearing the venv and always installing the harbor[modal] extra, simplifying backend switching.

Tests:

  • Add Modal backend planner tests to ensure Docker capacity is ignored, GPU tasks are runnable, explicit concurrency overrides are honored, and backend is recorded in plans.

The lane could only ever produce a development baseline. A submittable
run must cover all 74 tasks, four of which want a GPU, without overriding
any task's declared resources — so it needs a machine that can hand a
container 32 GB and an H100 on demand. This laptop's Docker VM is 10 GB
with no GPU, and no amount of scheduling fixes that: the plan was 48/74.

FB_ENV now selects the backend. On modal the plan is 74/74.

Three things change with the backend, each because a docker assumption is
false there rather than merely cautious:

* Nothing is excluded for capacity. Modal builds a sandbox per trial from
  that trial's own declared resources, so "does this task fit" is the
  wrong question. Carrying the laptop's exclusions over would produce a
  48-task result that looks exactly like a complete one.

* GPU tasks default to on. Harbor passes each task's gpus/gpu_types
  straight through. Defaulting them off there would silently drop the
  four tasks a submission is required to cover — the same
  plausible-wrong-number failure this lane exists to prevent, inverted.
  --no-allow-gpu still wins when said explicitly, which is why the flag
  is tri-state rather than store_true.

* warm_images.sh skips. The builds happen in the cloud; a local pull
  warms a cache no trial reads.

What does not change: the glibc-2.17 assert runs on both. Modal is a
different scheduler, not a different libc, and a binary that cannot exec
would fail there the same way it did on 2026-07-31 — as a reward-0 row.

Also wires --upload, opt-in behind FB_UPLOAD with private visibility by
default. The leaderboard requires publicly readable trials, so this
publishes every trajectory and every command the agent ran, permanently.
That is a deliberate act and must never be inherited from a shell that
had it set for an earlier run.

primary.sh now names *every* reason a run would be refused as a
submission — tier, attempts, any excluded task, upload off, visibility
private — rather than the first. An operator who fixes one and reruns
only to be told about the next has paid for a full run to learn something
one line could have said.

setup_venv.sh installs the modal extra and passes --clear, so it is
idempotent; it previously failed the moment a venv existed, which is
exactly when you want to run it.

27 planner tests (6 new for the backend), shell syntax and shellcheck
clean. Nothing under bench/harbor_adapter/ is touched.
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
stella-cli-docs Ignored Ignored Aug 1, 2026 12:26am

@sourcery-ai

sourcery-ai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds support for running Frontier-Bench on a Modal backend with per-task sandboxes, introduces backend-aware planning and concurrency overrides, makes GPU usage and uploading explicitly configurable and opt-in, and improves posture reporting and venv setup while keeping the Docker path and Harbor adapter tree unchanged.

Sequence diagram for submission-shaped run with upload and posture reporting

sequenceDiagram
  actor Operator
  participant EnvSh as env.sh
  participant Fetch as fetch_dataset.sh
  participant PlanPy as plan.py
  participant Primary as primary.sh
  participant Harbor as harbor run

  Operator->>EnvSh: set FB_ENV=modal FB_ATTEMPTS=5 FB_CONCURRENCY=32
  Operator->>EnvSh: set FB_UPLOAD=1 FB_UPLOAD_VISIBILITY=public
  EnvSh-->>Operator: exports FB_ENV, FB_CONCURRENCY, FB_UPLOAD, FB_UPLOAD_VISIBILITY

  Operator->>Fetch: run fetch_dataset.sh
  Fetch->>PlanPy: python3 plan.py --backend $FB_ENV --concurrency $FB_CONCURRENCY
  PlanPy->>PlanPy: _elastic_capacity() when backend=="modal"
  PlanPy-->>Fetch: write plan.json (backend=modal, tiers, excluded)

  Operator->>Primary: run primary.sh all fb-submission-01
  Primary->>Primary: compute EXCLUDED_N from plan.json
  Primary->>Primary: build UPLOAD_FLAGS from FB_UPLOAD / FB_UPLOAD_VISIBILITY
  Primary-->>Operator: print posture=submission-shaped or development-baseline

  Primary->>Harbor: harbor run --env $FB_ENV $INCLUDES $UPLOAD_FLAGS
  Harbor-->>Primary: exit status
  Primary-->>Operator: print harbor_exit and finished timestamp
Loading

Flow diagram for backend selection and planning on docker vs modal

flowchart TD
  Operator["Operator sets FB_ENV and FB_CONCURRENCY"] --> Env["env.sh loads FB_ENV, FB_ALLOW_GPU"]
  Env --> Fetch["fetch_dataset.sh"]
  Fetch -->|calls| PlanPy["plan.py build_plan(dataset_dir, allow_gpu, memory_headroom_mb, backend, concurrency)"]
  PlanPy -->|backend=docker| HostCap["_host_capacity"]
  PlanPy -->|backend=modal| ElasticCap["_elastic_capacity"]
  PlanPy --> PlanOut["plan.json (backend, tiers.concurrency, excluded)"]
  PlanOut --> Sentinel["sentinel.sh harbor run --env $FB_ENV"]
  PlanOut --> Primary["primary.sh harbor run --env $FB_ENV"]
  Primary --> Warm["warm_images.sh (skips when FB_ENV=modal)"]
Loading

File-Level Changes

Change Details Files
Backend-aware planning: introduce a Modal backend with elastic capacity, explicit concurrency overrides, and backend recorded in the plan, while keeping Docker behavior intact.
  • Add _elastic_capacity helper to model per-task sandbox capacity with unbounded memory/CPU and GPU available.
  • Extend build_plan to accept backend and concurrency arguments, switching between elastic and host capacity and recording backend in the returned plan.
  • Adjust tier concurrency calculation to respect an explicit concurrency override across both backends, falling back to capacity-derived arithmetic only when unset.
  • Update CLI in plan.py to accept backend and concurrency flags, wire FB_ENV/FB_CONCURRENCY defaults, and print backend-specific host/capacity information.
  • Implement tri-state GPU CLI flags (--allow-gpu/--no-allow-gpu) so backend-dependent defaults can be overridden explicitly.
bench/evidence/frontier/plan.py
Planner tests extended to cover Modal backend semantics, concurrency override behavior, and backend recording.
  • Add TestModalBackend test class validating that oversized tasks still run on Modal, GPU tasks are runnable even if the host lacks a GPU, and Docker host probing is not used for backend=modal.
  • Add tests to ensure explicit concurrency overrides capacity-derived values on both Modal and Docker, and that backend defaults to docker when unspecified.
  • Keep existing TestPlanShape and other tests intact while increasing total planner tests to cover new backend behaviors.
bench/evidence/frontier/tests/test_plan.py
Environment configuration gains backend selection, upload controls, and backend-aware preflight for Docker vs Modal, including Modal SDK/auth checks.
  • Introduce FB_ENV with docker/modal choices, validation, and documentation of hardware requirements and behavior differences.
  • Add FB_UPLOAD and FB_UPLOAD_VISIBILITY env vars with validation, defaulting to private and off, to control Harbor Hub uploads explicitly per run.
  • Make FB_ALLOW_GPU backend-aware in env.sh, defaulting GPUs on for Modal and off for Docker while still allowing explicit overrides.
  • Add fb_assert_backend to check Docker reachability or Modal SDK installation and authentication, and integrate it into fb_preflight instead of hardcoding docker info.
bench/evidence/frontier/env.sh
Submission docs and posture reporting updated to reflect Modal backend support, explicit upload configuration, and clear criteria for submission-shaped runs.
  • Update SUBMISSION.md to describe that all 74 tasks are satisfied on Modal, document the wired, opt-in upload mechanism, and explain backend-specific behavior (Modal vs Docker).
  • Clarify the two hardware blockers and how FB_ENV=modal clears them, add example commands for a full submission run, and emphasize preregistration/cost considerations.
  • Enhance primary.sh to build upload flags once, log backend and upload posture, compute and report all submission gaps (tier, attempts, exclusions, upload, visibility), and pass backend/env and upload flags through to harbor run.
bench/evidence/frontier/SUBMISSION.md
bench/evidence/frontier/primary.sh
README and helper scripts updated to document backend selection, Modal requirements, and correct behavior of image warming and sentinel under different backends.
  • Extend README.md with a backend selection section (FB_ENV), example Modal usage, explanation of host-size constraints and improved local coverage via Docker memory tuning.
  • Update warm_images.sh to skip on Modal with an explicit message since image builds occur in the cloud, making local pulls unnecessary.
  • Switch sentinel.sh to use FB_ENV for harbor --env in both stages so the sentinel path exercises the selected backend.
  • Modify fetch_dataset.sh to pass FB_ENV and optional FB_CONCURRENCY into plan.py so plans are backend-aware and concurrency-controlled from the shell.
bench/evidence/frontier/README.md
bench/evidence/frontier/warm_images.sh
bench/evidence/frontier/sentinel.sh
bench/evidence/frontier/fetch_dataset.sh
Virtualenv setup made idempotent and prepared for Modal usage by always installing the Harbor modal extra.
  • Change setup_venv.sh to use uv venv --clear so rerunning the script recreates the venv cleanly instead of failing when it already exists.
  • Install harbor[modal]==$FB_HARBOR_VERSION unconditionally so both Docker and Modal runs share one venv and backend switching does not require rebuilds, enabling clearer preflight error messages for missing SDK vs missing auth.
bench/evidence/frontier/setup_venv.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@macanderson
macanderson marked this pull request as ready for review August 1, 2026 00:26
@macanderson
macanderson merged commit a19a893 into main Aug 1, 2026
9 checks passed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@macanderson
macanderson deleted the frontier-modal-env branch August 1, 2026 00:27
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.

1 participant