Repository Analysis

microsoft/mimalloc

mimalloc is a compact general purpose allocator with excellent performance.

5.9 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of microsoft/mimalloc, a C project with 13,333 GitHub stars. SynthScan v2.0 examined 54,078 lines of code across 256 source files, recording 246 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 5.9 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

5.9
Adjusted Score
5.9
Raw Score
100%
Time Factor
2026-08-28
Last Push
13.3K
Stars
C
Language
54.1K
Lines of Code
256
Files
246
Pattern Hits
2026-08-29
Scan Date
0.01
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 2HIGH 0MEDIUM 34LOW 210

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 246 distinct pattern matches across 6 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Over-Commented Block209 hits · 188 pts
SeverityFileLineSnippetContext
LOWtest/main-override.cpp1#include <stdlib.h>COMMENT
LOWtest/test-stress.c21#include <stdbool.h>COMMENT
LOWtest/test-stress.c81COMMENT
LOWtest/test-stress.c101#define custom_free(p) mi_free(p)COMMENT
LOWtest/test-stress.c441COMMENT
LOWtest/main-static.cpp1#include <stdlib.h>COMMENT
LOWtest/main-override-static.c41 mi_stats_reset();COMMENT
LOWtest/main-override-static.c341#endifCOMMENT
LOWtest/test-api.c21we therefore test the API over various inputs. Please add more tests :-)COMMENT
LOWtest/test-api.c501COMMENT
LOWinclude/mimalloc.h1/* ----------------------------------------------------------------------------COMMENT
LOWinclude/mimalloc.h21 #define mi_attr_noexcept throw()COMMENT
LOWinclude/mimalloc.h41 #define mi_decl_exportCOMMENT
LOWinclude/mimalloc.h61 #define mi_attr_alloc_align(p)COMMENT
LOWinclude/mimalloc.h81 #define mi_attr_alloc_size2(s1,s2) __attribute__((alloc_size(s1,s2)))COMMENT
LOWinclude/mimalloc.h161// ------------------------------------------------------COMMENT
LOWinclude/mimalloc.h581#ifdef __cplusplusCOMMENT
LOWinclude/mimalloc-stats.h1/* ----------------------------------------------------------------------------COMMENT
LOWinclude/mimalloc-override.h21#define malloc(n) mi_malloc(n)COMMENT
LOWinclude/mimalloc-override.h41COMMENT
LOWinclude/mimalloc-override.h61#define _aligned_recalloc(p,c,n,a) mi_aligned_recalloc(p,c,n,a)COMMENT
LOWinclude/mimalloc-new-delete.h1/* ----------------------------------------------------------------------------COMMENT
LOWinclude/mimalloc-new-delete.h21#if defined(__cplusplus)COMMENT
LOWinclude/mimalloc/internal.h21// --------------------------------------------------------------------------COMMENT
LOWinclude/mimalloc/internal.h41#define mi_decl_hiddenCOMMENT
LOWinclude/mimalloc/internal.h61#define mi_decl_coldCOMMENT
LOWinclude/mimalloc/internal.h81#if defined(__GNUC__) || defined(__clang__)COMMENT
LOWinclude/mimalloc/internal.h101#define __has_builtin(x) 0COMMENT
LOWinclude/mimalloc/internal.h341COMMENT
LOWinclude/mimalloc/internal.h381void __mi_stat_adjust_increase_mt(mi_stat_count_t* stat, size_t amount);COMMENT
LOWinclude/mimalloc/internal.h401#define mi_theap_stat_increase(theap,stat,amount) __mi_stat_increase( &(theap)->stats.stat, amount)COMMENT
LOWinclude/mimalloc/internal.h481COMMENT
LOWinclude/mimalloc/internal.h701 return (valid ? page : NULL);COMMENT
LOWinclude/mimalloc/types.h1/* ----------------------------------------------------------------------------COMMENT
LOWinclude/mimalloc/types.h21// mi_tld_t : thread local dataCOMMENT
LOWinclude/mimalloc/types.h41COMMENT
LOWinclude/mimalloc/types.h61// #define MI_SECURE 4 // same as level 3 for now (`-DMI_SECURE=ON`)COMMENT
LOWinclude/mimalloc/types.h81#ifndef MI_STATCOMMENT
LOWinclude/mimalloc/types.h101#if !defined(MI_PADDING_CHECK_BYTES) && MI_PADDING && (MI_SECURE>=5 || MI_DEBUG>=1)COMMENT
LOWinclude/mimalloc/types.h121#endifCOMMENT
LOWinclude/mimalloc/types.h141// We can choose to page meta info aligned at the start of every MI_PAGE_META_ALIGNED_CHUNKSCOMMENT
LOWinclude/mimalloc/types.h161#if !MI_PAGE_META_IS_ALIGNEDCOMMENT
LOWinclude/mimalloc/types.h181#endifCOMMENT
LOWinclude/mimalloc/types.h201COMMENT
LOWinclude/mimalloc/types.h221#define MI_ARENA_MAX_CHUNK_OBJ_SIZE (MI_ARENA_MAX_CHUNK_OBJ_SLICES * MI_ARENA_SLICE_SIZE)COMMENT
LOWinclude/mimalloc/types.h241COMMENT
LOWinclude/mimalloc/types.h261typedef struct mi_arena_s mi_arena_t; // defined belowCOMMENT
LOWinclude/mimalloc/types.h381// and 4 for abandoned & mapped threads -- abandoned-mapped pages are abandoned but also mappedCOMMENT
LOWinclude/mimalloc/types.h401// `local_free` for freed blocks that are not yet available to `mi_malloc`COMMENT
LOWinclude/mimalloc/types.h461// ------------------------------------------------------COMMENT
LOWinclude/mimalloc/types.h481#error "mimalloc internal: define more bins"COMMENT
LOWinclude/mimalloc/types.h501 MI_PAGE_MEDIUM, // medium blocks go into 512KiB pagesCOMMENT
LOWinclude/mimalloc/types.h761COMMENT
LOWinclude/mimalloc/types.h781#ifndef EOVERFLOW // count*size overflowCOMMENT
LOWinclude/mimalloc/track.h41 #define mi_track_mem_undefined(p,size)COMMENT
LOWinclude/mimalloc/track.h61#define mi_track_mem_noaccess(p,size) VALGRIND_MAKE_MEM_NOACCESS(p,size)COMMENT
LOWinclude/mimalloc/track.h81#define MI_TRACK_ENABLED 1COMMENT
LOWinclude/mimalloc/track.h101COMMENT
LOWinclude/mimalloc/track.h121#endifCOMMENT
LOWinclude/mimalloc/prim-tls.h1/* ----------------------------------------------------------------------------COMMENT
149 more matches not shown…
Decorative Section Separators32 hits · 102 pts
SeverityFileLineSnippetContext
MEDIUMCMakeLists.txt135# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt137# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt198# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt200# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt224# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt226# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt740# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt742# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt807# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt809# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt945# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt947# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt1011# -----------------------------------------------------------------------------COMMENT
MEDIUMCMakeLists.txt1013# -----------------------------------------------------------------------------COMMENT
MEDIUMazure-pipelines.yml194# ----------------------------------------------------------COMMENT
MEDIUMazure-pipelines.yml196# ----------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh3#-----------------------------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh5#-----------------------------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh12#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh14#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh36#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh38#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh52#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh54#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh87#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh89#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh121#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh123#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh152#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh154#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh209#---------------------------------------------------------COMMENT
MEDIUMbin/bundle.sh211#---------------------------------------------------------COMMENT
Hallucination Indicators2 hits · 20 pts
SeverityFileLineSnippetContext
CRITICALdocs/jquery.js2!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):fCODE
CRITICALdocs/jquery.js8!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(y){"use strict"CODE
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/release.yaml46 # Create a release: https://github.com/softprops/action-gh-release (MIT license)COMMENT
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMsrc/prim/osx/alloc-override-zone.c433// it seems less robust than using interpose.COMMENT
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/options.c620// TODO: implement ourselves to reduce dependencies on the C runtimeCOMMENT