raptor.schema.blocks

raptor.schema.blocks#

The neural_block extension layer of the schema.

hawk never imports this module — only raptor.schema.manifest (the family-neutral layer) is part of hawk’s core-purity surface. This module is free to reference manifest, never the reverse.

Values below are copied VERBATIM from eagle/python/eagle/roles.py, cited by symbol below (symbol citations do not rot the way line citations do); eagle’s roles.py is not modified by this move — a later change may re-point it at this module instead.

The descriptor VALIDATOR lives here too. The clause that enforces this family’s wire contract — validate_neural_block_descriptor() and the private _validate_neural_block / _validate_exec_ref it is built from — moved VERBATIM out of eagle/python/eagle/sidecar.py into this module, because enforcement lives with the contract’s OWNER at (never above) its lowest-floor consumer: the descriptor wire contract is declared here and consumed at the raptor+numpy floor, so its validator is spine content. It is ONE implementation with two importers — a downstream package’s two roads and eagle.sidecar.validate_sidecar’s pattern-conditional dispatch — never a copy. What did NOT move is everything serving the KERNEL families (ROLES / validate_roles, parse_derivative, the recognized-pattern and buffer-kind loops, MANIFEST_FORMATS): that vocabulary is eagle-owned and consumed only by eagle loaders, so its validator stays in eagle for the neural_block family only — eagle stays the deep validator everywhere else. This module imports nothing but raptor.schema.manifest, so the clause runs on a numpy-less, eagle-less interpreter.

Module Attributes

NEURAL_BLOCK_PATTERN

the neural-block family name (verbatim value from eagle/python/eagle/roles.py::RECOGNIZED_PATTERNS, one element of that set).

NEURAL_TOP_LEVEL_KEY_ORDER

the full top-level key order for a NEURAL manifest — houses the literal "blocks" carriage key (kept out of the neutral module, per raptor.schema.manifest's note).

SCATTER_POLICIES

the declared TERMINAL-WRITE CONTRACT of a block's scatter (verbatim value from eagle/python/eagle/roles.py::SCATTER_POLICIES).

NEURAL_REQUIRED_FIELDS

the fields a neural_block descriptor MUST carry, beyond the general required set (verbatim value from eagle/python/eagle/roles.py::NEURAL_REQUIRED_FIELDS, minus a schema-key rename: fanin/fanout -> in_degree/out_degree, both ends renamed together, SCHEMA_VERSION stays 1).

NEURAL_EXEC_REF_FIELDS

the keys whose values are exec references (verbatim value from eagle/python/eagle/roles.py::NEURAL_EXEC_REF_FIELDS).

NEURAL_FORBIDDEN_FIELDS

kernel-machinery fields a descriptor must NOT carry (verbatim value from eagle/python/eagle/roles.py::NEURAL_FORBIDDEN_FIELDS).

BUFFER_KINDS

the declared-buffer kind vocabulary, schema v1 (verbatim value from eagle/python/eagle/roles.py::BUFFER_KINDS).

ALL_PATTERNS

the neutral base (raptor.schema.manifest.BASE_PATTERNS) plus neural_block.

Functions

validate_neural_block_descriptor(…)

Validate a neural_block descriptor document; raise on any breach.