| tags |
|
||||
|---|---|---|---|---|---|
| library_name | kernels | ||||
| license | apache-2.0 |
SZL Holdings · Doctrine v11 · Λ = Conjecture 1 (advisory, never "green"/theorem) · canonical a-11-oy.com
Control before action. Evidence after.
Product · Proof · GitHub organization
Source of truth for the Kernel Hub kernel huggingface.co/kernels/SZLHOLDINGS/szl-lambda-gate. The
hf-kernel-publishworkflow buildstorch-ext/szl_lambda_gateintobuild/torch-cpuandbuild/torch-universal, publishes the Hubmainandv1branches, and verifies whatget_kernel(..., version=1)serves against this repository.
The Λ (Lambda-Spine) aggregator as a universal kernel — a non-compensatory, advisory governance roll-up for the Hugging Face Kernel Hub.
Λ is the weighted geometric mean of axis scores in
[0,1]. Any single zeroed axis drives the whole aggregate to0: a conservative, non-compensatory signal. It is advisory — not proven trust, not a closed theorem. Λ uniqueness = Conjecture 1 (OPEN); it is never described as proven anywhere in this repo.
📦 Canonical kernels package (Wave D consolidation). This repo is the canonical SZL kernels package. The former
szl-holdings/szl-governed-norm(governed RMSNorm/LayerNorm) has been folded in here as theszl_lambda_gate.governed_normsubpackage —rms_norm,layer_norm,fused_add_rms_norm, their SHA3-256 hash-chained governance receipts,ReceiptChain,emit_receipt, andselfcheck().szl-governed-normis now DEPRECATED and points here (it was not deleted; archiving is a later founder step). The norm kernels are a different kernel family from the Λ aggregator; folding them in does not change Λ's status (still Conjecture 1, advisory).
A universal (pure-PyTorch) kernel from SZL Holdings. It ports the canonical Λ aggregator into a differentiable, torch.compile-friendly torch op, plus an advisory governance gate (Λ vs a threshold), the four carried axioms as real runtime self-checks, and pure nn.Module layers.
| Field | Truthful classification |
|---|---|
| Primary artifact | Executable software: a pure-PyTorch weighted-geometric-mean operator, advisory gate, runtime checks, and governed-normalization compatibility package. |
| Hub tensor artifact | Surrogate / compatibility artifact: useful for packaging and inspection, but not evidence of a separately trained production model or broad learned capability. |
| Formal status | Runtime checks exercise A1-A4 on supplied/sample inputs. Lambda uniqueness remains Conjecture 1 (OPEN); this repository is not a formal verifier or closed proof. |
| Evidence | Source, tests, self-checks, and receipt/provenance code. Any displayed output is SAMPLE until independently executed. |
| Limits | No speedup, safety, trust, or deployment-readiness claim. A gate result is advisory and must be enforced by the host. |
GitHub Actions declared matrix (ubuntu-latest, Python 3.10/3.11/3.12) is green.
This host without MSVC cl.exe cannot run torch inductor. Tests stay in the
suite and skip when the compiler is absent; they are not deleted.
Failing/unsupported tests on Windows without cl.exe:
tests/test_lambda.py::test_torch_compile_friendlytests/test_lambda.py::test_fullgraph_lambda_aggregatetests/test_lambda.py::test_fullgraph_lambda_gate_scoretests/test_lambda.py::test_fullgraph_lambda_gate_batch_score
Measured error: torch._inductor.exc.InductorError: RuntimeError: Compiler: cl is not found.
No acceleration or GPU story is claimed from this matrix.
Investor value. This is inspectable governance substrate that makes a conservative aggregate and its decision boundary explicit, rather than hiding policy inside a model response.
Evaluator path. Pin the reviewed Hub revision below, opt in to remote code,
run selfcheck(), and inspect each returned field. A clean run is evidence for
that revision and environment only.
szl-lambda-gate is a Kernel Hub kernel that computes:
[ \Lambda(x) = \prod_i x_i^{,w_i}, \quad \sum_i w_i = 1, \quad w_i > 0, \quad x_i \in [0,1] ]
the weighted geometric mean over the last dim of an axis-score tensor. It gives you:
- An auditable correctness reference. Λ is implemented in pure PyTorch, computed via logs in float32 (float64 for float64 inputs) for numerical stability, differentiable, and compared with a pure-Python reference in the test suite.
- An advisory governance gate.
lambda_gate(axes, threshold=...)returns a score plus a pass/fail mask (Λ ≥ threshold).lambda_gate_batchscores many candidate action-vectors in one call — the realistic per-inference-step agent usage. - The four carried axioms as runtime self-checks. A1–A4 (monotone, homogeneous, Egyptian-exact, bounded-by-max) are exposed as honest empirical checks plus a
selfcheck()verdict and an adversarial falsification search.
This is a universal kernel: it ships no hand-tuned CUDA/Triton binary. Its differentiator is a verifiable, honestly-labeled governance aggregator — not raw FLOPs.
import torch
from kernels import get_kernel
lg = get_kernel("SZLHOLDINGS/szl-lambda-gate", version=1, trust_remote_code=True)
axes = torch.tensor([0.9, 0.8, 0.95]) # axis scores in [0,1]
score = lg.lambda_aggregate(axes) # Λ(x) ∈ [0,1]
res = lg.lambda_gate(axes, threshold=0.5) # ADVISORY pass/fail
print(res.score, res.passed, res.advisory) # advisory is always True# candidates: (..., N, k) — N candidate action-vectors, each with k axis scores
candidates = torch.rand(8, 13)
res = lg.lambda_gate_batch(candidates, threshold=0.5)
print(res.score.shape, res.passed.shape) # (8,) (8,)verdict = lg.selfcheck()
print(verdict["all_axioms_hold"], verdict["lambda_status"])
# empirical checks on sampled inputs — NOT a proof of Λ-uniqueness| Function | Signature | Notes |
|---|---|---|
lambda_aggregate |
lambda_aggregate(axes, weights=None) |
Λ over the last dim. Uniform weights when None. Differentiable, batched. |
lambda_gate |
lambda_gate(axes, weights=None, threshold=0.5) |
ADVISORY gate → LambdaGateResult(score, passed, threshold, advisory). threshold must lie within Λ's range [0,1]. |
lambda_gate_batch |
lambda_gate_batch(candidates, weights=None, threshold=0.5) |
Score (..., N, k) candidates at once; advisory pass mask. Same [0,1] threshold domain guard. |
yuyay_weights |
yuyay_weights(dtype=..., device=None) |
Canonical 13-axis uniform Λ weight vector (advisory). |
| Function | Axiom | Description |
|---|---|---|
is_monotone |
A1 | Λ is non-decreasing in each axis (on the given data). |
is_homogeneous |
A2 | Λ(t·x) = t·Λ(x) (degree 1). |
is_egyptian_exact |
A3 | Λ(c,…,c) = c. |
is_bounded_by_max |
A4 | Λ(x) ≤ maxᵢ xᵢ. |
find_axiom_violation |
— | Random-search falsification attempt; returns a violating triple or None. |
selfcheck |
— | Runs A1–A4 + adversarial search, returns a verdict dict. |
Pure torch.nn.Module subclasses (only forward, no custom __init__, no class variables) for the kernels layer-mapping mechanism:
| Layer | Reads from host module | Description |
|---|---|---|
LambdaGate |
self.weights (optional), self.threshold (default 0.5) |
forward(axes) → LambdaGateResult. |
LambdaAggregate |
self.weights (optional) |
forward(axes) → Λ(axes) tensor. |
Any axis that is zero, or non-finite (NaN / ±Inf), is treated as a failing axis and drives the whole aggregate to exactly 0. A garbage or invalid axis must never silently pass as a "perfect" (clamped-to-1) axis, and both the output and its gradient stay finite and in [0,1] for every input. This is the conservative governance semantics, A4-consistent (Λ(x) ≤ maxᵢ xᵢ).
The torch kernel above predates a written contract, and the estate carries several Λ copies that disagree on edge inputs. szl.lambda/v1 fixes one contract as data:
| File | What it is |
|---|---|
spec/szl.lambda.v1.json |
The contract: domain, error codes and their precedence, the gate rules, and where τ comes from. |
spec/lambda_v1_vectors.json |
Golden vectors. Floats are f64:<hex> (IEEE-754 bits), so NaN, ±Inf and exact values survive JSON. |
reference/szl_lambda_v1.py |
The stdlib-only reference: lambda_v1, log_lambda_v1, gate_v1, LambdaV1Error(code). |
- Validated, never repaired. NaN or ±Inf, an axis outside
[0,1], a weight<= 0,|Σw − 1| > 1e-12, a length mismatch or an empty input each raiseLambdaV1Errorwith a namedLAMBDA_*code. Nothing is clamped, renormalised, defaulted or rounded. - A zero axis is a veto, not an error. Λ = 0, log Λ = −inf, and the gate returns
NO_GO. - The gate needs τ.
gate_v1(axes, weights, tau)has no default; the policy value ispolicy_tau(0.8) infrontier/model_admit_contract.v1.json. It compares log Λ with log τ on the unrounded value, returnsABSTAINwithinTIE_EPS = 1e-9, and returnsBLOCKwith the code on any contract error. - Pinned vectors. SHA-256 over canonical JSON (sorted keys, compact separators, UTF-8), also recorded in the spec:
61bfb0410b9f0eaab0eb9f22f29cb7cb13cfde8c083fe308d895565d6ba9ebd4. It is computed over the parsed JSON, so a CRLF checkout gives the same digest. - Conformance. The reference matches every vector bit for bit. Other implementations must match every error code and verdict exactly, and each value within the vector's
value_tol. - Not yet v1. The torch
lambda_aggregateclamps x > 1, maps NaN and ±Inf to 0 and renormalises weights;tests/test_lambda_v1_torch_divergence.pypins each difference.tests/lambda_aggregator_source.pyis not canonical either. - Honesty. Λ uniqueness is Conjecture 1 (open). The spec records
"uniqueness": "CONJECTURE_1_NOT_USED"because nothing in the contract relies on Conjecture 1.
Run a stdlib-only, revision-bound offline replay with
python -B -I scripts/replay_lambda_v1.py --output <path-outside-this-checkout>.
It checks all 60 vectors and four synthetic fail/abstain cases without writing
into the source tree. See offline replay and regression checks.
The separate python -m pytest -q tests/test_lambda_v1_vectors.py suite requires pytest.
We hold this kernel to a plain-spoken standard:
- Λ is the weighted-geometric-mean aggregator — a non-compensatory, advisory way to roll axis scores in
[0,1]into one number. - Λ is NOT "proven trust" and NOT a closed theorem. Its uniqueness (that the weighted geometric mean is the only aggregator satisfying the carried axioms) remains Conjecture 1 — OPEN (an unresolved
CAUCHY_NDstep plus a missing symmetry axiom in the Lean development). A gate "pass" is an advisory signal, never proven trust. - The axiom self-checks are empirical, not a proof. They verify the carried axioms hold for this implementation on the given data; finding no violation is evidence, not a uniqueness proof.
- No fabricated benchmarks. This is a universal kernel, not a hand-tuned binary — there are no speedup claims here.
The weighted geometric mean as a less-compensatory composite-indicator aggregator is established practice: the UN HDI (arithmetic→geometric switch, 2010), the OECD Handbook on Constructing Composite Indicators (2008), and the UNECE well-being guidelines all use it "to limit the compensation effect". The veto / cut-off idea (a single failing criterion blocks a pass regardless of the others) is the ELECTRE veto threshold / satisficing minimum-threshold screen. The 13-axis conjunctive form exposed by yuyay_weights is SZL's own yuyay_v3 gate. None of this makes Λ proven trust; the gate is advisory.
Backed by the Lean 4 formalization szl-holdings/lutar-lean (749 declarations / 14 axioms / 163 tracked sorries), DOI 10.5281/zenodo.20434308. Λ uniqueness = Conjecture 1 (open).
| Requirement | Version |
|---|---|
| Python | 3.9+ |
| PyTorch | torch>=2.5 |
| Dependencies | Python standard library + torch only |
The universal-kernel constraint (stdlib + torch only) is intentional: it keeps the kernel portable, easy to audit, and free of supply-chain surprises.
SZL Holdings, founded by Stephen Lutar, builds governed-AI infrastructure — provenance, observability, and security tooling for AI systems. This kernel applies that governance doctrine at the level of a single PyTorch operation: a conservative, honestly-labeled, advisory aggregator. See the SZL Holdings Hugging Face org and the a11oy governed-AI platform.
If you use this kernel, please cite it via the included CITATION.cff. Authored by Stephen Lutar (ORCID 0009-0001-0110-4173).
Apache-2.0 — see LICENSE. Copyright 2026 SZL Holdings.
SZL Holdings · Λ = Conjecture 1 (advisory, weighted geometric mean) · uniqueness OPEN · NOT proven trust · a-11-oy.com · github.com/szl-holdings/szl-lambda-gate · huggingface.co/SZLHOLDINGS/szl-lambda-gate
These are navigation links, not runtime or green-status claims. The quickstart
loads the v1 branch of the kernel repository. To pin an exact build, record the
current v1 commit (HfApi().list_repo_refs("SZLHOLDINGS/szl-lambda-gate", repo_type="kernel")) and pass it as revision=; commits of the model repository
are not kernel revisions. No companion Space availability is asserted here.
The immutable loading contract for the retained
SZLHOLDINGS/szl-governed-norm artifact is maintained in
hf-kernels/szl-governed-norm/README.md.
The contract pins a real first-class Kernel Hub revision and requires explicit
remote-code trust.
Explore the SZL estate: a11oy console · LLM Router · Receipt format spec · Lean proofs · Docs · 🤗 SZLHOLDINGS