Skip to main content

enforce_architecture_completeness

Function enforce_architecture_completeness 

Source
pub fn enforce_architecture_completeness(
    tensor_names: &[&str],
    architecture: &str,
    num_layers: usize,
) -> Result<(), ContractError>
Expand description

GH-279: Enforce architecture completeness at import/export boundary.

Checks that all tensors required by the declared architecture are present in the model’s tensor list. Missing required tensor = Err with a descriptive message naming the missing tensor, architecture, and layer.

Contract: architecture-requirements-v1, equation “weight_completeness”

§Arguments

  • tensor_names - Names of all tensors present in the model
  • architecture - Architecture name (e.g., “qwen3”, “qwen2”, “llama”)
  • num_layers - Number of transformer layers

§Errors

Returns ContractError if any required tensor is missing.