Skip to content

llvm: add ProjectId::Llvm and patch review workflow - #948

Merged
rgushchin merged 1 commit into
sashiko-dev:mainfrom
sendaoYan:add-llvm-project-profile
Nov 25, 2026
Merged

rgushchin merged 1 commit into
sashiko-dev:mainfrom
sendaoYan:add-llvm-project-profile

Conversation

@sendaoYan

@sendaoYan sendaoYan commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds first-class LLVM/clang support so --project llvm reviews
llvm/llvm-project with prompts and a workflow written for a compiler,
instead of borrowing the GCC profile.

Closes #946.

What changed

  • ProjectId::Llvm: selector llvm, mainline branch main, upstream
    github.com/llvm/llvm-project.git, URL matching on llvm/llvm-project.
  • projects/llvm/prompts/: review-core, severity,
    false-positive-guide, inline-template (Markdown pull-request report),
    plus maintainer notes for the clang frontend, LLVM IR/middle-end and the
    backend.
  • src/workflows/llvm_patch_review.rs: seven-stage pipeline (goal,
    implementation, execution-flow, resources, types-math,
    state-invalidation, diagnostics-abi) covering Sema/CodeGen/CIR symmetry,
    APInt widths, poison and fast-math flags, analysis invalidation,
    target-feature gating and TableGen patterns, with prior-version feedback,
    sharded verification, post-verification and a GitHub-style report.
  • Wiring for the prompt bundle/namespace, bug attribution, reviewer,
    bug worker, review map, baseline resolution (no linux-next remotes) and
    release-tag labels, plus README/docs updates.

Testing

  • cargo check --all-targets --all-features
  • cargo test --all-features --lib: 1856 passed
  • cargo fmt --check: clean
  • End-to-end run on llvm/llvm-project

Notes

  • LLVM patches arrive as GitHub pull requests; mailing_lists.toml tracks
    nothing, so this profile is local review only for now.
  • Generated code notes (notes/) are not produced for LLVM yet.

@sashiko-bot

sashiko-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

Sashiko review

Commit 1/1 — 6d47c656 llvm: add ProjectId::Llvm and patch review workflow

  • [HIGH] The commit message carries Signed-off-by: SendaoYan
    yansendao@hygon.cn, which uses a single-word handle instead of a
    space-separated full name. Use a real full name in the Signed-off-by
    trailer, such as Sendao Yan yansendao@hygon.cn.

  • [MEDIUM] src/workflows/llvm_patch_review.rs: validate_inline_format(),
    format_inline_feedback(), and report_stage_with_effort() contradict
    projects/llvm/prompts/inline-template.md. The template forbids headings
    larger than ### and starts directly with a summary paragraph and no heading,
    but validate_inline_format() rejects any report without a ## or ### heading
    and format_inline_feedback() asks for a ## summary heading on retry. In
    addition, starts_with("###") in validate_inline_format() accepts #### and
    deeper headings that STAGE_REPORT_INSTRUCTION forbids, and the
    RecitationPolicy::FallbackToFreeForm reminder in report_stage_with_effort()
    asks for Linux/GCC Commit/Author/Subject headers and > diff lines instead of
    the LLVM pull-request format.

  • [MEDIUM] projects/llvm/prompts/maintainers/clang-frontend.md: the Clang
    Frontend maintainer note tells reviewers that error, error_at, permerror,
    and pedwarn during template substitution must stay guarded by
    (Complain & tf_error) or tf_warning. Those functions and tsubst_flags_t
    bitmasks are GCC C++ frontend APIs and do not exist in Clang, where SFINAE
    diagnostics use Sema::Diag, SFINAETrap, TemplateDeductionInfo, and
    Diags.Report as described in STAGE_DIAGNOSTICS_ABI_INSTRUCTION in
    src/workflows/llvm_patch_review.rs.

  • [MEDIUM] projects/llvm/prompts/false-positive-guide.md: item 8 under
    section 1 (Patterns that are NOT bugs) tells verification to treat
    pre-existing defects outside the patch scope as out of scope. This
    contradicts STAGE_VERIFICATION_INSTRUCTION and
    STAGE_POST_VERIFICATION_INSTRUCTION in src/workflows/llvm_patch_review.rs,
    which require unrelated pre-existing defects in untouched code to be kept
    with preexisting set to true so record_verified_findings() records them into
    state.concerns for bug tracking and --report-preexisting.

  • [LOW] The first sentence of the commit message body wraps the --project
    llvm CLI flag in backticks. Remove the backticks from the commit message.

  • [LOW] src/workflows/linux_bug.rs: LLVM_REPORT_EXAMPLES wraps add nsw in
    backticks even though REPORT_WRITING_RULES forbids backticks in standalone
    bug reports, and pairs the heading "An assertion reached from valid input"
    with a wrong-code poison example rather than an assertion failure. In
    addition, test_infer_project_from_bug_or_tool() and
    test_report_examples_fit_the_width_they_teach() do not cover the new
    ProjectId::Llvm branches in infer_project_from_bug_or_tool(),
    extract_directory_subsystems_for_project(), and report_prompt_parts().

Full review and stage logs on sashiko.sashiko.dev

@sendaoYan
sendaoYan force-pushed the add-llvm-project-profile branch 2 times, most recently from 4dce4b8 to 69e5c60 Compare November 25, 2026 13:36
@sashiko-bot

sashiko-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

Sashiko review — v3

Commit 1/1 — 69e5c60b llvm: add ProjectId::Llvm and patch review workflow

  • [MEDIUM] src/workflows/llvm_patch_review.rs: validate_inline_format() checks
    every line for non-level-3 Markdown headings without skipping fenced code
    blocks, even though projects/llvm/prompts/inline-template.md allows fenced
    code blocks for reproducers and fixes. Any code block line that starts with
    a hash followed by a space or tab (such as a lit, FileCheck, CMake, shell,
    or Python comment, or a C preprocessor directive like # if or # define) is
    rejected as an invalid level-1 heading, which triggers false retries and can
    fail the report stage with ReviewError::FormatRejection. Track fenced code
    blocks and skip lines inside them when checking heading levels.

Full review and stage logs on sashiko.sashiko.dev

Add first-class LLVM/clang support so --project llvm reviews patches
against llvm/llvm-project with prompts written for a compiler rather
than for the kernel or GCC:

- Register ProjectId::Llvm on github.com/llvm/llvm-project.git (main
  branch), bundle its prompts under llvm/, and load llvm/severity.md in
  prompt_bundle.
- Build the seven-stage discovery fan-out (goal, implementation,
  execution-flow, resources, types-math, state-invalidation and
  diagnostics-abi) with prior-version feedback, sharded verification,
  post-verification and a Markdown pull-request report. The stage
  instructions name the LLVM failure classes the general prompts miss:
  Sema/CodeGen/CIR symmetry, APInt widths, poison and fast-math flags,
  analysis invalidation, target-feature gating and TableGen patterns.
- Add projects/llvm/prompts: review-core, severity,
  false-positive-guide, inline-template and maintainer notes for the
  clang frontend, LLVM IR/middle-end and the backend.
- Wire LLVM tool attribution, directory subsystems, upstream fix
  checks and release-tag labels across db, reviewer, bug_worker,
  review_map and linux_bug.

Signed-off-by: Sendao Yan <yansendao@126.com>
@sendaoYan
sendaoYan force-pushed the add-llvm-project-profile branch from 69e5c60 to ed3fd5f Compare November 25, 2026 13:51
@sashiko-bot

sashiko-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

Sashiko review — v4

✓ No issues found across 1 commit.

Full review log on sashiko.sashiko.dev

@rgushchin
rgushchin merged commit e67e72d into sashiko-dev:main Nov 25, 2026
1 check passed
@sendaoYan

Copy link
Copy Markdown
Contributor Author

@rgushchin Thanks for the review and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an LLVM/clang project profile (prompts for llvm/llvm-project)

2 participants