feat(gpu-bringup): mandatory fast-math reseal of six PTX, flag overrides, PTX ISA/driver precheck
Rust port / port-typecheck (push) Failing after 7s
Rust port / port-fast (push) Failing after 7s
Rust port / port-oracles (push) Failing after 9s
Rust port / port-linux-tests (push) Failing after 32s

Adds the six audited assets (head_native, original_verify_qsa, router, gr_post,
gr_norm, ple_native_batch) as an atomic reseal group built with --use_fast_math,
re-pins their old digests (incl. ple PTX_BYTES) and window-plan hex, and a
generic --flag-override recorded in the manifest and re-applied by the sealer.
compile_assets --isa-inventory/--driver-check and run_gpu_smokes.sh refuse a
driver older than the highest PTX ISA in the tree (9.0 needs >= 580.65.06).
Runbook: mandatory reseal + golden comparison section, step d' (linux-tests).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-10-14 17:00:26 +02:00
co-authored by Claude Sonnet 5.5
parent 9189e236e3
commit 90d3433da4
7 changed files with 512 additions and 22 deletions
+60 -6
View File
@@ -4,7 +4,7 @@ This is the one-shot runbook for the first evening on the Linux RTX 5090 host: c
build, run the Root-only GPU smokes, and prepare the Original-vs-Rust parity run. It was written without access to
the host and without a GPU: **nothing here has been executed on the card**, and no number in this file is a
measurement. Everything the scripts can verify on a Mac (pin logic, patching, the runner's stop/skip rules) is
covered by `python3 scripts/gpu-bringup/tests/test_gpu_bringup.py` (60 tests; also run in a Linux container).
covered by `python3 scripts/gpu-bringup/tests/test_gpu_bringup.py` (75 tests; also run in a Linux container).
Owner decision on record: there is no Root/Codex handoff; this work owns the sealing, the smokes and the parity run.
Rules from `AGENTS.md` apply throughout: no weights, captures, credentials or generated artifacts in Git; no lossy
@@ -18,10 +18,11 @@ cd /Users/para/work/leleka-claude-port-bringup # branch claude/port
python3 scripts/gpu-bringup/tests/test_gpu_bringup.py # expect: OK (skipped=1 is fine)
python3 scripts/gpu-bringup/compile_assets.py --preflight # expect: PREFLIGHT OK
scripts/gpu-bringup/remote_sync.sh check --host rnr5090 # prints the build plan; no network
scripts/linux-tests/run.sh # step d': docker x86_64 harness, the non-GPU tests (761 passed when it landed)
ssh -o BatchMode=yes rnr5090 true && echo ssh-ok # the only network touch; skip if unsure
```
`remote_sync.sh` refuses to sync a tree with modified tracked files, so commit first.
`remote_sync.sh` refuses to sync a tree with modified tracked files, so commit first. `scripts/linux-tests/run.sh` (Docker, x86_64, no GPU; see its header) is the pre-host build/test baseline: if it is red on the commit you are about to sync, the host build will be too. Re-run it after pulling the sealed files home (step g) before committing them.
## Decisions to take (the scripts force them; none is silently defaulted)
@@ -32,6 +33,7 @@ ssh -o BatchMode=yes rnr5090 true && echo ssh-ok # the only network t
| D3 | `RUSTFLAGS` for the build. | None (Cargo default release, as the earlier Linux binaries). `native-cpu-expert` selects its AVX-512 paths with `cfg!(target_feature = ...)`, so a default build uses the baseline paths. Record whichever you choose in `env.json`; do not mix builds inside one A/B. |
| D4 | Seal the optional `mmq_group` (3 PTX, recipe unverified)? | Not tonight unless an MMQ-group smoke needs it (they are in the model-assets group). Flags are quoted from the `.cu` headers, not from CMake. Opt in with `--include-optional`. |
| D5 | Stopping the live Strata service for the GPU phases. | Yours. The scripts never stop, kill or restart anything. Compile/build (b-d) do not use the GPU; smokes (e) and parity (f) need it free (`run_gpu_smokes.sh` refuses a busy card). |
| D6 | Fast-math reseal of six already-sealed PTX (step c, below). | **Mandatory, not optional**: the verifier review found them sealed with the build script's non-fast flags while the Original compiles their sources with `--use_fast_math`. The compiler and sealer do it by default; refusing it means the verifier window and the MTP path are not bit-comparable to the Original. |
## 1. Timeline and checkpoints
@@ -40,6 +42,7 @@ ssh -o BatchMode=yes rnr5090 true && echo ssh-ok # the only network t
| a | host sanity (read-only) | no FAIL | nothing changed |
| b | rsync tree, bootstrap toolkit 13.0.88 | `nvcc --version` says `V13.0.88` | `rm -rf $TK`; tree: delete `$R` |
| c | compile PTX, seal pins | compile report all `ok`; seal dry-run reviewed | restore from `pre-seal.tgz` or re-sync from the Mac |
| d' | `scripts/linux-tests/run.sh` on the Mac (docker x86_64) before the host build | green on the commit being synced | n/a |
| d | release build + test binaries | `BUILD OK`; only the listed placeholder tests fail | `rm -rf $R/target` |
| e | GPU smokes in dependency order | `driver-basic` passes before anything else | none needed (smokes are read-only) |
| f | Original vs Rust parity | self-determinism first, then equality | none |
@@ -61,7 +64,7 @@ ssh $HOST 'bash -s' < scripts/gpu-bringup/host_sanity.sh | tee /tmp/host-sanity-
```
Reads `nvidia-smi`, driver, disk/RAM/CPU, tool versions, processes and units, and reachability of NVIDIA / crates.io /
rust-lang. Go if there is no `[FAIL]` (driver >= 580.65, Linux x86_64, `libcuda.so.1`, >= 20 GiB free, python3 >= 3.11,
rust-lang. Go if there is no `[FAIL]` (driver >= 580.65.06 because the tree mixes PTX ISA 9.0 from CUDA 13.0 with ISA 8.7 from 12.8, Linux x86_64, `libcuda.so.1`, >= 20 GiB free, python3 >= 3.11,
a C/C++ compiler, 6 GiB RAM). `[WARN]` lines need a human look:
* a compute process on the GPU or a running `strata`/`leleka` process is **the live service or someone's job**. Leave it.
@@ -110,6 +113,7 @@ What is pending, by group (`compile_assets.py --list` prints it live):
| experimental (6) | `experimental_{kv_q4,kv_q8,kv_stream,keyless,qsa_attn,cvec}` | `experimental.rs` `PINS[0..6]` (`source_sha256`, `ptx_sha256`) |
| window (2) | `original_verify_window_moe_experts`, `original_verify_window_qsa_gate` | `AssetSpec.sha` of `EXPERTS` / `GATE` |
| kar (1) | `kar_decode_levels` | `KAR_DECODE_LEVELS_PIN` |
| reseal-fastmath (6, **mandatory**) | `mtp_original_full_head_native`, `original_verify_qsa`, `mtp_original_full_router`, `mtp_original_full_gr_post`, `mtp_original_full_gr_norm`, `ple_native_batch` | their old digests (7 spots: `original_verify_window_{proj,moe,gr}.rs`, `original_verify.rs`, `ple_batch_queue.rs` + its `PTX_BYTES`, hex in the window plan) |
| rope (4, regenerate) | `qsa_prompt_indexer`, `qsa_prompt_postops`, `qsa_decode_postops`, `qsa_prompt_resolver` | decimal digests in `original_verify_window_qsa.rs` (3), hex digests in the window plan, and `crates/context/src/ptx_abi.rs` (test must now require `Extended`) |
| mmq_group (3, optional) | `mmq_original_group_{swiglu,mul,fixup}` | `SEALED[0..3]` in `mmq_original_group.rs` |
| deferred (3) | `mtp_original_scalar_{norm,gr}`, `native_parity` | no recipe exists; they stay fail-closed |
@@ -122,6 +126,7 @@ still refuse to open after tonight's sealing, and `auto` falls back to the previ
```sh
cd $R
python3 scripts/gpu-bringup/compile_assets.py --preflight # pins, includes, fast-math lint, sealed shas; OK
python3 scripts/gpu-bringup/compile_assets.py --isa-inventory --driver-check # tree has ISA 9.0 and 8.7 PTX; the driver must be >= 580.65.06
mkdir -p $G && PTX=$G/ptx-1
python3 scripts/gpu-bringup/compile_assets.py --dry-run --rope-flags preserve --toolkit $TK --out $PTX | head -40 # eyeball flags
python3 scripts/gpu-bringup/compile_assets.py --toolkit $TK --out $PTX --rope-flags preserve --jobs 4 2>&1 | tee $G/compile-1.log
@@ -169,6 +174,47 @@ them (`followup_tests`, per file): `placeholder_assets_are_well_formed_but_unpin
and `expert_launches_are_refused_while_the_asset_is_unsealed` (window moe), `the_new_gate_asset_is_an_unsealed_placeholder_with_a_matching_source`
(window qsa). Flip them to "sealed" expectations on the Mac after the session (step g); any *other* failure is a real problem.
### c2. Mandatory: fast-math reseal of six sealed PTX (and the golden comparison after it)
The verifier review (`docs/cuda-seal-plan-additions-window.json`, `numerics_risk_fast_math.audit`) found six sealed PTX
that `scripts/build-original-verify-ptx.sh` compiled with `--fmad=true --ftz=false` while the Original compiles the
corresponding sources with `--use_fast_math` (`engine/strata/CMakeLists.txt` fast-math list). They are part of the default
compile set (group `reseal-fastmath`, one atomic group: all six or none). Each has its own flag list in
`scripts/gpu-bringup/extra-seal-plan.json`; the seal replaces `--ftz=false` by `--use_fast_math` and never passes both:
| PTX | Original source (CMake list) | what differs in the old copy (audit) |
| --- | --- | --- |
| `mtp_original_full_head_native` (`head_quant`) | `native_mmvq.cu` | two `div.rn.f32` where the Original emits `div.full.f32`; flips an int8 code at a rounding tie; feeds every q8_1 activation |
| `original_verify_qsa` (`verify_qsa_append_analytic`) | `native_qsa_indexer.cu` | `powf/cosf/sinf` vs `__powf/cos.approx/sin.approx`: index keys differ well beyond 1 ulp past 2051 cells |
| `mtp_original_full_router` (`mtp_full_route`) | `native_router.cu` | `expf`, reciprocal: expert weights differ in the last bits (ids do not) |
| `mtp_original_full_gr_post` | `native_gr_postops.cu` | sigmoid/silu `expf` and division |
| `mtp_original_full_gr_norm` | `native_gr_norm.cu` | `mean = partial / n_cols` |
| `ple_native_batch` | `native_ple_postops.cu` | `sqrtf`, `expf`, divisions (only with a PLE block); recipe is the stra169 one (`-ptx -O3 -arch=sm_120`) plus `--use_fast_math` |
The old digests are found and re-pinned wherever they live: `original_verify_window_proj.rs` (head_native),
`original_verify.rs` (qsa), `original_verify_window_moe.rs` (router), `original_verify_window_gr.rs` (gr_post, gr_norm, ple),
`ple_batch_queue.rs` (ple digest **and** its `PTX_BYTES` length) and the hex digests in the window plan; the sealer refuses
if a digest is pinned anywhere else or a pin is missing. `original_verify_qsa` and `ple_native_batch` are stored without a NUL
(`concat!(include_str!(..), "\0")`), the other four with one. `mtp_original_full_attention`, `qsa_decode_postops` and the
other assets the audit lists as matching the Original are **not** touched. Ad-hoc per-asset overrides exist too
(`compile_assets.py --flag-override ID:+--use_fast_math` / `ID:---flag`, recorded in the manifest and re-applied by the
sealer), but the six above need no override.
These six also back the MTP path, so **the MTP golden comparisons must be redone after the reseal**, and the reseal is not
accepted until the Original-vs-port golden comparison below has run:
1. Per kernel, same inputs, bitwise: Original kernel output (the Original's own parity executables built from `engine/strata`:
`quantize_act_parity` and `mmvq_multi_parity` for `head_quant`, `router_top10_parity`, `gr_parity`, `ple_parity`,
`rope_parity`/`qsa_parity` for the indexer append; confirm each with `--help`) against the port kernel launched with the same
inputs. **No harness in this tree feeds Original inputs to the port PTX yet.** That is a gap to close on the Mac; tonight's
executable substitute is 2-4.
2. The smokes of step e after the reseal (`seal-loads`, `transport`, `gr`, `moe-mmq`, `ple`, `mtp`, `runtime-*`): they prove the
re-pinned modules load and run, not that they match the Original.
3. Greedy parity (step f) in `--backend-mode original` and `preview`, with the MTP path on; any divergence found there is
attributed first to these six assets, then to the rope PTX.
4. Record per asset: old and new digest (sealed manifest `repins`), flags, and whether the golden comparison was run (yes, harness
name / no, gap). Until a bitwise result exists, write "resealed fast-math, not golden-compared" in the ledger.
Rope numerics (open item from `docs/rope-and-memory-plan.md`): there is no harness that runs old and new PTX on identical
inputs. Minimum evidence tonight: `diff <(grep -v '^//' old.ptx) <(grep -v '^//' new.ptx)` for `qsa_prompt_postops` and
`qsa_prompt_resolver` (old copies are in `pre-seal.tgz`) should show only ISA/version header and register-numbering churn
@@ -178,6 +224,14 @@ If a source does not compile: do not hack the host tree. Note the failing asset
with `--only a,b,c` (atomic groups must be complete), and fix the rest on the Mac; the next sync is blocked until `pull-sealed`
(or `--force-overwrite-sealed`).
## d'. Linux test harness (Mac, before the host build)
`scripts/linux-tests/run.sh` runs the Linux x86_64-gated CPU tests of `leleka-cuda-driver`, `leleka-runtime` and
`leleka-native-cpu-expert` in Docker (no GPU, ignored tests stay ignored; 761 non-GPU tests passed when it landed on
`claude/port-main`). Run it on the exact commit you sync, and again on the commit that contains the sealed files after step g.
Expect, after sealing, only the placeholder tests listed in step c to need flipping; any other red here is a defect in
the tree, not in the host.
## d. Build
```sh
@@ -341,7 +395,7 @@ scripts/gpu-bringup/run_gpu_smokes.sh --run --run-dir $G/smokes-3
Semantics: groups run in dependency order; the first failing test stops its group (later tests are `NOT-RUN`); groups that
depend on a failed group are `SKIPPED-DEP`; independent groups still run; a cargo filter that matches no test counts as a
failure (it means the test is cfg-gated away or was renamed); the runner refuses to start while another process holds the
failure (it means the test is cfg-gated away or was renamed); the runner first checks the driver against the highest PTX ISA in the tree and refuses (exit 3) if it is too old, then refuses to start while another process holds the
GPU or less than 8 GiB VRAM is free (`--allow-busy-gpu`, `MIN_FREE_MIB`), never kills anything, and writes per test logs,
`results.tsv`, `run-info.txt`, `gpu-timeline.csv` (nvidia-smi at run start, around every group and at the end) and
`nvidia-smi.before.txt` / `.after.txt` under the run dir. Per-test timeout 900 s (`SMOKE_TIMEOUT`). To repeat one test:
@@ -351,7 +405,7 @@ inherited descriptor: `exec 9<archive; export LELEKA_STRA169_KAR_FD=9`); tests w
How to read results: a smoke proves the pinned PTX loads on the card and the listed entries run; it is not a numerical
qualification of the Original (the window GPU test says so itself). Typical failures: `Unpinned`/`unsealed` => step c missed
an asset; `CUDA_ERROR_INVALID_PTX` / `UNSUPPORTED_PTX_VERSION` => toolkit/driver mismatch (D2); `NO_BINARY_FOR_GPU` => wrong
an asset; `CUDA_ERROR_INVALID_PTX` / `UNSUPPORTED_PTX_VERSION` => the driver does not know the PTX ISA in the tree (9.0 needs >= 580.65.06; `compile_assets.py --isa-inventory --driver-check`), see D2; `NO_BINARY_FOR_GPU` => wrong
`-arch`; launch/shared-memory errors => a real kernel problem to log, not to patch on the host.
## f. Original17 parity plan (greedy equality)
@@ -456,6 +510,6 @@ lifts the sync guard. Sealed does not mean qualified: pins computed by a script
Rehearsal without hardware (what the unit tests do): copy the tree, `compile_assets.py --fake-nvcc --out DIR --rope-flags preserve`,
`seal_pins.py --ptx-dir DIR --root /tmp/copy --allow-fake --write`, then `cargo test -p leleka-context ptx_abi` in the copy.
Verified that way on 2026-10-14: all 21 assets patch, every pin reads back, `cargo check --target x86_64-unknown-linux-gnu -p
Verified that way on 2026-10-14: all 27 assets patch, every pin reads back, `cargo check --target x86_64-unknown-linux-gnu -p
leleka-cuda-driver --features cuda-driver --tests` type-checks the patched copy, and the strict ABI test passes against fake
extended PTX. None of that says anything about real nvcc output or the card.
+101
View File
@@ -80,6 +80,8 @@ class Asset:
atomic_group: Optional[str] = None # all members must be sealed together
notes: List[str] = field(default_factory=list)
seal_fields: bool = False # the plan entry carries seal_sha256/seal_length slots to fill
entries_from_symbols: bool = False # entry names live in crates/cuda-driver/src/mtp_original_full_symbols.rs
flag_overrides: List[str] = field(default_factory=list) # operator overrides applied (recorded in the manifest)
@property
def ptx_name(self) -> str:
@@ -152,6 +154,8 @@ def asset_from_assets_entry(entry: dict, plan: str, group: str) -> Asset:
optional=bool(entry.get("optional", False)),
atomic_group=entry.get("atomic_group"),
seal_fields="seal_sha256" in entry and "seal_length" in entry,
entries_from_symbols=bool(entry.get("entries_from_symbols", False)),
repin_expect={k: int(v) for k, v in (entry.get("repin_expect") or {}).items()},
)
if "include_profile" in entry:
if entry["include_profile"] != "standard":
@@ -556,3 +560,100 @@ def fill_derived_entries(root: Path, asset: Asset) -> None:
return
asset.entries = derive_entries(root, asset)
asset.entries_derived = True
SYMBOLS_FILE = "crates/cuda-driver/src/mtp_original_full_symbols.rs"
def symbols_entries(root: Path, ptx_name: str) -> List[str]:
"""Entry names the Rust side loads from `ptx_name` (mtp_original_full_symbols.rs table)."""
text = (root / SYMBOLS_FILE).read_text(encoding="utf-8")
m = re.search(r'include_bytes!\("' + re.escape(ptx_name) + r'"\)\s*,\s*&\[([^\]]*)\]', text)
if not m:
raise PlanError(f"{ptx_name}: no entry table in {SYMBOLS_FILE}")
names = re.findall(r'c"([^"]+)"', m.group(1))
if not names:
raise PlanError(f"{ptx_name}: empty entry table in {SYMBOLS_FILE}")
return names
def fill_derived_entries(root: Path, asset: Asset) -> None: # noqa: F811 - supersedes the earlier definition
if asset.deferred or asset.entries or asset.entry_prefix_counts:
return
if asset.entries_from_symbols:
asset.entries = symbols_entries(root, asset.ptx_name)
return
asset.entries = derive_entries(root, asset)
asset.entries_derived = True
def apply_flag_overrides(assets: List[Asset], specs: List[str]) -> None:
"""Operator flag overrides, `ID:+FLAG` (add) / `ID:-FLAG` (remove); recorded on the asset.
The policy note is replaced because the plan's own note no longer describes the build; the fast-math lint
still rejects contradictory flag sets (--use_fast_math with --ftz=false/--prec-div=true/--prec-sqrt=true)."""
by_id = {a.id: a for a in assets}
for spec in specs:
m = re.fullmatch(r"([\w.\-]+):([+-])(-.+)", spec)
if not m:
raise PlanError(f"bad --flag-override {spec!r}; expected ID:+--flag or ID:---flag")
a = by_id.get(m.group(1))
if a is None:
raise PlanError(f"--flag-override: unknown asset {m.group(1)!r}")
flag = m.group(3)
if m.group(2) == "+":
if flag not in a.flags:
a.flags.append(flag)
else:
if flag not in a.flags:
raise PlanError(f"--flag-override {spec}: {a.id} does not have {flag}")
a.flags.remove(flag)
a.flag_overrides.append(spec)
a.policy = "operator flag override"
# ---------------------------------------------------------------------------------- PTX ISA / driver
# PTX ISA version -> minimum NVIDIA driver able to JIT it. 8.7 is CUDA 12.8 (R570); 9.0 is CUDA 13.0 (R580,
# GA 580.65.06, deploy/README.md). An unknown version is an error: extend this table, do not guess.
ISA_MIN_DRIVER = {"7.0": "450.80", "8.0": "525.60", "8.7": "570.26", "9.0": "580.65.06"}
def ptx_isa_version(data: bytes) -> Optional[str]:
m = re.search(rb"(?m)^\.version\s+(\d+\.\d+)", data[:8192])
return m.group(1).decode() if m else None
def isa_inventory(root: Path) -> Dict[str, List[str]]:
"""{ISA version: [ptx names]} over the real (non-placeholder) PTX in crates/cuda-driver/src."""
out: Dict[str, List[str]] = {}
for p in sorted((root / "crates/cuda-driver/src").glob("*.ptx")):
data = p.read_bytes()
if b"UNSEALED" in data[:4096] or b"PLACEHOLDER" in data[:4096]:
continue
v = ptx_isa_version(data)
if v:
out.setdefault(v, []).append(p.name)
return out
def version_tuple(v: str) -> Tuple[int, ...]:
return tuple(int(x) for x in re.findall(r"\d+", v))
def min_driver_for(isa_versions) -> Tuple[str, str]:
"""(highest ISA, minimum driver) for a set of ISA versions."""
versions = sorted(set(isa_versions), key=version_tuple)
if not versions:
raise PlanError("no PTX ISA versions given")
for v in versions:
if v not in ISA_MIN_DRIVER:
raise PlanError(f"unknown PTX ISA version {v}: add it to ISA_MIN_DRIVER with its minimum driver")
top = max(versions, key=lambda v: version_tuple(ISA_MIN_DRIVER[v]))
return top, ISA_MIN_DRIVER[top]
def driver_ok(driver: str, isa_versions) -> Tuple[bool, str]:
top, need = min_driver_for(isa_versions)
ok = version_tuple(driver) >= version_tuple(need)
return ok, (f"driver {driver} {'supports' if ok else 'is too old for'} PTX ISA {top} (needs >= {need})")
+53 -2
View File
@@ -100,13 +100,46 @@ def nvcc_version(nvcc: str) -> Dict[str, str]:
"version": m.group(2) if m else ""}
# ------------------------------------------------------------------------------------ driver / ISA
def installed_driver() -> Optional[str]:
"""Driver version from nvidia-smi, or None if there is no NVIDIA driver on this machine."""
try:
p = subprocess.run(["nvidia-smi", "--query-gpu=driver_version", "--format=csv,noheader"],
capture_output=True, text=True, timeout=30)
except (OSError, subprocess.SubprocessError):
return None
lines = [x.strip() for x in p.stdout.splitlines() if x.strip()]
return lines[0] if p.returncode == 0 and lines else None
def driver_report(root: Path, extra_isa=(), override: Optional[str] = None, require: bool = False) -> int:
"""Print the PTX ISA inventory of the tree and check the installed driver can JIT the highest one."""
inv = L.isa_inventory(root)
for v in extra_isa:
inv.setdefault(v, [])
print("PTX ISA versions in crates/cuda-driver/src (real PTX only):")
for v in sorted(inv, key=L.version_tuple):
print(f" ISA {v}: {len(inv[v]):>3} files (driver >= {L.ISA_MIN_DRIVER.get(v, '?')})")
top, need = L.min_driver_for(inv)
print(f"highest ISA {top} => the driver must be >= {need}")
drv = override or installed_driver()
if drv is None:
print("no NVIDIA driver visible here (nvidia-smi absent): cannot check; the GPU host must satisfy the line above")
return 1 if require else 0
ok, msg = L.driver_ok(drv, inv)
print(("OK: " if ok else "FAIL: ") + msg)
return 0 if ok else 1
# ------------------------------------------------------------------------------------------ compile
def compile_one(root: Path, nvcc: str, asset: L.Asset, out_dir: Path, args, fake: bool) -> dict:
rec: dict = {"id": asset.id, "group": asset.group, "cu": asset.cu, "ptx": asset.ptx,
"ptx_file": asset.ptx_name, "encoding": asset.encoding, "flags": asset.flags + [f"-I{d}" for d in asset.includes],
"plan": asset.plan, "status": "failed", "problems": []}
"plan": asset.plan, "status": "failed", "problems": [], "flag_overrides": list(asset.flag_overrides)}
status, detail = L.check_cu_pin(root, asset)
rec["cu_pin_status"] = status
if status in ("stale", "missing"):
@@ -156,7 +189,7 @@ def compile_one(root: Path, nvcc: str, asset: L.Asset, out_dir: Path, args, fake
tmp.replace(out_dir / (asset.ptx_name + ".rejected"))
return rec
tmp.replace(final)
rec.update({"status": "ok", "raw_bytes": len(raw), "raw_sha256": L.sha256_hex(raw),
rec.update({"status": "ok", "ptx_isa": L.ptx_isa_version(raw), "raw_bytes": len(raw), "raw_sha256": L.sha256_hex(raw),
"stored_bytes": len(L.stored_bytes(raw, asset.encoding)),
"entries_checked": len(asset.entries) + sum(asset.entry_prefix_counts.values()),
"fake": fake})
@@ -223,6 +256,8 @@ def preflight(root: Path, assets: List[L.Asset], everything: List[L.Asset]) -> i
bad += len(cov["uncovered_placeholders"])
exp = L.toolkit_expected_version(root)
print(f"== toolkit lock pins nvcc {exp}")
print("== PTX ISA / driver")
driver_report(root)
print("PREFLIGHT " + ("FAILED" if bad else "OK"))
return 1 if bad else 0
@@ -262,18 +297,27 @@ def build_parser() -> argparse.ArgumentParser:
ap.add_argument("--timeout", type=int, default=1800, help="seconds per nvcc invocation")
ap.add_argument("--fail-fast", action="store_true")
ap.add_argument("--ignore-policy-lint", action="store_true")
ap.add_argument("--flag-override", action="append", default=[], metavar="ID:+FLAG|ID:-FLAG",
help="per-asset nvcc flag override, e.g. mtp_original_full_router:+--use_fast_math (recorded in the manifest)")
ap.add_argument("--isa-inventory", action="store_true", help="print PTX ISA versions of the tree and the minimum driver")
ap.add_argument("--driver-check", action="store_true", help="with --isa-inventory: fail if the installed driver is too old / absent")
ap.add_argument("--driver-version", help=argparse.SUPPRESS)
ap.add_argument("--skip-driver-check", action="store_true", help="do not refuse to compile on a host whose driver is too old")
return ap
def main(argv: Optional[List[str]] = None) -> int:
args = build_parser().parse_args(argv)
root = Path(args.root).resolve()
if args.isa_inventory:
return driver_report(root, override=args.driver_version, require=args.driver_check)
list_only = args.list or args.preflight
if list_only:
args.include_optional = True
rope_variant = None if args.no_rope else (args.rope_flags or ("precise" if list_only else None))
try:
assets, _ = L.load_all_assets(root, rope_variant)
L.apply_flag_overrides(assets, args.flag_override)
selected = select_assets(assets, args)
except L.PlanError as error:
print(f"error: {error}", file=sys.stderr)
@@ -325,6 +369,11 @@ def main(argv: Optional[List[str]] = None) -> int:
f" Use --expect-version {version['version']} (or any) only if the owner accepted that toolchain.", file=sys.stderr)
return 2
print(f"nvcc: {version['banner']} ({nvcc}){' [FAKE]' if fake else ''}")
# the tree mixes CUDA 13.0 PTX (ISA 9.0) with 12.8 PTX (ISA 8.7): the driver that will load them must know 9.0
if not fake and not args.skip_driver_check and driver_report(root, extra_isa=("9.0",), override=args.driver_version) != 0:
print("error: this host's driver cannot load ISA 9.0 PTX. Compiling here is pointless for the GPU session;\n"
" fix the driver or pass --skip-driver-check if you only compile here and run elsewhere.", file=sys.stderr)
return 2
records: List[dict] = []
failed = False
@@ -354,6 +403,8 @@ def main(argv: Optional[List[str]] = None) -> int:
"nvcc": {"path": nvcc, **version},
"toolkit_lock_nvcc": L.toolkit_expected_version(root),
"rope_flags": args.rope_flags,
"flag_overrides": list(args.flag_override),
"ptx_isa_versions": sorted({r["ptx_isa"] for r in records if r.get("ptx_isa")}),
"assets": records,
"deferred": [{"id": a.id, "reason": a.deferred} for a in deferred],
"coverage": coverage_report(root, selected),
+207 -13
View File
@@ -1,28 +1,59 @@
{
"schema": 1,
"note": "Assets that are unsealed placeholders in crates/cuda-driver/src but are covered by none of docs/cuda-seal-plan*.json. Same entry format as those plans (plus group/optional/deferred/entry_prefix_counts/include_profile). Recipes are taken from the placeholder/.cu headers; none has been compiled. Sibling plans carry cu_pin; these entries have none because no pin was ever written, so the compile manifest (cu sha256 at compile time) is the pin.",
"note": "Assets that are unsealed placeholders in crates/cuda-driver/src but are covered by none of docs/cuda-seal-plan*.json. Same entry format as those plans (plus group/optional/deferred/entry_prefix_counts/include_profile). Recipes are taken from the placeholder/.cu headers; none has been compiled. Sibling plans carry cu_pin; these entries have none because no pin was ever written, so the compile manifest (cu sha256 at compile time) is the pin. The six reseal-fastmath entries are the verifier reviewer's audit (docs/cuda-seal-plan-additions-window.json numerics_risk_fast_math.audit): they REPLACE already-sealed PTX, so their old digests are re-pinned wherever they appear (repin_expect).",
"assets": [
{
"cu": "crates/cuda-driver/src/kar_decode_levels.cu",
"ptx": "crates/cuda-driver/src/kar_decode_levels.ptx",
"flags": ["-ptx", "-O3", "-arch=sm_120", "-std=c++17", "--ftz=false", "--prec-div=true", "--prec-sqrt=true", "--fmad=true"],
"flags": [
"-ptx",
"-O3",
"-arch=sm_120",
"-std=c++17",
"--ftz=false",
"--prec-div=true",
"--prec-sqrt=true",
"--fmad=true"
],
"policy": "precise (flags quoted from the placeholder header of kar_decode_levels.ptx; no fast-math)",
"entries": ["leleka_kar_decode_levels_f32", "leleka_kar_multiply_f32", "leleka_kar_swiglu_f32"],
"entries": [
"leleka_kar_decode_levels_f32",
"leleka_kar_multiply_f32",
"leleka_kar_swiglu_f32"
],
"encoding": "concat_include_str",
"rust_fields_to_fill": {
"kar_decode_levels.rs": ["KAR_DECODE_LEVELS_PIN.source_sha256", "KAR_DECODE_LEVELS_PIN.ptx_sha256"]
"kar_decode_levels.rs": [
"KAR_DECODE_LEVELS_PIN.source_sha256",
"KAR_DECODE_LEVELS_PIN.ptx_sha256"
]
},
"group": "kar"
},
{
"cu": "crates/cuda-driver/src/mmq_original_group_swiglu.cu",
"ptx": "crates/cuda-driver/src/mmq_original_group_swiglu.ptx",
"flags": ["-ptx", "-O3", "-arch=sm_120", "-std=c++17", "--use_fast_math", "--extended-lambda"],
"flags": [
"-ptx",
"-O3",
"-arch=sm_120",
"-std=c++17",
"--use_fast_math",
"--extended-lambda"
],
"policy": "fast-math, flags quoted from the sibling mmq_original_group_{mul,fixup}.cu header ('ROOT must compile sm120 --use_fast_math'); swiglu itself uses explicit __expf. UNVERIFIED against engine/strata CMake: decide before sealing.",
"entries": ["leleka_original_mmq_swiglu", "leleka_original_mmq_gather", "leleka_original_mmq_gu_finite"],
"entries": [
"leleka_original_mmq_swiglu",
"leleka_original_mmq_gather",
"leleka_original_mmq_gu_finite"
],
"encoding": "include_bytes",
"include_profile": "standard",
"rust_fields_to_fill": {"mmq_original_group.rs": ["SEALED[0]"]},
"rust_fields_to_fill": {
"mmq_original_group.rs": [
"SEALED[0]"
]
},
"group": "mmq_group",
"optional": true,
"atomic_group": "mmq_group"
@@ -30,12 +61,25 @@
{
"cu": "crates/cuda-driver/src/mmq_original_group_mul.cu",
"ptx": "crates/cuda-driver/src/mmq_original_group_mul.ptx",
"flags": ["-ptx", "-O3", "-arch=sm_120", "-std=c++17", "--use_fast_math", "--extended-lambda"],
"flags": [
"-ptx",
"-O3",
"-arch=sm_120",
"-std=c++17",
"--use_fast_math",
"--extended-lambda"
],
"policy": "fast-math, flags quoted from the .cu header and the stra169 mmq-original-formats recipe (--use_fast_math --extended-lambda). UNVERIFIED: decide before sealing.",
"entry_prefix_counts": {"_Z9mul_mat_q": 66},
"entry_prefix_counts": {
"_Z9mul_mat_q": 66
},
"encoding": "include_bytes",
"include_profile": "standard",
"rust_fields_to_fill": {"mmq_original_group.rs": ["SEALED[1]"]},
"rust_fields_to_fill": {
"mmq_original_group.rs": [
"SEALED[1]"
]
},
"group": "mmq_group",
"optional": true,
"atomic_group": "mmq_group"
@@ -43,12 +87,25 @@
{
"cu": "crates/cuda-driver/src/mmq_original_group_fixup.cu",
"ptx": "crates/cuda-driver/src/mmq_original_group_fixup.ptx",
"flags": ["-ptx", "-O3", "-arch=sm_120", "-std=c++17", "--use_fast_math", "--extended-lambda"],
"flags": [
"-ptx",
"-O3",
"-arch=sm_120",
"-std=c++17",
"--use_fast_math",
"--extended-lambda"
],
"policy": "fast-math, flags quoted from the .cu header and the stra169 mmq-original-formats-fixup recipe. UNVERIFIED: decide before sealing.",
"entry_prefix_counts": {"_Z24mul_mat_q_stream_k_fixup": 66},
"entry_prefix_counts": {
"_Z24mul_mat_q_stream_k_fixup": 66
},
"encoding": "include_bytes",
"include_profile": "standard",
"rust_fields_to_fill": {"mmq_original_group.rs": ["SEALED[2]"]},
"rust_fields_to_fill": {
"mmq_original_group.rs": [
"SEALED[2]"
]
},
"group": "mmq_group",
"optional": true,
"atomic_group": "mmq_group"
@@ -73,6 +130,143 @@
"flags": [],
"deferred": "placeholder says 'compile native_parity.cu using pinned Original headers and flags. No executable entries.' Parity oracle source (iq_kernels.cu derivative); not needed for serving.",
"group": "native_parity"
},
{
"cu": "crates/cuda-driver/src/mtp_original_full_head_native.cu",
"ptx": "crates/cuda-driver/src/mtp_original_full_head_native.ptx",
"flags": [
"--ptx",
"-std=c++17",
"-O3",
"-arch=sm_120",
"--fmad=true",
"--use_fast_math"
],
"policy": "fast-math RESEAL: the Original compiles native_mmvq.cu quantize_q8_1 (head_quant) with --use_fast_math (native_mmvq on the CMake fast-math list); the copy sealed by scripts/build-original-verify-ptx.sh used the non-fast flags. Audit: head_quant has two div.rn.f32 where the Original emits div.full.f32.",
"encoding": "include_bytes",
"group": "reseal-fastmath",
"atomic_group": "reseal-fastmath",
"mandatory": true,
"repin_expect": {
"crates/cuda-driver/src/original_verify_window_proj.rs": 1
},
"include_profile": "standard",
"entries_from_symbols": true
},
{
"cu": "crates/cuda-driver/src/original_verify_qsa.cu",
"ptx": "crates/cuda-driver/src/original_verify_qsa.ptx",
"flags": [
"--ptx",
"-std=c++17",
"-O3",
"-arch=sm_120",
"--fmad=true",
"--use_fast_math"
],
"policy": "fast-math RESEAL: the Original compiles native_qsa_indexer.cu append<false> with --use_fast_math (native_qsa_indexer on the CMake fast-math list); the copy sealed by scripts/build-original-verify-ptx.sh used the non-fast flags. Audit: powf/cosf/sinf are the libm forms here, __powf/cos.approx/sin.approx in the Original.",
"encoding": "concat_include_str",
"group": "reseal-fastmath",
"atomic_group": "reseal-fastmath",
"mandatory": true,
"repin_expect": {
"crates/cuda-driver/src/original_verify.rs": 1
},
"include_profile": "standard",
"entries": [
"verify_qsa_append_analytic",
"verify_qsa_append_table"
]
},
{
"cu": "crates/cuda-driver/src/mtp_original_full_router.cu",
"ptx": "crates/cuda-driver/src/mtp_original_full_router.ptx",
"flags": [
"--ptx",
"-std=c++17",
"-O3",
"-arch=sm_120",
"--fmad=true",
"--use_fast_math"
],
"policy": "fast-math RESEAL: the Original compiles native_router.cu route with --use_fast_math (native_router on the CMake fast-math list); the copy sealed by scripts/build-original-verify-ptx.sh used the non-fast flags. Audit: expf and reciprocal.",
"encoding": "include_bytes",
"group": "reseal-fastmath",
"atomic_group": "reseal-fastmath",
"mandatory": true,
"repin_expect": {
"crates/cuda-driver/src/original_verify_window_moe.rs": 1
},
"include_profile": "standard",
"entries_from_symbols": true
},
{
"cu": "crates/cuda-driver/src/mtp_original_full_gr_post.cu",
"ptx": "crates/cuda-driver/src/mtp_original_full_gr_post.ptx",
"flags": [
"--ptx",
"-std=c++17",
"-O3",
"-arch=sm_120",
"--fmad=true",
"--use_fast_math"
],
"policy": "fast-math RESEAL: the Original compiles native_gr_postops.cu with --use_fast_math (native_gr_postops on the CMake fast-math list); the copy sealed by scripts/build-original-verify-ptx.sh used the non-fast flags. Audit: sigmoid/silu expf and division.",
"encoding": "include_bytes",
"group": "reseal-fastmath",
"atomic_group": "reseal-fastmath",
"mandatory": true,
"repin_expect": {
"crates/cuda-driver/src/original_verify_window_gr.rs": 1
},
"include_profile": "standard",
"entries_from_symbols": true
},
{
"cu": "crates/cuda-driver/src/mtp_original_full_gr_norm.cu",
"ptx": "crates/cuda-driver/src/mtp_original_full_gr_norm.ptx",
"flags": [
"--ptx",
"-std=c++17",
"-O3",
"-arch=sm_120",
"--fmad=true",
"--use_fast_math"
],
"policy": "fast-math RESEAL: the Original compiles native_gr_norm.cu weighted_rms_norm with --use_fast_math (native_gr_norm on the CMake fast-math list); the copy sealed by scripts/build-original-verify-ptx.sh used the non-fast flags. Audit: mean = partial / n_cols.",
"encoding": "include_bytes",
"group": "reseal-fastmath",
"atomic_group": "reseal-fastmath",
"mandatory": true,
"repin_expect": {
"crates/cuda-driver/src/original_verify_window_gr.rs": 1
},
"include_profile": "standard",
"entries_from_symbols": true
},
{
"cu": "crates/cuda-driver/src/ple_native_batch.cu",
"ptx": "crates/cuda-driver/src/ple_native_batch.ptx",
"flags": [
"-ptx",
"-O3",
"-arch=sm_120",
"--use_fast_math"
],
"policy": "fast-math RESEAL: the Original compiles native_ple_postops.cu with --use_fast_math (native_ple_postops on the CMake fast-math list); the copy sealed by scripts/build-original-verify-ptx.sh used the non-fast flags. Audit: sqrtf/expf/division. Only with a PLE block. Recipe: the stra169 plan's flags plus --use_fast_math (no -std, no includes).",
"encoding": "concat_include_str",
"group": "reseal-fastmath",
"atomic_group": "reseal-fastmath",
"mandatory": true,
"repin_expect": {
"crates/cuda-driver/src/original_verify_window_gr.rs": 1,
"crates/cuda-driver/src/ple_batch_queue.rs": 1
},
"rust_fields_to_fill": {
"ple_batch_queue.rs": [
"PTX_BYTES"
]
}
}
]
}
+6
View File
@@ -16,6 +16,7 @@
# around every group;
# * nothing here starts a model run: the model-assets group (tests that read shard/pack/oracle paths) runs only
# with --allow-model-runs AND only when the caller already exported every variable it needs;
# * it refuses to start if the driver is older than the highest PTX ISA in the tree (9.0 needs >= 580.65.06);
# * the script never kills a process and refuses to start while another process holds the GPU
# (--allow-busy-gpu overrides, e.g. for a deliberately shared card).
#
@@ -106,6 +107,11 @@ fi
command -v nvidia-smi >/dev/null || { echo "nvidia-smi not found: no NVIDIA driver on this machine" >&2; exit 2; }
command -v cargo >/dev/null || { echo "cargo not on PATH (source ~/.cargo/env)" >&2; exit 2; }
# the tree mixes CUDA 13.0 PTX (ISA 9.0) with 12.8 PTX (ISA 8.7): the driver must be able to JIT the highest ISA
if ! python3 "$here/compile_assets.py" --root "$repo" --isa-inventory --driver-check; then
echo "refusing to start: the installed NVIDIA driver cannot load the PTX in this tree (see above)" >&2
exit 3
fi
busy="$(nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv,noheader 2>/dev/null || true)"
if [[ -n "${busy//[[:space:]]/}" && "$allow_busy" != 1 ]]; then
echo "refusing to start: other processes hold the GPU (not touching them):" >&2
+16
View File
@@ -116,6 +116,7 @@ def resolve_assets(root: Path, manifest: dict) -> Dict[str, L.Asset]:
if has_rope and manifest.get("rope_flags") not in L.ROPE_VARIANTS:
raise SealError("manifest holds rope assets but no valid rope_flags")
assets, _ = L.load_all_assets(root, manifest["rope_flags"] if has_rope else None)
L.apply_flag_overrides(assets, manifest.get("flag_overrides", []))
return {a.id: a for a in assets}
@@ -242,6 +243,18 @@ def seal(root: Path, ptx_dir: Path, *, allow_fake: bool, only: Optional[set], ru
if not R.read_field(ws.text[rel], spec, v):
raise SealError(f"{rel} {spec}: pin does not read back after formatting")
placeholders_after = sorted(placeholders_before - {s["ptx"] for s in sealed})
# ISA inventory of the tree AFTER this seal: the driver on the GPU host must support the highest version
isa: Dict[str, List[str]] = {k: list(v) for k, v in L.isa_inventory(root).items()}
for s_ in sealed:
v = L.ptx_isa_version((ptx_dir / manifest_file(manifest, s_["id"])).read_bytes())
name = Path(s_["ptx"]).name
for k in isa:
if name in isa[k]:
isa[k].remove(name)
if v:
isa.setdefault(v, []).append(name)
isa = {k: sorted(v) for k, v in isa.items() if v}
top_isa, min_driver = L.min_driver_for(isa)
result = {
"schema": 1,
"tool": "scripts/gpu-bringup/seal_pins.py",
@@ -253,6 +266,9 @@ def seal(root: Path, ptx_dir: Path, *, allow_fake: bool, only: Optional[set], ru
"assets": sealed,
"touched_files": ws.touched(),
"unsealed_placeholders_remaining": placeholders_after,
"ptx_isa_inventory": {k: len(v) for k, v in sorted(isa.items())},
"highest_ptx_isa": top_isa,
"min_driver_required": min_driver,
"format_notes": fmt_notes,
"after_sealing": [
"These tests assert the placeholder state and WILL fail until updated (listed per file in followup_tests).",
+69 -1
View File
@@ -525,6 +525,31 @@ class EndToEnd(unittest.TestCase):
self.assertEqual(run_quiet(S.main, base)[0], 0)
self.assertEqual((self.root / "crates/cuda-driver/src/cons.rs").read_text(), snap)
def test_flag_override_is_recorded_and_checked_by_the_sealer(self):
code, out, _ = self.compile("--flag-override", "b:-clearly-not-there")
self.assertEqual(code, 2)
shutil.rmtree(self.out, ignore_errors=True)
code, out, err = self.compile("--flag-override", "a:+--use_fast_math")
self.assertEqual(code, 0, out + err)
m = json.loads((self.out / "build-manifest.json").read_text())
self.assertEqual(m["flag_overrides"], ["a:+--use_fast_math"])
rec = next(r for r in m["assets"] if r["id"] == "a")
self.assertIn("--use_fast_math", rec["flags"])
self.assertEqual(rec["flag_overrides"], ["a:+--use_fast_math"])
base = ["--ptx-dir", str(self.out), "--root", str(self.root), "--allow-fake", "--rustfmt", "never"]
self.assertEqual(run_quiet(S.main, base)[0], 0) # the sealer re-applies the recorded overrides
man = json.loads((self.out / "build-manifest.json").read_text())
man["flag_overrides"] = []
(self.out / "build-manifest.json").write_text(json.dumps(man))
code, _, err = run_quiet(S.main, base)
self.assertEqual(code, 1)
self.assertIn("compiled with flags", err)
def test_contradictory_override_is_stopped_by_the_lint(self):
code, out, _ = self.compile("--flag-override", "b:+--ftz=false")
self.assertEqual(code, 1)
self.assertIn("contradicts itself", out)
def test_atomic_groups_must_move_together(self):
plan = json.loads((self.root / "docs/cuda-seal-plan-mini.json").read_text())
for a in plan["assets"]:
@@ -553,7 +578,20 @@ class RealTreeFakeSeal(unittest.TestCase):
"--rustfmt", "never"])
self.assertEqual(code, 0, err)
man = json.loads(text)
self.assertEqual(len(man["assets"]), 21)
self.assertEqual(len(man["assets"]), 27)
self.assertEqual(man["min_driver_required"], "580.65.06")
# the six fast-math reseals were re-pinned where the old digests lived, and the PLE length slot updated
by = {a["id"]: a for a in man["assets"]}
resealed = [a for a in man["assets"] if a["group"] == "reseal-fastmath"]
self.assertEqual(len(resealed), 6)
self.assertTrue(all("--use_fast_math" in a["flags"] and "--ftz=false" not in a["flags"] for a in resealed))
self.assertEqual(sum(r["replacements"] for a in resealed for r in a["repins"] if r.get("kind") == "decimal"), 7)
ple = by["ple_native_batch"]
queue = (scratch / "crates/cuda-driver/src/ple_batch_queue.rs").read_text()
self.assertEqual(R.read_plain(queue, "PTX_BYTES"), ple["raw_bytes"])
self.assertEqual(R.read_plain(queue, "PTX_SHA256"), bytes.fromhex(ple["raw_sha256"]))
gr = (scratch / "crates/cuda-driver/src/original_verify_window_gr.rs").read_text()
self.assertEqual(len(R.find_decimal_pins(gr, bytes.fromhex(ple["raw_sha256"]))), 1)
# idempotent on the second run of identical output
code, _, err = run_quiet(S.main, ["--ptx-dir", str(out), "--root", str(scratch), "--allow-fake", "--write",
"--rustfmt", "never"])
@@ -653,6 +691,7 @@ echo "test $name ... ok"; echo "test result: ok. 1 passed; 0 failed; 0 ignored;
"""
STUB_SMI = """#!/usr/bin/env bash
case "$*" in
*query-gpu=driver_version\\ *) echo "${STUB_DRIVER:-595.91.07}" ;;
*query-compute-apps*) [[ -n "${STUB_BUSY:-}" ]] && echo "4242, strata, 1000 MiB" ;;
*memory.free*) echo "${STUB_FREE:-32000}" ;;
*query-gpu*) echo "2026/10/14 20:00:00.000, NVIDIA GeForce RTX 5090, 595.91, 100 MiB, 32607 MiB, 40, 30.0 W, 210 MHz, 405 MHz, 0 %" ;;
@@ -725,6 +764,13 @@ class RunSmokesScript(unittest.TestCase):
self.assertEqual(self.status("driver-basic"), "FAIL")
self.assertEqual({self.status(g) for g in ("seal-loads", "new-pins", "transport", "gr")}, {"SKIPPED-DEP"})
def test_old_driver_is_refused_because_the_tree_holds_ptx_isa_9_0(self):
p = self.run_script("--run", "--run-dir", str(self.run_dir), STUB_DRIVER="575.28")
self.assertEqual(p.returncode, 3)
self.assertIn("ISA 9.0", p.stdout)
self.assertIn("too old", p.stdout)
self.assertFalse(self.run_dir.exists())
def test_busy_gpu_and_low_vram_are_refused_without_touching_anything(self):
p = self.run_script("--run", "--run-dir", str(self.run_dir), STUB_BUSY="1")
self.assertEqual(p.returncode, 3)
@@ -769,6 +815,28 @@ for a in "$@"; do case "$a" in --files-from=*) cp "${a#--files-from=}" "$STUB_LO
"""
class DriverIsaChecks(unittest.TestCase):
def test_table_and_checks(self):
self.assertEqual(L.min_driver_for(["8.7", "9.0"]), ("9.0", "580.65.06"))
self.assertEqual(L.driver_ok("595.91.07", ["8.7", "9.0"])[0], True)
self.assertEqual(L.driver_ok("580.65.06", ["9.0"])[0], True)
self.assertEqual(L.driver_ok("580.65.05", ["9.0"])[0], False)
self.assertEqual(L.driver_ok("570.26", ["8.7"])[0], True)
with self.assertRaises(L.PlanError):
L.min_driver_for(["9.9"])
def test_the_tree_really_mixes_8_7_and_9_0(self):
inv = L.isa_inventory(REPO)
self.assertIn("8.7", inv)
self.assertIn("9.0", inv)
def test_cli_exit_codes(self):
code, out, _ = run_quiet(C.main, ["--isa-inventory", "--driver-check", "--driver-version", "575.0"])
self.assertEqual(code, 1)
self.assertIn("too old", out)
self.assertEqual(run_quiet(C.main, ["--isa-inventory", "--driver-check", "--driver-version", "595.91.07"])[0], 0)
class RemoteSyncScript(unittest.TestCase):
"""remote_sync.sh against stub ssh/rsync: argument construction and the safety refusals, no network."""