Repository Analysis

dtolnay/cxx

Safe interop between Rust and C++

2.4 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of dtolnay/cxx, a Rust project with 6,773 GitHub stars. SynthScan v2.0 examined 31,033 lines of code across 299 source files, recording 75 pattern matches distributed across 1 syntactic category. The overall adjusted score of 2.4 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.4
Adjusted Score
2.4
Raw Score
100%
Time Factor
2026-07-14
Last Push
6.8K
Stars
Rust
Language
31.0K
Lines of Code
299
Files
75
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 75

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 75 distinct pattern matches across 1 syntactic category. 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 Block75 hits · 75 pts
SeverityFileLineSnippetContext
LOWbridge/lib/src/lib.rs1//! The CXX code generator for constructing and compiling C++ code.COMMENT
LOWbridge/src/write.rs541 out.next_section();COMMENT
LOWbridge/src/write.rs561 //COMMENT
LOWbridge/src/mod.rs41/// #COMMENT
LOWbridge/src/builtin/alignmax.h1#pragma onceCOMMENT
LOWinclude/cxx.h1#pragma onceCOMMENT
LOWinclude/cxx.h461 Opaque(const Opaque &) = delete;COMMENT
LOWtests/cpp_compile/mod.rs21 /// Path to the `.cc` file (in `temp_dir`) that is generated by theCOMMENT
LOWtests/cpp_compile/mod.rs61 temp_dir,COMMENT
LOWtests/cpp_compile/mod.rs81 ///COMMENT
LOWtests/cpp_compile/mod.rs161 ///COMMENT
LOWmacro/src/lib.rs41COMMENT
LOWmacro/src/expand.rs1681 #cfgCOMMENT
LOWmacro/src/expand.rs1761COMMENT
LOWbook/src/concepts.md21 language.COMMENT
LOWbook/src/concepts.md41# unsafe extern "C++" {COMMENT
LOWbook/src/tutorial.md301# fn next_chunk(buf: &mut MultiBuf) -> &[u8];COMMENT
LOWbook/src/tutorial.md381COMMENT
LOWbook/src/tutorial.md401# unsafe extern "C++" {COMMENT
LOWbook/src/tutorial.md521# fn next_chunk(buf: &mut MultiBuf) -> &[u8];COMMENT
LOWsyntax/mangle.rs1// Mangled symbol arrangements:COMMENT
LOWsyntax/mangle.rs21// - cxxbridge1$unique_ptr$std$vector$u8$dropCOMMENT
LOWsyntax/mangle.rs41// pattern: {NAMESPACE...} $ {CXXBRIDGE} $ {CXXVERSION} $ {TYPE} $ operator $ {NAME}COMMENT
LOWsyntax/attrs.rs1use crate::syntax::cfg::CfgExpr;COMMENT
LOWsyntax/instantiate.rs21 ///COMMENT
LOWsrc/lib.rs1//! [![github]](https://github.com/dtolnay/cxx) [![crates-io]](https://crates.io/crates/cxx) [![docs-rs]](httpCOMMENT
LOWsrc/lib.rs21//! *Compiler support: requires rustc 1.85+ and c++11 or newer*<br>COMMENT
LOWsrc/lib.rs41//! If everything checks out statically, then CXX uses a pair of code generatorsCOMMENT
LOWsrc/lib.rs61//! string from C++, its `size()` member function calls Rust's `len()`.COMMENT
LOWsrc/lib.rs81//! // Any shared structs, whose fields will be visible to both languages.COMMENT
LOWsrc/lib.rs101//!COMMENT
LOWsrc/lib.rs121//! ```COMMENT
LOWsrc/lib.rs141//!COMMENT
LOWsrc/lib.rs161//! type depending on your use case.COMMENT
LOWsrc/lib.rs181//! Your function implementations themselves, whether in C++ or Rust, *do not*COMMENT
LOWsrc/lib.rs201//! replacement for the concept of `extern "C"` signatures as we know them,COMMENT
LOWsrc/lib.rs221//! of your FFI that is straightforward and doing the remaining few oddballCOMMENT
LOWsrc/lib.rs241//! ```tomlCOMMENT
LOWsrc/lib.rs261//!COMMENT
LOWsrc/lib.rs281//!COMMENT
LOWsrc/lib.rs301//! may contain internal pointers that would be screwed up by Rust's moveCOMMENT
LOWsrc/lib.rs321//! <br>COMMENT
LOWsrc/lib.rs341//! <tr><td><a href="struct.CxxVector.html">CxxVector&lt;T&gt;</a></td><td>std::vector&lt;T&gt;</td><td><sup><i>cannot bCOMMENT
LOWsrc/cxx_string.rs21 fn string_init(this: &mut MaybeUninit<CxxString>, ptr: *const u8, len: usize);COMMENT
LOWsrc/cxx_string.rs41/// macro, in Rust code we can never obtain a `CxxString` by value. C++'s stringCOMMENT
LOWsrc/cxx_string.rs61/// ```COMMENT
LOWsrc/cxx_string.rs101 /// [`let_cxx_string!`] macro.COMMENT
LOWsrc/cxx_string.rs121 self.len() == 0COMMENT
LOWsrc/cxx_string.rs141 ///COMMENT
LOWsrc/cxx_string.rs161COMMENT
LOWsrc/cxx_string.rs181 ///COMMENT
LOWsrc/cxx_string.rs201 /// **The meaning of the argument is not the same asCOMMENT
LOWsrc/shared_ptr.rs21/// **WARNING:** Unlike Rust's `Arc<T>`, a C++ shared pointer manipulatesCOMMENT
LOWsrc/shared_ptr.rs81 shared_ptr.assume_init()COMMENT
LOWsrc/shared_ptr.rs101 /// Panics if `T` is an incomplete type (including `void`) or is notCOMMENT
LOWsrc/shared_ptr.rs121 ///COMMENT
LOWsrc/shared_ptr.rs141 ///COMMENT
LOWsrc/shared_ptr.rs161 /// # PanicsCOMMENT
LOWsrc/shared_ptr.rs361///COMMENT
LOWsrc/cxx_vector.rs41 /// Constructs a new heap allocated vector, wrapped by UniquePtr.COMMENT
15 more matches not shown…