ci: repairs found by running the Docker- and tool-dependent steps in containers

* scripts/test-cuda-fixed-ptx.sh asserted the CUDA 13.0 toolkit pins; deploy/cuda-toolkit.lock.json moved to 13.2.2 on 2026-10-14. Pins updated
  to nvcc/ptxas 13.2.86 and nvdisasm 13.2.86 (sha256 and sizes from the official manifest, verified against the lock's manifest_sha256);
  the SASS dataflow assertions hold for the new ptxas.
* crates/model-format/src/huge_pages.rs: libc 0.2.190 has no MADV_COLLAPSE for musl targets, so the static CLI (linux-static-cli,
  release-cli, Dockerfile.static-cli) did not compile since the hugepages work (2026-11-01). The constant (25, the same value glibc's libc
  exports) is spelled out locally; nothing else changes.
* deploy/Dockerfile.static-cli: `rustup target add` ran before rust-toolchain.toml was copied; the floating rust:1.99 tag is 1.99.1 while the
  pin is 1.99.0, so the musl std was installed for the wrong toolchain ("can't find crate for core"). The target is added after the COPY.
* crates/cuda-driver/tests/mock_cuda.c: load-only cuStreamSynchronize (Driver::load resolves it eagerly); the fake-libcuda mock gates pass again.
  port.yml runs them (`run.sh --mocks`) after the harness.
* scripts/cuda-stubs: glibc/libstdc++ already declare the libm names the stub redefines (clash on every file), so those stubs are skipped under
  __GLIBC__; check-cu.py finds s26_tsum.cuh in the Original kernels; check-local.sh runs the C++-only pass (--plain) off macOS (101/104 files).
* check-local.sh --full: test-cuda-driver-bootstrap.sh reported as debt (stale: it builds a synthetic workspace of the crate alone, which no
  longer resolves its path dependencies).

No engine numerics or kernels are changed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-11-03 02:59:50 +01:00
co-authored by Claude Sonnet 5.5
parent 9b08355660
commit 4cecb3b205
8 changed files with 59 additions and 14 deletions
+3
View File
@@ -105,3 +105,6 @@ jobs:
- name: Linux test harness
if: steps.present.outputs.present == 'true'
run: scripts/linux-tests/run.sh
- name: Fake-libcuda mock gates (CPU-only ELF protocol tests of the driver)
if: steps.present.outputs.present == 'true'
run: scripts/linux-tests/run.sh --mocks
+7
View File
@@ -169,6 +169,13 @@ CUresult cuMemsetD8_v2(CUdeviceptr destination,unsigned char value,size_t bytes)
return 1;
}
/* Driver::load now resolves cuStreamSynchronize eagerly (the stream wait of the chained launches). Same load-only policy as above:
the synthetic harness never creates a stream. */
CUresult cuStreamSynchronize(void *stream) {
(void)stream;
return 1;
}
/* Independent fixed vector ABI fixture. Arithmetic here is a CPU reference;
it neither interprets nor executes PTX. */
static int exact_image(const char *ptx,int matvec) {
+4 -1
View File
@@ -273,11 +273,14 @@ mod linux {
let t = std::time::Instant::now();
let ranges: Vec<(usize, usize)> =
LIVE.lock().unwrap_or_else(|p| p.into_inner()).iter().filter(|e| !e.2).map(|e| (e.0, e.1 & !(HUGE - 1))).collect();
// linux/mman-common.h MADV_COLLAPSE = 25 (6.1+). Spelled out because libc 0.2.190 does not define it for the musl targets
// (the static CLI build failed to compile); glibc's libc::MADV_COLLAPSE has the same value.
const MADV_COLLAPSE: libc::c_int = 25;
let mut failed = 0usize;
let mut last_error = 0i32;
for (base, len) in ranges.into_iter().filter(|r| r.1 > 0) {
// SAFETY: advice over a live mapping of ours; MADV_COLLAPSE copies pages into a huge page without changing contents.
if unsafe { libc::madvise(base as *mut libc::c_void, len, libc::MADV_COLLAPSE) } != 0 {
if unsafe { libc::madvise(base as *mut libc::c_void, len, MADV_COLLAPSE) } != 0 {
failed += 1;
last_error = std::io::Error::last_os_error().raw_os_error().unwrap_or(0);
}
+3 -2
View File
@@ -4,11 +4,12 @@ ARG RUST_TARGET=x86_64-unknown-linux-musl
RUN apt-get update \
&& apt-get install -y --no-install-recommends musl-tools cmake \
&& rm -rf /var/lib/apt/lists/*
RUN rustup target add "${RUST_TARGET}"
WORKDIR /src
ENV CARGO_TARGET_DIR=/src/control-plane/target
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
# After the toolchain file is in place: the floating rust:1.99 tag can carry a newer patch than the pinned 1.99.0, and the target must be
# installed for the toolchain rustup actually selects (adding it before made the build fail with "can't find crate for `core`").
RUN rustup target add "${RUST_TARGET}"
COPY crates/ ./crates/
COPY manifests/ ./manifests/
COPY desktop-core/ ./desktop-core/
+6 -2
View File
@@ -210,7 +210,10 @@ if [[ "${host_os}" == Linux ]]; then
debt cargo clippy --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-cuda-driver --all-targets --all-features -- -D warnings
# the crate does not compile without its `cuda-driver` feature (lib.rs gates only part of the modules); leleka-runtime always enables it
cargo test --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-cuda-driver --features cuda-driver
"${repo_root}/scripts/test-cuda-driver-bootstrap.sh"
# Stale since leleka-cuda-driver gained path dependencies (leleka-context, -model-format, -experimental-ref): the script builds a
# synthetic workspace of the crate alone (cargo metadata fails) and also runs `cargo fmt --check` / Clippy `-D warnings` on it, which
# carry the debt of finding 9 in docs/ci-audit.md. scripts/linux-tests/run.sh --mocks runs the same mock-ELF gates on the real tree.
debt "${repo_root}/scripts/test-cuda-driver-bootstrap.sh"
else
echo "== Linux-only crate tests skipped on ${host_os}"
fi
@@ -220,7 +223,8 @@ if command -v clang++ >/dev/null 2>&1; then
if [ "$(uname -s)" = Darwin ]; then
python3 "${repo_root}/scripts/cuda-stubs/check-cu.py"
else
python3 "${repo_root}/scripts/cuda-stubs/check-cu.py" || echo "warning: cuda stub syntax check failed (advisory off macOS)" >&2
# glibc/libstdc++ hosts: clang's CUDA frontend needs macOS-only stub overloads, so the C++-only pass (--plain) is the advisory check here
python3 "${repo_root}/scripts/cuda-stubs/check-cu.py" --plain || echo "warning: cuda stub syntax check failed (advisory off macOS)" >&2
fi
fi
cargo fmt --manifest-path "${repo_root}/control-plane/Cargo.toml" --check
+1
View File
@@ -17,6 +17,7 @@ SRC = os.path.join(ROOT, 'crates', 'cuda-driver', 'src')
INCLUDES = [
STUBS,
os.path.join(ROOT, 'engine', 'strata', 'include'),
os.path.join(ROOT, 'engine', 'strata', 'src', 'kernels', 'cuda'), # sm120_iq_prefix.cuh includes "s26_tsum.cuh" from the Original
os.path.join(ROOT, 'engine', 'strata', 'third_party', 'ggml'),
os.path.join(SRC, 'third_party', 'llamacpp', 'ggml-cuda'),
os.path.join(SRC, 'third_party', 'llamacpp', 'ggml-include'),
+26
View File
@@ -241,22 +241,48 @@ static inline double min(double a, float b) { return fmin(a, (double) b); }
static inline double max(float a, double b) { return fmax((double) a, b); }
static inline double max(double a, float b) { return fmax(a, (double) b); }
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline int __isnanf(float x) { return std::isnan(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline int __isinff(float x) { return std::isinf(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline int __finitef(float x) { return std::isfinite(x); }
#endif
static inline float rsqrtf(float x) { return 1.0f / sqrtf(x); }
static inline double rsqrt(double x) { return 1.0 / sqrt(x); }
static inline float rcbrtf(float x) { return 1.0f / cbrtf(x); }
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline float exp10f(float x) { return powf(10.0f, x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline void sincosf(float x, float* s, float* c) { *s = sinf(x); *c = cosf(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline float __expf(float x) { return expf(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline float __logf(float x) { return logf(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline float __log2f(float x) { return log2f(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline float __log10f(float x) { return log10f(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline float __sinf(float x) { return sinf(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline float __cosf(float x) { return cosf(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline float __tanf(float x) { return tanf(x); }
#endif
#ifndef __GLIBC__ // glibc (with libstdc++/_GNU_SOURCE) already declares this name; the stub would clash with it
static inline float __powf(float x, float y) { return powf(x, y); }
#endif
static inline float __fdividef(float x, float y) { return x / y; }
static inline double __ddiv_rn(double x, double y) { return x / y; }
static inline float __saturatef(float x) { return x < 0.f ? 0.f : (x > 1.f ? 1.f : x); }
+9 -9
View File
@@ -20,21 +20,21 @@ import hashlib, json, pathlib, re, sys, tarfile, urllib.request
root, work = map(pathlib.Path, sys.argv[1:])
lock = json.loads((root/'deploy/cuda-toolkit.lock.json').read_text())
component = next(row for row in lock['components'] if row['component'] == 'cuda_nvcc')
expected = '48e35be3cfbf4b4fbc16828eaec8a7048ee789403049dc409f7b643d6259cf7a'
assert component['version']=='13.0.88' and component['sha256']==expected
assert component['relative_path']=='cuda_nvcc/linux-x86_64/cuda_nvcc-linux-x86_64-13.0.88-archive.tar.xz'
assert int(component['size'])==26657716
expected = 'b04e5ca5b41f8b5629ce5f16930920e6af437f32c9777fcb67e0361f732b6f43'
assert component['version']=='13.2.86' and component['sha256']==expected
assert component['relative_path']=='cuda_nvcc/linux-x86_64/cuda_nvcc-linux-x86_64-13.2.86-archive.tar.xz'
assert int(component['size'])==31085360
manifest_url=lock['manifest_url']
with urllib.request.urlopen(manifest_url,timeout=60) as response:
manifest=response.read(1_000_000)
assert hashlib.sha256(manifest).hexdigest()==lock['manifest_sha256']
entry=json.loads(manifest)['cuda_nvdisasm'];row=entry['linux-x86_64']
expected_disasm='0541e0230f724a43d67288ef882c63351d0c302bf567591b7620d40f93c2c93c'
assert entry['version']=='13.0.85' and row['sha256']==expected_disasm
assert row['relative_path']=='cuda_nvdisasm/linux-x86_64/cuda_nvdisasm-linux-x86_64-13.0.85-archive.tar.xz'
assert int(row['size'])==4129456
expected_disasm='a920f95954b031c2437b0888e92e0d52f78ee84bf83ac47cfa9e28cb3de7a69c'
assert entry['version']=='13.2.86' and row['sha256']==expected_disasm
assert row['relative_path']=='cuda_nvdisasm/linux-x86_64/cuda_nvdisasm-linux-x86_64-13.2.86-archive.tar.xz'
assert int(row['size'])==4282328
print('Official manifest URL/SHA256:',manifest_url,lock['manifest_sha256'])
for name,part,size,digest in [('ptxas',component,26657716,expected),('nvdisasm',row,4129456,expected_disasm)]:
for name,part,size,digest in [('ptxas',component,31085360,expected),('nvdisasm',row,4282328,expected_disasm)]:
url='https://developer.download.nvidia.com/compute/cuda/redist/'+part['relative_path']
with urllib.request.urlopen(url,timeout=60) as response:data=response.read(size+1)
assert len(data)==size and hashlib.sha256(data).hexdigest()==digest