Skip to content

docs(BA-6926): amend BEP-1055 with scope-local job_priority for preemption#12939

Merged
HyeockJinKim merged 2 commits into
mainfrom
BA-6926-scope-priority-preempt
Jul 18, 2026
Merged

docs(BA-6926): amend BEP-1055 with scope-local job_priority for preemption#12939
HyeockJinKim merged 2 commits into
mainfrom
BA-6926-scope-priority-preempt

Conversation

@HyeockJinKim

Copy link
Copy Markdown
Collaborator

Summary

  • Amends BEP-1055 so preemption keys on a new scope-local job_priority axis instead of the global scheduler priority, which was compared across all owners (a user could raise their own priority to evict another owner's sessions).
  • New 2.4 Priority Model: three-axis split (scheduler priority / job_priority / fair-share), user vs. future project scope, and a caveat on how v1's within-owner rule differs from BEP-1014's cross-tenant motivation.
  • Victim selection is restricted to the same user_uuid and ordered by job_priority ascending → preemption_order; the preemptible_priority absolute threshold is removed. Snapshot gains job_priority + user_uuid; keypair resource policy gains max_priority to cap the global priority.

Test plan

  • Documentation-only change — no code/tests. Reviewers confirm the amended sections (2.4, 3.a, 3.b, Decision Summary, Open Questions) are internally consistent.

Resolves BA-6926

…ption

Preemption compared the global scheduler priority across all owners, so a
user could raise their own priority to evict another owner's sessions. This
amendment introduces a separate scope-local axis, job_priority, as the sole
victim-comparison key, restricted to the same owner (v1: user scope).

- 2.4 Priority Model: three-axis split (scheduler priority / job_priority /
  fair-share), user vs future project scope, BEP-1014 within-owner caveat
- 3.b: victim filter uses job_priority within the same user_uuid; drop the
  preemptible_priority threshold, keep preemption_order
- 3.a: snapshot carries job_priority + user_uuid (scope-owner key)
- Keypair resource policy max_priority caps the global priority
- Open Questions: cross-tenant preemption as a future admin cross-scope axis

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@HyeockJinKim
HyeockJinKim requested a review from a team as a code owner July 18, 2026 08:46
Copilot AI review requested due to automatic review settings July 18, 2026 08:46
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Amends BEP-1055 to use owner-scoped job_priority for safe preemption.

Changes:

  • Defines separate scheduling and preemption priority axes.
  • Restricts victims to the same user.
  • Adds priority policy and snapshot requirements.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
proposals/BEP-1055-preemption-scheduler-mechanics.md Revises the preemption design and priority model.
changes/12939.doc.md Adds the documentation changelog entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

| ➕ | Expose `preemption.enabled` (preemption on/off toggle) and `preemption_min_runtime` (the anti-thrashing knob in section 3) in the RG config |
| ➕ | On session creation, the user also sets `job_priority` — the session's **scope-local** preemption priority (used only for preemption; see 2.4). Distinct from the global scheduler `priority` |
| ➕ | Keypair (user) resource policy gains `max_priority` — caps the `priority` a user may declare on session creation (2.4) |
| ➕ | Remove admin `preemptible_priority` from the RG config — unused once victims are chosen by relative `job_priority` (3.b) |
| ➕ | New `SessionStatus.PREEMPTED` — the **single state** for a confirmed victim; after kernel cleanup it branches by mode to **PENDING (reschedule) or TERMINATED (terminate)** (3.(c)) |
| ➕ | New `preemption_min_runtime` config field (RG opts) |
| ➕ | New `SessionRow.job_priority` (default 10) — scope-local preemption priority, compared only within the same scope-owner (2.4, 3.b) |
| ➕ | New keypair resource-policy field `max_priority` — per-user cap on the global `priority` (2.4) |

`job_priority` values are **only comparable within one owner** (no global meaning). v1 fixes the owner key to `user_uuid`; wider scopes reuse the same column and only change the owner key used for comparison.

> The keypair resource policy `max_priority` bounds the global `priority` a user may declare on session creation; `job_priority` needs no such cap since it only reorders the user's own jobs.

## Open Questions

- Cross-tenant (cross-scope) preemption — v1's same-owner rule cannot evict *another* owner's session. Evicting a different tenant's low-priority work belongs to a separate **admin-managed cross-scope (project) axis**, gated on the "project session" concept, and must not be conflated with the user-declared `job_priority`.
@HyeockJinKim
HyeockJinKim merged commit 62d39c0 into main Jul 18, 2026
29 checks passed
@HyeockJinKim
HyeockJinKim deleted the BA-6926-scope-priority-preempt branch July 18, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants