Repository Analysis

cberner/redb

An embedded key-value database in pure Rust

2.5 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of cberner/redb, a Rust project with 4,655 GitHub stars. SynthScan v2.0 examined 45,242 lines of code across 99 source files, recording 91 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 2.5 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).

2.5
Adjusted Score
2.5
Raw Score
100%
Time Factor
2026-07-13
Last Push
4.7K
Stars
Rust
Language
45.2K
Lines of Code
99
Files
91
Pattern Hits
2026-07-14
Scan Date
0.00
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 0MEDIUM 0LOW 91

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 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 Block38 hits · 38 pts
SeverityFileLineSnippetContext
LOWdeny.toml1# This template contains all of the possible sections and their default valuesCOMMENT
LOWdeny.toml21yanked = "warn"COMMENT
LOWdeny.toml41# List of explictly allowed licensesCOMMENT
LOWdeny.toml61 { allow = ["Unicode-3.0"], name = "unicode-ident", version = "*" }, # Used only by comfy-table in the benchmarksCOMMENT
LOWdeny.toml81 # Each entry is a crate relative path, and the (opaque) hash of its contentsCOMMENT
LOWdeny.toml101multiple-versions = "warn"COMMENT
LOWdeny.toml121]COMMENT
LOWtests/basic_tests.rs2661COMMENT
LOWsrc/transactions.rs1261 #[cfg(feature = "logging")]COMMENT
LOWsrc/transactions.rs1401 ///COMMENT
LOWsrc/transactions.rs1421 ///COMMENT
LOWsrc/transactions.rs1441 /// Enable or disable quick-repair (defaults to disabled)COMMENT
LOWsrc/lib.rs21//! redb is written in pure Rust and is loosely inspired by [lmdb][lmdb]. Data is stored in a collectionCOMMENT
LOWsrc/lib.rs41//! let file = tempfile::NamedTempFile::new().unwrap();COMMENT
LOWsrc/db.rs361 /// Note: these metrics are only collected when the "`cache_metrics`" feature is enabledCOMMENT
LOWsrc/db.rs381/// # fn main() -> Result<(), Error> {COMMENT
LOWsrc/db.rs481/// Multiple reads may be performed concurrently, with each other, and with writes. Only a single writeCOMMENT
LOWsrc/db.rs581 /// Force a check of the integrity of the database file, and repair it if possible.COMMENT
LOWsrc/table.rs141 /// Removes and returns the last key-value pair in the tableCOMMENT
LOWsrc/table.rs161 predicate: F,COMMENT
LOWsrc/table.rs441 /// Returns a double-ended iterator over a range of elements in the tableCOMMENT
LOWsrc/table.rs461 /// table.insert("a", &0)?;COMMENT
LOWsrc/types/chrono_v0_4.rs1//! All of the structures in this module can be serialized to a fixed-width byte array.COMMENT
LOWsrc/tree_store/multimap_btree.rs461/// type (1 byte):COMMENT
LOWsrc/tree_store/btree_base.rs981 .sum();COMMENT
LOWsrc/tree_store/btree_base.rs2001 );COMMENT
LOWsrc/tree_store/btree_cursor.rs481 // operations use the entry before `position`.COMMENT
LOWsrc/tree_store/btree_cursor.rs501 // commit. Every cursor operation re-raises instead of touching the tree,COMMENT
LOWsrc/tree_store/btree_cursor.rs981 // moderate removals packs into full replacements instead of oneCOMMENT
LOWsrc/tree_store/btree_cursor.rs1161 let path = path.into_iter().map(Branch::into_parts).collect();COMMENT
LOWsrc/tree_store/btree_cursor.rs1181 Live(CursorState),COMMENT
LOWsrc/tree_store/page_store/xxh3.rs1// Copyright (c) 2022 Christopher BernerCOMMENT
LOWsrc/tree_store/page_store/header.rs21// Definition of regionCOMMENT
LOWsrc/tree_store/page_store/cached_file.rs201 file: CheckedBackend,COMMENT
LOWsrc/tree_store/page_store/base.rs21pub(crate) const MAX_REGIONS: u32 = 0x0010_0000;COMMENT
LOWsrc/tree_store/page_store/page_manager.rs61pub(crate) enum ShrinkPolicy {COMMENT
LOWsrc/tree_store/page_store/page_manager.rs301 } else {COMMENT
LOWsrc/tree_store/page_store/savepoint.rs1use crate::transaction_tracker::{SavepointId, TransactionId, TransactionTracker};COMMENT
Verbosity Indicators16 hits · 26 pts
SeverityFileLineSnippetContext
LOWtests/integration_tests.rs3201 // Step 1: Insert initial data and commit durablyCOMMENT
LOWtests/integration_tests.rs3209 // Step 2: In a new write transaction, create a savepoint BEFORE any modificationsCOMMENT
LOWtests/integration_tests.rs3213 // Step 3: Open table, insert new data, then close (drop) the table handle.COMMENT
LOWtests/integration_tests.rs3222 // Step 4: Restore the savepoint. This restores the table tree root to theCOMMENT
LOWtests/integration_tests.rs3227 // Step 5: Commit. During commit, flush_table_root_updates() drainsCOMMENT
LOWtests/integration_tests.rs3232 // Step 6: Verify. After restoring the savepoint, keys 2 and 3 should NOT exist.COMMENT
LOWtests/integration_tests.rs3861 // Step 3: Commit an empty transaction. During durable_commit(),COMMENT
LOWtests/integration_tests.rs3867 // Step 4: Insert data into a DIFFERENT table (table_b) so that the allocator reusesCOMMENT
LOWtests/integration_tests.rs3741 // Step 1: Create initial data in the "original" table and commit.COMMENT
LOWtests/integration_tests.rs3753 // Step 2: Modify the table and rename it in the same transaction.COMMENT
LOWtests/integration_tests.rs3775 // Step 3: Reopen and verify data survives and integrity check passes.COMMENT
LOWtests/integration_tests.rs3808 // Step 1: Insert initial data into table_a and commit durably.COMMENT
LOWtests/integration_tests.rs3830 // Step 2: In a new write transaction, create a savepoint, then modify all ofCOMMENT
LOWtests/integration_tests.rs3879 // Step 5: Read table_a. If the bug is present, the original pages have been freedCOMMENT
LOWtests/integration_tests.rs3947 // Step 1: Insert several pages worth of committed data into table_a.COMMENT
LOWtests/integration_tests.rs3964 // Step 2: In a single transaction, create an ephemeral savepoint (which enables allocationCOMMENT
Structural Annotation Overuse16 hits · 26 pts
SeverityFileLineSnippetContext
LOWtests/integration_tests.rs3201 // Step 1: Insert initial data and commit durablyCOMMENT
LOWtests/integration_tests.rs3209 // Step 2: In a new write transaction, create a savepoint BEFORE any modificationsCOMMENT
LOWtests/integration_tests.rs3213 // Step 3: Open table, insert new data, then close (drop) the table handle.COMMENT
LOWtests/integration_tests.rs3222 // Step 4: Restore the savepoint. This restores the table tree root to theCOMMENT
LOWtests/integration_tests.rs3227 // Step 5: Commit. During commit, flush_table_root_updates() drainsCOMMENT
LOWtests/integration_tests.rs3232 // Step 6: Verify. After restoring the savepoint, keys 2 and 3 should NOT exist.COMMENT
LOWtests/integration_tests.rs3861 // Step 3: Commit an empty transaction. During durable_commit(),COMMENT
LOWtests/integration_tests.rs3867 // Step 4: Insert data into a DIFFERENT table (table_b) so that the allocator reusesCOMMENT
LOWtests/integration_tests.rs3741 // Step 1: Create initial data in the "original" table and commit.COMMENT
LOWtests/integration_tests.rs3753 // Step 2: Modify the table and rename it in the same transaction.COMMENT
LOWtests/integration_tests.rs3775 // Step 3: Reopen and verify data survives and integrity check passes.COMMENT
LOWtests/integration_tests.rs3808 // Step 1: Insert initial data into table_a and commit durably.COMMENT
LOWtests/integration_tests.rs3830 // Step 2: In a new write transaction, create a savepoint, then modify all ofCOMMENT
LOWtests/integration_tests.rs3879 // Step 5: Read table_a. If the bug is present, the original pages have been freedCOMMENT
LOWtests/integration_tests.rs3947 // Step 1: Insert several pages worth of committed data into table_a.COMMENT
LOWtests/integration_tests.rs3964 // Step 2: In a single transaction, create an ephemeral savepoint (which enables allocationCOMMENT
Hyper-Verbose Identifiers14 hits · 18 pts
SeverityFileLineSnippetContext
LOWcrates/redb-python/test/test_multiprocess.py42def test_concurrent_read_only_opens(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_multiprocess.py46def test_second_writer_is_rejected(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_multiprocess.py50def test_reader_sees_consistent_snapshot(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_multiprocess.py54def test_lock_released_after_writer_crash(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_database_create.py14def test_create_new_database_creates_file(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_database_create.py20def test_create_on_non_database_file_raises_error(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_database_create.py61def test_create_then_reopen_arbitrary_filenames(tmp_path_factory, name: str) -> None:CODE
LOWcrates/redb-python/test/test_transactions.py27def test_completed_transaction_releases_database(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_transactions.py40def test_drop_unfinalized_transaction_does_not_deadlock(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_transactions.py49def test_transaction_outlives_anonymous_database(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_transactions.py58def test_reentering_finalized_transaction_raises(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_transactions.py71def test_nested_with_block_raises(tmp_db_path: Path) -> None:CODE
LOWcrates/redb-python/test/test_transactions.py84def test_sequential_transactions(tmp_path_factory, commits: list) -> None:CODE
LOWcrates/redb-python/test/test_transactions.py97def test_context_manager_aborts_on_exception(tmp_db_path: Path) -> None:CODE
Unused Imports6 hits · 6 pts
SeverityFileLineSnippetContext
LOWcrates/redb-python/test/conftest.py1CODE
LOWcrates/redb-python/test/test_multiprocess.py3CODE
LOWcrates/redb-python/test/test_smoke.py2CODE
LOWcrates/redb-python/test/test_database_create.py3CODE
LOWcrates/redb-python/test/test_transactions.py3CODE
LOWcrates/redb-python/test/test_properties.py8CODE
Deep Nesting1 hit · 1 pts
SeverityFileLineSnippetContext
LOWcrates/redb-python/test/test_transactions.py84CODE