An embedded key-value database in pure Rust
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).
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.
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.
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.
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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deny.toml | 1 | # This template contains all of the possible sections and their default values | COMMENT |
| LOW | deny.toml | 21 | yanked = "warn" | COMMENT |
| LOW | deny.toml | 41 | # List of explictly allowed licenses | COMMENT |
| LOW | deny.toml | 61 | { allow = ["Unicode-3.0"], name = "unicode-ident", version = "*" }, # Used only by comfy-table in the benchmarks | COMMENT |
| LOW | deny.toml | 81 | # Each entry is a crate relative path, and the (opaque) hash of its contents | COMMENT |
| LOW | deny.toml | 101 | multiple-versions = "warn" | COMMENT |
| LOW | deny.toml | 121 | ] | COMMENT |
| LOW | tests/basic_tests.rs | 2661 | COMMENT | |
| LOW | src/transactions.rs | 1261 | #[cfg(feature = "logging")] | COMMENT |
| LOW | src/transactions.rs | 1401 | /// | COMMENT |
| LOW | src/transactions.rs | 1421 | /// | COMMENT |
| LOW | src/transactions.rs | 1441 | /// Enable or disable quick-repair (defaults to disabled) | COMMENT |
| LOW | src/lib.rs | 21 | //! redb is written in pure Rust and is loosely inspired by [lmdb][lmdb]. Data is stored in a collection | COMMENT |
| LOW | src/lib.rs | 41 | //! let file = tempfile::NamedTempFile::new().unwrap(); | COMMENT |
| LOW | src/db.rs | 361 | /// Note: these metrics are only collected when the "`cache_metrics`" feature is enabled | COMMENT |
| LOW | src/db.rs | 381 | /// # fn main() -> Result<(), Error> { | COMMENT |
| LOW | src/db.rs | 481 | /// Multiple reads may be performed concurrently, with each other, and with writes. Only a single write | COMMENT |
| LOW | src/db.rs | 581 | /// Force a check of the integrity of the database file, and repair it if possible. | COMMENT |
| LOW | src/table.rs | 141 | /// Removes and returns the last key-value pair in the table | COMMENT |
| LOW | src/table.rs | 161 | predicate: F, | COMMENT |
| LOW | src/table.rs | 441 | /// Returns a double-ended iterator over a range of elements in the table | COMMENT |
| LOW | src/table.rs | 461 | /// table.insert("a", &0)?; | COMMENT |
| LOW | src/types/chrono_v0_4.rs | 1 | //! All of the structures in this module can be serialized to a fixed-width byte array. | COMMENT |
| LOW | src/tree_store/multimap_btree.rs | 461 | /// type (1 byte): | COMMENT |
| LOW | src/tree_store/btree_base.rs | 981 | .sum(); | COMMENT |
| LOW | src/tree_store/btree_base.rs | 2001 | ); | COMMENT |
| LOW | src/tree_store/btree_cursor.rs | 481 | // operations use the entry before `position`. | COMMENT |
| LOW | src/tree_store/btree_cursor.rs | 501 | // commit. Every cursor operation re-raises instead of touching the tree, | COMMENT |
| LOW | src/tree_store/btree_cursor.rs | 981 | // moderate removals packs into full replacements instead of one | COMMENT |
| LOW | src/tree_store/btree_cursor.rs | 1161 | let path = path.into_iter().map(Branch::into_parts).collect(); | COMMENT |
| LOW | src/tree_store/btree_cursor.rs | 1181 | Live(CursorState), | COMMENT |
| LOW | src/tree_store/page_store/xxh3.rs | 1 | // Copyright (c) 2022 Christopher Berner | COMMENT |
| LOW | src/tree_store/page_store/header.rs | 21 | // Definition of region | COMMENT |
| LOW | src/tree_store/page_store/cached_file.rs | 201 | file: CheckedBackend, | COMMENT |
| LOW | src/tree_store/page_store/base.rs | 21 | pub(crate) const MAX_REGIONS: u32 = 0x0010_0000; | COMMENT |
| LOW | src/tree_store/page_store/page_manager.rs | 61 | pub(crate) enum ShrinkPolicy { | COMMENT |
| LOW | src/tree_store/page_store/page_manager.rs | 301 | } else { | COMMENT |
| LOW | src/tree_store/page_store/savepoint.rs | 1 | use crate::transaction_tracker::{SavepointId, TransactionId, TransactionTracker}; | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/integration_tests.rs | 3201 | // Step 1: Insert initial data and commit durably | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3209 | // Step 2: In a new write transaction, create a savepoint BEFORE any modifications | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3213 | // Step 3: Open table, insert new data, then close (drop) the table handle. | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3222 | // Step 4: Restore the savepoint. This restores the table tree root to the | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3227 | // Step 5: Commit. During commit, flush_table_root_updates() drains | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3232 | // Step 6: Verify. After restoring the savepoint, keys 2 and 3 should NOT exist. | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3861 | // Step 3: Commit an empty transaction. During durable_commit(), | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3867 | // Step 4: Insert data into a DIFFERENT table (table_b) so that the allocator reuses | COMMENT |
| LOW | tests/integration_tests.rs | 3741 | // Step 1: Create initial data in the "original" table and commit. | COMMENT |
| LOW | tests/integration_tests.rs | 3753 | // Step 2: Modify the table and rename it in the same transaction. | COMMENT |
| LOW | tests/integration_tests.rs | 3775 | // Step 3: Reopen and verify data survives and integrity check passes. | COMMENT |
| LOW | tests/integration_tests.rs | 3808 | // Step 1: Insert initial data into table_a and commit durably. | COMMENT |
| LOW | tests/integration_tests.rs | 3830 | // Step 2: In a new write transaction, create a savepoint, then modify all of | COMMENT |
| LOW | tests/integration_tests.rs | 3879 | // Step 5: Read table_a. If the bug is present, the original pages have been freed | COMMENT |
| LOW | tests/integration_tests.rs | 3947 | // Step 1: Insert several pages worth of committed data into table_a. | COMMENT |
| LOW | tests/integration_tests.rs | 3964 | // Step 2: In a single transaction, create an ephemeral savepoint (which enables allocation | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/integration_tests.rs | 3201 | // Step 1: Insert initial data and commit durably | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3209 | // Step 2: In a new write transaction, create a savepoint BEFORE any modifications | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3213 | // Step 3: Open table, insert new data, then close (drop) the table handle. | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3222 | // Step 4: Restore the savepoint. This restores the table tree root to the | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3227 | // Step 5: Commit. During commit, flush_table_root_updates() drains | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3232 | // Step 6: Verify. After restoring the savepoint, keys 2 and 3 should NOT exist. | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3861 | // Step 3: Commit an empty transaction. During durable_commit(), | COMMENT |
| LOW⚡ | tests/integration_tests.rs | 3867 | // Step 4: Insert data into a DIFFERENT table (table_b) so that the allocator reuses | COMMENT |
| LOW | tests/integration_tests.rs | 3741 | // Step 1: Create initial data in the "original" table and commit. | COMMENT |
| LOW | tests/integration_tests.rs | 3753 | // Step 2: Modify the table and rename it in the same transaction. | COMMENT |
| LOW | tests/integration_tests.rs | 3775 | // Step 3: Reopen and verify data survives and integrity check passes. | COMMENT |
| LOW | tests/integration_tests.rs | 3808 | // Step 1: Insert initial data into table_a and commit durably. | COMMENT |
| LOW | tests/integration_tests.rs | 3830 | // Step 2: In a new write transaction, create a savepoint, then modify all of | COMMENT |
| LOW | tests/integration_tests.rs | 3879 | // Step 5: Read table_a. If the bug is present, the original pages have been freed | COMMENT |
| LOW | tests/integration_tests.rs | 3947 | // Step 1: Insert several pages worth of committed data into table_a. | COMMENT |
| LOW | tests/integration_tests.rs | 3964 | // Step 2: In a single transaction, create an ephemeral savepoint (which enables allocation | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | crates/redb-python/test/test_multiprocess.py | 42 | def test_concurrent_read_only_opens(tmp_db_path: Path) -> None: | CODE |
| LOW⚡ | crates/redb-python/test/test_multiprocess.py | 46 | def test_second_writer_is_rejected(tmp_db_path: Path) -> None: | CODE |
| LOW⚡ | crates/redb-python/test/test_multiprocess.py | 50 | def test_reader_sees_consistent_snapshot(tmp_db_path: Path) -> None: | CODE |
| LOW⚡ | crates/redb-python/test/test_multiprocess.py | 54 | def test_lock_released_after_writer_crash(tmp_db_path: Path) -> None: | CODE |
| LOW | crates/redb-python/test/test_database_create.py | 14 | def test_create_new_database_creates_file(tmp_db_path: Path) -> None: | CODE |
| LOW | crates/redb-python/test/test_database_create.py | 20 | def test_create_on_non_database_file_raises_error(tmp_db_path: Path) -> None: | CODE |
| LOW | crates/redb-python/test/test_database_create.py | 61 | def test_create_then_reopen_arbitrary_filenames(tmp_path_factory, name: str) -> None: | CODE |
| LOW | crates/redb-python/test/test_transactions.py | 27 | def test_completed_transaction_releases_database(tmp_db_path: Path) -> None: | CODE |
| LOW⚡ | crates/redb-python/test/test_transactions.py | 40 | def test_drop_unfinalized_transaction_does_not_deadlock(tmp_db_path: Path) -> None: | CODE |
| LOW⚡ | crates/redb-python/test/test_transactions.py | 49 | def test_transaction_outlives_anonymous_database(tmp_db_path: Path) -> None: | CODE |
| LOW⚡ | crates/redb-python/test/test_transactions.py | 58 | def test_reentering_finalized_transaction_raises(tmp_db_path: Path) -> None: | CODE |
| LOW | crates/redb-python/test/test_transactions.py | 71 | def test_nested_with_block_raises(tmp_db_path: Path) -> None: | CODE |
| LOW | crates/redb-python/test/test_transactions.py | 84 | def test_sequential_transactions(tmp_path_factory, commits: list) -> None: | CODE |
| LOW | crates/redb-python/test/test_transactions.py | 97 | def test_context_manager_aborts_on_exception(tmp_db_path: Path) -> None: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/redb-python/test/conftest.py | 1 | CODE | |
| LOW | crates/redb-python/test/test_multiprocess.py | 3 | CODE | |
| LOW | crates/redb-python/test/test_smoke.py | 2 | CODE | |
| LOW | crates/redb-python/test/test_database_create.py | 3 | CODE | |
| LOW | crates/redb-python/test/test_transactions.py | 3 | CODE | |
| LOW | crates/redb-python/test/test_properties.py | 8 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/redb-python/test/test_transactions.py | 84 | CODE |