SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.15695 · ICML · 2023

On Preemption and Learning in Stochastic Scheduling

Vianney Perchet, Hugo Richard, Nadav Merlis, Flore Sentenac, Corentin Odic, Mathieu Molina

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2205.15695.json · badge: /api/ran/2205.15695.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
hugorichard/ml4a-scheduling canonical (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
FunctionStatusWhere it lives
ftpp Ran
ran on a synthesized input
hugorichard/ml4a-scheduling/mlforscheduling/utils.py
code served (permissive licence) · get_code("19b3997a48ae4661")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct a small numpy array of shape (k, n) where k=3 and n=4
# This represents jobs ordered by increasing type means
jobs = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [2.0, 3.0, 4.0, 5.0],
    [3.0, 4.0, 5.0, 6.0]
])

ARGS = {
    "jobs": jobs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rr Ran
ran on a synthesized input
hugorichard/ml4a-scheduling/mlforscheduling/utils.py
code served (permissive licence) · get_code("d03714c28277ccb1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small numpy array representing jobs
# jobs[i, j] is the processing time of the jth job of type i
# Shape: (k, n) where k=2 job types, n=4 jobs per type
jobs = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=np.float64)

ARGS = {
    "jobs": jobs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rr_run Ran
ran on a synthesized input
hugorichard/ml4a-scheduling/mlforscheduling/utils.py
code served (permissive licence) · get_code("1c13e9a5ff9dea64")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct valid arguments for rr_run
current_time = 0.0

# Create a small numpy array representing job durations
# The function filters for jobs > 0, so we need positive values
# It also requires that there's a unique minimum (no ties: assert np.sum(jobs == ji) < 2)
old_jobs = np.array([5.0, 3.0, 8.0, 0.0, 2.0])

ARGS = {
    "current_time": current_time,
    "old_jobs": old_jobs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
select_duration Ran
ran on a synthesized input
hugorichard/ml4a-scheduling/mlforscheduling/ucb_rr.py
code served (permissive licence) · get_code("ab9914d50bea5947")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from numba import njit

@njit
def update_confidence_bound(bound, m, i, total_time, n, k):
    if m[i] > n - 1:
        bound[i] = -np.inf
    else:
        tot = np.sum(total_time)
        mean = m[i] / total_time[i]
        gap = np.log(k ** 3 * n ** 2) / total_time[i]
        bound[i] = klucbBern_numba(mean, gap, lower=False)
    return bound[i]

@njit
def klBern_numba(x, y, eps=1e-09):
    x = min(max(x, eps), 1 - eps)
    y = min(max(y, eps), 1 - eps)
    return x * np.log(x / y) + (1 - x) * np.log((1 - x) / (1 - y))

@njit
def klucb_numba(x, d, kl, upperbound=1, lowerbound=0, precision=1e-09, max_iterations=200, lower=False):
    value = min(x, upperbound)
    if lower:
        u = lowerbound
    else:
        u = upperbound
    _count_iteration = 0
    while _count_iteration < max_iterations and np.abs(value - u) > precision:
        _count_iteration += 1
        m = (value + u) / 2.0
        if kl(x, m) > d:
            u = m
        else:
            value = m
    return (value + u) / 2.0

@njit
def klucbBern_numba(x, d, precision=1e-09, lower=False):
    upperbound = 1
    return klucb_numba(x, d, klBern_numba, upperbound, precision, lower=lower)

@njit
def select_duration(bound, jobs, m, total_time, current_type, n, k):
    duration = 1
    stop = np.sort(bound)[-2]
    if stop < 0:
        return np.inf
    next_bound = update_confidence_bound(bound, m, current_type, total_time + duration, n, k)
    while next_bound > stop:
        duration = 2 * duration
        next_bound = update_confidence_bound(bound, m, current_type, total_time + duration, n, k)
    return max(1, int(duration / 2))

# Setup code to construct valid arguments
bound = np.array([0.5, 0.6, 0.4, 0.7], dtype=np.float64)
jobs = np.array([1, 2, 3, 4], dtype=np.int64)
m = np.array([5, 3, 7, 2], dtype=np.int64)
total_time = np.array([10.0, 8.0, 12.0, 9.0], dtype=np.float64)
current_type = 1
n = 10
k = 3

ARGS = {
    "bound": bound,
    "jobs": jobs,
    "m": m,
    "total_time": total_time,
    "current_type": current_type,
    "n": n,
    "k": k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
select_next_job Ran
ran on a synthesized input
hugorichard/ml4a-scheduling/mlforscheduling/ucb_rr.py
code served (permissive licence) · get_code("3b4e33f9f466a5fe")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function to understand parameter requirements:
# - bound: numpy array used with np.sort, np.argmax, indexing with current_type
# - jobs: 2D array indexed as jobs[current_type, m[current_type]]
# - m: array indexed by current_type, compared to n-1
# - total_time: array that gets summed and indexed
# - current_type: integer index
# - n: integer compared with m[i]
# - k: integer used in calculations

# Set up small test data
n = 5  # number of job types
k = 3  # parameter for confidence bound
num_jobs_per_type = 4

# bound: confidence bounds for each job type
bound = np.array([0.5, 0.6, 0.4, 0.7, 0.3], dtype=np.float64)

# jobs: 2D array where jobs[i, j] is the j-th job of type i
jobs = np.arange(n * num_jobs_per_type, dtype=np.int32).reshape(n, num_jobs_per_type)

# m: number of times each job type has been selected
m = np.array([1, 2, 0, 1, 3], dtype=np.int32)

# total_time: total time spent on each job type
total_time = np.array([10.0, 15.0, 5.0, 8.0, 12.0], dtype=np.float64)

ARGS = {
    "bound": bound,
    "jobs": jobs,
    "m": m,
    "total_time": total_time,
    "n": n,
    "k": k,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
select_next_job Ran
ran on a synthesized input
hugorichard/ml4a-scheduling/mlforscheduling/ucb_u.py
code served (permissive licence) · get_code("7f48f516036fc383")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct arguments for select_next_job
# The function uses:
# - bound: indexed with np.argmin, so a 1D array
# - jobs: 2D indexed as jobs[current_type, m[current_type]], so a 2D array
# - m: indexed as m[current_type], so a 1D array

# Create a simple bound array (1D)
bound = np.array([5.0, 2.0, 8.0, 1.0])

# Create a jobs 2D array where first dimension matches bound size
# Shape: (4, 5) - 4 job types, each with up to 5 job IDs
jobs = np.array([
    [10, 11, 12, 13, 14],
    [20, 21, 22, 23, 24],
    [30, 31, 32, 33, 34],
    [40, 41, 42, 43, 44]
])

# Create m array where each element is an index into the corresponding row of jobs
# Must be same length as bound (4 elements)
m = np.array([1, 2, 0, 3])

ARGS = {
    "bound": bound,
    "jobs": jobs,
    "m": m
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
update_confidence_bound Ran
ran on a synthesized input
hugorichard/ml4a-scheduling/mlforscheduling/ucb_u.py
code served (permissive licence) · get_code("8f982db6707ee0aa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (3,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from scipy.stats import chi2

torch.manual_seed(0)

# Construct arguments for update_confidence_bound
bound = np.array([1.5, 2.5, 3.5])  # array of confidence bounds
m = np.array([0, 1, 2])  # array of counts
i = 1  # index to update
total_time = np.array([10.0, 20.0, 30.0])  # array of total times
n = 5  # threshold parameter
k = 3  # scaling parameter

ARGS = {
    "bound": bound,
    "m": m,
    "i": i,
    "total_time": total_time,
    "n": n,
    "k": k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (3,) — shape (3,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We study single-machine scheduling of jobs, each belonging to a job type that determines its duration distribution. We start by analyzing the scenario where the type characteristics are known and then move to two learning scenarios where the types are unknown: non-preemptive problems, where each started job must be completed before moving to another job; and preemptive problems, where job execution can be paused in the favor of moving to a different job. In both cases, we design algorithms that achieve sublinear excess cost, compared to the performance with known types, and prove lower bounds for the non-preemptive case. Notably, we demonstrate, both theoretically and through simulations, how preemptive algorithms can greatly outperform non-preemptive ones when the durations of different job types are far from one another, a phenomenon that does not occur when the type durations are known.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2205.15695")
get_code_for_paper("2205.15695")
have("2205.15695")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2205.15695.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2205.15695.svg)](https://syntology.ai/paper/2205.15695)

Connect an agent — have() is free.