Manuscript Offprint

arXiv:2609.11180

SemVerBench: Benchmarking LLM Comprehension of Version-Constraint Resolution Semantics

Qibai Chen, Zeming Liu

Qibai Chen

Independent Researcher

United States

qibaic@alumni.cmu.edu

Zeming Liu

Brown University

United States

zeming_liu@brown.edu

Abstract—Large language model (LLM) coding agents resolve dependency versions constantly—deciding whether an installed version satisfies a declared constraint such as ^1.2.3 or >=2.0, <3—yet their grasp of version-constraint semantics has never been measured directly. We introduce SemVerBench, the first benchmark of LLM version-constraint resolution semantics across three ecosystems (npm, PEP 440, Cargo). SemVerBench contains 240 machine-checkable items with unique answers, built author-neutrally from four balanced sources (each ecosystem's official test suite plus three frontier LLM proposers), and labeled by a non-circular two-implementation oracle rather than by humans. Evaluating a six-model panel, we find systematic, predictable per-mechanism blind spots rather than diffuse noise: a partial-comparator carry rule (>1.2 ≡ >=1.3.0) traps every model on Cargo (all near 60%), and although PEP 440 standard prefix matching is universal, on zero-pad/post-release corner cases GPT-5.1 collapses (0/26 zero-pad cases) while Claude stays at 97–100% (verified on a 67-item oracle-validated set). Opus significantly outperforms all other models, and Sonnet outperforms the OpenAI models (McNemar). Crucially, the failures look more consistent with an activation/application gap than with a knowledge gap: injecting the relevant rule recovers most errors and a light correct hint corrects models that already failed, whereas interval decomposition does not help, and models are at ceiling on the basic forms of the same rules. An author-stratified analysis finds no statistically significant self-favoritism (the largest own-item advantage, GPT-4.1 +10 points, is n.s.; the only significant author effect is Gemini scoring lower on its own items), and the blind spots hold on official-suite and cross-family items. Because the task is verifiable and a free, 100%-correct resolver exists, tool delegation reaches ≈100%. The takeaway: coding agents should delegate version resolution to a resolver, not reason about versions in-head.

Index Terms—large language models, semantic versioning, dependency resolution, software engineering benchmarks, tool use, knowledge activation

I. INTRODUCTION

GPT-5.1, a frontier reasoning model, handles the standard PEP 440 prefix form ==2.* perfectly—and yet, asked the zero-pad corner case “does 2 satisfy ==2.0.*?” (PEP 440 says yes, because it zero-pads the release segment), it is wrong on all 26 such cases we tested, while Claude scores 97–100%. A free, deterministic resolver answers every such query in microseconds, and the same model that fails the corner case aces the basic form. This is not an isolated glitch. Across three packaging ecosystems and six frontier models, we find that LLMs systematically and predictably misapply version-constraint rules whose simple forms they handle perfectly.

LLM coding agents resolve dependency versions all the time. They read a lockfile, judge whether an upgrade is admissible under ^1.2.3, pick a version that satisfies >=2.0, <3, or reason about whether a security fix falls inside a declared range. These are high-frequency operations in every package manager (npm, pip, Cargo, and beyond) and inside every coding assistant that touches dependencies. When an agent gets version semantics wrong, the consequence is not a cosmetic typo: it is an incorrect dependency decision—an unsafe version range, a missed patch, or a build that silently resolves to the wrong release. These are supply-chain-relevant errors: empirically, a substantial fraction of dependent releases are broken by upstream version/breaking-change issues [6]. Despite this, the semantics of version-constraint resolution—as opposed to the upstream task of inferring which dependencies a repository needs—has never been benchmarked.

We close that gap with SemVerBench. The task is deliberately narrow and unambiguous: given a version V and a constraint C in ecosystem E∈{npm,PEP440,Cargo}E \in \{npm, PEP 440, Cargo\}, decide whether V satisfies C. Every item has a unique, machine-checkable answer. This narrowness is a feature: it removes the confounds of open-ended generation and lets us attribute every error to constraint semantics rather than to formatting, taste, or ambiguity. The narrow surface has broad impact, because version resolution is universal.

A first reaction might be that an LLM simply “cannot compute” such things. The evidence points the other way, along three converging lines. First, models are at or near ceiling on the basic forms of every grammar (plain membership, epochs, exact pins), so they demonstrably command the underlying concepts; the failures are concentrated in corner cases of rules whose simple forms they handle perfectly. Second, a light, hedged hint—“I think the answer is…”, not a forceful instruction—is enough to correct most previously-failed items,

Accepted at the 38th IEEE International Conference on Tools with Artificial Intelligence (ICTAI 2026). This is the authors' preprint version.

which is more consistent with nudging a latent competence than with teaching a missing one. Third, supplying the rule itself helps, whereas supplying additional reasoning structure (interval decomposition) does not: the missing ingredient is the availability of the right rule in context, not more reasoning steps. Together these are more consistent with an activation/application gap than with a capability or knowledge gap—a reading that aligns with work on model self-knowledge [10], though, as we discuss in Section VI, our design cannot fully separate activating latent knowledge from supplying missing knowledge.

Our findings are also structured, not diffuse. Difficulty concentrates in specific mechanisms: basic membership, epochs, and plain ranges are at or near ceiling for all models, while a handful of mechanisms account for nearly all errors. Two stand out. First, a universal cross-ecosystem trap: a partial comparator rounds up, so >1.2 means >=1.3.0 and >1 means >=2.0.0; on Cargo, every model—including the strongest—falls to roughly 60% on this mechanism. Second, a vendor-specific blind spot: PEP 440 standard prefix matching (==N.) is universal—all six models handle it—but its corner cases (zero-pad versions like 2 against ==2.0., and post-releases) form a sharp vendor-specific blind spot that GPT-5.1 fails systematically while Claude does not. These are not random; they are reproducible signatures of how each model family internalizes (or fails to internalize) a documented rule. Contributions.

  1. SemVerBench, the first benchmark of LLM version-constraint / semver resolution semantics, spanning npm, PEP 440, and Cargo: 240 machine-checkable items with unique answers, constructed author-neutrally and labeled by a non-circular two-implementation oracle.

  2. A characterization of systematic, per-mechanism blind spots across six frontier models, including a universal cross-ecosystem partial-comparator trap and a sharp, vendor-specific prefix-match failure, with statistical significance (McNemar) and an author-stratified analysis showing no significant item-proposer self-favoritism.

  3. An actionable diagnosis: the errors look like activation/application gaps, recoverable by rule-injection and corrected by light accurate hints, and eliminated by delegating to the resolver (tool use reaches ≈\approx100%).