benchmark-results / CODEQL.md
jfbrown95's picture
Compare CodeQL and Jev on matched public methods (#31)
49665ce
|
Raw History Blame
3.32 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/`.
The cohort is listed in [`codeql-cohort.json`](codeql-cohort.json). A pair is
counted only if both source states can be recreated, CodeQL extracts both
target files, and the method text matches the recorded lines. Failed or
unavailable snapshots are excluded from both models' counts. This is a subset
of the public bug and security benchmarks, so its results are separate from
the full-set model tables.
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](https://huggingface.co/datasets/nebius/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`](https://huggingface.co/datasets/perchscan/bug-pairs-public)
and [`security-pairs-public`](https://huggingface.co/datasets/perchscan/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:
```sh
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
python3 codeql_compare.py score \
--root /path/to/codeql-work \
--data /path/to/public \
--predictions predictions/current
```
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](https://docs.github.com/en/code-security/concepts/code-scanning/codeql/codeql-query-suites)
describes the built-in suites and their intended coverage. The
[CLI terms](https://docs.github.com/en/code-security/concepts/code-scanning/codeql/codeql-cli)
cover its use on public repositories.