Datasets:
schema_version int64 1 1 | pair_id stringlengths 12 101 | domain stringclasses 2
values | language stringclasses 15
values | repository stringlengths 7 49 | before dict | after dict | rule dict |
|---|---|---|---|---|---|---|---|
1 | bugsinpy:matplotlib_7:LightSource_shade_rgb | bug | python | matplotlib/matplotlib | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "LightSource.shade_rgb",
"path": "lib/matplotlib/colors.py",
"revision": "969513e2a5227331a2eb9e4bc4ba8448a0f9831d",
"source": " def shade_rgb(self, rgb, elevation, fraction=1., blend_mode='hsv',\n vert_exag=1, dx=1, dy=1... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "LightSource.shade_rgb",
"path": "lib/matplotlib/colors.py",
"revision": "ac400b51bb31b91920ee9aae02a0606a67983a8f",
"source": " def shade_rgb(self, rgb, elevation, fraction=1., blend_mode='hsv',\n vert_exag=1, dx=1, dy=1... | {
"name": "semantic-22f141ed8eefc3b4",
"each": "method",
"where": "**/*",
"ensure": "Masked-array blending must test whether intensity values are actually masked before applying the masked-data path."
} |
1 | github-pr:rack/rack#2270 | bug | ruby | rack/rack | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "Rack.Helpers.forwarded_authority",
"path": "lib/rack/request.rb",
"revision": "cf24be20715ee8ecde78cdfab6bcba094d924dc4",
"source": " def forwarded_authority\n forwarded_priority.each do |type|\n case type\n wh... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "Rack.Helpers.forwarded_authority",
"path": "lib/rack/request.rb",
"revision": "02ece97f94acb573cd1b4e1e06e1cb7b34c1b9a0",
"source": " def forwarded_authority\n forwarded_priority.each do |type|\n case type\n wh... | {
"name": "semantic-067103da78179a5c",
"each": "method",
"where": "**/*",
"ensure": "A forwarded-host header that yields no final host must be skipped so resolution can continue to the next configured source."
} |
1 | github-pr:rails/rails#58854 | bug | ruby | rails/rails | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "ActionView.compiled_source",
"path": "actionview/lib/action_view/template.rb",
"revision": "9fb66ed2dc239e9f78d51c8e36b43f287f548d52",
"source": " def compiled_source\n set_strict_locals = strict_locals!\n source = encode... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "ActionView.compiled_source",
"path": "actionview/lib/action_view/template.rb",
"revision": "e1bcdfdb887c0eb851b3c89e54c1422d0e08b3f9",
"source": " def compiled_source\n set_strict_locals = strict_locals!\n source = encode... | {
"name": "semantic-d2f4bae8008c3fa6",
"each": "method",
"where": "**/*",
"ensure": "Preserve source encoding for ASCII-only compiled output and propagate the returned code’s encoding when non-ASCII bytes require it."
} |
1 | jsts-exp-003 | bug | javascript | koajs/koa | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "subdomains",
"path": "lib/request.js",
"revision": "1aa85ce7214ff553287c4b66240f160f74ab7056",
"source": " get subdomains() {\n var offset = this.app.subdomainOffset;\n return (this.host || '')\n .split('.')\n .reverse()\n ... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "subdomains",
"path": "lib/request.js",
"revision": "1aa85ce7214ff553287c4b66240f160f74ab7056+pinned-source-patch",
"source": " get subdomains() {\n var offset = this.app.subdomainOffset;\n var host = this.host || '';\n if (net.isI... | {
"name": "semantic-d23acf1e0db9804a",
"each": "method",
"where": "**/*",
"ensure": "IP literal hosts have no DNS subdomains and must produce an empty subdomain list instead of being split into labels."
} |
1 | swe-rebench:analysis-dev__diktat-596:242162b945c0 | bug | kotlin | analysis-dev/diktat | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "AssignmentOperatorChecker.checkNode",
"path": "diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/Checkers.kt",
"revision": "67ffa9cbe7ed7248450d1d38825c1edb0e64524a",
"source": " override fun checkNode(whiteSpace: Ps... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "AssignmentOperatorChecker.checkNode",
"path": "diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/Checkers.kt",
"revision": "07601ad5357bf183ee1bfcabacc1ff1c46688d71",
"source": " override fun checkNode(whiteSpace: Ps... | {
"name": "semantic-97f637c348377e58",
"each": "method",
"where": "**/*",
"ensure": "PSI inspection must tolerate a missing previous node before examining its element type or following node."
} |
1 | swe-rebench:analysis-dev__diktat-596:50bf988c970f | bug | kotlin | analysis-dev/diktat | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "ArrowInWhenChecker.checkNode",
"path": "diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/Checkers.kt",
"revision": "67ffa9cbe7ed7248450d1d38825c1edb0e64524a",
"source": " override fun checkNode(whiteSpace: PsiWhiteS... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "ArrowInWhenChecker.checkNode",
"path": "diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/Checkers.kt",
"revision": "07601ad5357bf183ee1bfcabacc1ff1c46688d71",
"source": " override fun checkNode(whiteSpace: PsiWhiteS... | {
"name": "semantic-07d3db6160cb68eb",
"each": "method",
"where": "**/*",
"ensure": "Whitespace inspection must tolerate the absence of a preceding syntax-tree sibling before accessing that sibling node."
} |
1 | swe-rebench:ant-design-blazor__ant-design-blazor-4147:71d86eb8c6c7 | bug | csharp | ant-design-blazor/ant-design-blazor | {
"labels": {
"bug": 1,
"security": 0
},
"method_name": "Tabs.OnInitialized",
"path": "components/tabs/Tabs.razor.cs",
"revision": "946b89405b77ad0913c4cba0c23db26993048bf4",
"source": " protected override void OnInitialized()\n {\n base.OnInitialized();\n\n if (T... | {
"labels": {
"bug": 0,
"security": 0
},
"method_name": "Tabs.OnInitialized",
"path": "components/tabs/Tabs.razor.cs",
"revision": "a45ed8d4285883b99e95916d03745e629d721cce",
"source": " protected override void OnInitialized()\n {\n base.OnInitialized();\n\n if (T... | {
"name": "semantic-3536f1859dc648e1",
"each": "method",
"where": "**/*",
"ensure": "When card configuration is present, initialization must connect it to the component's tab-rendering callback."
} |
1 | swe-rebench:anz-bank__sysl-1020:6644005fa407 | bug | go | anz-bank/sysl | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "TreeShapeListener.lintEndpoint",
"path": "pkg/parse/linter.go",
"revision": "7e4867bf860785fe6ff4dab9e8458dfc3ccdd4e9",
"source": "func (s *TreeShapeListener) lintEndpoint() {\n\tappNotExistLog := func(location, appName, call string) {\n\t\... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "TreeShapeListener.lintEndpoint",
"path": "pkg/parse/linter.go",
"revision": "079a1a51c8ca0f53a477c49f4315d8f6554881fe",
"source": "func (s *TreeShapeListener) lintEndpoint() {\n\tappNotExistLog := func(location, appName, call string) {\n\t\... | {
"name": "semantic-f4e51d0fd93ebd83",
"each": "method",
"where": "**/*",
"ensure": "Accept an existing endpoint as valid for simple calls that have no REST method to validate."
} |
1 | swe-rebench:apache__jena-2623:7b4f03929161 | bug | java | apache/jena | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "Unparser.wPropertyEltLiteral",
"path": "jena-core/src/main/java/org/apache/jena/rdfxml/xmloutput/impl/Unparser.java",
"revision": "8e0007e7c0513a0a185848061f8bac94d5e593ba",
"source": " private boolean wPropertyEltLiteral(WType wt, Prope... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "Unparser.wPropertyEltLiteral",
"path": "jena-core/src/main/java/org/apache/jena/rdfxml/xmloutput/impl/Unparser.java",
"revision": "bd40101029078ec8dff8bcd3e99b0cc2cf4dfdb8",
"source": " private boolean wPropertyEltLiteral(WType wt, Prope... | {
"name": "semantic-aff7fba741f13afc",
"each": "method",
"where": "**/*",
"ensure": "Inline an RDF XML literal only when its lexical content is a well-formed, self-contained XML fragment."
} |
1 | swe-rebench:apollographql__apollo-codegen-312:f87be2100129 | bug | typescript | apollographql/apollo-codegen | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "Printer.fixCommas",
"path": "src/javascript/typescript/printer.ts",
"revision": "a6bda6ef00fce74972aa4f3c02b7c5c54da810e5",
"source": " private fixCommas(documentPart: string) {\n const lines = documentPart.split('\\n');\n let curren... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "Printer.fixCommas",
"path": "src/javascript/typescript/printer.ts",
"revision": "86b7fc10a3074d0b8136185ff832263e5f1f6460",
"source": " private fixCommas(documentPart: string) {\n const lines = documentPart.split('\\n');\n let curren... | {
"name": "semantic-445179ce0fd2c287",
"each": "method",
"where": "**/*",
"ensure": "Handle absent inline comments explicitly when normalizing lines so comment-free input remains valid."
} |
1 | swe-rebench:apple__swift-markdown-133:734e38ca3040 | bug | swift | apple/swift-markdown | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "Markup.child",
"path": "Sources/Markdown/Base/Markup.swift",
"revision": "8ea3072e4ba2a2aa6395d529fbfc188c838c2dba",
"source": " public func child(through path: TypedChildIndexPath) -> Markup? {\n var element: Markup = self\n ... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "Markup.child",
"path": "Sources/Markdown/Base/Markup.swift",
"revision": "0e8a992ec5d51b8e8f696b5fefae3917b2672c3c",
"source": " public func child(through path: TypedChildIndexPath) -> Markup? {\n var element: Markup = self\n ... | {
"name": "semantic-c10589b9c224871f",
"each": "method",
"where": "**/*",
"ensure": "Validate each path component against the child count of the current parent node before descending to its child."
} |
1 | swe-rebench:apple__swift-markdown-50:e07e7b2e43ae | bug | swift | apple/swift-markdown | {
"labels": {
"bug": 1,
"security": null
},
"method_name": "PendingBlockDirective.parseArgumentsStart",
"path": "Sources/Markdown/Parser/BlockDirectiveParser.swift",
"revision": "d03ad208210c23cba8652395fff05bc906e2334c",
"source": " @discardableResult\n mutating func parseArgumentsStart(from ... | {
"labels": {
"bug": 0,
"security": null
},
"method_name": "PendingBlockDirective.parseArgumentsStart",
"path": "Sources/Markdown/Parser/BlockDirectiveParser.swift",
"revision": "592311d8e9f1d9502ae799d44e6eddfa4536b505",
"source": " @discardableResult\n mutating func parseArgumentsStart(from ... | {
"name": "semantic-41bf21afe53ca1bc",
"each": "method",
"where": "**/*",
"ensure": "Directive argument parsing must tolerate unavailable source coordinates without trapping after an opener is consumed."
} |
Perch Lint Bench — Public
This benchmark tests whether a model can apply a user-written Perch semantic lint rule to a code method. Each record has a method before and after a bug or security fix. One concise ensure rule describes the intended behavior and applies unchanged to both versions. The model sees each version separately, with the method source and Perch's saved imports, callers, callees, and static call-graph edges where available. It never sees the paired version while answering.
File: benchmark.jsonl — 214 method pairs (428 independently scored methods). The public and private sets are disjoint by source repository. Code retains the licenses of its source repositories.
Record fields
| Field | Contents |
|---|---|
pair_id |
Stable method-pair identifier |
domain |
bug or security |
repository, language |
Source repository and language |
rule.ensure |
The same desired-behavior rule for both versions |
before, after |
Independent method inputs at the two revisions |
Each side contains revision, path, method_name, source, source_sha256, state, and labels. state is the input adapted from a Perch method scan. Its call graph may be incomplete for some source projects. The relevant labels.bug or labels.security is 1 for the before method and 0 for the fixed after method.
Evaluation
Ask the same Perch ensure question of each side independently: “Is rule true of the code below?” The true criterion is the rule text; the false criterion is Not so: followed by that text. The issue score is 1 - P(rule true). At a declared cutoff, report average precision (AP), precision, recall, F1, TP, FP, TN, FN, false positives per true positive, and the share of pairs where the before method scores above the after method. The included benchmark.py runner alerts only when the score is strictly greater than 0.7 by default and saves resumable per-method predictions.
Languages
| Language | Pairs |
|---|---|
python |
29 |
go |
23 |
csharp |
20 |
java |
20 |
php |
19 |
rust |
19 |
typescript |
18 |
c |
14 |
javascript |
13 |
ruby |
9 |
swift |
9 |
kotlin |
7 |
scala |
6 |
cpp |
5 |
lua |
3 |
File SHA-256: 534f6c2abddc507c40f4597607e97e07168c544011d617b83aa39e08abb35d75
Sources
All 214 pairs in this dataset come from the bug (115 pairs) and security (99 pairs) datasets. See their cards for more on their sources.
License
The rules, labels, Perch method context and this card are licensed under CC BY 4.0. benchmark.py is licensed under MIT. Each method's source code keeps the license of the repository it came from.
- Downloads last month
- 145