From e9580fb6b9d0c69ed6b7a481e5cd52343e3cf7fc Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Sat, 14 Nov 2026 11:54:45 +0100 Subject: [PATCH] Laptop identity gate: base-vs-new bitwise comparison on the 3080 (identity-gate.sh, identity_compare.py with self-test, lap_lib.sh gates and the gpu-wanted flag) Co-Authored-By: Claude Sonnet 5.5 --- scripts/laptop/identity-gate.sh | 104 ++++++++++++++++++++++++ scripts/laptop/identity_compare.py | 126 +++++++++++++++++++++++++++++ scripts/laptop/lap_lib.sh | 49 +++++++++++ 3 files changed, 279 insertions(+) create mode 100644 scripts/laptop/identity-gate.sh create mode 100644 scripts/laptop/identity_compare.py create mode 100644 scripts/laptop/lap_lib.sh diff --git a/scripts/laptop/identity-gate.sh b/scripts/laptop/identity-gate.sh new file mode 100644 index 00000000..eb3df595 --- /dev/null +++ b/scripts/laptop/identity-gate.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +# LAPTOP identity gate (bitwise, base against new, on the RTX 3080 laptop; inside WSL2). One command verifies a refactor: +# +# bash scripts/laptop/identity-gate.sh [--base REF=23bdbb308] [--new REF=main] [--out DIR] [--steps prepare,run,compare] [--four] +# +# What it compares: the evidence lines of the laptop bench (`original_serve_laptop_bench`, the Original serve stack in the laptop form: mapped experts, KAR file, +# MTP depth 4) for two fixed agent-style prompts of 2,048 and 3,072 tokens (below the context where the sm_86 prefill fault of STRA-235 shows), greedy, 96 new +# tokens each, every prompt served twice in one process (pass 0, pass 1), tier placement frozen (3,000 slots from the profile, no adaptive swaps, seed off, global +# fill, 7 CPU workers, no prefix cache). Evidence per request, bit for bit: the residual hash of every prompt chunk (PREFILL-R), the top-16 log-probability rows +# and argmax ids of every verify window, the draft trace with the IEEE bits of the probabilities, and the output token ids. +# +# Processes (one engine load each, ~10 GPU-minutes, every one under the laptop safety protocol: flag, build/memory gates, lock, 15 s guard, power-limit +# preflight): P1 base, P2 new, P3 base again; with --four also P4 new again. The A/A floor comes first and must be ZERO differences: pass 1 against pass 0 inside P1 +# and P2, and P3 against P1 across processes. Only then are `P2 against P1` (new against base) and, with --four, `P4 against P2` read. VERDICT IDENTICAL means +# every pair is identical and every evidence category was present. A DIFFERENT floor means the gate cannot judge the refactor on this machine (run-to-run +# nondeterminism); say so rather than reading new against base. +# +# Inputs are frozen under OUT/inputs (corpus from the base tree's docs, the two prompt files, MANIFEST.sha256) and refused when a digest differs. The two engine test +# binaries are built from exported source trees (`git archive`, no worktree metadata) under OUT/src-