This document defines a production-grade CI/CD topology for compute-kernel style repositories where determinism, security, hardware compatibility, and release repeatability are first-class gates.
Developer
-> Pull Request / Push
-> Layer 1: Pre-commit Validation
-> Layer 2: Static Analysis
-> Layer 3: Dependency & Supply Chain
-> Layer 4: Build Matrix
-> Layer 5: Kernel Compilation
-> Layer 6: Test Matrix
-> Layer 7: Performance
-> Layer 8: Security
-> Layer 9: Packaging
-> Layer 10: Release
Primary tools: ruff, black, clang-format, pre-commit, commitlint, gitleaks.
Primary tools: mypy, pylint, radon, vulture, codeql.
Primary tools: pip-audit, safety, syft, dependabot.
Primary tools: pytest, cuda-memcheck, ASAN, valgrind.
Primary tools: pytest-benchmark, nvprof, Nsight Systems, Nsight Compute, Airspeed Velocity.
Primary tools: trivy, grype, libFuzzer, hypothesis.
Primary outputs: signed PyPI wheels, signed OCI images, compiled kernels, benchmark reports, SBOM + provenance attestations.
repo/
├── shards_kernel/
├── tests/
│ ├── unit/
│ ├── integration/
│ ├── gpu/
│ └── benchmarks/
├── benchmarks/
├── docker/
├── scripts/
├── .github/workflows/
└── pyproject.toml
The following files in this repository implement core parts of the architecture. .github/workflows/hpc-matrix.yml, .github/workflows/gpu-hardware.yml, and .github/workflows/benchmark.yml are not in this repository.
| Existing workflow | Layer coverage | Notes |
|---|---|---|
.github/workflows/ci.yml |
1, 2, 4, 6 | Fast lint/type/test/build gate |
.github/workflows/security.yml |
1, 2, 3, 8 | CodeQL, dependency review, secret scanning |
.github/workflows/dependency-health.yml |
3 | Dependency graph and vulnerability health |
.github/workflows/dependency-canary.yml |
3, 4 | Canary runs against latest dependencies |
.github/workflows/release.yml |
9, 10 | Build + publish releases |
.github/workflows/docs.yml |
release support | Documentation validation and publication |
Use artifact-backed baseline comparison:
main.The 5% slowdown value is intended as a conservative default that works well for many numerical and GPU/CPU kernel workloads where benchmark noise is typically low but non-zero. Projects SHOULD tune this threshold based on:
In practice, configure the threshold as a parameter in your CI (per-suite or per-benchmark)
rather than hard-coding 5% globally, and document the chosen values and rationale in
the repository (e.g., in CONTRIBUTING.md or a benchmarking README).
Recommended dedicated GPU runner pools:
Alternative cloud-backed runner pools:
Recommended minimum gate:
pytest --cov=kernels --cov-fail-under=85
Raise the threshold for critical packages over time as flaky suites are removed.
For kernel-heavy production systems, add: