You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Metal/CUDA GPU qualifiers (kernel, __global__, device, ...) mint sourceless god nodes #4550
Metal (.metal) and CUDA (.cu/.cuh) are C++-derived GPU languages and route through the C++ extractor. Their address-space / execution-space / function qualifiers are not part of the C++ grammar, so tree-sitter-cpp parses a leading qualifier as the declaration's type_identifier (the real type is pushed into an ERROR node). _cpp_collect_type_refs then emits the qualifier as a type reference, and each one becomes a sourceless, corpus-shared god node that every shader/kernel references.
This violates the provenance invariant (a node with no source_file), and the hubs pollute god-node rankings in analyze.
Expected: kernel, device, constant, __global__, __device__, __host__, ... are language keywords, not corpus symbols, and should not become nodes. The genuine struct Vec3 should still resolve.
Actual: each qualifier is a sourceless god node with a false references edge.
Notes
These words are legal identifiers in plain C++/CUDA (e.g. a user type named device), so any filter must be keyed by the GPU-dialect file extension, not applied to .cpp/.cc/.h.
Activity
github-actions commentedon Oct 18, 2026
Thanks for opening this issue, @rajatnagda45. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
Leave GPU qualifier words alone inside comments and strings