Skip to content

Preserve inference execution time after Spark queueing - #254

Merged
i386 merged 1 commit into
mainfrom
fix/inference-queue-execution-budget
Nov 28, 2026
Merged

i386 merged 1 commit into
mainfrom
fix/inference-queue-execution-budget

Conversation

@i386

@i386 i386 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Original problem

PR inference qualification can cancel healthy native work because time spent waiting for Sparks consumes the same 90-minute deadline as compilation and tests. Give queued PR work a bounded execution window once it starts, so capacity pressure does not masquerade as an inference failure.

This is a main-based infrastructure fix, separate from the llama upgrade in #235.

Diagnostics

In #235's Coder split job, the formation was created at 22:19 UTC on November 27. Both members started at 23:41 UTC, completed their builds and reached server startup. At 23:46 UTC the controller exhausted its 5,400-second dispatch deadline and cancelled both members, despite native lease deadlines around 00:12 UTC. No qualification assertion had failed.

An offline fake-clock reproduction queues a job for 82 minutes, then completes it at minute 100. It fails on main with JY qualification timed out and passes with this change.

Fix

  • Retain a 90-minute PR placement/queue budget. On the first observed running standalone job or split member, start a separate 31-minute controller execution budget, matching the native 30-minute lease plus 60-second grace. Later polls and the second member starting do not reset it.
  • Raise the PR Actions job limit from 100 to 130 minutes, allowing the queue and execution budgets plus nine minutes for setup, evidence and cleanup. Timeout errors identify the phase.
  • Add offline coverage for long queues, the first split member starting, non-resetting execution deadlines, bounded queues and running jobs, native failure propagation, and unchanged nightly/release deadlines. Check controller headroom against both native PR template budgets.

The seven configurations, model inputs, admission checks and qualification assertions are unchanged. Native leases and cleanup remain bounded. This changes protected controller code; existing in-flight workflows retain their current process and deadline. Candidate PR qualification cannot establish that the changed protected controller is deployed. A real post-merge qualification run must verify it.

Workflow diagrams

Inference qualification — Before

flowchart TD
    T[PR target / schedule / manual / reusable call] --> P[Protected admission and plan]
    P --> Q[Qualification matrix: max 3 concurrent]
    subgraph QJ[PR qualification job: 100-minute Actions limit]
        B[Placement + queue + native execution share 90 minutes]
        B --> U[Upload evidence; cancel outstanding work on failure]
    end
    Q --> B
    U --> A[Inference evidence artifacts]
    P --> N[Scheduled nightly publisher]
    Q --> N
    A --> N
    P --> S[Summary: require admitted plan and successful qualification]
    Q --> S
    N --> S
    N --> HF[Public nightly report]
    S --> R[PR results comment]
    A --> R
    Q --> R
    P --> R
Loading

Inference qualification — After

flowchart TD
    T[PR target / schedule / manual / reusable call] --> P[Protected admission and plan]
    P --> Q[Qualification matrix: max 3 concurrent]
    subgraph QJ[PR qualification job: 130-minute Actions limit]
        B[Placement + queue: at most 90 minutes]
        B -->|First native member observed running| E[Execution: at most 31 minutes; never reset]
        E --> U[Upload evidence; cancel outstanding work on failure]
        B -->|Queue timeout| U
    end
    Q --> B
    U --> A[Inference evidence artifacts]
    P --> N[Scheduled nightly publisher]
    Q --> N
    A --> N
    P --> S[Summary: require admitted plan and successful qualification]
    Q --> S
    N --> S
    N --> HF[Public nightly report]
    S --> R[PR results comment]
    A --> R
    Q --> R
    P --> R
Loading

The publisher applies only to scheduled nightly runs. Nightly/release execution keeps its existing total deadline and Actions limit. No composite action flow changes.

Validation

  • Before the fix: just --justfile /dev/stdin --working-directory . repro, with recipe PYTHONPATH=scripts /opt/homebrew/bin/python3.12 scripts/tests/inference_deadlines.py DeadlineTests.test_long_queue_does_not_consume_native_execution_budget, fails with the original timeout.
  • just inference-contracts: passes, including all seven new deadline regressions and the buffered-pipe streaming rehearsal.
  • SKIPPY_PYTHON=/Users/jdumay/.paseo/worktrees/2f4aprt2/gorgeous-stingray/target/upgrade-repro/automation-venv/bin/python just ci-automation: passes, using the supplied reporting dependencies. The first invocation with the default interpreter stopped because pyarrow was absent; the complete rerun above exited successfully.
  • just --justfile /dev/stdin --working-directory . workflow-check, with recipe actionlint .github/workflows/inference.yml: passes.
  • git diff --check: passes.

No Rust or native/model implementation changes. Hardware qualification of this controller change has not run; #235's independent qualification is still in progress.

Acceptance criteria

  • I ran the relevant local checks, or explained why they do not apply.
  • I agree to license my contributions under the Apache License, Version 2.0.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bfe2b643-6195-4245-81bc-922efd67a2db
Commits

Reviewing files that changed from the base of the PR and between 5001096 and daf0f70.

Files selected for processing: 5

  • .github/workflows/inference.yml
  • ci/README.md
  • ci/automation.just
  • scripts/inference-dispatch.py
  • scripts/tests/inference_deadlines.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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