Beginner, advanced, expert level Rust training material
This report presents the forensic synthetic code analysis of microsoft/RustTraining, a Rust project with 14,712 GitHub stars. SynthScan v2.0 examined 77,355 lines of code across 193 source files, recording 122 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 2.8 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 122 distinct pattern matches across 8 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 | csharp-book/src/ch17-capstone-project.md | 48 | ### Step 1: Project Setup | COMMENT |
| LOW | csharp-book/src/ch17-capstone-project.md | 78 | ### Step 2: Define Your Data Types | COMMENT |
| LOW | csharp-book/src/ch17-capstone-project.md | 147 | ### Step 3: Error Type | COMMENT |
| LOW | csharp-book/src/ch17-capstone-project.md | 168 | ### Step 4: HTTP Client | COMMENT |
| LOW | csharp-book/src/ch17-capstone-project.md | 219 | ### Step 5: Display Formatting | COMMENT |
| LOW | csharp-book/src/ch17-capstone-project.md | 247 | ### Step 6: Wire It All Together | COMMENT |
| LOW | csharp-book/src/ch17-capstone-project.md | 298 | ### Step 7: Tests | COMMENT |
| LOW | rust-patterns-book/src/ch19-capstone-project.md | 39 | ## Step 1: Define the Task Types | COMMENT |
| LOW | rust-patterns-book/src/ch19-capstone-project.md | 90 | ## Step 2: Define the Work Function | COMMENT |
| LOW | rust-patterns-book/src/ch19-capstone-project.md | 105 | ## Step 3: Error Handling | COMMENT |
| LOW | rust-patterns-book/src/ch19-capstone-project.md | 128 | ## Step 4: The Scheduler | COMMENT |
| LOW | rust-patterns-book/src/ch19-capstone-project.md | 184 | ## Step 5: Integration Test | COMMENT |
| LOW | rust-patterns-book/src/ch19-capstone-project.md | 235 | ## Step 6: Put It All Together | COMMENT |
| LOW⚡ | …k/src/ch05-miri-valgrind-and-sanitizers-verifying-u.md | 112 | # Step 1: Run all tests under Miri | COMMENT |
| LOW⚡ | …k/src/ch05-miri-valgrind-and-sanitizers-verifying-u.md | 115 | # Step 2: If Miri reports errors, isolate them | COMMENT |
| LOW⚡ | …k/src/ch05-miri-valgrind-and-sanitizers-verifying-u.md | 118 | # Step 3: Use Miri's backtrace for diagnosis | COMMENT |
| LOW⚡ | …k/src/ch05-miri-valgrind-and-sanitizers-verifying-u.md | 121 | # Step 4: Choose a borrow model | COMMENT |
| LOW⚡ | engineering-book/src/ch12-tricks-from-the-trenches.md | 199 | # Step 1: Find duplicates | COMMENT |
| LOW⚡ | engineering-book/src/ch12-tricks-from-the-trenches.md | 202 | # Step 2: Find who pulls the old version | COMMENT |
| LOW⚡ | engineering-book/src/ch12-tricks-from-the-trenches.md | 205 | # Step 3: Update the culprit | COMMENT |
| LOW⚡ | engineering-book/src/ch12-tricks-from-the-trenches.md | 208 | # Step 4: If no update available, pin in [patch] | COMMENT |
| LOW⚡ | engineering-book/src/ch12-tricks-from-the-trenches.md | 212 | # Step 5: Verify | COMMENT |
| LOW⚡ | …-book/src/ch04-code-coverage-seeing-what-tests-miss.md | 129 | # Step 1: Build with coverage instrumentation | COMMENT |
| LOW⚡ | …-book/src/ch04-code-coverage-seeing-what-tests-miss.md | 134 | # Step 2: Run tests (generates .profraw files) | COMMENT |
| LOW⚡ | …-book/src/ch04-code-coverage-seeing-what-tests-miss.md | 137 | # Step 3: Aggregate with grcov | COMMENT |
| LOW | …-book/src/ch04-code-coverage-seeing-what-tests-miss.md | 148 | # Step 4: View report | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 258 | # Step 1: Build with debug info (release speed, debug symbols) | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 264 | # Step 2: Record with perf | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 267 | # Step 3: Generate a flamegraph | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 292 | # Step 1: Build with instrumentation | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 295 | # Step 2: Run representative workloads | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 298 | # Step 3: Merge profiling data | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 304 | # Step 4: Rebuild with profiling feedback | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 316 | # Step 1: Build with instrumentation | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 319 | # Step 2: Run representative workloads | COMMENT |
| LOW⚡ | …g-book/src/ch03-benchmarking-measuring-what-matters.md | 322 | # Step 3: Rebuild with profiling feedback | COMMENT |
| LOW⚡ | …k/src/ch02-cross-compilation-one-source-many-target.md | 153 | # Step 1: Install target + cross-linker | COMMENT |
| LOW⚡ | …k/src/ch02-cross-compilation-one-source-many-target.md | 157 | # Step 2: Configure linker in .cargo/config.toml (see above) | COMMENT |
| LOW⚡ | …k/src/ch02-cross-compilation-one-source-many-target.md | 159 | # Step 3: Build | COMMENT |
| LOW⚡ | …k/src/ch02-cross-compilation-one-source-many-target.md | 162 | # Step 4: Verify the binary | COMMENT |
| LOW | python-book/src/ch15-migration-patterns.md | 271 | ### Step 1: Identify Hotspots | COMMENT |
| LOW | python-book/src/ch15-migration-patterns.md | 283 | ### Step 2: Write Rust Extension for Hotspot | COMMENT |
| LOW | python-book/src/ch15-migration-patterns.md | 295 | ### Step 3: Replace Python Call with Rust Call | COMMENT |
| LOW | python-book/src/ch15-migration-patterns.md | 308 | ### Step 4: Expand Gradually | COMMENT |
| LOW | python-book/src/ch17-capstone-project.md | 70 | ## Step 1: Define the Data Model (Ch. 3, 6, 10, 11) | COMMENT |
| LOW | python-book/src/ch17-capstone-project.md | 152 | ## Step 2: Storage Layer (Ch. 9, 7) | COMMENT |
| LOW | python-book/src/ch17-capstone-project.md | 190 | ## Step 3: Command Enum (Ch. 6) | COMMENT |
| LOW | python-book/src/ch17-capstone-project.md | 251 | ## Step 4: Business Logic (Ch. 5, 12, 7) | COMMENT |
| LOW | python-book/src/ch17-capstone-project.md | 335 | ## Step 5: Wire It Together (Ch. 8) | COMMENT |
| LOW | python-book/src/ch17-capstone-project.md | 401 | ## Step 6: Cargo.toml Dependencies | COMMENT |
| LOW | python-book/src/ch17-capstone-project.md | 420 | ## Step 7: Tests (Ch. 14) | COMMENT |
| LOW | xtask/src/main.rs | 323 | /// NOTE: This function preserves and hardens the multi-layer security from PR#18: | COMMENT |
| LOW⚡ | …c/ch14-async-is-an-optimization-not-an-architecture.md | 52 | // Step 1: Validate — pure business rules, no I/O | COMMENT |
| LOW⚡ | …c/ch14-async-is-an-optimization-not-an-architecture.md | 56 | // Step 2: Check inventory — needs a database call | COMMENT |
| LOW⚡ | …c/ch14-async-is-an-optimization-not-an-architecture.md | 62 | // Step 3: Calculate pricing — pure math, but async because we're already here | COMMENT |
| LOW⚡ | …c/ch14-async-is-an-optimization-not-an-architecture.md | 65 | // Step 4: Apply discount — needs an external service call | COMMENT |
| LOW⚡ | …c/ch14-async-is-an-optimization-not-an-architecture.md | 69 | // Step 5: Format receipt — pure | COMMENT |
| LOW⚡ | async-book/src/ch15-exercises.md | 298 | // Step 2: Filter evens | COMMENT |
| LOW⚡ | async-book/src/ch15-exercises.md | 300 | // Step 3: Square each | COMMENT |
| LOW⚡ | async-book/src/ch15-exercises.md | 302 | // Step 4: Process concurrently (simulate async work) | COMMENT |
| 14 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | csharp-book/RustBootstrapForCSharp.md | 801 | } | COMMENT |
| LOW | csharp-book/src/ch03-built-in-types-and-variables.md | 461 | /* Multi-line | COMMENT |
| LOW | csharp-book/src/ch16-3-rust-tooling-ecosystem.md | 61 | COMMENT | |
| LOW | …p-book/src/ch15-1-essential-crates-for-c-developers.md | 321 | } | COMMENT |
| LOW | …rns-book/src/ch14-testing-and-benchmarking-patterns.md | 61 | COMMENT | |
| LOW | …book/src/ch06-concurrency-vs-parallelism-vs-threads.md | 401 | } | COMMENT |
| LOW | …rns-book/src/ch15-crate-architecture-and-api-design.md | 481 | // #[arg(short, long)] | COMMENT |
| LOW | …rns-book/src/ch15-crate-architecture-and-api-design.md | 501 | # type Error = String; | COMMENT |
| LOW | …rns-book/src/ch15-crate-architecture-and-api-design.md | 801 | /// Parses a diagnostic fault code from a string. | COMMENT |
| LOW | …k/src/ch06-dependency-management-and-supply-chain-s.md | 21 | which tracks known vulnerabilities in published crates. | COMMENT |
| LOW | …k/src/ch06-dependency-management-and-supply-chain-s.md | 221 | # Output: | COMMENT |
| LOW | …k/src/ch06-dependency-management-and-supply-chain-s.md | 241 | cargo tree --invert --package openssl-sys | COMMENT |
| LOW | …k/src/ch05-miri-valgrind-and-sanitizers-verifying-u.md | 81 | mod tests { | COMMENT |
| LOW | …ring-book/src/ch08-compile-time-and-developer-tools.md | 161 | # x = unsafe code used by the build | COMMENT |
| LOW | …g-book/src/ch10-windows-and-conditional-compilation.md | 41 | // Operating system | COMMENT |
| LOW | python-book/src/ch08-crates-and-modules.md | 1 | ## Rust Modules vs Python Packages | COMMENT |
| LOW | python-book/src/ch08-crates-and-modules.md | 21 | # ├── user.py | COMMENT |
| LOW | python-book/src/ch12-closures-and-iterators.md | 381 | COMMENT | |
| LOW | python-book/src/ch14-unsafe-rust-and-ffi.md | 61 | ```rust | COMMENT |
| LOW | python-book/src/ch01-introduction-and-motivation.md | 301 | # COPY requirements.txt . | COMMENT |
| LOW | async-book/src/ch06-building-futures-by-hand.md | 61 | } else { | COMMENT |
| LOW | …k/src/ch06-dimensional-analysis-making-the-compiler.md | 181 | # #[derive(Debug, Clone, Copy, PartialEq, PartialOrd)] | COMMENT |
| LOW | …k/src/ch06-dimensional-analysis-making-the-compiler.md | 281 | - Comparing Celsius against Volts is a **compile error** | COMMENT |
| LOW | …k/src/ch15-const-fn-compile-time-correctness-proofs.md | 261 | COMMENT | |
| LOW | …k/src/ch08-capability-mixins-compile-time-hardware-.md | 81 | ``` | COMMENT |
| LOW | …k/src/ch08-capability-mixins-compile-time-hardware-.md | 181 | ```rust,ignore | COMMENT |
| LOW | type-driven-correctness-book/src/ch12-exercises.md | 761 | format!("{}: {}/{} passed", self.name, passed, total) | COMMENT |
| LOW | …orrectness-book/src/ch18-redfish-server-walkthrough.md | 301 | // .name("PowerEdge R750".into()) | COMMENT |
| LOW | c-cpp-book/src/ch13-concurrency.md | 381 | // Output (order may vary): | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | rust-patterns-book/src/ch02-traits-in-depth.md | 961 | // ── Bus abstractions (traits the hardware team provides) ────────── | COMMENT |
| MEDIUM | rust-patterns-book/src/ch02-traits-in-depth.md | 1093 | // ── Concrete bus implementations (Linux platform) ──────────────── | COMMENT |
| MEDIUM | rust-patterns-book/src/ch02-traits-in-depth.md | 1125 | // ── Production platform — all four buses ───────────────────────── | COMMENT |
| MEDIUM | rust-patterns-book/src/ch02-traits-in-depth.md | 1187 | // ── Partial platform: only fan-related buses ───────────────── | COMMENT |
| MEDIUM | xtask/src/main.rs | 99 | // ── build ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | xtask/src/main.rs | 404 | // ── serve ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | xtask/src/main.rs | 485 | // ── clean ──────────────────────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | python-book/src/ch08-crates-and-modules.md | 25 | from myproject.utils.helpers import format_name | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | csharp-book/RustBootstrapForCSharp.md | 5205 | name: "John Doe".to_string(), | CODE |
| LOW | csharp-book/RustTrainingForCSharp.md | 1913 | "John Doe".to_string(), | CODE |
| LOW | …p-book/src/ch15-1-essential-crates-for-c-developers.md | 164 | "John Doe".to_string(), | CODE |
| LOW | …s-book/src/ch03-the-newtype-and-type-state-patterns.md | 56 | let email = Email::new("user@example.com").unwrap(); | CODE |
| LOW | …k/src/ch07-validated-boundaries-parse-dont-validate.md | 179 | Some("Acme Corp".to_string()) // stub | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | python-book/src/ch15-migration-patterns.md | 417 | # Same Python orchestration, same tests, same deployment | COMMENT |
| MEDIUM | c-cpp-book/src/ch08-crates-and-modules.md | 620 | | `#ifdef TEST` mock functions | Trait-based dependency injection | | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | csharp-book/RustBootstrapForCSharp.md | 116 | public class DataProcessor | CODE |
| LOW | csharp-book/RustBootstrapForCSharp.md | 4859 | public class DataProcessor | CODE |
| LOW | csharp-book/src/ch01-introduction-and-motivation.md | 25 | public class DataProcessor | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | c-cpp-book/src/ch08-crates-and-modules.md | 20 | // TODO: implement pub fn add(a: u32, b: u32) -> u32 | COMMENT |