benchmark-results / CODEQL.md
jfbrown95's picture
Update completed CodeQL benchmark results (#34)
76359b1
|
Raw History Blame
3.8 kB

CodeQL comparison

This track compares CodeQL with the saved Jev run on the same public method pairs. CodeQL analyzes each repository snapshot. Jev's saved decision for each method is read from predictions/current/.

CodeQL evaluated 682 bug pairs and 305 security pairs. It scanned Python, JavaScript, TypeScript, C and C++ repositories listed in codeql-cohort.json. Each counted pair has both source versions available, both target files extracted, and method text matching the benchmark's recorded lines.

Of the 937 eligible bug pairs, 159 lacked recoverable source files, 72 failed source verification, and 24 had failed CodeQL analysis. Of the 323 eligible security pairs, 18 had failed analysis. Each database-creation or analysis stage had a 30-minute timeout. Unscored pairs are excluded from the counts. The main benchmark tables mark CodeQL's coverage with an asterisk. results.json includes the exclusions and Jev's results on the same successfully scored pairs.

Input revisions for this run: bug-pairs-public@80cc6cbcf4b44e140706bcef3d40336ae81e7a05, security-pairs-public@0b3312a609892f4383e8252841ea94fdf74b2935, and the SWE-rebench V2 Parquet file with SHA-256 0e0bf9355f892ad74ae98d4e1c404f39fd6654a8e351ee3e6ab162e4a64cd3ad.

CodeQL CLI 2.27.1 runs the published security-extended suite for security and security-and-quality for bugs. The query packs are pinned to codeql/python-queries@1.8.11, codeql/javascript-queries@2.4.6, and codeql/cpp-queries@1.9.0. For the bug track, only results tagged correctness, reliability, or security count; pure maintainability advice does not represent a bug. A finding counts for a method only when its primary SARIF location overlaps that method's recorded source lines. A finding elsewhere in the file is not assigned to the method.

Python, JavaScript, TypeScript, C, and C++ snapshots use CodeQL's no-build extraction. For SWE-rebench V2 bug pairs, the runner applies the dataset's gold patch to its pinned base_commit to reconstruct the repaired repository. It does not run project code or tests.

To reproduce, download the public benchmark.jsonl files from bug-pairs-public and security-pairs-public into public/bug/ and public/security/. Download SWE-rebench V2's train Parquet file separately. Install Docker, the CodeQL CLI for your Docker architecture, its three query packs at the versions above, and DuckDB. Then run:

python3 codeql_compare.py scan \
  --root /path/to/codeql-work \
  --data /path/to/public \
  --predictions predictions/current \
  --codeql /path/to/codeql \
  --rebench-parquet /path/to/swe-rebench-train.parquet \
  --all-supported --jobs 4 --scan-timeout 1800

python3 codeql_compare.py score \
  --root /path/to/codeql-work \
  --data /path/to/public \
  --predictions predictions/current \
  --all-supported

The runner writes per-pair decisions and aggregate counts under the work directory. It resumes completed databases and SARIF analyses. CodeQL reports binary findings here, so it has no average-precision score or threshold curve to compare with Jev's probabilities. The semantic lint track is not included: stock CodeQL queries do not take the pair's written behavior rule as input.

GitHub's CodeQL documentation describes the built-in suites and their intended coverage. The CLI terms cover its use on public repositories.