Files

46 lines
3.5 KiB
Bash

#!/usr/bin/env bash
# Sourced by the stubs of the confirmation series of the DEFAULT 5090 profile with the lossy route tail skip ON (owner decision 2026-11-13).
# The tail skip comes from the profile keys of the package ONLY: the stub unsets every route/placement variable of the shell, so a pass proves the
# profile alone delivers `LELEKA_ROUTE_TAIL_SKIP=7`, `..._MAX_CACHED=100`, pcie_frac=0.65 and expert_per_layer=0.
TSD_TOOLS=/data/leleka-e2e/prefill-latency/tools
TSD_TAG=945fc44f32fb
TSD_RUN=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-$TSD_TAG-owner-default-tail-skip
TSD_TARBALL=/data/leleka-e2e/prefill-latency/release-tail-skip-default/leleka-0.1.0-$TSD_TAG-linux-x86_64.tar.xz
TSD_TARBALL_SHA256=5f5479151620b9b5cb3f5d86a32e228858544411bfad30f48ff24853e9503a67
TSD_STATE=/data/leleka-e2e/codex-compare/ours-state-$TSD_TAG
# $1 repetition: the proof lines of the block after the warm-up cell: tail skip announced, both keys in the `up` engine environment line, the placement in the meta config
tsd_proof_lines() {
local rep=$1 stack=$TSD_RUN/LEL/stack-r$1
grep -a -m1 "EXPERIMENTAL route tail skip is ON (LELEKA_ROUTE_TAIL_SKIP=7" "$TSD_STATE/logs/engine.log" || return 1
grep -a -m1 "engine environment:" "$stack/up-foreground.txt" | grep -q "LELEKA_ROUTE_TAIL_SKIP=7 .*LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED=100\|LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED=100 .*LELEKA_ROUTE_TAIL_SKIP=7" || return 2
grep -a "leleka-serve meta: config" "$TSD_STATE/logs/engine.log" | tail -1 | grep -q "expert_per_layer=0 .*pcie_frac=0.65" || return 3
}
# $1 repetition, $2 job pid: writes tail-skip-default-proof-r$1.txt, or ABORT-tail-skip-default-r$1.txt with the failing check (no kill: a human decides)
tsd_watch_proof() {
local rep=$1 job_pid=$2 smoke=$TSD_RUN/LEL/smoke-mini-r10$1/cell.json rc
until [ -f "$smoke" ]; do kill -0 "$job_pid" 2>/dev/null || return 0; sleep 20; done
if tsd_proof_lines "$rep" >"$TSD_RUN/tail-skip-default-proof-r$rep.txt"; then
grep -a -m1 "engine environment:" "$TSD_RUN/LEL/stack-r$rep/up-foreground.txt" >>"$TSD_RUN/tail-skip-default-proof-r$rep.txt"
grep -a "leleka-serve meta: config" "$TSD_STATE/logs/engine.log" | tail -1 >>"$TSD_RUN/tail-skip-default-proof-r$rep.txt"
else
rc=$?; echo "proof check $rc failed after the warm-up cell of repetition $rep ($(date -u +%FT%TZ)): 1 = no ON line, 2 = keys not in the engine environment line, 3 = placement" >"$TSD_RUN/ABORT-tail-skip-default-r$rep.txt"
fi
}
# $1 repetition: guards, a clean environment, the watcher, then the job (exec)
tsd_run() {
unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG
unset LELEKA_ROUTE_TAIL_SKIP LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED LELEKA_ORIGINAL_SERVE_PCIE_FRAC LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER STRATA_ROUTE_TAIL_SKIP
local rep=$1 got
got=$(sha256sum "$TSD_TARBALL" | cut -d' ' -f1)
[ "$got" = "$TSD_TARBALL_SHA256" ] || { echo "tarball sha256 $got differs from $TSD_TARBALL_SHA256: stop"; exit 5; }
mkdir -p "$TSD_RUN"
for v in VAN VANL; do [ -e "$TSD_RUN/$v" ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v "$TSD_RUN/$v"; done
export CMP_ARM=ours CMP_TASKS="ttt nestng-crm" CMP_REPS="$rep" CMP_RUN=$TSD_RUN CMP_OURS_TAG=$TSD_TAG CMP_TARBALL=$TSD_TARBALL
echo "tail skip default series rep $rep: tarball sha256 $got, no route/placement variable exported" >>"$TSD_RUN/series-start.txt"
( tsd_watch_proof "$rep" "$$" ) </dev/null >/dev/null 2>&1 &
exec bash "$TSD_TOOLS/cmp_codex_job_profile.sh"
}