Tensor library for machine learning
This report summarizes scanner evidence for ggml-org/ggml, a C++ project with 15,564 GitHub stars. SynthScan examined 407,820 lines of code across 820 source files, recording 892 pattern matches distributed across 16 syntactic categories. The legacy adjusted pattern signal is 2.3 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 878 finding(s).
Are imports declared and package/API names verified? 3 finding(s).
Are wrappers, guards, and repeated structures necessary? 22 finding(s).
Which changes need focused human review? 892 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 892 distinct pattern matches across 16 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ci/run.sh | 1 | #/bin/bash | COMMENT |
| LOW | ci/run.sh | 241 | gg_printf '```\n' | COMMENT |
| LOW | ci/run.sh | 261 | # | COMMENT |
| LOW | include/ggml-cpp.h | 1 | #pragma once | COMMENT |
| LOW | include/ggml-sycl.h | 1 | // | COMMENT |
| LOW | include/ggml-backend.h | 1 | #pragma once | COMMENT |
| LOW | include/ggml-backend.h | 321 | // if the user returns false the scheduler simply copies the entire weight | COMMENT |
| LOW | include/ggml-backend.h | 401 | GGML_API const char * ggml_backend_meta_split_axis_name(enum ggml_backend_meta_split_axis split_axis); | COMMENT |
| LOW | include/ggml-cuda.h | 1 | #pragma once | COMMENT |
| LOW | include/ggml-opt.h | 1 | // This file contains functionality for training models using GGML. | COMMENT |
| LOW | include/ggml-opt.h | 181 | struct ggml_tensor * inputs, | COMMENT |
| LOW | include/ggml-metal.h | 1 | // Note: this description is outdated | COMMENT |
| LOW | include/ggml-metal.h | 21 | COMMENT | |
| LOW | include/gguf.h | 1 | // This file contains functionality related to "GGUF" files, the binary file format used by ggml. | COMMENT |
| LOW | include/gguf.h | 21 | // 1. The size of the tensor in the dimension (int64_t). | COMMENT |
| LOW | include/gguf.h | 161 | COMMENT | |
| LOW | include/gguf.h | 181 | // FILE * f = fopen(fname, "ab"); | COMMENT |
| LOW | include/ggml-rpc.h | 1 | #pragma once | COMMENT |
| LOW | include/ggml.h | 1 | #pragma once | COMMENT |
| LOW | include/ggml.h | 21 | // | COMMENT |
| LOW | include/ggml.h | 41 | // struct ggml_context * ctx = ggml_init(params); | COMMENT |
| LOW | include/ggml.h | 61 | // struct ggml_cgraph * gf = ggml_new_graph(ctx); | COMMENT |
| LOW | include/ggml.h | 81 | // and after defining the computation graph, call the ggml_used_mem() function to find out how much memory was | COMMENT |
| LOW | include/ggml.h | 101 | // - ggml_conv_1d_2s() | COMMENT |
| LOW | include/ggml.h | 121 | // assert(c->src[0] == a); | COMMENT |
| LOW | include/ggml.h | 141 | // *(float *) ((char *) a->data + y*a->nb[1] + x*a->nb[0]) = x + y; | COMMENT |
| LOW | include/ggml.h | 161 | // | COMMENT |
| LOW | include/ggml.h | 181 | # define GGML_API __declspec(dllimport) extern | COMMENT |
| LOW | include/ggml.h | 201 | #elif defined(__MINGW32__) && !defined(__clang__) | COMMENT |
| LOW | include/ggml.h | 221 | COMMENT | |
| LOW | include/ggml.h | 241 | #define GGML_MEM_ALIGN 8 | COMMENT |
| LOW | include/ggml.h | 261 | __host__ __device__ constexpr inline void ggml_unused_vars_impl(Args&&...) noexcept {} | COMMENT |
| LOW | include/ggml.h | 281 | #elif defined(_MSC_VER) | COMMENT |
| LOW | include/ggml.h | 421 | // GGML_TYPE_Q4_0_4_4 = 31, support has been removed from gguf files | COMMENT |
| LOW | include/ggml.h | 1441 | struct ggml_tensor * a, | COMMENT |
| LOW | include/ggml.h | 1461 | // ranks in decreasing order: | COMMENT |
| LOW | include/ggml.h | 1881 | int n_dims, | COMMENT |
| LOW | include/ggml.h | 1921 | float attn_factor, | COMMENT |
| LOW | include/ggml.h | 1941 | // given sections = [t=4, y=2, x=2, 0] | COMMENT |
| LOW | include/ggml.h | 2201 | int d1, // dilation height | COMMENT |
| LOW | include/ggml.h | 2681 | // DSA lightning indexer | COMMENT |
| LOW | include/ggml.h | 2701 | // using a richer representation through streams. | COMMENT |
| LOW | include/ggml.h | 2741 | GGML_API struct ggml_tensor * ggml_dsv4_hc_post( | COMMENT |
| LOW | include/ggml.h | 2881 | // this is useful for creating graphs that have constant topology but compute different things based on the input | COMMENT |
| LOW | include/ggml.h | 2961 | GGML_API void ggml_log_set(ggml_log_callback log_callback, void * user_data); | COMMENT |
| LOW | include/ggml.h | 3001 | # define GGML_RESTRICT __restrict | COMMENT |
| LOW | tests/test-conv2d.cpp | 1 | #include "ggml.h" | COMMENT |
| LOW | tests/test-timestep_embedding.cpp | 1 | #include "ggml.h" | COMMENT |
| LOW | tests/test-conv1d-dw-c1.cpp | 1 | #include "ggml.h" | COMMENT |
| LOW | tests/test-conv1d-dw-c2.cpp | 1 | #include "ggml.h" | COMMENT |
| LOW | tests/test-pad-reflect-1d.cpp | 1 | #include "ggml.h" | COMMENT |
| LOW | tests/test-quantize-fns.cpp | 1 | // Unit tests for quantization specific functions - quantize, dequantize and dot product | COMMENT |
| LOW | tests/test-roll.cpp | 1 | #include <ggml.h> | COMMENT |
| LOW | tests/test-opt.cpp | 1 | // TODO refactor | COMMENT |
| LOW | tests/test-conv-transpose-1d.cpp | 1 | #include "ggml.h" | COMMENT |
| LOW | tests/test-quantize-perf.cpp | 1 | // Benchmark quantization specific functions on synthetic data | COMMENT |
| LOW | tests/test-arange.cpp | 1 | #include "ggml.h" | COMMENT |
| LOW | tests/test-customop.c | 1 | #include "ggml.h" | COMMENT |
| LOW | tests/test-conv1d.cpp | 1 | #include "ggml.h" | COMMENT |
| LOW | tests/test-backend-ops.cpp | 1 | // This file defines tests for various GGML ops and backends. | COMMENT |
| 729 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/test-backend-ops.cpp | 2071 | // Step 1: create input tensors that don't depend on any other tensors: | COMMENT |
| LOW⚡ | tests/test-backend-ops.cpp | 2078 | // Step 2: use the op that you want to test in the GGML compute graph. | COMMENT |
| LOW⚡ | tests/test-backend-ops.cpp | 2082 | // Step 3: return the output tensor. | COMMENT |
| LOW | src/ggml-et/et-kernels/src/norm_f32.c | 84 | // Step 1: sum for mean | COMMENT |
| LOW | src/ggml-et/et-kernels/src/norm_f32.c | 110 | // Step 2: compute (x - mean) → dst, accumulate variance | COMMENT |
| LOW | src/ggml-et/et-kernels/src/norm_f32.c | 143 | // Step 3: apply scale to centered values in dst | COMMENT |
| LOW | src/ggml-et/et-kernels/src/rms_norm_f32.c | 100 | // Step 1: Compute sum of squares using 8-wide vectors | COMMENT |
| LOW⚡ | src/ggml-et/et-kernels/src/rms_norm_f32.c | 124 | // Step 2: scale = rsqrt(mean + eps) | COMMENT |
| LOW⚡ | src/ggml-et/et-kernels/src/rms_norm_f32.c | 132 | // Step 3: Apply scaling: broadcast scale once, reuse across loop | COMMENT |
| LOW | src/ggml-et/et-kernels/src/rwkv_wkv7_f32.c | 177 | // Step 1: sa = dot(a, state_prev[i]) | COMMENT |
| LOW | src/ggml-et/et-kernels/src/rwkv_wkv7_f32.c | 196 | // Step 2: state update + result accumulation | COMMENT |
| LOW⚡ | src/ggml-openvino/openvino/op/gated_delta_net.cpp | 318 | // Step 1: Apply decay gate to state | COMMENT |
| LOW⚡ | src/ggml-openvino/openvino/op/gated_delta_net.cpp | 323 | // Step 2: delta = (v - S @ k) * beta | COMMENT |
| LOW⚡ | src/ggml-openvino/openvino/op/gated_delta_net.cpp | 330 | // Step 3: state += outer(delta, k) | COMMENT |
| LOW⚡ | src/ggml-openvino/openvino/op/gated_delta_net.cpp | 336 | // Step 4: attn_out = S @ q * scale | COMMENT |
| LOW⚡ | src/ggml-metal/CMakeLists.txt | 118 | # Step 1: concatenate shared headers + this kernel source | COMMENT |
| LOW⚡ | src/ggml-metal/CMakeLists.txt | 120 | # Step 2: remove internal #include and #pragma once | COMMENT |
| LOW⚡ | src/ggml-metal/CMakeLists.txt | 122 | # Step 3: inline ggml-common.h (replacing __embed_ggml-common.h__ sentinel) | COMMENT |
| LOW⚡ | src/ggml-metal/CMakeLists.txt | 124 | # Step 4: inline ggml-metal-impl.h | COMMENT |
| LOW⚡ | src/ggml-metal/CMakeLists.txt | 126 | # Step 5: emit an asm chunk with kind-specific start/end symbols | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 2853 | // Step 5: multiply by attn_factor | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 2870 | // Step 6: repeat | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3134 | // Step 1: Prepare trans tensors for F16 type conversion to F32 if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3159 | // Step 2: Prepare head tensors for tail splitting if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3188 | // Step 3: Execute RotaryPositionEmbedding | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3235 | // Step 4: Copy unrotated tail portion from source to destination | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3264 | // Step 5: Cast back to F16 if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3950 | // Step 1: cast the src0 (Query) to fp16 if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3973 | // Step 2: create the acl tensors for src1 (Key), src2 (Value), | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 4017 | // Step 3: create the PSEShift tensor if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 4086 | // Step 4: set the inputs for FusedInferAttention. | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 4147 | // Step 6: post-processing — slice padded output and/or cast to f32 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/test-backend-ops.cpp | 2071 | // Step 1: create input tensors that don't depend on any other tensors: | COMMENT |
| LOW⚡ | tests/test-backend-ops.cpp | 2078 | // Step 2: use the op that you want to test in the GGML compute graph. | COMMENT |
| LOW⚡ | tests/test-backend-ops.cpp | 2082 | // Step 3: return the output tensor. | COMMENT |
| LOW | src/ggml-et/et-kernels/src/norm_f32.c | 84 | // Step 1: sum for mean | COMMENT |
| LOW | src/ggml-et/et-kernels/src/norm_f32.c | 110 | // Step 2: compute (x - mean) → dst, accumulate variance | COMMENT |
| LOW | src/ggml-et/et-kernels/src/norm_f32.c | 143 | // Step 3: apply scale to centered values in dst | COMMENT |
| LOW | src/ggml-et/et-kernels/src/rms_norm_f32.c | 100 | // Step 1: Compute sum of squares using 8-wide vectors | COMMENT |
| LOW⚡ | src/ggml-et/et-kernels/src/rms_norm_f32.c | 124 | // Step 2: scale = rsqrt(mean + eps) | COMMENT |
| LOW⚡ | src/ggml-et/et-kernels/src/rms_norm_f32.c | 132 | // Step 3: Apply scaling: broadcast scale once, reuse across loop | COMMENT |
| LOW | src/ggml-et/et-kernels/src/rwkv_wkv7_f32.c | 177 | // Step 1: sa = dot(a, state_prev[i]) | COMMENT |
| LOW | src/ggml-et/et-kernels/src/rwkv_wkv7_f32.c | 196 | // Step 2: state update + result accumulation | COMMENT |
| LOW | src/ggml-webgpu/ggml-webgpu.cpp | 1454 | // For set rows specifically, we need to check if src and idx are empty | COMMENT |
| LOW⚡ | src/ggml-openvino/openvino/op/gated_delta_net.cpp | 318 | // Step 1: Apply decay gate to state | COMMENT |
| LOW⚡ | src/ggml-openvino/openvino/op/gated_delta_net.cpp | 323 | // Step 2: delta = (v - S @ k) * beta | COMMENT |
| LOW⚡ | src/ggml-openvino/openvino/op/gated_delta_net.cpp | 330 | // Step 3: state += outer(delta, k) | COMMENT |
| LOW⚡ | src/ggml-openvino/openvino/op/gated_delta_net.cpp | 336 | // Step 4: attn_out = S @ q * scale | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 2853 | // Step 5: multiply by attn_factor | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 2870 | // Step 6: repeat | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3134 | // Step 1: Prepare trans tensors for F16 type conversion to F32 if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3159 | // Step 2: Prepare head tensors for tail splitting if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3188 | // Step 3: Execute RotaryPositionEmbedding | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3235 | // Step 4: Copy unrotated tail portion from source to destination | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3264 | // Step 5: Cast back to F16 if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3950 | // Step 1: cast the src0 (Query) to fp16 if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 3973 | // Step 2: create the acl tensors for src1 (Key), src2 (Value), | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 4017 | // Step 3: create the PSEShift tensor if needed | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 4086 | // Step 4: set the inputs for FusedInferAttention. | COMMENT |
| LOW | src/ggml-cann/aclnn_ops.cpp | 4147 | // Step 6: post-processing — slice padded output and/or cast to f32 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | examples/gpt-2/convert-ckpt-to-ggml.py | 0 | returns list of utf-8 byte and a corresponding list of unicode strings. the reversible bpe codes work on unicode strings | STRING |
| HIGH | examples/gpt-2/convert-h5-to-ggml.py | 0 | returns list of utf-8 byte and a corresponding list of unicode strings. the reversible bpe codes work on unicode strings | STRING |
| HIGH | examples/gpt-2/convert-cerebras-to-ggml.py | 0 | returns list of utf-8 byte and a corresponding list of unicode strings. the reversible bpe codes work on unicode strings | STRING |
| HIGH | examples/gpt-j/convert-h5-to-ggml.py | 0 | returns list of utf-8 byte and a corresponding list of unicode strings. the reversible bpe codes work on unicode strings | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | examples/mnist/mnist-common.h | 20 | // The physical batch size determines how many datapoints are processed in parallel, larger values utilize compute bette | COMMENT |
| MEDIUM | src/ggml-cpu/amx/mmq.cpp | 603 | // pack again with 128 to fully utilize vector length | COMMENT |
| MEDIUM | src/ggml-cpu/amx/mmq.cpp | 645 | // pack again with 128 to fully utilize vector length | COMMENT |
| MEDIUM | src/ggml-cpu/amx/mmq.cpp | 743 | // pack again with 128 to fully utilize vector length | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | include/ggml-backend.h | 215 | typedef ggml_backend_buffer_type_t (*ggml_backend_split_buffer_type_t)(int main_device, const float * tensor_split | CODE |
| LOW | examples/mnist/server.py | 9 | class CustomHTTPRequestHandler(http.server.SimpleHTTPRequestHandler): | CODE |
| LOW | examples/python/ggml/utils.py | 172 | def __check_shape_consistent_with_type(tensor: TensorLike): | CODE |
| LOW⚡ | src/ggml-virtgpu/regenerate_remoting.py | 49 | def _check_clang_format_available(self) -> bool: | CODE |
| LOW⚡ | src/ggml-virtgpu/regenerate_remoting.py | 53 | def _format_file_with_clang_format(self, file_path: Path) -> bool: | CODE |
| LOW | src/ggml-virtgpu/regenerate_remoting.py | 78 | def generate_backend_function_name(self, group_name: str, function_name: str) -> str: | CODE |
| LOW | src/ggml-virtgpu/regenerate_remoting.py | 89 | def generate_frontend_function_name(self, group_name: str, function_name: str) -> str: | CODE |
| LOW | src/ggml-virtgpu/regenerate_remoting.py | 125 | def generate_apir_backend_header(self) -> str: | CODE |
| LOW | src/ggml-virtgpu/regenerate_remoting.py | 176 | def generate_backend_dispatched_header(self) -> str: | CODE |
| LOW | src/ggml-virtgpu/regenerate_remoting.py | 222 | def generate_virtgpu_forward_header(self) -> str: | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | examples/mnist/server.py | 35 | print(f"Error: {e}") | CODE |
| LOW | examples/python/example_test_all_quants.py | 65 | except Exception as e: | CODE |
| MEDIUM | examples/python/example_test_all_quants.py | 66 | print(f'Error: {e}') | CODE |
| LOW | src/ggml-virtgpu/regenerate_remoting.py | 69 | except Exception as e: | CODE |
| LOW | src/ggml-virtgpu/regenerate_remoting.py | 327 | except Exception as e: | STRING |
| MEDIUM | src/ggml-virtgpu/regenerate_remoting.py | 323 | def main(): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/sync-whisper-am.sh | 5 | # Usage: | COMMENT |
| LOW | scripts/release.sh | 11 | # Usage: | COMMENT |
| LOW | scripts/sync-llama-am.sh | 5 | # Usage: | COMMENT |
| LOW | src/ggml-sycl/dpct/helper.hpp | 3020 | /// Example usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/ggml.c | 4015 | // TODO: implement non F32 return | COMMENT |
| LOW | src/ggml.c | 4039 | // TODO: implement non F32 return | COMMENT |
| LOW | src/ggml.c | 5218 | // TODO: implement antialias for modes other than bilinear | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/release.sh | 77 | # Check if we have the latest from master (skip in dry-run) | COMMENT |
| LOW⚡ | src/ggml-virtgpu/regenerate_remoting.py | 46 | # Check if clang-format is available | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | ci/run.sh | 367 | # Create a fresh python3 venv and enter it | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/python/stubs.py | 7 | CODE | |
| LOW | examples/gpt-2/convert-cerebras-to-ggml.py | 9 | CODE | |
| LOW | examples/gpt-j/convert-h5-to-ggml.py | 23 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/python/ggml/utils.py | 118 | CODE | |
| LOW | src/ggml-webgpu/wgsl-shaders/embed_wgsl.py | 68 | CODE | |
| LOW | src/ggml-hexagon/htp/htp-swiv.py | 409 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/ggml-et/et-kernels/src/platform.h | 347 | // ────── ──────────── ────────────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/ggml-virtgpu/regenerate_remoting.py | 3 | # Generated by Claude AI | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/mnist/mnist-train-fc.py | 31 | CODE |