Repository Analysis

lz4/lz4

Extremely Fast Compression algorithm

3.0 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of lz4/lz4, a C project with 11,929 GitHub stars. SynthScan v2.0 examined 34,975 lines of code across 130 source files, recording 91 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 3.0 places this repository in the Likely human-written 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).

3.0
Adjusted Score
3.0
Raw Score
100%
Time Factor
2026-07-01
Last Push
11.9K
Stars
C
Language
35.0K
Lines of Code
130
Files
91
Pattern Hits
2026-07-14
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 0HIGH 1MEDIUM 3LOW 87

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 91 distinct pattern matches across 7 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 Block52 hits · 52 pts
SeverityFileLineSnippetContext
LOWtests/check_stdvars.sh1#!/usr/bin/env shCOMMENT
LOWtests/test-lz4-speed.py1#!/usr/bin/env python3COMMENT
LOWtests/fuzzer.c41# undef _GNU_SOURCE /* in case it's already defined */COMMENT
LOWtests/fuzzer.c81#define FUZ_MAX_DICT_SIZE (1 << 15)COMMENT
LOWtests/abiTest.c21#include <stdlib.h> /* malloc, free, exit */COMMENT
LOWtests/frametest.c41#include <string.h> /* strcmp */COMMENT
LOWtests/fullbench.c41#include <sys/stat.h> /* stat64 */COMMENT
LOWtests/freestanding.c1// Basic test for LZ4_FREESTANDINGCOMMENT
LOWtests/roundTripTest.c21* Tuning ConstantCOMMENT
LOWtests/checkFrame.c41#include <string.h> /* strcmp */COMMENT
LOWprograms/lz4io.c41# define _POSIX_SOURCE 1 /* disable %llu warnings with MinGW on Windows */COMMENT
LOWprograms/lz4io.c61#define LZ4F_STATIC_LINKING_ONLYCOMMENT
LOWprograms/lz4io.c81#define LZ4IO_SKIPPABLE0 0x184D2A50COMMENT
LOWprograms/util.h21#define UTIL_H_MODULECOMMENT
LOWprograms/util.h41# include <sys/utime.h> /* utime */COMMENT
LOWprograms/util.h101******************************************/COMMENT
LOWprograms/util.h121# endifCOMMENT
LOWprograms/util.h141# define UTIL_STAT_MODE_ISREG(st_mode) ((st_mode) & S_IFREG)COMMENT
LOWprograms/util.h161***************************************/COMMENT
LOWprograms/lz4cli.c41COMMENT
LOWprograms/lz4cli.c61# define IO_MT "multithread"COMMENT
LOWprograms/bench.c41#include <string.h> /* memset */COMMENT
LOWprograms/bench.c61#ifndef LZ4_GIT_COMMIT_STRINGCOMMENT
LOWprograms/platform.h61/* *********************************************************COMMENT
LOWprograms/platform.h81* PLATFORM_POSIX_VERSION >= 1 is equal to found _POSIX_VERSIONCOMMENT
LOWprograms/platform.h101# endifCOMMENT
LOWprograms/platform.h141# define SET_SPARSE_FILE_MODE(file) { DWORD dw; DeviceIoControl((HANDLE) _get_osfhandle(_fileno(file)), FSCTL_SET_SPACOMMENT
LOWexamples/blockStreaming_lineByLine.c1// LZ4 streaming API example : line-by-line logfile compressionCOMMENT
LOWexamples/bench_functions.c61COMMENT
LOWexamples/bench_functions.c161 run_screaming("Couldn't run LZ4_compress_fast_extState()... error code received is in exit code.", rv);COMMENT
LOWexamples/blockStreaming_doubleBuffer.c1// LZ4 streaming API example : double bufferCOMMENT
LOWexamples/dictionaryRandomAccess.c1// LZ4 API example : Dictionary Random AccessCOMMENT
LOWlib/xxhash.h121 * Note that no change is required within the calling program as long as it includes `xxhash.h` :COMMENT
LOWlib/lz4frame.c61#ifndef LZ4F_HEAPMODECOMMENT
LOWlib/lz4frame.c141* DebugCOMMENT
LOWlib/lz4.h81* Enable exporting of functions when building a Windows DLLCOMMENT
LOWlib/lz4.h121# endifCOMMENT
LOWlib/lz4.h781 * Deprecated functions make the compiler generate a warning when invoked.COMMENT
LOWlib/xxhash.c121* Compiler Specific OptionsCOMMENT
LOWlib/xxhash.c181#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */COMMENT
LOWlib/lz4.c121/*-************************************COMMENT
LOWlib/lz4.c161 * of LZ4_wildCopy8 does not affect the compression speed.COMMENT
LOWlib/lz4.c221# define ALLOC(s) LZ4_malloc(s)COMMENT
LOWlib/lz4.c241* Common ConstantsCOMMENT
LOWlib/lz4.c261#define ML_BITS 4COMMENT
LOWlib/lz4.c341 * LZ4 relies on memcpy with a constant size being inlined. In freestandingCOMMENT
LOWlib/lz4frame.h81# define LZ4FLIB_API __declspec(dllexport) LZ4FLIB_VISIBILITYCOMMENT
LOWdoc/lz4_manual.html601# if defined (__cplusplus) && (__cplusplus >= 201402) </b>/* C++14 or greater */<b>COMMENT
LOWossfuzz/fuzz_helpers.h21#include <stdio.h>COMMENT
LOWossfuzz/fuzz_helpers.h41 */COMMENT
LOW.circleci/config.yml1# This configuration was automatically generated from a CircleCI 1.0 config.COMMENT
LOW.circleci/config.yml21 CIRCLE_ARTIFACTS: /tmp/circleci-artifactsCOMMENT
Fake / Example Data26 hits · 32 pts
SeverityFileLineSnippetContext
LOWtests/loremOut.h2 loremOut.h - lorem ipsum generator to stdoutCODE
LOWtests/loremOut.h28 * Generate @size bytes of compressible data using lorem ipsum generator into stdout.COMMENT
LOWtests/decompress-partial-usingDict.c8 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n"CODE
LOWtests/decompress-partial-usingDict.c8 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n"CODE
LOWtests/decompress-partial-usingDict.c21 "porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,\n"CODE
LOWtests/decompress-partial-usingDict.c21 "porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,\n"CODE
LOWtests/decompress-partial.c6 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n"CODE
LOWtests/decompress-partial.c6 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n"CODE
LOWtests/decompress-partial.c19 "porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,\n"CODE
LOWtests/decompress-partial.c19 "porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,\n"CODE
LOWtests/loremOut.c2 lorem.c - lorem ipsum generator to stdoutCODE
LOWtests/loremOut.c27 * Generates a stream of Lorem ipsum paragraphs to stdout,COMMENT
LOWprograms/lorem.h2 lorem.h - lorem ipsum generatorCODE
LOWprograms/lorem.h31 * Generate @size bytes of compressible data using lorem ipsum generatorCOMMENT
LOWprograms/README.md59When no file is provided, uses an internal Lorem Ipsum generator instead.CODE
LOWprograms/lorem.c2 lorem.c - lorem ipsum generatorCODE
LOWprograms/lorem.c28 * This is a very simple lorem ipsum generatorCOMMENT
LOWprograms/lorem.c35 * The resulting compression / ratio curve of the lorem ipsum generatorCOMMENT
LOWprograms/lorem.c40 * The compression ratio achievable on the generated lorem ipsumCOMMENT
LOWprograms/lorem.c319/* It's "common" for lorem ipsum generators to start with the same firstCOMMENT
LOWprograms/bench.c771 "Lorem ipsum",CODE
LOWexamples/bench_functions.c238 * Test suite A) Uses generic Lorem Ipsum text which should be generally compressible insomuch as basic human text isCOMMENT
LOWexamples/bench_functions.c253 const char src[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus purus et risus vulputate, eCODE
LOWexamples/bench_functions.c253 const char src[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus purus et risus vulputate, eCODE
LOWexamples/simple_buffer.c41 const char* const src = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor site amat.";CODE
LOWexamples/simple_buffer.c41 const char* const src = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor site amat.";CODE
Excessive Try-Catch Wrapping5 hits · 8 pts
SeverityFileLineSnippetContext
LOWtests/test-lz4-speed.py71 except Exception:CODE
LOWtests/test-lz4-speed.py343 except Exception as e:CODE
MEDIUMtests/test-lz4-speed.py68def does_command_exist(command):CODE
MEDIUMtests/test-lz4-abi.py48 print('Error Code:', s.poll())CODE
MEDIUMtests/test-lz4-versions.py53 print('Error Code:', s.poll())CODE
Cross-Language Confusion1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHtests/test-lz4-speed.py209 'make clean && CPPFLAGS="-DLZ4_GIT_COMMIT=%s" make -C programs lz4 lz4c32 ' % version)CODE
Unused Imports4 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/test-lz4-speed.py18CODE
LOWtests/test-lz4-abi.py11CODE
LOWtests/test-lz4-abi.py13CODE
LOWtests/test-lz4-abi.py15CODE
Deep Nesting2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/test-lz4-list.py65CODE
LOWtests/test-lz4-list.py117CODE
Hyper-Verbose Identifiers1 hit · 1 pts
SeverityFileLineSnippetContext
LOWtests/test-lz4-speed.py89def send_email_with_attachments(branch, commit, last_commit, args, text, results_files,CODE