Official inference framework for 1-bit LLMs
This report summarizes scanner evidence for microsoft/BitNet, a C++ project with 40,658 GitHub stars. SynthScan examined 21,907 lines of code across 59 source files, recording 137 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 10.3 (Moderate 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.
Can maintainers explain intent, assumptions, and trade-offs? 59 finding(s).
Are imports declared and package/API names verified? 31 finding(s).
Are wrappers, guards, and repeated structures necessary? 56 finding(s).
Which changes need focused human review? 137 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 137 distinct pattern matches across 12 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 |
|---|---|---|---|---|
| MEDIUM | run_inference_server.py | 13 | print(f"Error occurred while running command: {e}") | CODE |
| MEDIUM | run_inference.py | 13 | print(f"Error occurred while running command: {e}") | CODE |
| MEDIUM | utils/quantize_embeddings.py | 116 | print(f"Error: {result.stderr}") | CODE |
| LOW | utils/quantize_embeddings.py | 123 | except Exception as e: | CODE |
| MEDIUM | utils/quantize_embeddings.py | 176 | print(f"Error: {result.stderr}") | CODE |
| LOW | utils/quantize_embeddings.py | 183 | except Exception as e: | CODE |
| LOW | utils/quantize_embeddings.py | 270 | except Exception as e: | CODE |
| LOW | utils/quantize_embeddings.py | 367 | except Exception as e: | CODE |
| LOW | utils/quantize_embeddings.py | 465 | except Exception as e: | CODE |
| LOW | utils/tune_gemm_config.py | 252 | except Exception as e: | CODE |
| MEDIUM | utils/convert-helper-bitnet.py | 15 | print(f"Error executing command: {' '.join(map(str, e.cmd))}") | CODE |
| MEDIUM | utils/convert-helper-bitnet.py | 29 | print(f"Error: Model directory '{model_dir}' not found or is not a directory.") | CODE |
| MEDIUM⚡ | utils/convert-helper-bitnet.py | 48 | print(f"Error: Preprocess script not found at '{preprocess_script}'") | CODE |
| MEDIUM⚡ | utils/convert-helper-bitnet.py | 51 | print(f"Error: Convert script not found at '{convert_script}'") | CODE |
| MEDIUM⚡ | utils/convert-helper-bitnet.py | 54 | print(f"Error: llama-quantize binary not found at '{llama_quantize_binary}'") | CODE |
| MEDIUM⚡ | utils/convert-helper-bitnet.py | 58 | print(f"Error: Input safetensors file not found at '{input_file}'") | CODE |
| LOW | utils/convert-helper-bitnet.py | 101 | except Exception as e: | CODE |
| MEDIUM | utils/convert-helper-bitnet.py | 102 | print(f"An error occurred: {e}") | CODE |
| LOW | utils/convert-helper-bitnet.py | 124 | except Exception as e: | CODE |
| LOW | utils/test_perplexity.py | 102 | except Exception as e: | CODE |
| MEDIUM | utils/test_perplexity.py | 170 | print(f"Error: {result.stderr[:500]}") | CODE |
| LOW | utils/test_perplexity.py | 195 | except Exception as e: | CODE |
| MEDIUM | utils/test_perplexity.py | 304 | print(f"Error: {result.stderr[:500]}") | CODE |
| LOW | utils/test_perplexity.py | 310 | except Exception as e: | CODE |
| LOW | utils/test_perplexity.py | 321 | except Exception as e: | CODE |
| LOW | utils/test_perplexity.py | 598 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | utils/convert-ms-to-gguf-bitnet.py | 435 | except FileNotFoundError: | CODE |
| HIGH | utils/convert-ms-to-gguf-bitnet.py | 505 | except FileNotFoundError: | CODE |
| HIGH | utils/convert-ms-to-gguf-bitnet.py | 1599 | except FileNotFoundError: | CODE |
| HIGH | utils/convert.py | 435 | except FileNotFoundError: | CODE |
| HIGH | utils/convert.py | 505 | except FileNotFoundError: | CODE |
| HIGH | utils/convert.py | 1454 | except FileNotFoundError: | CODE |
| HIGH | utils/test_perplexity.py | 112 | except: | CODE |
| HIGH | utils/test_perplexity.py | 217 | except ValueError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 32 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 34 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 90 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 92 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 335 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 337 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 397 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 399 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 416 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 418 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 495 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | utils/convert-bitnet-embedding-to-gguf.py | 497 | # --------------------------------------------------------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gpu/convert_safetensors.py | 1 | CODE | |
| LOW | gpu/convert_safetensors.py | 3 | CODE | |
| LOW | gpu/generate.py | 6 | CODE | |
| LOW | gpu/generate.py | 8 | CODE | |
| LOW | gpu/test.py | 3 | CODE | |
| LOW | gpu/test.py | 6 | CODE | |
| LOW | gpu/test.py | 6 | CODE | |
| LOW | gpu/test.py | 6 | CODE | |
| LOW | gpu/convert_checkpoint.py | 1 | CODE | |
| LOW | gpu/convert_checkpoint.py | 3 | CODE | |
| LOW | gpu/convert_checkpoint.py | 4 | CODE | |
| LOW | gpu/convert_checkpoint.py | 5 | CODE | |
| LOW | gpu/convert_checkpoint.py | 6 | CODE | |
| LOW | gpu/convert_checkpoint.py | 7 | CODE | |
| LOW | gpu/convert_checkpoint.py | 9 | CODE | |
| LOW | gpu/convert_checkpoint.py | 10 | CODE | |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 2 | CODE | |
| LOW | utils/convert.py | 2 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 4 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 9 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 15 | CODE | |
| LOW | utils/convert-helper-bitnet.py | 4 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 3 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 12 | CODE | |
| LOW | utils/test_perplexity.py | 16 | CODE | |
| LOW | utils/test_perplexity.py | 17 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 3 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 10 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 17 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup_env.py | 115 | CODE | |
| LOW | setup_env.py | 162 | CODE | |
| LOW | gpu/convert_checkpoint.py | 15 | CODE | |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1076 | CODE | |
| LOW | utils/quantize_embeddings.py | 187 | CODE | |
| LOW | utils/convert.py | 1002 | CODE | |
| LOW | utils/convert.py | 1302 | CODE | |
| LOW | utils/tune_gemm_config.py | 262 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 498 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 577 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 620 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 328 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 431 | CODE | |
| LOW | utils/generate-dummy-bitnet-model.py | 861 | CODE | |
| LOW | utils/convert-helper-bitnet.py | 19 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 193 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 248 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 339 | CODE | |
| LOW | utils/convert-bitnet-embedding-to-gguf.py | 499 | CODE | |
| LOW | utils/test_perplexity.py | 326 | CODE | |
| LOW | utils/test_perplexity.py | 490 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 260 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 380 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 776 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 946 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 991 | CODE | |
| LOW | utils/convert-hf-to-gguf-bitnet.py | 1074 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gpu/test.py | 81 | ) | COMMENT |
| LOW | gpu/bitnet_kernels/bitnet_kernels.h | 1 | #include <cuda_runtime.h> | COMMENT |
| LOW | include/gemm-config.h | 1 | #define ACT_PARALLEL | COMMENT |
| LOW | include/gemm-config.h | 21 | #define PARALLEL_SIZE 2 | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 121 | # assert(np.prod(arr.shape) % 4 == 0) | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1381 | # if params.n_experts and params.n_experts > 0: | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1401 | COMMENT | |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1421 | COMMENT | |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1441 | # for name, lazy_tensor in model.items(): | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1461 | # tmp[f"layers.{i}.feed_forward.w3.weight"] = part_lazy_w3(model[f"layers.{i}.feed_forward.w13.weight"], 1) | COMMENT |
| LOW | utils/convert.py | 121 | # assert(np.prod(arr.shape) % 4 == 0) | COMMENT |
| LOW | utils/test_gemm_kernel.sh | 121 | COMMENT | |
| LOW | src/ggml-bitnet-mad.cpp | 1 | #include <vector> | COMMENT |
| LOW | src/ggml-bitnet-lut.cpp | 1 | #include <vector> | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup_env.py | 210 | # Check if cmake is installed | COMMENT |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1551 | # Check if it's a set of safetensors files | COMMENT |
| LOW | utils/quantize_embeddings.py | 59 | # Check if file already exists | COMMENT |
| LOW | utils/convert.py | 1406 | # Check if it's a set of safetensors files | COMMENT |
| LOW | utils/test_gemm_kernel.sh | 448 | # Set LD_LIBRARY_PATH to include the GGML library directory | COMMENT |
| LOW | utils/test_gemm_kernel.sh | 477 | # Check if values were extracted successfully | COMMENT |
| LOW | utils/test_perplexity.py | 256 | # Check if file already exists | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | utils/codegen_tl2.py | 629 | if (!(is_type_supported(tensor->type) && tensor->backend == GGML_BACKEND_TYPE_CPU && tensor->extra == nullptr)) {\n\ | CODE |
| HIGH | utils/codegen_tl1.py | 324 | if (!(is_type_supported(tensor->type) && tensor->backend == GGML_BACKEND_TYPE_CPU && tensor->extra == nullptr)) {\n\ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | gpu/pack_weight.py | 23 | # Create a lookup table for the permutation | COMMENT |
| MEDIUM | gpu/pack_weight.py | 36 | # Create the source indices | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gpu/tokenizer.py | 172 | def _split_whitespaces_or_nonwhitespaces( | CODE |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1029 | def lazy_load_safetensors_file(fp: IO[bytes], path: Path) -> ModelPlus: | CODE |
| LOW | utils/convert-ms-to-gguf-bitnet.py | 1193 | def extract_vocabulary_from_model(self, vocab: Vocab) -> tuple[list[bytes], list[float], list[gguf.TokenType]]: | CODE |
| LOW | utils/convert.py | 955 | def lazy_load_safetensors_file(fp: IO[bytes], path: Path) -> ModelPlus: | CODE |
| LOW | utils/convert.py | 1123 | def extract_vocabulary_from_model(self, vocab: Vocab) -> tuple[list[bytes], list[float], list[gguf.TokenType]]: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gpu/pack_weight.py | 98 | CODE | |
| LOW | gpu/model.py | 162 | CODE | |
| LOW | gpu/model.py | 197 | CODE | |
| LOW | gpu/model.py | 243 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | utils/convert-hf-to-gguf-bitnet.py | 370 | def _set_vocab_gpt2(self) -> None: | CODE |