Rust: query evaluation ~15× slower on 2.26.4 vs 2.26.3 (4 min → 45–60 min, type-inference/data-flow stage)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- compilers, performance
Línea de trabajo
Compara los bundles de CodeQL 2.26.3 y 2.26.4 usando el Rust workspace indicado y revisa los commits 52cbb679, e9bd6988, ce360c4f, 5f76c946 y 1d6ac57d. Recopila la salida de evaluator-log o tuple-counting sugerida si es necesario y determina después si los cambios en callback, rust-analyzer o macro explican la regresión. La tarea estará terminada cuando se identifiquen la causa y un fix compatible o una opción de tuning.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description of the issue
After the CodeQL bundle moved from 2.26.3 to 2.26.4, Rust analysis of our workspace went from ~4 minutes to ~45–60 minutes per run, with no change on our side. The extra time is almost entirely in query evaluation — the type-inference / data-flow stage — not extraction.
Setup
- GitHub code scanning default setup (so the bundle version is whatever the action ships;
codeql-actionv4.37.9 bumped the default bundle to 2.26.4 on 2026-08-26). build-mode: none,ubuntu-latesthosted runner (2 vCPU,CODEQL_THREADS=2,CODEQL_RAM=6914).- Private Rust workspace: 15 crates, ~470k lines of Rust (roughly a third of that under
tests/), ~720 packages inCargo.lock, edition 2021. Standard async web-service stack — nothing exotic in the code. - The default query suite (36 queries).
What changed / what didn't
We compared the last run on 2.26.3 and the first run on 2.26.4:
- Same
github/codeql-actioncommit, same runner image. - Same commit of our code (identical merge base; no diff at all in
Cargo.toml/Cargo.lock). - ~150 consecutive runs on 2.26.3 over the preceding four weeks: all 2–4 min. 50+ consecutive runs on 2.26.4 since: all 41–59 min. No overlap.
Timings from the job logs
| Stage | 2.26.3 | 2.26.4 |
|---|---|---|
total duration (Extract) |
12.8 s | 59 s |
diagnostics/DataFlowConsistencyCounts |
2m01s (slowest query) | ~30 min |
diagnostics/TypeInferenceConsistencyCounts |
58 s | ~17 min |
diagnostics/SsaConsistencyCounts |
50 s | ~13 min |
summary/NodesWithTypeAtLengthLimit |
< 1 s | ~22 min |
diagnostics/UnresolvedMacroCalls |
— | 6m11s |
whole security/* data-flow batch (CWE-089/SqlInjection, CWE-312/CleartextLogging, CWE-319/UseOfHttp, CWE-327/BrokenCryptoAlgorithm, …) |
well under a minute each | ~30 min each (shared batch) |
So extraction got ~5× slower but is still small; evaluation of everything downstream of type inference got roughly 15–30× slower.
Suspected cause
Looking at the Rust changes between codeql-cli/v2.26.3 and codeql-cli/v2.26.4, the ones that touch the stage that regressed are:
52cbb679"Rust: EvaluatemayInvokeCallbackin type inference stage"e9bd6988"Rust: Assume callbacks will be invoked in library functions"- the rust-analyzer upgrade to 0.0.328 (
ce360c4f,5f76c946) and the derive-macro expansion restore (1d6ac57d).
The first two look like they widen the call graph feeding type inference, which is consistent with every data-flow query slowing down together. Happy to be corrected — that's inferred from the commit list, not from profiling.
One other difference we noticed in the extractor output on 2.26.4: a handful of new macro expansion failed for '$crate::count' warnings on the metrics crate's counter!-style macros that did not appear on 2.26.3. Possibly unrelated, mentioning it in case it points at the rust-analyzer upgrade.
What would help
- Is this a known regression in 2.26.4, and is there a tuning knob (e.g. an extractor option, or a way to cap the callback assumption) short of pinning the bundle?
- If profiling output from a run would help, tell me what to collect (
--evaluator-log/--tuple-countingetc.) and I'll attach it.
We can pin codeql-bundle-v2.26.3 via advanced setup in the meantime.
- Lenguaje dominante
- CodeQL
- Estrellas
- 10.1k
- Forks
- 2.1k
- Merge medio
- 2 d 11 h
- PR fusionados (30 d)
- 129
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/codeql
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
C#: cs/simplifiable-boolean-expression false positive on Nullable<bool> compared with a literal Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
false-positive
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
False positive Abiertofalse-positive
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
Todos los issues de github/codeql
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
EricSpencer00/Resilient#4824 · 1 comentario ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
objectionary/jeo-maven-plugin#1758 ·
-
generics
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
mlir
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
llvm/llvm-project#224908 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100