Repository Analysis

cockroachdb/pebble

RocksDB/LevelDB inspired key-value database in Go

5.8 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of cockroachdb/pebble, a Go project with 5,955 GitHub stars. SynthScan v2.0 examined 277,249 lines of code across 852 source files, recording 1402 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 5.8 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.8
Adjusted Score
5.8
Raw Score
100%
Time Factor
2026-07-14
Last Push
6.0K
Stars
Go
Language
277.2K
Lines of Code
852
Files
1.4K
Pattern Hits
2026-07-14
Scan Date
0.03
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 25HIGH 0MEDIUM 10LOW 1367

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 1402 distinct pattern matches across 9 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 Block1331 hits · 1263 pts
SeverityFileLineSnippetContext
LOWblob_rewrite.go81// rewrites a blob file without rewriting sstables. When the compactionCOMMENT
LOWrange_keys.go61 }COMMENT
LOWrange_keys.go121func containsAnyRangeKeys(iter manifest.LevelIterator) bool {COMMENT
LOWrange_keys.go141// RangeKeyMasking.Suffix, it acts as a mask.COMMENT
LOWrange_keys.go161//COMMENT
LOWrange_keys.go181// IterOptions.RangeKeyMasking field has an optional Filter option. This FilterCOMMENT
LOWrange_keys.go201// property filter interface with two new methods: KeyIsWithinLowerBound andCOMMENT
LOWrange_keys.go221// block property filter indicates that it does NOT intersect, the filter'sCOMMENT
LOWrange_keys.go301// iteration. Whenever a point key is covered by a non-empty Span, theCOMMENT
LOWrange_keys.go321// s 8 | • l@8COMMENT
LOWrange_keys.go361 return falseCOMMENT
LOWrange_keys.go381//COMMENT
LOWrange_keys.go421func (m *rangeKeyMasking) KeyIsWithinLowerBound(key []byte) bool {COMMENT
LOWrange_keys.go441// lazyCombinedIter implements the internalIterator interface, wrapping aCOMMENT
LOWrange_keys.go461// When one is discovered, they set triggered=true and key to the smallestCOMMENT
LOWrange_keys.go481 c.triggered = trueCOMMENT
LOWrange_keys.go521 // switch to combined iteration was itself a seek, and we can use that key.COMMENT
LOWrange_keys.go541 // L6: 000001:[bar.SET.2] 000002:[bax.RANGEKEYSET.8]COMMENT
LOWrange_keys.go581 // iterator that's now initialized with our current state.COMMENT
LOWcheckpoint.go21COMMENT
LOWcheckpoint.go41// performed with Sync = false. Otherwise, the guarantee will already be met.COMMENT
LOWcheckpoint.go201 virtualBackingFiles := make(map[base.DiskFileNum]struct{})COMMENT
LOWrecovery.go241 FileNum: base.DiskFileNum(w.Num),COMMENT
LOWrecovery.go361 if ve.NextFileNum != 0 {COMMENT
LOWrecovery.go441// guaranteed to be flushed when a flush is scheduled after this method is run.COMMENT
LOWrecovery.go541 // Otherwise, the reader surfaces record.ErrUnexpectedEOF indicatingCOMMENT
LOWtable_stats.go21 "github.com/cockroachdb/pebble/sstable/block"COMMENT
LOWtable_stats.go41// so a completing job triggers a new job if necessary. Only one job runs at aCOMMENT
LOWtable_stats.go441 // If the table is in the last level of the LSM, there is no dataCOMMENT
LOWtable_stats.go461 // deletion is ingested into L5 and subsequently compacted into L6 butCOMMENT
LOWtable_stats.go621 // FileSize RawValueSizeCOMMENT
LOWtable_stats.go641}COMMENT
LOWtable_stats.go661func (d *DB) examineTablesBeneathTombstones(COMMENT
LOWtable_stats.go681 // Determine whether we need to update size estimates andCOMMENT
LOWtable_stats.go821}COMMENT
LOWtable_stats.go861 return 0COMMENT
LOWtable_stats.go881 // point tombstone on average covers 1 key and using average value sizes.COMMENT
LOWtable_stats.go921 // The shadowed keys have the same exact user keys as the tombstonesCOMMENT
LOWtable_stats.go941 return uint64((tombstonesLogicalSize + shadowedLogicalSize) * compressionRatio)COMMENT
LOWtable_stats.go961// of both range deletions and range key deletions.COMMENT
LOWtable_stats.go981// |--------| |-------| RANGEKEYDELCOMMENT
LOWtable_stats.go1061 mIter.Init(comparer, transform, new(keyspanimpl.MergingBuffers))COMMENT
LOWtable_stats.go1081 // SSTables" where the table metadata's effective bounds can again beCOMMENT
LOWingest_test.go2881COMMENT
LOWingest_test.go2901 time.Sleep(100 * time.Millisecond)COMMENT
LOWmerging_iter_v2_slab.go21// merging iterator.COMMENT
LOWmerging_iter_v2_slab.go41}COMMENT
LOWevent.go281 // JobID is the ID of the compaction job.COMMENT
LOWevent.go381 JobID intCOMMENT
LOWevent.go621 }COMMENT
LOWevent.go861 // SINGLEDEL and delete an arbitrary subset of data below that SINGLEDEL.COMMENT
LOWevent.go881 // ways some of these keys can first meet in a compaction.COMMENT
LOWevent.go901 // SET g#40 in L2COMMENT
LOWevent.go921 // violation callback. This example doesn't need multi-level compactions:COMMENT
LOWevent.go981COMMENT
LOWcompaction_value_separation.go181 // existing references.COMMENT
LOWlevel_iter_v2.go21// levelIterV2 provides a merged view of the sstables in a level.COMMENT
LOWlevel_iter_v2.go41//COMMENT
LOWlevel_iter_v2.go61// potentially spurious: it does not necessarily correspond to a change in rangeCOMMENT
LOWlevel_iter_v2.go81 // tableOpts.{Lower,Upper}Bound are nil, the corresponding iteration boundaryCOMMENT
1271 more matches not shown…
Hallucination Indicators25 hits · 250 pts
SeverityFileLineSnippetContext
CRITICALcheckpoint.go202 for backing := range d.mu.versions.latest.virtualBackings.All() {CODE
CRITICALcheckpoint.go205 versionBlobFiles := d.mu.versions.latest.blobFiles.Metadatas()CODE
CRITICALdb.go2312 backingStats := d.mu.versions.latest.virtualBackings.Stats()CODE
CRITICALdb.go2313 blobStats, _ := d.mu.versions.latest.blobFiles.Stats()CODE
CRITICALdb.go2748 l0ReadAmp := d.mu.versions.latest.l0Organizer.ReadAmplification()CODE
CRITICALdb.go2938 if err := d.mu.log.metrics.LogWriterMetrics.Merge(&metrics); err != nil {CODE
CRITICALingest.go1034 if backing, ok := d.mu.versions.latest.virtualBackings.Get(n); ok {CODE
CRITICALingest.go1037 d.mu.versions.latest.virtualBackings.Protect(n)CODE
CRITICALingest.go1062 d.mu.versions.latest.virtualBackings.Unprotect(meta.TableBacking.DiskFileNum)CODE
CRITICALcheckpoint_test.go160 fileNums := d.mu.versions.latest.virtualBackings.DiskFileNums()CODE
CRITICALcompaction_test.go1195 s := d.mu.versions.latest.virtualBackings.String()CODE
CRITICALcompaction.go396 if err := d.mu.versions.latest.l0Organizer.UpdateStateForStartedCompaction(l0Inputs, isBase); err != nil {CODE
CRITICALcompaction.go1354 d.mu.versions.latest.l0Organizer.InitCompactingFileInfo(l0InProgress)CODE
CRITICALiterator.go2529 i.readState.db.mu.compact.readCompactions.combine(&i.readSampling.pendingCompactions, i.cmp)CODE
CRITICALsnapshot.go97 s.db.mu.compact.wideTombstones.UpdateWithEarliestSnapshot(e)CODE
CRITICALsnapshot.go424 es.db.mu.compact.cond.Wait()CODE
CRITICALsstable/reader_iter_two_lvl.go525 smallest = i.secondLevel.reader.Comparer.Split.Prefix(smallest)CODE
CRITICALsstable/reader_iter_two_lvl.go527 largest = i.secondLevel.reader.Comparer.Split.Prefix(largest)CODE
CRITICALsstable/reader_iter_two_lvl.go1051 return i.seekPrefixGE(i.secondLevel.reader.Comparer.Split.Prefix(i.secondLevel.synthetic.seekKey),CODE
CRITICALmetamorphic/generator.go911 key = g.keyManager.kf.Comparer.Split.Prefix(key)CODE
CRITICALmetamorphic/cockroachkvs.go268 if !kg.keyManager.prefixExists(kg.keyManager.kf.Comparer.Split.Prefix(key)) {CODE
CRITICALobjstorage/objstorageprovider/cold_writable.go102 w.meta.file, w.err = w.p.st.Local.FS.Create(w.metaPath(), w.diskWriteCategory)CODE
CRITICALobjstorage/objstorageprovider/cold_writable.go167 _ = w.p.st.Local.FS.Remove(w.metaPath())CODE
CRITICALobjstorage/objstorageprovider/vfs.go228 fsDir, err := p.st.Local.ColdTier.FS.OpenDir(p.st.Local.ColdTier.FSDirName)CODE
CRITICALobjstorage/objstorageprovider/vfs.go234 coldListing, err := p.st.Local.ColdTier.FS.List(p.st.Local.ColdTier.FSDirName)CODE
Structural Annotation Overuse15 hits · 31 pts
SeverityFileLineSnippetContext
LOWcompaction.go208// NOTE: This function iterates up to compactionKindVirtualRewrite. If a newCOMMENT
LOWscripts/crossversion_smoke_test.sh125# Step 3: Build clean HEAD test binaryCOMMENT
LOWscripts/crossversion_smoke_test.sh133# Step 4: Run crossversion test WITHOUT the bug (should PASS)COMMENT
LOWscripts/crossversion_smoke_test.sh167# Step 5: Apply the intentional bug patchCOMMENT
LOWscripts/crossversion_smoke_test.sh177# Step 6: Build buggy HEAD test binaryCOMMENT
LOWscripts/crossversion_smoke_test.sh185# Step 7: Test buggy version by itself (should PASS - verifies patch doesn't break single-version)COMMENT
LOWscripts/crossversion_smoke_test.sh219# Step 8: Revert the patchCOMMENT
LOWscripts/crossversion_smoke_test.sh225# Step 9: Run crossversion test WITH the bug multiple times (should FAIL at least once)COMMENT
LOWscripts/crossversion_smoke_test.sh93# Step 1: Find the latest release branchCOMMENT
LOWscripts/crossversion_smoke_test.sh111# Step 2: Build test binary from release branchCOMMENT
LOWscripts/crossversion_smoke_test.sh264# Step 10: Verify that the test failed in phase 2COMMENT
LOW.github/workflows/cockroach-go.yaml55 # Step 1: Fetch the branch tip SHA for cache keyCOMMENT
LOW.github/workflows/cockroach-go.yaml62 # Step 2: Restore cache (per branch + commit SHA)COMMENT
LOW.github/workflows/cockroach-go.yaml69 # Step 3: Install bootstrap Go (needed to build fork)COMMENT
LOW.github/workflows/cockroach-go.yaml75 # Step 4: Run tests with custom GoCOMMENT
Verbosity Indicators14 hits · 29 pts
SeverityFileLineSnippetContext
LOWscripts/crossversion_smoke_test.sh125# Step 3: Build clean HEAD test binaryCOMMENT
LOWscripts/crossversion_smoke_test.sh133# Step 4: Run crossversion test WITHOUT the bug (should PASS)COMMENT
LOWscripts/crossversion_smoke_test.sh167# Step 5: Apply the intentional bug patchCOMMENT
LOWscripts/crossversion_smoke_test.sh177# Step 6: Build buggy HEAD test binaryCOMMENT
LOWscripts/crossversion_smoke_test.sh185# Step 7: Test buggy version by itself (should PASS - verifies patch doesn't break single-version)COMMENT
LOWscripts/crossversion_smoke_test.sh219# Step 8: Revert the patchCOMMENT
LOWscripts/crossversion_smoke_test.sh225# Step 9: Run crossversion test WITH the bug multiple times (should FAIL at least once)COMMENT
LOWscripts/crossversion_smoke_test.sh93# Step 1: Find the latest release branchCOMMENT
LOWscripts/crossversion_smoke_test.sh111# Step 2: Build test binary from release branchCOMMENT
LOWscripts/crossversion_smoke_test.sh264# Step 10: Verify that the test failed in phase 2COMMENT
LOW.github/workflows/cockroach-go.yaml55 # Step 1: Fetch the branch tip SHA for cache keyCOMMENT
LOW.github/workflows/cockroach-go.yaml62 # Step 2: Restore cache (per branch + commit SHA)COMMENT
LOW.github/workflows/cockroach-go.yaml69 # Step 3: Install bootstrap Go (needed to build fork)COMMENT
LOW.github/workflows/cockroach-go.yaml75 # Step 4: Run tests with custom GoCOMMENT
AI Slop Vocabulary9 hits · 27 pts
SeverityFileLineSnippetContext
MEDIUMingest.go1183 // for data overlap is a little more nuanced. Consider the following examples:COMMENT
MEDIUMiterator.go1416 // We also leverage the IterAtLimit <=> i.pos invariant defined in theCOMMENT
MEDIUMsstable/format.go109// The ideal solution for P2 would allow user-facing reads to utilize theCOMMENT
MEDIUMsstable/format.go203// For robust correctness, non-obsolete SINGLEDELs in foreign sstables shouldCOMMENT
MEDIUMsstable/reader_iter.go113// An implication of the above is that if we are going to somehow utilizeCOMMENT
MEDIUMinternal/compact/iterator.go133// that backs a compact.Iter is nuanced and care must be taken whenCOMMENT
MEDIUMinternal/iterv2/iter.go115// A more nuanced example:COMMENT
MEDIUMinternal/base/lazy_value.go176 // iterator that initially provided this LazyValue. Hence, to utilize thisCOMMENT
MEDIUMobjstorage/objstorageprovider/remote_readable.go208 // could enhance this to utilize a suffix of the needed data.COMMENT
Hyper-Verbose Identifiers5 hits · 5 pts
SeverityFileLineSnippetContext
LOWdocs/js/write-throughput.js12function writeThroughputSummaryURL() {CODE
LOWdocs/js/write-throughput.js37function bisectAndRenderWriteThroughputDetail(data, detailDate) {CODE
LOWdocs/js/write-throughput.js64function renderWriteThroughputSummary(allData) {CODE
LOWdocs/js/write-throughput.js304function fetchWriteThroughputSummaryData(file) {CODE
LOWdocs/js/write-throughput.js334function renderWriteThroughputSummaryDetail(workload, date, opsSec, rawData) {CODE
Decorative Section Separators1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMinternal/rangekeystack/user_iterator.go45// ╭────────────────┴───────────────╮COMMENT
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsstable/external_reader.go19// Example usage:COMMENT
Slop Phrases1 hit · 1 pts
SeverityFileLineSnippetContext
LOWinternal/lint/lint_test.go361 "Don't forget to add amend the result to the correct commits.",CODE