All Algorithms implemented in Rust
This report presents the forensic synthetic code analysis of TheAlgorithms/Rust, a Rust project with 25,911 GitHub stars. SynthScan v2.0 examined 62,964 lines of code across 442 source files, recording 384 pattern matches distributed across 5 syntactic categories. The overall adjusted score of 7.6 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).
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 384 distinct pattern matches across 5 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 | src/data_structures/segment_tree_recursive.rs | 81 | /// | COMMENT |
| LOW | src/data_structures/segment_tree_recursive.rs | 121 | match (left_res, right_res) { | COMMENT |
| LOW | src/data_structures/fenwick_tree.rs | 21 | IndexOutOfBounds, | COMMENT |
| LOW | src/data_structures/fenwick_tree.rs | 41 | /// A new `FenwickTree` instance. | COMMENT |
| LOW | src/data_structures/fenwick_tree.rs | 101 | COMMENT | |
| LOW | src/data_structures/fenwick_tree.rs | 121 | let left_query = if left == 0 { | COMMENT |
| LOW | src/data_structures/fenwick_tree.rs | 161 | /// desired value and the current value, then applying that difference using `update`. | COMMENT |
| LOW | src/data_structures/fenwick_tree.rs | 181 | /// | COMMENT |
| LOW | src/data_structures/heap.rs | 1 | //! A generic heap data structure. | COMMENT |
| LOW | src/data_structures/heap.rs | 21 | COMMENT | |
| LOW | src/data_structures/heap.rs | 161 | } else { | COMMENT |
| LOW | src/data_structures/heap.rs | 221 | /// | COMMENT |
| LOW | src/data_structures/stack_using_singly_linked_list.rs | 101 | /// With the help of the ownership mechanism, the type `List` will be cleaned up automatically (dropped) after it goes o | COMMENT |
| LOW | src/data_structures/trie.rs | 1 | //! This module provides a generic implementation of a Trie (prefix tree). | COMMENT |
| LOW | src/data_structures/segment_tree.rs | 61 | } | COMMENT |
| LOW | src/data_structures/segment_tree.rs | 101 | left /= 2; | COMMENT |
| LOW | src/data_structures/range_minimum_query.rs | 1 | //! Range Minimum Query (RMQ) Implementation | COMMENT |
| LOW | src/data_structures/range_minimum_query.rs | 21 | } | COMMENT |
| LOW | src/data_structures/range_minimum_query.rs | 41 | /// A `RangeMinimumQuery` instance that can be used to perform range minimum queries. | COMMENT |
| LOW | src/data_structures/probabilistic/count_min_sketch.rs | 1 | use std::collections::hash_map::RandomState; | COMMENT |
| LOW | src/data_structures/probabilistic/count_min_sketch.rs | 21 | fn increment_by(&mut self, item: Self::Item, count: usize); | COMMENT |
| LOW | src/data_structures/probabilistic/count_min_sketch.rs | 41 | /// <- WIDTH = 5 -> | COMMENT |
| LOW | src/data_structures/probabilistic/count_min_sketch.rs | 61 | /// E hash2: [0, 1, 0, 0, 0] | COMMENT |
| LOW | src/data_structures/probabilistic/bloom_filter.rs | 1 | use std::collections::hash_map::{DefaultHasher, RandomState}; | COMMENT |
| LOW | src/data_structures/probabilistic/bloom_filter.rs | 81 | COMMENT | |
| LOW | src/bit_manipulation/swap_odd_even_bits.rs | 1 | /// Swaps odd and even bits in an integer. | COMMENT |
| LOW | src/bit_manipulation/swap_odd_even_bits.rs | 21 | /// assert_eq!(swap_odd_even_bits(2), 1); | COMMENT |
| LOW | src/bit_manipulation/find_unique_number.rs | 1 | /// Finds the unique number in a slice where every other element appears twice. | COMMENT |
| LOW | src/bit_manipulation/n_bits_gray_code.rs | 1 | /// Custom error type for Gray code generation. | COMMENT |
| LOW | src/bit_manipulation/reverse_bits.rs | 1 | //! This module provides a function to reverse the bits of a 32-bit unsigned integer. | COMMENT |
| LOW | src/bit_manipulation/reverse_bits.rs | 21 | //! O(1) - Uses a constant amount of extra space | COMMENT |
| LOW | src/bit_manipulation/reverse_bits.rs | 41 | /// A 32-bit unsigned integer with bits in reverse order | COMMENT |
| LOW | src/bit_manipulation/binary_coded_decimal.rs | 1 | //! Binary Coded Decimal (BCD) conversion | COMMENT |
| LOW | src/bit_manipulation/binary_coded_decimal.rs | 21 | /// | COMMENT |
| LOW | src/bit_manipulation/binary_coded_decimal.rs | 41 | /// | COMMENT |
| LOW | src/bit_manipulation/find_previous_power_of_two.rs | 1 | //! Previous Power of Two | COMMENT |
| LOW | src/bit_manipulation/find_previous_power_of_two.rs | 21 | /// | COMMENT |
| LOW | src/bit_manipulation/find_previous_power_of_two.rs | 41 | /// assert_eq!(find_previous_power_of_two(8).unwrap(), 8); | COMMENT |
| LOW | src/bit_manipulation/rightmost_set_bit.rs | 1 | /// Finds the index (position) of the rightmost set bit in a number. | COMMENT |
| LOW | src/bit_manipulation/rightmost_set_bit.rs | 21 | /// | COMMENT |
| LOW | src/bit_manipulation/sum_of_two_integers.rs | 1 | //! This module provides a function to add two integers without using the `+` operator. | COMMENT |
| LOW | src/bit_manipulation/find_missing_number.rs | 1 | /// Finds the missing number in a slice of consecutive integers. | COMMENT |
| LOW | src/bit_manipulation/highest_set_bit.rs | 1 | //! This module provides a function to find the position of the most significant bit (MSB) | COMMENT |
| LOW | src/bit_manipulation/counting_bits.rs | 1 | //! This module implements a function to count the number of set bits (1s) | COMMENT |
| LOW | src/bit_manipulation/twos_complement.rs | 1 | //! Two's Complement Representation | COMMENT |
| LOW | src/bit_manipulation/twos_complement.rs | 21 | /// A `Result` containing: | COMMENT |
| LOW | src/bit_manipulation/binary_count_trailing_zeros.rs | 1 | /// Counts the number of trailing zeros in the binary representation of a number | COMMENT |
| LOW | src/bit_manipulation/binary_count_trailing_zeros.rs | 21 | pub fn binary_count_trailing_zeros(num: u64) -> u32 { | COMMENT |
| LOW | src/bit_manipulation/hamming_distance.rs | 1 | //! Hamming Distance | COMMENT |
| LOW | src/bit_manipulation/hamming_distance.rs | 41 | /// | COMMENT |
| LOW | src/bit_manipulation/hamming_distance.rs | 61 | } | COMMENT |
| LOW | src/bit_manipulation/binary_shifts.rs | 1 | //! Binary Shift Operations | COMMENT |
| LOW | src/bit_manipulation/binary_shifts.rs | 21 | //! | COMMENT |
| LOW | src/bit_manipulation/binary_shifts.rs | 41 | /// | COMMENT |
| LOW | src/bit_manipulation/binary_shifts.rs | 61 | let zeros = "0".repeat(shift_amount as usize); | COMMENT |
| LOW | src/bit_manipulation/binary_shifts.rs | 81 | /// | COMMENT |
| LOW | src/bit_manipulation/binary_shifts.rs | 101 | } | COMMENT |
| LOW | src/bit_manipulation/binary_shifts.rs | 121 | /// ``` | COMMENT |
| LOW | src/bit_manipulation/binary_shifts.rs | 201 | /// # Arguments | COMMENT |
| LOW | src/bit_manipulation/is_power_of_two.rs | 1 | //! Power of Two Check | COMMENT |
| 266 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | src/financial/depreciation.rs | 427 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | src/financial/depreciation.rs | 429 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | src/financial/depreciation.rs | 435 | // ── Straight-line ──────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 23 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 25 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 63 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 65 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 84 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 86 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 137 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 139 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 205 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 207 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 282 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 284 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 348 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 350 | // ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 496 | // ── Diminishing balance ────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 537 | // ── Units-of-production ────────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 577 | // ── Sum-of-years' digits ───────────────────────────────── | COMMENT |
| MEDIUM | src/financial/depreciation.rs | 637 | // ── Double-declining balance ───────────────────────────── | COMMENT |
| MEDIUM | src/machine_learning/optimization/adam.rs | 126 | // ── Initialisation ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/machine_learning/optimization/adam.rs | 206 | // ── Step: standard Adam (weight_decay = 0.0) ────────────────────────────── | COMMENT |
| MEDIUM | src/machine_learning/optimization/adam.rs | 266 | // ── Step: AdamW (weight_decay > 0.0) ───────────────────────────────────── | COMMENT |
| MEDIUM⚡ | src/machine_learning/optimization/adam.rs | 323 | // ── Step: shared edge cases ─────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | src/machine_learning/optimization/adam.rs | 332 | // ── Convergence (slow; marked #[ignore]) ───────────────────────────────── | COMMENT |
| MEDIUM⚡ | src/machine_learning/optimization/adam.rs | 332 | // ── Convergence (slow; marked #[ignore]) ───────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha1.rs | 156 | // ── NIST FIPS 180-4 / RFC 3174 test vectors ────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 25 | // ── SHA-256 / SHA-224 ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 153 | // ── SHA-512 / SHA-384 / SHA-512/224 / SHA-512/256 ─────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 305 | // ── Tests ──────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 323 | // ── Constant correctness ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 356 | // ── SHA-256 (FIPS 180-4) ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 394 | // ── SHA-224 (FIPS 180-4) ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 429 | // ── SHA-512 (FIPS 180-4) ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 468 | // ── SHA-384 (FIPS 180-4) ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 504 | // ── SHA-512/256 (FIPS 180-4) ───────────────────────────────────────────── | COMMENT |
| MEDIUM | src/hashing/sha2.rs | 530 | // ── SHA-512/224 (FIPS 180-4) ───────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | src/general/huffman_encoding.rs | 351 | "Lorem ipsum dolor sit amet, consectetur ", | CODE |
| LOW⚡ | src/general/huffman_encoding.rs | 351 | "Lorem ipsum dolor sit amet, consectetur ", | CODE |
| LOW⚡ | src/general/huffman_encoding.rs | 355 | "nullam vehicula. Interdum posuere lorem ipsum dolor. Elit eget ", | CODE |
| LOW | src/ciphers/base64.rs | 250 | test_e_d!(b"Lorem Ipsum sit dolor amet."); | CODE |
| LOW⚡ | src/ciphers/vigenere.rs | 59 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", | CODE |
| LOW⚡ | src/ciphers/vigenere.rs | 59 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", | CODE |
| LOW⚡ | src/ciphers/vigenere.rs | 69 | vigenere("1 Lorem ⏳ ipsum dolor sit amet Ѡ", "unicode"), | CODE |
| LOW⚡ | src/ciphers/vigenere.rs | 77 | vigenere("Lorem ipsum dolor sit amet", "😉 key!"), | CODE |
| LOW⚡ | src/ciphers/vigenere.rs | 77 | vigenere("Lorem ipsum dolor sit amet", "😉 key!"), | CODE |
| LOW⚡ | src/ciphers/vigenere.rs | 84 | assert_eq!(vigenere("Lorem ipsum", ""), "Lorem ipsum"); | CODE |
| LOW⚡ | src/string/z_algorithm.rs | 185 | "lorem ipsum dolor sit amet, consectetur ", | CODE |
| LOW⚡ | src/string/z_algorithm.rs | 185 | "lorem ipsum dolor sit amet, consectetur ", | CODE |
| LOW⚡ | src/string/z_algorithm.rs | 194 | "lorem ipsum dolor sit amet, consectetur ", | CODE |
| LOW⚡ | src/string/z_algorithm.rs | 194 | "lorem ipsum dolor sit amet, consectetur ", | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/data_structures/probabilistic/bloom_filter.rs | 54 | /// Can we improve it? Certainly, in different ways. | COMMENT |
| MEDIUM | …hine_learning/loss_function/mean_squared_error_loss.rs | 4 | //! robust loss function used in machine learning. | COMMENT |
| MEDIUM | …ine_learning/loss_function/mean_absolute_error_loss.rs | 4 | //! robust loss function used in machine learning. | COMMENT |
| MEDIUM | src/math/huber_loss.rs | 3 | //! The `huber_loss` function calculates the Huber loss, which is a robust loss function used in machine learning, parti | COMMENT |
| MEDIUM | src/math/huber_loss.rs | 18 | //! This implementation takes two references to vectors of f64 values, `actual` and `predicted`, and a `delta` value. It | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/math/elliptic_curve.rs | 110 | // TODO: implement counting for big P | COMMENT |