hawk#
HAWK — Hardware Agnostic Writing of Kernels.
A from-scratch kernel-authoring toolchain: Python authoring surface,
tensor-typed IR, IR-level autodiff, aether-vocabulary codegen, and a C++
host execution path — emitting aether-abi/2 artifacts eagle deploys
under the heterogeneous execution contract eagle enforces.
This module is the authoring surface. Importing it never imports
hawk.ir, hawk.emit or hawk.compile.
Runtime severance: no module under hawk/hawk/ imports raptor or
eagle at runtime, mechanically checked by
hawk/tests/test_severance.py and by raptor’s own conformance reader.
This module also adds the authoring names (kernel, the declaration
vocabulary, raw_device, Quantity), bound lazily through
PEP 562’s module __getattr__ because hawk.trace imports
hawk.ir and forbids import hawk from pulling that in —
touching one authoring name imports the tracer, but importing the
package alone costs nothing beyond this module.
This module also runs the import-time build-digest/layout self-check
against hawk._core (below), here rather than at first launch
because the failure it catches — a stale, wrong-arch or
editable-shadowed binding — imports cleanly and then computes wrong
answers. hawk._core stamps its own sources’ digest at build; this
module recomputes it from the tree when beside the package (a dev
checkout), or reads the same stamp from a generated module,
hawk._build_digest, when it is not (a wheel install).