Skip to content

RFC LLMinus: LLM-Assisted Merge Conflict Resolution

Sasha Levin lkml tools 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest7 patches 0 repliesNew
  2. v1 RFC5 patches 6 repliesSuperseded

Changes in v2 from the cover letter

====================
- Add --max-tokens option (default: 100K) with adaptive RAG reduction to prevent prompt overflow errors across different LLM providers. When prompts exceed the token limit, historical examples are progressively removed until the prompt fits.

- Add semantic conflict detection via build test integration. When no textual conflicts exist but the merge may have introduced build failures, LLMinus runs the build and generates specialized prompts for the LLM to investigate and fix compile errors caused by incompatible changes from different branches.

- Update ureq HTTP client from v2 to v3.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7LLMinus: Add skeleton project with learn commandtools/llminus/.gitignore tools/llminus/Cargo.toml tools/llminus/src/main.rs+817 -00 replies
2/7LLMinus: Add vectorize command with fastembedtools/llminus/Cargo.toml tools/llminus/src/main.rs+158 -00 replies
3/7LLMinus: Add find command for similarity searchtools/llminus/src/main.rs+327 -00 replies
4/7LLMinus: Add resolve command for LLM-assisted conflict resolutiontools/llminus/src/main.rs+476 -00 replies
5/7LLMinus: Add pull command for LLM-assisted kernel pull request mergingtools/llminus/Cargo.toml tools/llminus/src/main.rs+647 -140 replies
6/7LLMinus: Add prompt token limit enforcementtools/llminus/src/main.rs+95 -190 replies
7/7LLMinus: Add build test integration for semantic conflictstools/llminus/src/main.rs+224 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC v2 0/7] LLMinus: LLM-Assisted Merge Conflict Resolution

This series introduces LLMinus, an LLM-powered tool for assisting with git merge conflict resolution in the Linux kernel.

The tool builds a searchable database of historical conflict resolutions from the kernel's git history, uses semantic embeddings to find similar past conflicts, and constructs rich prompts for LLMs to resolve current conflicts with appropriate context.

Commands:
learn - Extract historical conflict resolution cases from git history
vectorize - Create semantic embeddings using fastembed (BGE-small model)

  find      - Perform similarity search on historical resolutions
  resolve   - LLM-assisted conflict resolution with contextual guidance
  pull      - Fetch pull requests from lore.kernel.org and auto-resolve

The tool works with any LLM that accepts stdin input, performing best with models that support tool use for dynamic investigation.

Changes since RFC v1:
====================
- Add --max-tokens option (default: 100K) with adaptive RAG reduction to prevent prompt overflow errors across different LLM providers. When prompts exceed the token limit, historical examples are progressively removed until the prompt fits.

- Add semantic conflict detection via build test integration. When no textual conflicts exist but the merge may have introduced build failures, LLMinus runs the build and generates specialized prompts for the LLM to investigate and fix compile errors caused by incompatible changes from different branches.

- Update ureq HTTP client from v2 to v3.

Real-World Testing:
==================
LLMinus is being actively tested through automated subsystem integration branches. These are available for anyone who wants to follow along or help identify edge cases:

https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-next.git/

The repository contains ~40 subsystem-specific integration branches (drivers-next, fs-next, net-next, etc.) that are merged into an all-next integration branch. This exercises LLMinus on actual kernel merges from maintainer trees.

Note that these branches are experimental and primarily serve to shake out LLMinus itself. They are not intended to replace or compete with existing integration workflows - rather, they provide a testing ground for the tool. Build testing is performed after merges complete, and trees are only recreated when upstream maintainers rebase.

Build:
cd tools/llminus && cargo build --release

RFC v1: https://lore.kernel.org/all/[email protected]/

Sasha Levin (7):
LLMinus: Add skeleton project with learn command
LLMinus: Add vectorize command with fastembed
LLMinus: Add find command for similarity search
LLMinus: Add resolve command for LLM-assisted conflict resolution
LLMinus: Add pull command for LLM-assisted kernel pull request merging
LLMinus: Add prompt token limit enforcement
LLMinus: Add build test integration for semantic conflicts

 tools/llminus/.gitignore  |    1 +
 tools/llminus/Cargo.toml  |   20 +
 tools/llminus/src/main.rs | 2678 +++++++++++++++++++++++++++++++++++++
 3 files changed, 2699 insertions(+)
 create mode 100644 tools/llminus/.gitignore
 create mode 100644 tools/llminus/Cargo.toml
 create mode 100644 tools/llminus/src/main.rs
Signature · 1 line
2.51.0