The Commonplace
Home Papers Evidence Explore Trends Syntheses Digests References Docs 🎲 Workforce Futures
← Papers
Direction, evidence grade, and study type are AI-generated labels (gpt-5-mini), not human-verified. Syntheses are LLM-written. "Tensions" are machine-detected candidates, not confirmed contradictions. A research-acceleration tool, not peer review. How this is built →

Superficial code rewrites slightly weaken AI coding agents: semantics-preserving perturbations cut repair success by up to 6.7 percentage points and raise effort, and model rankings by robustness change with the agent scaffold and repository.

A Jagged Frontier: Evaluating Robustness of Code Agents to Semantics-Preserving Transformations
Hasan Najib Mahmud, Shreya Gupta, Isha Chaudhary, Nathaniel Enis, Ravi Mangal, Gagandeep Singh, Corina Pasareanu · August 18, 2026
arxiv quasi_experimental medium evidence 7/10 relevance Full text usable extracted full text Source PDF

Structured author observations

Linked only from stored provider relations; the raw author line above is never matched by name.

Arxiv

Latest observation:

  1. Hasan Najib Mahmud unresolved corpus identity
  2. Shreya Gupta unresolved corpus identity
  3. Isha Chaudhary unresolved corpus identity
  4. Nathaniel Enis unresolved corpus identity
  5. Ravi Mangal unresolved corpus identity
  6. Gagandeep Singh unresolved corpus identity
  7. Corina Pasareanu unresolved corpus identity

Semantic Scholar

Latest observation:

  1. Hasan Mahmud provider ID
  2. Shreya Gupta provider ID
  3. Isha Chaudhary provider ID
  4. Nathaniel Enis provider ID
  5. Ravi Mangal provider ID
  6. Gagandeep Singh provider ID
  7. Corina Pasareanu Colorado State University provider ID
  8. Microsoft provider ID
  9. U. I. Urbana-Champaign provider ID
  10. C. University provider ID
Random semantics-preserving code rewrites cause modest, non-uniform drops in repository-level AI code-agent repair success (up to 6.7 percentage points) and raise agent effort and token cost, with robustness depending jointly on model, scaffold, and workload.

Citation observations

Cumulative provider counts captured on specific dates; providers are never combined.

AI code agents are increasingly deployed to resolve real software issues, yet their reliability under superficial code variations remains poorly understood. We evaluate whether coding agents that repair repository-level issues remain reliable when the surrounding codebase is rewritten into a semantically equivalent form. We introduce a random variant sampler that applies common semantics-preserving transformations (SPTs) - spanning control-flow rewrites, dead-code injection, and identifier renaming - to produce perturbed variants. We evaluate two agentic scaffolds (mini-SWE agent and OpenCode) each backed by one of four frontier models (Claude Opus 4.5, Kimi K2.5, MiniMax M2.5, and Qwen 3.6-27B) across instances drawn from SWE-bench Verified and SWE-bench Pro. For each instance, the agent is run multiple times on the unperturbed and perturbed variants, yielding paired resolve-rate estimates that isolate the perturbation effect from intrinsic stochasticity. We find small degradation in most configurations: up to 6.7 percentage points mean resolve-rate drop in the most affected configurations with statistically significant degradations in 6 of 16 configurations of model, scaffold, and dataset. Crucially, no single model ranking by robustness holds across scaffolds - Qwen is among the most robust under mini-SWE agent on SWE-bench Verified yet the most brittle under OpenCode - revealing a jagged robustness frontier. The simpler scaffold (mini-SWE agent) is more robust to perturbation. Our results demonstrate that even top frontier models are susceptible to semantics-preserving perturbations although the effect is not uniform, raising concerns about the deployment reliability of AI code agents in diverse real-world codebases.

Summary

Main Finding

Local, semantics-preserving code rewrites (semantics-preserving transformations, SPTs) cause measurable but heterogeneous drops in the effectiveness and efficiency of repository-level AI code agents. Across 54 repair instances and 16 (scaffold × model × benchmark) configurations, perturbations produced up to a 6.7 percentage-point mean drop in resolve rate in the worst configurations, with statistically significant degradation in 6 of 16 configurations. Perturbations also increased agent effort—step counts and token cost rose by up to ~9.9% and ~22.9% respectively—even when resolve rates were largely unchanged. Robustness is not a fixed property of a model: a model’s robustness ranking changes with scaffold and workload, producing a “jagged robustness frontier.”

Key Points

  • Scope and targets
    • Evaluated repository-level issue resolution (FAIL_TO_PASS and PASS_TO_PASS test oracles) on 54 instances drawn from SWE-bench Verified (28 instances) and SWE-bench Pro (26 instances).
    • Two agentic scaffolds: mini-SWE agent and OpenCode.
    • Four frontier models: Claude Opus 4.5, Kimi K2.5, MiniMax M2.5, Qwen 3.6-27B.
  • Semantics-preserving transformations (SPTs)
    • Catalog of 14 SPTs: control-flow rewrites (if/else swap/negation, loop rewrites/unrolling, condition splitting), operand/ comparison swaps, double-negation injection, commutative reordering, local renaming, try/except wrapping, dead-code injection (unreachable blocks, dead method, unread string assignment), string literal splitting, etc.
    • Transformations validated by differential testing on large test suites for SymPy, sqlfluff, and xarray (no test outcomes changed in those validations).
    • Perturbations exclude test files and preserve the gold-patch files to keep tasks comparable.
  • Sampling design
    • Random Variant Sampler (non-adversarial): for each seed repository, produce N = 20 variants by sampling Nt = 3 transformations per variant, selecting files with per-transformation random inclusion pfile ∼ U(0,1), applying transforms to ϕ = 0.7 fraction of matched sites, Nk = 5 keyword bindings, and cap Nf = 10 files per keyword-bound transform.
    • Keyword targets for some transforms are extracted from the issue description via a single LLM call; sampler is intentionally not feedback-guided (gives lower-bound effects).
    • Median perturbation magnitude: targets ≈ 6.9% of source lines (Verified) and 7.7% (Pro).
  • Experimental protocol and statistics
    • For each instance: 20 unperturbed runs on the seed and 20 perturbed runs (one per variant), each in an isolated environment. This pairing isolates perturbation effects from agent stochasticity.
    • Primary metric: per-instance degradation Δ = r0 − rp (baseline minus perturbed resolve rates); configuration summaries use mean Δ across instances.
    • Effort metrics: relative changes in mean agent steps (δstep) and token cost (δcost).
    • Statistical inference: fixed-population approach, 95% bootstrap percentile intervals (B = 20,000) for configuration-level means; Newcombe intervals for per-instance proportions.
  • Empirical findings
    • Resolve-rate impact: generally small but non-negligible; up to 6.7 percentage-point mean drop in the most affected configurations; 6 of 16 configurations showed statistically significant degradation.
    • Effort/cost impact: average increases in steps and token cost (up to ~9.9% more steps and ~22.9% higher token costs), so outcome-only metrics understate operational impact.
    • Model × scaffold × workload interaction: no stable robustness ordering of models across scaffolds. Example: Qwen was among the most robust under mini-SWE agent on SWE-bench Verified but the most brittle under OpenCode.
    • Simpler scaffolds (mini-SWE agent) tended to be more robust to SPTs than more complex scaffolds (OpenCode).
    • Heterogeneity across instances: perturbation effects concentrate on a subset of repositories (large instance-specific variance).
  • Reproducibility: code and sampler implementation available at the project GitHub.

Data & Methods

  • Benchmarks and instances
    • SWE-bench Verified (human-validated subset of SWE-bench) and SWE-bench Pro; total 54 chosen instances (28 Verified, 26 Pro) due to compute constraint.
    • Each instance includes a seed repo, an issue description, the gold patch, and test suites defining success.
  • Agent/scaffold configurations
    • Two scaffolds: mini-SWE agent and OpenCode.
    • Four models: Claude Opus 4.5, Kimi K2.5, MiniMax M2.5, Qwen 3.6-27B.
    • Crossed to give 16 independent configurations.
  • Variant generation
    • Random Variant Sampler parameters: N=20 variants/instance, Nt=3 transforms/variant, Nk=5 keywords, Nf=10 files cap for keyword-bound transforms, ϕ=0.7 site fraction.
    • Transformations applied only to source files (tests excluded); transforms validated individually on large test suites for three representative projects.
    • Sampler is intentionally non-adversarial (no feedback loop from model results).
  • Run protocol
    • For each instance and configuration: run agent 20 times on the seed; generate 20 variants and run agent once per variant; evaluate patches against the same test oracle.
    • Isolated environments per run; identical agent settings across seed and variants.
  • Metrics and inference
    • Resolve rate, per-instance degradation Δ = r0 − rp, mean degradation across instances.
    • Effort: relative change in agent steps and token cost per instance, averaged.
    • Statistical treatment: fixed-population; bootstrap percentile intervals for configuration means; Newcombe intervals for differences of proportions; analysis separates agent stochasticity vs. variant variability.

Implications for AI Economics

  • Benchmarking and procurement
    • Standard capability benchmarks can overstate "deployment reliability." Rankings based purely on unperturbed benchmark performance do not reliably predict real-world robustness; procurement decisions based solely on benchmark scores risk suboptimal choices.
    • Buyers should require robustness evaluations that vary scaffolds and codebase presentations, not just single-run benchmark numbers.
  • Operational costs and pricing
    • Semantics-preserving variability raises expected operational costs: more agent steps and higher token usage increase per-issue compute cost and latency—even when success rates are similar.
    • Firms should incorporate an expected-cost premium for brittleness (mean extra tokens/rounds) and consider tail-risk pricing for rare but costly instance-specific failures.
    • SLA design should include robustness metrics (mean and tail behavior) and account for non-uniformity across workloads.
  • Vendor selection and contracting
    • Because robustness depends jointly on model, scaffold, and workload, economic decisions must consider the whole pipeline (model + agent scaffold + expected codebase characteristics). Contracts should specify which scaffold + model combination was validated and for which workload types.
    • There is value in simple, predictable scaffolds (lower complexity can reduce brittleness), so investment in simpler scaffold designs can yield economic returns through reduced rework and lower token costs.
  • Testing, risk assessment, and QA
    • Organizations should add non-adversarial SPT-driven stress tests (and adversarial variants for upper-bound risk) to pre-deployment QA to measure expected degradation and cost increases per workload.
    • Measure instance-level heterogeneity and tail risk: a small number of brittle instances can dominate operational losses—economic models should capture this concentration.
  • Incentives for model and scaffold developers
    • Model makers should provide robustness evaluations across agent scaffolds and representative codebase perturbations; scaffold builders should design for invariance to typical refactorings and inert code.
    • There is an economic case for investing in robustness diagnostics, canonicalization layers (normalize code representations), and retrieval/localization methods that are resistant to decoys (dead-code injections, renames).
  • Policy and standards
    • Robustness to semantics-preserving transformations can be formalized as a deployment requirement or labelling metric. Regulators or industry bodies could standardize tests that better reflect operational reliability, reducing asymmetric information in procurement.
  • Practical short recommendations for stakeholders
    • For buyers: demand robustness tests that include SPT-like perturbations, evaluate end-to-end scaffold + model combos, budget for higher-than-benchmark operational costs, and require SLAs covering robustness metrics.
    • For vendors: publish robustness profiles across scaffolds and workloads, optimize scaffolds for simpler, more robust interaction patterns, and provide guidance on workload characteristics that exacerbate brittleness.
    • For economists/analysts: incorporate expected extra compute cost, failure concentration (tail risk), and reduced reliability into cost–benefit and ROI analyses for AI-assisted software engineering tools.

Code and artifacts: the authors provide the Random Variant Sampler and experiments on GitHub (repository linked in paper).

Assessment

Paper Typequasi_experimental Evidence Strengthmedium — The paper uses a careful experimental design with within-instance pairing, multiple models and scaffolds, and bootstrap inference, producing credible evidence that semantics-preserving perturbations can degrade agent performance modestly; however, conclusions are bounded by a limited instance sample (54 selected instances), reliance on test-suite-based validation of SPTs (coverage-limited), two scaffolds and four models only, and a non-adversarial sampler, which together limit external validity and the strength of causal claims for broader deployment settings. Methods Rigorhigh — Design shows strong attention to confounders and stochasticity (paired runs, variance decomposition, choice of N=20 variants, bootstrap and Newcombe intervals), clear specification of transformations and sampling hyperparameters, and validation of SPTs; remaining concerns include instance selection constraints, limited SPT validation scope (three projects), and use of LLM calls inside sampler for keyword extraction which could introduce dependencies between sampler and evaluated model. Sample54 repository-level repair task instances drawn from SWE-bench benchmarks (28 from SWE-bench Verified, 26 from SWE-bench Pro); two agent scaffolds (mini-SWE agent, OpenCode) each backed by one of four frontier LLMs (Claude Opus 4.5, Kimi K2.5, MiniMax M2.5, Qwen 3.6-27B); for each instance the Random Variant Sampler produced 20 semantically-equivalent perturbed repository variants (N=20) using a catalog of 14 SPTs (Nt=3, Nk=5, Nf=10, ϕ=0.7), with 20 unperturbed agent runs and 20 perturbed runs per instance per configuration; SPT catalog validated on SymPy, sqlfluff, and xarray via full test-suite differential testing. Themesproductivity human_ai_collab adoption IdentificationControlled within-instance paired experiments: for each repository/issue instance the authors (1) run the agent N=20 times on the unperturbed seed, (2) generate N=20 randomly sampled semantics-preserving variants (via a Random Variant Sampler applying up to Nt=3 SPTs per variant) and run the agent once on each variant, and (3) compare paired resolve rates, step counts, and token costs using bootstrap/Newcombe intervals to isolate perturbation effects from agent stochasticity; SPTs are validated via differential testing (test-suite equivalence) on three representative projects. GeneralizabilityLimited instance sample (54 selected instances) rather than entire benchmarks; selection procedure constrained by compute budget, Only two agent scaffolds evaluated (mini-SWE agent and OpenCode), which may not represent other agent designs, Four models tested; other models, sizes, or fine-tuning regimes may behave differently, SPT validation relies on project test-suite coverage (three projects)—transformations labeled semantics-preserving could have undetected semantic changes in other repositories, Sampler is non-adversarial and constrained (e.g., capped keyword reach), so worst-case adversarial perturbations are not assessed, Likely focused on particular programming language(s) and ecosystems in SWE-bench; results may not transfer to other languages or domain-specific codebases

Claims (8)

ClaimDirectionOutcomeConfidence & EvidenceDetails
Semantics-preserving perturbations cause small degradations in repository-level code-agent issue resolution in most evaluated configurations, with the largest mean resolve-rate decline reaching 6.7 percentage points. Output Quality negative Issue resolve rate, defined as the proportion of runs whose patches pass both FAIL_TO_PASS and PASS_TO_PASS tests.
Reading fidelity high
Study strength medium
n=54
up to 6.7 percentage points mean resolve-rate drop
0.48
Statistically significant resolve-rate degradations occur in 6 of the 16 model, scaffold, and dataset configurations. Output Quality negative Difference in issue resolve rate between unperturbed and perturbed repositories.
Reading fidelity high
Study strength medium
n=16
6 of 16 configurations
0.48
Semantics-preserving perturbations increase the effort expended by code agents, raising agent step counts by up to 9.9% and token costs by up to 22.9%, including configurations where resolve rate changes little. Organizational Efficiency negative Relative change in agent step count and token cost between perturbed and baseline runs.
Reading fidelity high
Study strength medium
n=54
step counts up to 9.9% higher and token cost up to 22.9% higher
0.48
The simpler mini-SWE agent scaffold is more robust to semantics-preserving perturbations than the OpenCode scaffold. Output Quality positive Robustness of issue resolve rate under semantics-preserving repository perturbations.
Reading fidelity high
Study strength medium
n=54
0.48
Model robustness rankings are not consistent across agentic scaffolds: Qwen is among the most robust with mini-SWE agent on SWE-bench Verified but is the most brittle with OpenCode. Output Quality mixed Relative resolve-rate degradation under perturbation across models and scaffolds.
Reading fidelity high
Study strength medium
n=54
0.48
Robustness to semantics-preserving perturbations is a joint property of the model, agentic scaffold, and workload rather than a property of the model alone. Output Quality mixed Variation in issue-resolution robustness across model, scaffold, benchmark, and repository instances.
Reading fidelity high
Study strength medium
n=54
0.48
The effect of perturbations varies substantially across repositories, with degradation concentrated in a small subset of task instances while other instances are unaffected. Output Quality mixed Per-instance change in issue resolve rate after repository perturbation.
Reading fidelity high
Study strength medium
n=54
0.48
All 14 implemented transformations retained the per-test outcomes of the original programs in empirical validation across SymPy, sqlfluff, and xarray. Other null_result Per-test behavioral equivalence between transformed and unmodified repositories.
Reading fidelity high
Study strength medium
n=42971
0 divergent test outcomes across 42,971 tests
0.48

Notes