{"record":{"id":"7a8f7e3c03cddc61","repo":"xai-org/x-algorithm","slug":"unknown-kernel-kernel-r","errorCode":null,"errorMessage":"Unknown kernel: {kernel!r}","messagePattern":"Unknown kernel: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/models/recsys_feature_prep.py","lineNumber":98,"sourceCode":"\n\ndef _box_kernel(u: jax.Array) -> jax.Array:\n    return ((u >= -0.5) & (u < 0.5)).astype(jnp.float32)\n\n\ndef _triangle_kernel(u: jax.Array) -> jax.Array:\n    return jnp.maximum(1.0 - jnp.abs(u), 0.0)\n\n\ndef _cyclic_kernel_weights(u: jax.Array, kernel: str, width: float) -> jax.Array:\n    if kernel == \"box\":\n        return _box_kernel(u)\n    half_width = width / 2.0\n    if kernel == \"triangle\":\n        return _triangle_kernel(u / half_width)\n    if kernel == \"cosine\":\n        return _cosine_compact_kernel(u / half_width)\n    raise ValueError(f\"Unknown kernel: {kernel!r}\")\n\n\ndef _compute_cyclic_time_phase(\n    impr_ts_sec: jax.Array,\n    period_seconds: int,\n) -> tuple[jax.Array, jax.Array]:\n    sec_in_period = jnp.mod(impr_ts_sec.astype(jnp.int32), period_seconds).astype(jnp.float32)\n    phase = sec_in_period / float(period_seconds)\n    valid_mask = impr_ts_sec > 0\n    phase = jnp.where(valid_mask, phase, 0.0)\n    return phase, valid_mask\n\n\ndef _compute_cyclic_kernel_embedding(\n    phase: jax.Array,\n    valid_mask: jax.Array,\n    embedding_table: jax.Array,\n    fprop_dtype: jnp.dtype,","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/models/recsys_feature_prep.py#L80-L116","documentation":"_cyclic_kernel_weights selects the smoothing kernel for cyclic time-phase embeddings: 'box' (default path returning _box_kernel), 'triangle', and 'cosine' are implemented. Any other kernel string falls through to ValueError, so misspelled or unsupported kernel names fail fast before embedding computation.","triggerScenarios":"Calling _compute_cyclic_kernel_embedding with kernel=\"gaussian\", \"tri\", or \"COSINE\" (case-sensitive) via the feature-prep config.","commonSituations":"Feature configs ported from pipelines with more kernels; typos and casing mistakes in YAML.","solutions":["Use 'box', 'triangle', or 'cosine'.","Fix typos/casing in the kernel config string.","Add a new kernel function and an if-branch if a different shape is required."],"exampleFix":"# before\nkernel: triangular\n\n# after\nkernel: triangle","handlingStrategy":"validation","validationCode":"assert kernel in {\"box\", \"triangle\", \"cosine\"}, kernel","typeGuard":"def is_supported_kernel(k: str) -> bool:\n    return k in {\"box\", \"triangle\", \"cosine\"}","tryCatchPattern":null,"preventionTips":["Validate feature-prep config strings against the kernel whitelist before building features."],"tags":["feature-prep","kernel","enum-validation","time-features"],"backgroundTag":"invalid-config-value","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}