zed-industries/zed · error

split point {split} classified as {}, expected {kind}

Error message

split point {split} classified as {}, expected {kind}

What it means

When an explicit split point was requested, the generated split is classified and compared against the requested kind; a mismatch (e.g. asking for index but the resolved split behaves as a fraction boundary) aborts generation with this message naming the split and both kinds.

Source

Thrown at crates/edit_prediction_cli/src/split_commit.rs:706

        None => {
            let split = sample_split_point(&patch, rng.as_mut());
            generate_split_commit_at_split(&patch, split, rng.as_mut())?
        }
        Some(SplitPoint::Fraction(fraction)) => {
            let split = resolve_split_point_value(SplitPointValue::Fraction(fraction), num_edits);
            generate_split_commit_at_split(&patch, split, rng.as_mut())?
        }
        Some(SplitPoint::Index(index)) => {
            let split = resolve_split_point_value(SplitPointValue::Index(index), num_edits);
            generate_split_commit_at_split(&patch, split, rng.as_mut())?
        }
        Some(SplitPoint::Kind(kind)) => sample_split_commit_of_kind(&patch, kind, rng.as_mut())?,
        Some(SplitPoint::KindWithSplit { kind, split_point }) => {
            let split = resolve_split_point_value(split_point, num_edits);
            let generated_split_commit =
                generate_split_commit_at_split(&patch, split, rng.as_mut())?;
            let actual_kind = classify_generated_split_commit(&generated_split_commit);
            anyhow::ensure!(
                actual_kind == Some(kind),
                "split point {split} classified as {}, expected {kind}",
                actual_kind
                    .map(|kind| kind.to_string())
                    .unwrap_or_else(|| "empty-target".to_string())
            );
            generated_split_commit
        }
    };

    let split = generated_split_commit.split;
    let cursor = generated_split_commit.cursor;
    let mut split_commit = generated_split_commit.split_commit;

    // Get cursor excerpt
    let cursor_excerpt = get_cursor_excerpt(
        &cursor,
        &split_commit.source_patch,

View on GitHub (pinned to f4178619ac)

Solutions

  1. Choose a split point value that lands on a boundary of the requested kind
  2. Regenerate with a random split if the exact boundary is not required
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/edit_prediction_cli/src/split_commit.rs:706 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/538ff415d6671f82. Report an issue: GitHub.