From d6babcba0f5b48d1dfdc8caeddbf4364edbb9019 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 5 Nov 2026 21:52:16 -0800 Subject: [PATCH] :new: Let a round or a gate's correctness boot share the lane host A boot that times nothing need not hold the whole host. probe-batch.sh's --shared and lane-gate.sh's --shared-boot dispatch the job with the 5080 alone (no --exclusive), so other jobs' builds can run beside it once its run.sh's 180 s wait for them ends. The bench boot keeps the whole host. --- scripts/internal/lane-gate.sh | 13 ++++++++++--- scripts/internal/lane-gate/probe-batch.sh | 10 ++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/scripts/internal/lane-gate.sh b/scripts/internal/lane-gate.sh index 911cbdfec..345f10f3a 100755 --- a/scripts/internal/lane-gate.sh +++ b/scripts/internal/lane-gate.sh @@ -7,7 +7,8 @@ # [--bench-phases "PHASE..."] [--boot-tag TAG] [--capture-boot] # [--no-appload] [--no-bench | --wait-bench] [--qemu-hook CMD] # [--bench-host-log FILTER] -# [--publish | --probe-tip] [--keep-workspace] [--boot-only] [--priority N] [REV] +# [--publish | --probe-tip] [--keep-workspace] [--boot-only] [--priority N] +# [--shared-boot] [REV] # # REV the commit to check (default HEAD); the gate checks commits, never a dirty tree # --record store the run as a sample of REV's baseline (in baselines/SHA/runs), measure the @@ -77,6 +78,9 @@ # --boot-only the correctness boot of a resumed run alone, in its kept workspace, taking no lock # (as a bench leg), so two runs' boots can be queued back to back # --priority N the potluck jobs' priority (default 3, a --landed car's 4) +# --shared-boot the correctness boot's job takes the 5080 alone, not the whole host (no --exclusive): +# it times nothing, so other jobs' builds may run beside it once its 180 s wait for +# them ends; the bench boot keeps the whole host # # What it runs: the Mac builds the guest's side, and the lane host runs the rest as potluck jobs # (potluck's lease is the lock), dispatched from a throwaway commit of the run's own (do_ship): @@ -129,7 +133,7 @@ fi [[ -f $GH/config.sh ]] || die "no $GH/config.sh: it names this host's KDK, loader builder and lane host" . "$GH/config.sh" -record=0 landed=0 qemu_hook= bench_host_log= base_sha= resume= image= host_dir= load= skip= phases= bench_phases= boot_tag= host_log= capture=0 appload=1 appload_info= rev=HEAD bench=detach publish=0 probe_tip=0 keep_ws=0 boot_only=0 prio= post_probes= advance= +shared_boot=0 record=0 landed=0 qemu_hook= bench_host_log= base_sha= resume= image= host_dir= load= skip= phases= bench_phases= boot_tag= host_log= capture=0 appload=1 appload_info= rev=HEAD bench=detach publish=0 probe_tip=0 keep_ws=0 boot_only=0 prio= post_probes= advance= while (($#)); do case $1 in --record) record=1 ;; @@ -158,6 +162,7 @@ while (($#)); do --probe-tip) publish=1 probe_tip=1 ;; --keep-workspace) keep_ws=1 ;; --boot-only) boot_only=1 ;; + --shared-boot) shared_boot=1 ;; --priority) prio=$2; shift ;; -h|--help) sed -n '2,/^set -euo/p' "$0" | sed '$d; s/^# \{0,1\}//'; exit 0 ;; -*) die "unknown option $1" ;; @@ -689,7 +694,9 @@ POST_PROBES=$([[ $mode == boot && -n $post_probes ]] && echo "$MR/post-probes") POST_PROBE_TIP=$sha EOF set +e - pl_run "$mode" --timeout "$tmo" --ram 64 --priority "$PL_PRIO" --exclusive --gpu "$PL_GPU" --workspace "$ws" ${advance:+--advance} \ + local xa=--exclusive + [[ $mode == boot ]] && ((shared_boot)) && xa= + pl_run "$mode" --timeout "$tmo" --ram 64 --priority "$PL_PRIO" ${xa:+"$xa"} --gpu "$PL_GPU" --workspace "$ws" ${advance:+--advance} \ --label "lane-gate=$mode" --keep "lg-out/$mode" -- bash lg/bin/msi-job.sh boot "$mode" "$(base64 < "$RUN/boot-$mode.env" | tr -d '\n')" local rc=$? set -e diff --git a/scripts/internal/lane-gate/probe-batch.sh b/scripts/internal/lane-gate/probe-batch.sh index 1dab73d03..04636cdba 100755 --- a/scripts/internal/lane-gate/probe-batch.sh +++ b/scripts/internal/lane-gate/probe-batch.sh @@ -27,10 +27,11 @@ # [--cold-cache KEY] [--qemu-hook CMD] [--pre-qemu CMD] [--log-add FILTER] # [--host-log FILTER] [--stage NAME=DIR[@TIP]]... [--ram GIB] [--after CMD] # [--image PATH] [--rom PATH] [--gfx-b64 B64] [--qemu-env K=V]... [--no-metal-check] -# [--stage-local NAME=DIR[@TIP]]... [--appload] [--kring-s S] [--bin FILE]... +# [--stage-local NAME=DIR[@TIP]]... [--appload] [--kring-s S] [--bin FILE]... [--shared] # # The round runs as a potluck job on the lane host (lane-gate/msi-round.sh), holding the 5080 and the -# whole host (--exclusive; potluck's lease is the lock), dispatched from a throwaway commit of the +# whole host (--exclusive; potluck's lease is the lock; --shared takes the 5080 alone, for a round +# that times nothing, so other jobs' builds may run beside it once its 180 s wait for them ends), dispatched from a throwaway commit of the # round's own (lane-gate/ship-commit.sh) that carries the gate's host scripts, the tip's bench and the # round's boot.env. This script only reads the lane host's state (its queue and published tips, over # ssh); the job makes every change there. --stage NAME=DIR[@TIP] adds the probe in DIR on the lane host @@ -85,7 +86,7 @@ L=$(cd "$(dirname "$0")" && pwd) GH=${LANE_GATE_HOME:-$HOME/.cache/rgk-lane-gate} force=0 list=0 dry=0 capture=0 want_tip= first= hold= only=0 exclude= from_boot=0 host_tip= image_tip= cold_cache= qemu_hook= pre_qemu= log_add= host_log= stages=() lstages=() ram=64 after= -oc_path= rom_path= gfx_b64= qemu_env=() metal_check=1 appload=0 kring_s= bins=() +oc_path= rom_path= gfx_b64= qemu_env=() metal_check=1 appload=0 kring_s= bins=() excl=--exclusive while (($#)); do a=$1 shift @@ -117,6 +118,7 @@ while (($#)); do --gfx-b64) gfx_b64=${1:?--gfx-b64 B64}; shift ;; --qemu-env) qemu_env+=("${1:?--qemu-env K=V}"); shift ;; --no-metal-check) metal_check=0 ;; + --shared) excl= ;; --list) list=1 ;; --dry-run) dry=1 ;; -h|--help) sed -n '2,/^set -euo/p' "$0" | sed '$d; s/^# \{0,1\}//'; exit 0 ;; @@ -314,7 +316,7 @@ echo "probe-batch: round $ROUND from $commit on $branch" # among the jobs running on its machine): the hold, the boot's own time and its waits for quiet and # the cool-down (12 minutes), and 40 minutes more for --after. tmo=$(( (HOLD_S + 720) / 60 + ${after:+40} + 0 )) -out=$(cd "$wt" && potluck dispatch --json --timeout "${tmo}m" --ram "$ram" --exclusive --gpu "${POTLUCK_MSI_GPU:-5080}" \ +out=$(cd "$wt" && potluck dispatch --json --timeout "${tmo}m" --ram "$ram" ${excl:+"$excl"} --gpu "${POTLUCK_MSI_GPU:-5080}" \ --on "node=${POTLUCK_MSI_NODE:-msi-laptop}" --label lane-gate=round -- bash lg/bin/msi-round.sh) || { echo "probe-batch: potluck dispatch: $out" >&2; exit 1; } job=$(python3 -I -c 'import json, sys; print(json.load(sys.stdin)["job"])' <<< "$out")