Repository Analysis

pybind/pybind11

Seamless operability between C++11 and Python

8.7 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of pybind/pybind11, a C++ project with 18,008 GitHub stars. SynthScan v2.0 examined 77,134 lines of code across 311 source files, recording 609 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 8.7 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).

8.7
Adjusted Score
8.7
Raw Score
100%
Time Factor
2026-08-25
Last Push
18.0K
Stars
C++
Language
77.1K
Lines of Code
311
Files
609
Pattern Hits
2026-08-29
Scan Date
0.02
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 5MEDIUM 7LOW 597

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 609 distinct pattern matches across 11 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.

Hyper-Verbose Identifiers349 hits · 369 pts
SeverityFileLineSnippetContext
LOWtests/test_stl_binders.py90def test_vector_delitem_slice(s):CODE
LOWtests/test_stl_binders.py99def test_vector_delitem_slice_step_zero():CODE
LOWtests/test_stl_binders.py234def test_map_string_double_const():CODE
LOWtests/test_stl_binders.py247def test_noncopyable_containers():CODE
LOWtests/test_methods_and_attributes.py29def test_methods_and_attributes():CODE
LOWtests/test_methods_and_attributes.py274def test_property_return_value_policies(access):CODE
LOWtests/test_methods_and_attributes.py294def test_property_rvalue_policy():CODE
LOWtests/test_methods_and_attributes.py388def test_dynamic_attr_dealloc_frees_dict_contents():CODE
LOWtests/test_methods_and_attributes.py519def test_unregistered_base_implementations():STRING
LOWtests/test_methods_and_attributes.py565def test_rvalue_ref_qualified_methods():STRING
LOWtests/test_methods_and_attributes.py589def test_noexcept_rvalue_ref_qualified_methods():STRING
LOWtests/test_methods_and_attributes.py603def test_noexcept_overload_cast():STRING
LOWtests/test_methods_and_attributes.py621def test_ref_qualified_overload_cast():STRING
LOWtests/test_methods_and_attributes.py645def test_noexcept_ref_qualified_overload_cast():STRING
LOWtests/test_sequences_and_iterators.py19def test_slice_constructors_explicit_optional():CODE
LOWtests/test_sequences_and_iterators.py24def test_generalized_iterators():CODE
LOWtests/test_sequences_and_iterators.py56def test_generalized_iterators_simple():CODE
LOWtests/test_sequences_and_iterators.py66def test_iterator_doc_annotations():CODE
LOWtests/test_sequences_and_iterators.py83def test_iterator_referencing():CODE
LOWtests/test_sequences_and_iterators.py235def test_python_iterator_in_cpp():CODE
LOWtests/test_sequences_and_iterators.py267def test_iterator_passthrough():CODE
LOWtests/test_sequences_and_iterators.py288def test_generated_dunder_methods_pos_only():CODE
LOWtests/test_numpy_vectorize.py159def test_trivial_broadcasting():STRING
LOWtests/test_numpy_vectorize.py210def test_passthrough_arguments(doc):STRING
LOWtests/test_numpy_vectorize.py243def test_method_vectorization():STRING
LOWtests/test_numpy_vectorize.py250def test_ref_qualified_method_vectorization():STRING
LOWtests/test_numpy_vectorize.py270def test_noexcept_ref_qualified_method_vectorization():STRING
LOWtests/test_numpy_vectorize.py284def test_noexcept_method_vectorization():STRING
LOWtests/test_class_release_gil_before_calling_cpp_dtor.py17def test_gil_state_check_results(probe_type, unique_key, expected_result):CODE
LOWtests/test_chrono.py32def test_chrono_system_clock_roundtrip():CODE
LOWtests/test_chrono.py46def test_chrono_system_clock_roundtrip_date():CODE
LOWtests/test_chrono.py102def test_chrono_system_clock_roundtrip_time(time1, tz, monkeypatch):CODE
LOWtests/test_chrono.py125def test_chrono_duration_roundtrip():CODE
LOWtests/test_chrono.py145def test_chrono_duration_subtraction_equivalence():CODE
LOWtests/test_chrono.py155def test_chrono_duration_subtraction_equivalence_date():CODE
LOWtests/test_chrono.py170def test_chrono_steady_clock_roundtrip():CODE
LOWtests/test_chrono.py180def test_floating_point_duration():CODE
LOWtests/test_chrono.py200def test_chrono_different_resolutions():CODE
LOWtests/conftest.py34def use_multiprocessing_forkserver_on_linux():CODE
LOWtests/conftest.py205def pytest_assertrepr_compare(op, left, right): # noqa: ARG001CODE
LOWtests/conftest.py228def delattr_and_ensure_destroyed(*specs):CODE
LOWtests/test_callbacks.py38def test_bound_method_callback():CODE
LOWtests/test_callbacks.py51def test_keyword_args_and_generalized_unpacking():CODE
LOWtests/test_callbacks.py94def test_lambda_closure_cleanup():CODE
LOWtests/test_callbacks.py103def test_cpp_callable_cleanup():CODE
LOWtests/test_callbacks.py108def test_cpp_function_roundtrip():CODE
LOWtests/test_callbacks.py191def test_async_async_callbacks():CODE
LOWtests/test_callbacks.py239def test_boost_histogram_apply_custom_transform():CODE
LOWtests/test_warnings.py30def test_warning_wrong_subclass_fail():CODE
LOWtests/test_warnings.py41def test_warning_double_register_fail():CODE
LOWtests/test_pytypes.py576def test_print_missing_from_current_builtins_is_silent(monkeypatch):CODE
LOWtests/test_pytypes.py585def test_print_stdout_none_matches_current_builtin(monkeypatch):CODE
LOWtests/test_pytypes.py705def test_memoryview_from_buffer_empty_shape():CODE
LOWtests/test_pytypes.py712def test_test_memoryview_from_buffer_invalid_strides():CODE
LOWtests/test_pytypes.py717def test_test_memoryview_from_buffer_nullptr():CODE
LOWtests/test_pytypes.py722def test_memoryview_from_memory():CODE
LOWtests/test_pytypes.py968def test_tuple_nonempty_annotations(doc):CODE
LOWtests/test_pytypes.py975def test_tuple_empty_annotations(doc):CODE
LOWtests/test_pytypes.py981def test_tuple_variable_length_annotations(doc):CODE
LOWtests/test_pytypes.py1052def test_union_object_annotations(doc):CODE
289 more matches not shown…
Unused Imports119 hits · 118 pts
SeverityFileLineSnippetContext
LOWnoxfile.py7CODE
LOWtools/libsize.py1CODE
LOWtools/make_changelog.py7CODE
LOWtools/make_global.py6CODE
LOWtools/codespell_ignore_lines_from_errors.py12CODE
LOWpybind11/setup_helpers.py39CODE
LOWpybind11/_version.py5CODE
LOWpybind11/__init__.py1CODE
LOWpybind11/__init__.py10CODE
LOWpybind11/__init__.py11CODE
LOWpybind11/__init__.py11CODE
LOWpybind11/__init__.py11CODE
LOWpybind11/commands.py1CODE
LOWpybind11/__main__.py2CODE
LOWtests/test_stl_binders.py1CODE
LOWtests/test_methods_and_attributes.py1CODE
LOWtests/test_sequences_and_iterators.py1CODE
LOWtests/test_vector_unique_ptr_member.py1CODE
LOWtests/test_numpy_vectorize.py1CODE
LOWtests/test_class_release_gil_before_calling_cpp_dtor.py1CODE
LOWtests/test_chrono.py1CODE
LOWtests/test_chrono.py7CODE
LOWtests/conftest.py7CODE
LOWtests/test_python_multiple_inheritance.py3CODE
LOWtests/test_callbacks.py1CODE
LOWtests/test_callbacks.py9CODE
LOWtests/test_warnings.py1CODE
LOWtests/test_warnings.py7CODE
LOWtests/test_pytypes.py1CODE
LOWtests/test_class.py1CODE
LOWtests/env.py1CODE
LOWtests/test_class_sh_trampoline_self_life_support.py1CODE
LOWtests/test_class_sh_property_non_owning.py1CODE
LOWtests/test_docs_advanced_cast_custom.py1CODE
LOWtests/test_eigen_tensor.py1CODE
LOWtests/test_eigen_tensor.py7CODE
LOWtests/test_class_sh_trampoline_shared_from_this.py1CODE
LOWtests/test_docstring_options.py1CODE
LOWtests/test_cpp_conduit.py3CODE
LOWtests/test_class_sh_disowning_mi.py1CODE
LOWtests/test_class_sh_disowning_mi.py5CODE
LOWtests/test_async.py1CODE
LOWtests/test_unnamed_namespace_a.py1CODE
LOWtests/test_class_sh_basic.py2CODE
LOWtests/test_class_sh_trampoline_basic.py1CODE
LOWtests/test_local_bindings.py1CODE
LOWtests/test_class_sh_factory_constructors.py1CODE
LOWtests/test_smart_ptr.py1CODE
LOWtests/test_smart_ptr.py5CODE
LOWtests/test_numpy_array.py1CODE
LOWtests/test_numpy_array.py7CODE
LOWtests/test_builtin_casters.py1CODE
LOWtests/test_constants_and_functions.py1CODE
LOWtests/test_exceptions.py1CODE
LOWtests/test_factory_constructors.py1CODE
LOWtests/test_factory_constructors.py7CODE
LOWtests/test_iostream.py1CODE
LOWtests/test_operator_overloading.py1CODE
LOWtests/test_union.py1CODE
LOWtests/test_kwargs_and_defaults.py1CODE
59 more matches not shown…
Over-Commented Block115 hits · 114 pts
SeverityFileLineSnippetContext
LOW.pre-commit-config.yaml1# To use:COMMENT
LOW.cmake-format.yaml21 # arguments, then force it to a vertical layout.COMMENT
LOWtools/check-style.sh1#!/bin/bashCOMMENT
LOWinclude/pybind11/numpy.h21#include <cstdlib>COMMENT
LOWinclude/pybind11/numpy.h461PYBIND11_NUMPY_SCALAR_IMPL(std::complex<double>, NPY_CDOUBLE);COMMENT
LOWinclude/pybind11/numpy.h921 // Note: The signature, `dtype::char_` follows the naming of NumPy'sCOMMENT
LOWinclude/pybind11/numpy.h1821COMMENT
LOWinclude/pybind11/numpy.h1841# if defined(_MSC_VER) \COMMENT
LOWinclude/pybind11/pybind11.h21#include "gil.h"COMMENT
LOWinclude/pybind11/pybind11.h261#elseCOMMENT
LOWinclude/pybind11/pybind11.h701COMMENT
LOWinclude/pybind11/pybind11.h2081COMMENT
LOWinclude/pybind11/iostream.h21COMMENT
LOWinclude/pybind11/subinterpreter.h21COMMENT
LOWinclude/pybind11/subinterpreter.h261/// The PyThreadState is created on construction in a *released* state: it is NOT made current,COMMENT
LOWinclude/pybind11/subinterpreter.h281/// // ... use the subinterpreter ...COMMENT
LOWinclude/pybind11/native_enum.h1// Copyright (c) 2022-2025 The pybind Community.COMMENT
LOWinclude/pybind11/stl.h21#include <memory>COMMENT
LOWinclude/pybind11/common.h1#include "detail/common.h"COMMENT
LOWinclude/pybind11/cast.h21COMMENT
LOWinclude/pybind11/cast.h1141/// For class_-wrapped types using std::shared_ptr as the holder, the following expressionsCOMMENT
LOWinclude/pybind11/trampoline_self_life_support.h1// Copyright (c) 2021 The Pybind Development Team.COMMENT
LOWinclude/pybind11/gil_safe_call_once.h1// Copyright (c) 2023 The pybind Community.COMMENT
LOWinclude/pybind11/gil_safe_call_once.h21PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)COMMENT
LOWinclude/pybind11/gil_safe_call_once.h41//COMMENT
LOWinclude/pybind11/gil_safe_call_once.h61// normal Python code. However, this will be unnoticeable for quick call-onceCOMMENT
LOWinclude/pybind11/gil_safe_call_once.h261 return detail::atomic_get_or_create_in_state_dict<storage_type>(get_storage_key().c_str())COMMENT
LOWinclude/pybind11/pytypes.h741/// thrown to propagate python-side errors back through C++ which can either be caught manually orCOMMENT
LOWinclude/pybind11/conduit/pybind11_platform_abi_id.h1#pragma onceCOMMENT
LOWinclude/pybind11/conduit/pybind11_platform_abi_id.h21# define PYBIND11_COMPILER_TYPE "mingw"COMMENT
LOWinclude/pybind11/conduit/pybind11_platform_abi_id.h41# if defined(_MT) && defined(_DLL) // Corresponding to CL command line options /MD or /MDd.COMMENT
LOWinclude/pybind11/conduit/pybind11_platform_abi_id.h61// // Assume that NVHPC is in the 1xxx ABI family.COMMENT
LOWinclude/pybind11/conduit/pybind11_platform_abi_id.h81# define PYBIND11_BUILD_TYPE "_debug"COMMENT
LOWinclude/pybind11/conduit/wrap_include_python_h.h1#pragma onceCOMMENT
LOWinclude/pybind11/conduit/wrap_include_python_h.h21// See https://github.com/pybind/pybind11/pull/3497 for full context.COMMENT
LOWinclude/pybind11/conduit/wrap_include_python_h.h41// C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removedCOMMENT
LOWinclude/pybind11/conduit/wrap_include_python_h.h61# undef isalnumCOMMENT
LOWinclude/pybind11/stl/filesystem.h1// Copyright (c) 2021 The Pybind Development Team.COMMENT
LOWinclude/pybind11/detail/type_caster_base.h21#include "typeid.h"COMMENT
LOWinclude/pybind11/detail/type_caster_base.h41/// A life support system for temporary objects created by `type_caster::load()`.COMMENT
LOWinclude/pybind11/detail/type_caster_base.h501 // Allocate space to hold: [v1*][h1][v2*][h2]...[bb...] where [vN*] is a value pointer,COMMENT
LOWinclude/pybind11/detail/type_caster_base.h581 cast_sources(const raw_source &orig) : original(orig) { result = resolve(); }COMMENT
LOWinclude/pybind11/detail/type_caster_base.h1581// polymorphic_type_hook<itype>::get(src, tinfo) determines whether the object pointedCOMMENT
LOWinclude/pybind11/detail/function_ref.h1/*COMMENT
LOWinclude/pybind11/detail/function_ref.h21//===----------------------------------------------------------------------===//COMMENT
LOWinclude/pybind11/detail/function_record_pyobject.h1// Copyright (c) 2024-2025 The Pybind Development Team.COMMENT
LOWinclude/pybind11/detail/function_record_pyobject.h41 // unhelpful compiler warnings.COMMENT
LOWinclude/pybind11/detail/internals.h21#include <cstdint>COMMENT
LOWinclude/pybind11/detail/internals.h41#ifndef PYBIND11_INTERNALS_VERSIONCOMMENT
LOWinclude/pybind11/detail/internals.h61 _Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"") /**/ \COMMENT
LOWinclude/pybind11/detail/internals.h301class loader_life_support;COMMENT
LOWinclude/pybind11/detail/internals.h421 void *(*module_local_load)(PyObject *, const type_info *) = nullptr;COMMENT
LOWinclude/pybind11/detail/internals.h581 return;COMMENT
LOWinclude/pybind11/detail/internals.h641 // Use `PyDict_SetDefault` for atomic test-and-set:COMMENT
LOWinclude/pybind11/detail/argument_vector.h21#include <cstring>COMMENT
LOWinclude/pybind11/detail/common.h21#define PYBIND11_VERSION_MINOR 1COMMENT
LOWinclude/pybind11/detail/common.h41 Py_PACK_FULL_VERSION(PYBIND11_VERSION_MAJOR, \COMMENT
LOWinclude/pybind11/detail/common.h61// MSVC sets _MSVC_LANG rather than __cplusplus (supposedly until the standard is fullyCOMMENT
LOWinclude/pybind11/detail/common.h81COMMENT
LOWinclude/pybind11/detail/common.h101#elseCOMMENT
55 more matches not shown…
Cross-Language Confusion4 hits · 24 pts
SeverityFileLineSnippetContext
HIGHtests/test_methods_and_attributes.py594 - Return (Class::*)(Args...) const && noexcept (peek_noexcept)CODE
HIGHtests/test_methods_and_attributes.py632 - overload_cast_impl::operator()(Return (Class::*)(Args...) const && noexcept, true_type)CODE
HIGHtests/test_methods_and_attributes.py652 - overload_cast_impl::operator()(Return (Class::*)(Args...) const && noexcept, true_type)CODE
HIGHtests/test_methods_and_attributes.py658 assert obj.method_const_rref_noexcept(1.0) == "(double) const && noexcept"STRING
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_eval_call.py1# This file is called from 'test_eval.py'COMMENT
MEDIUMtests/test_custom_type_setup.py69 # Create a self-referential cycle that will be collected during shutdown.COMMENT
MEDIUMdocs/conf.py4# This file is execfile()d with the current directory set to itsCOMMENT
Excessive Try-Catch Wrapping6 hits · 8 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py27except Exception:CODE
MEDIUMtests/test_pytypes.py586def exception_type(func):CODE
LOWtests/test_pytypes.py589 except Exception as exc:CODE
LOWtests/test_thread.py22 except Exception as e:CODE
MEDIUMtests/test_thread.py18def run(self):CODE
LOWtests/test_multiple_interpreters.py115 except Exception as e:CODE
AI Slop Vocabulary3 hits · 8 pts
SeverityFileLineSnippetContext
MEDIUMpybind11/commands.py30 # about nuanced counting here.COMMENT
MEDIUMtests/test_numpy_array.py663# HINT: An easy and robust way (although only manual unfortunately) to check forCOMMENT
LOWtests/test_modules.py138 # changes in future Python versions, simply add the new expected exception types here.COMMENT
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHinclude/pybind11/detail/class.h660 // Fill in all the information, and then downgrade as requested by the caller, or raise anCOMMENT
Deep Nesting7 hits · 7 pts
SeverityFileLineSnippetContext
LOWtools/codespell_ignore_lines_from_errors.py17CODE
LOWpybind11/setup_helpers.py285CODE
LOWtests/test_numpy_array.py603CODE
LOWtests/test_factory_constructors.py481CODE
LOWtests/test_factory_constructors.py499CODE
LOWtests/test_numpy_dtypes.py391CODE
LOWtests/test_gil_scoped.py170CODE
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtools/libsize.py7# Usage:COMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtests/test_numpy_array.py670# value increases without bounds. (Don't forget to Ctrl-C the test!)COMMENT