Honor GINO day reservation at new dispatch and preserve running guard

This commit is contained in:
NewMeltAssist committed 2026-11-19 16:11:28 +08:00
1 parent 9a4f8563ee
commit 8af022e434
7 files changed
+953 -13

No files matched your search

+8 -7
View File
@@ -18,7 +18,7 @@ from track_b_gino_ordinal_recovery import ROOT as MEASUREMENT
from track_b_gino_shapenet_entry import BASE, checked, read, save, sha
ROOT = MEASUREMENT.with_name('track-b-gino-shapenet611-formal-2026-11-19')
ROOT = MEASUREMENT.with_name('track-b-gino-shapenet611-formal-v2-2026-11-19')
SOURCES = Path(__file__).resolve().parent
OLD_FILES = {
'contract.json': 'ad9daa2cfb7e2a92bd57507221eba4b94d642bd25e072a6cabbbdd27984ff68a',
@@ -72,7 +72,8 @@ def expected_contract():
start_inclusive=RESERVATION_START.isoformat(),
end_exclusive=RESERVATION_END.isoformat(), gpu3_single_task=True,
historical_inventory_path=str(INVENTORY), historical_inventory_sha256=INVENTORY_SHA,
runtime_idle_check_required=True),
runtime_idle_check_required=True, applies_to_new_dispatch_only=True,
already_running_guards_unchanged=True),
budget_per_seed_stage_gpu_seconds=budgets, total_gpu_wall_seconds=40000,
timing=dict(record_paths={str(MEASUREMENT / k): v for k, v in OLD_FILES.items()},
status='CONTENTION_AFFECTED_NOT_GUARD_CERTIFIED', sizing_only=True,
@@ -126,10 +127,9 @@ def authorize(c):
raise PermissionError('Exact execution and card-reservation authorization required')
def check_reservation(unix, duration):
if (unix < RESERVATION_START.timestamp()
or unix + duration >= RESERVATION_END.timestamp()):
raise PermissionError('The entire booking must fit the November 19 Hong Kong reservation')
def check_reservation(unix):
if not RESERVATION_START.timestamp() <= unix < RESERVATION_END.timestamp():
raise PermissionError('New dispatch must begin in the November 19 Hong Kong reservation')
def run_root(seed, phase):
@@ -226,7 +226,7 @@ def dispatch(c, seed, phase):
unix = time.time()
authorize(c)
budget = c['formal']['budget_per_seed_stage_gpu_seconds'][str(seed)][phase]
check_reservation(unix, budget)
check_reservation(unix)
seed_root = run_root(seed, phase).parent
seed_root.mkdir(exist_ok=True)
with (seed_root / 'execution.lock').open('a') as lock:
@@ -238,6 +238,7 @@ def dispatch(c, seed, phase):
save(root / 'checkpoints-frozen.json', roster)
ticket = dict(seed=seed, phase=phase, ordinal=str(ORDINALS[str(seed)]),
booked_gpu_seconds=budget, unix=unix,
dispatch_before_unix=RESERVATION_END.timestamp(),
contract_sha256=sha(ROOT / 'contract.json'),
guard_started_monotonic=began, booked_deadline_monotonic=began + budget)
save(root / 'started.json', ticket)
+2
View File
@@ -111,6 +111,8 @@ def guard(root, command, *, uuid, limits, deadline, ticket, validate_result):
save(root / 'ordinal-dispatch.json', dict(ordinal=ordinal, physical_uuid=uuid, inventory=inventory))
if time.monotonic() >= admission:
raise RuntimeError('ADMISSION_DEADLINE')
if time.time() >= ticket['dispatch_before_unix']:
raise PermissionError('CARD_RESERVATION_EXPIRED_BEFORE_SPAWN')
proc = subprocess.Popen(args, **dict(kwargs, env=env))
try:
worker = process_identity(proc.pid)