Seamless operability between C++11 and Python
This report presents the forensic synthetic code analysis of pybind/pybind11, a C++ project with 17,969 GitHub stars. SynthScan v2.0 examined 76,189 lines of code across 309 source files, recording 592 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 8.4 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 592 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_stl_binders.py | 198 | def test_map_string_double_const(): | CODE |
| LOW | tests/test_stl_binders.py | 211 | def test_noncopyable_containers(): | CODE |
| LOW | tests/test_methods_and_attributes.py | 29 | def test_methods_and_attributes(): | CODE |
| LOW | tests/test_methods_and_attributes.py | 274 | def test_property_return_value_policies(access): | CODE |
| LOW | tests/test_methods_and_attributes.py | 294 | def test_property_rvalue_policy(): | CODE |
| LOW | tests/test_methods_and_attributes.py | 388 | def test_dynamic_attr_dealloc_frees_dict_contents(): | CODE |
| LOW | tests/test_methods_and_attributes.py | 519 | def test_unregistered_base_implementations(): | STRING |
| LOW | tests/test_methods_and_attributes.py | 565 | def test_rvalue_ref_qualified_methods(): | STRING |
| LOW⚡ | tests/test_methods_and_attributes.py | 589 | def test_noexcept_rvalue_ref_qualified_methods(): | STRING |
| LOW⚡ | tests/test_methods_and_attributes.py | 603 | def test_noexcept_overload_cast(): | STRING |
| LOW | tests/test_methods_and_attributes.py | 621 | def test_ref_qualified_overload_cast(): | STRING |
| LOW⚡ | tests/test_methods_and_attributes.py | 645 | def test_noexcept_ref_qualified_overload_cast(): | STRING |
| LOW | tests/test_sequences_and_iterators.py | 19 | def test_slice_constructors_explicit_optional(): | CODE |
| LOW | tests/test_sequences_and_iterators.py | 24 | def test_generalized_iterators(): | CODE |
| LOW | tests/test_sequences_and_iterators.py | 56 | def test_generalized_iterators_simple(): | CODE |
| LOW | tests/test_sequences_and_iterators.py | 66 | def test_iterator_doc_annotations(): | CODE |
| LOW | tests/test_sequences_and_iterators.py | 83 | def test_iterator_referencing(): | CODE |
| LOW | tests/test_sequences_and_iterators.py | 235 | def test_python_iterator_in_cpp(): | CODE |
| LOW | tests/test_sequences_and_iterators.py | 267 | def test_iterator_passthrough(): | CODE |
| LOW | tests/test_sequences_and_iterators.py | 288 | def test_generated_dunder_methods_pos_only(): | CODE |
| LOW | tests/test_numpy_vectorize.py | 159 | def test_trivial_broadcasting(): | STRING |
| LOW | tests/test_numpy_vectorize.py | 210 | def test_passthrough_arguments(doc): | STRING |
| LOW | tests/test_numpy_vectorize.py | 243 | def test_method_vectorization(): | STRING |
| LOW | tests/test_numpy_vectorize.py | 250 | def test_ref_qualified_method_vectorization(): | STRING |
| LOW | tests/test_numpy_vectorize.py | 270 | def test_noexcept_ref_qualified_method_vectorization(): | STRING |
| LOW | tests/test_numpy_vectorize.py | 284 | def test_noexcept_method_vectorization(): | STRING |
| LOW | tests/test_class_release_gil_before_calling_cpp_dtor.py | 17 | def test_gil_state_check_results(probe_type, unique_key, expected_result): | CODE |
| LOW | tests/test_chrono.py | 32 | def test_chrono_system_clock_roundtrip(): | CODE |
| LOW | tests/test_chrono.py | 46 | def test_chrono_system_clock_roundtrip_date(): | CODE |
| LOW | tests/test_chrono.py | 102 | def test_chrono_system_clock_roundtrip_time(time1, tz, monkeypatch): | CODE |
| LOW | tests/test_chrono.py | 125 | def test_chrono_duration_roundtrip(): | CODE |
| LOW | tests/test_chrono.py | 145 | def test_chrono_duration_subtraction_equivalence(): | CODE |
| LOW | tests/test_chrono.py | 155 | def test_chrono_duration_subtraction_equivalence_date(): | CODE |
| LOW | tests/test_chrono.py | 170 | def test_chrono_steady_clock_roundtrip(): | CODE |
| LOW | tests/test_chrono.py | 180 | def test_floating_point_duration(): | CODE |
| LOW | tests/test_chrono.py | 200 | def test_chrono_different_resolutions(): | CODE |
| LOW | tests/conftest.py | 34 | def use_multiprocessing_forkserver_on_linux(): | CODE |
| LOW | tests/conftest.py | 205 | def pytest_assertrepr_compare(op, left, right): # noqa: ARG001 | CODE |
| LOW | tests/conftest.py | 228 | def delattr_and_ensure_destroyed(*specs): | CODE |
| LOW | tests/test_callbacks.py | 38 | def test_bound_method_callback(): | CODE |
| LOW | tests/test_callbacks.py | 51 | def test_keyword_args_and_generalized_unpacking(): | CODE |
| LOW⚡ | tests/test_callbacks.py | 94 | def test_lambda_closure_cleanup(): | CODE |
| LOW⚡ | tests/test_callbacks.py | 103 | def test_cpp_callable_cleanup(): | CODE |
| LOW⚡ | tests/test_callbacks.py | 108 | def test_cpp_function_roundtrip(): | CODE |
| LOW | tests/test_callbacks.py | 191 | def test_async_async_callbacks(): | CODE |
| LOW | tests/test_callbacks.py | 239 | def test_boost_histogram_apply_custom_transform(): | CODE |
| LOW | tests/test_warnings.py | 30 | def test_warning_wrong_subclass_fail(): | CODE |
| LOW | tests/test_warnings.py | 41 | def test_warning_double_register_fail(): | CODE |
| LOW | tests/test_pytypes.py | 473 | def test_non_converting_constructors(): | CODE |
| LOW⚡ | tests/test_pytypes.py | 661 | def test_memoryview_from_buffer_empty_shape(): | STRING |
| LOW⚡ | tests/test_pytypes.py | 668 | def test_test_memoryview_from_buffer_invalid_strides(): | STRING |
| LOW⚡ | tests/test_pytypes.py | 673 | def test_test_memoryview_from_buffer_nullptr(): | STRING |
| LOW⚡ | tests/test_pytypes.py | 678 | def test_memoryview_from_memory(): | STRING |
| LOW⚡ | tests/test_pytypes.py | 924 | def test_tuple_nonempty_annotations(doc): | STRING |
| LOW⚡ | tests/test_pytypes.py | 931 | def test_tuple_empty_annotations(doc): | STRING |
| LOW⚡ | tests/test_pytypes.py | 937 | def test_tuple_variable_length_annotations(doc): | STRING |
| LOW⚡ | tests/test_pytypes.py | 1008 | def test_union_object_annotations(doc): | STRING |
| LOW⚡ | tests/test_pytypes.py | 1015 | def test_optional_annotations(doc): | STRING |
| LOW⚡ | tests/test_pytypes.py | 1021 | def test_type_guard_annotations(doc, backport_typehints): | STRING |
| LOW | tests/test_pytypes.py | 208 | def test_unhashable_exceptions(arg, func): | STRING |
| 277 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | noxfile.py | 7 | CODE | |
| LOW | tools/libsize.py | 1 | CODE | |
| LOW | tools/make_changelog.py | 7 | CODE | |
| LOW | tools/make_global.py | 6 | CODE | |
| LOW | tools/codespell_ignore_lines_from_errors.py | 12 | CODE | |
| LOW | pybind11/setup_helpers.py | 39 | CODE | |
| LOW | pybind11/_version.py | 5 | CODE | |
| LOW | pybind11/__init__.py | 1 | CODE | |
| LOW | pybind11/__init__.py | 10 | CODE | |
| LOW | pybind11/__init__.py | 11 | CODE | |
| LOW | pybind11/__init__.py | 11 | CODE | |
| LOW | pybind11/__init__.py | 11 | CODE | |
| LOW | pybind11/commands.py | 1 | CODE | |
| LOW | pybind11/__main__.py | 2 | CODE | |
| LOW | tests/test_stl_binders.py | 1 | CODE | |
| LOW | tests/test_methods_and_attributes.py | 1 | CODE | |
| LOW | tests/test_sequences_and_iterators.py | 1 | CODE | |
| LOW | tests/test_vector_unique_ptr_member.py | 1 | CODE | |
| LOW | tests/test_numpy_vectorize.py | 1 | CODE | |
| LOW | tests/test_class_release_gil_before_calling_cpp_dtor.py | 1 | CODE | |
| LOW | tests/test_chrono.py | 1 | CODE | |
| LOW | tests/test_chrono.py | 7 | CODE | |
| LOW | tests/conftest.py | 7 | CODE | |
| LOW | tests/test_python_multiple_inheritance.py | 3 | CODE | |
| LOW | tests/test_callbacks.py | 1 | CODE | |
| LOW | tests/test_callbacks.py | 9 | CODE | |
| LOW | tests/test_warnings.py | 1 | CODE | |
| LOW | tests/test_warnings.py | 7 | CODE | |
| LOW | tests/test_pytypes.py | 1 | CODE | |
| LOW | tests/test_class.py | 1 | CODE | |
| LOW | tests/env.py | 1 | CODE | |
| LOW | tests/test_class_sh_trampoline_self_life_support.py | 1 | CODE | |
| LOW | tests/test_class_sh_property_non_owning.py | 1 | CODE | |
| LOW | tests/test_docs_advanced_cast_custom.py | 1 | CODE | |
| LOW | tests/test_eigen_tensor.py | 1 | CODE | |
| LOW | tests/test_eigen_tensor.py | 7 | CODE | |
| LOW | tests/test_class_sh_trampoline_shared_from_this.py | 1 | CODE | |
| LOW | tests/test_docstring_options.py | 1 | CODE | |
| LOW | tests/test_cpp_conduit.py | 3 | CODE | |
| LOW | tests/test_class_sh_disowning_mi.py | 1 | CODE | |
| LOW | tests/test_class_sh_disowning_mi.py | 5 | CODE | |
| LOW | tests/test_async.py | 1 | CODE | |
| LOW | tests/test_unnamed_namespace_a.py | 1 | CODE | |
| LOW | tests/test_class_sh_basic.py | 2 | CODE | |
| LOW | tests/test_class_sh_trampoline_basic.py | 1 | CODE | |
| LOW | tests/test_local_bindings.py | 1 | CODE | |
| LOW | tests/test_class_sh_factory_constructors.py | 1 | CODE | |
| LOW | tests/test_smart_ptr.py | 1 | CODE | |
| LOW | tests/test_smart_ptr.py | 5 | CODE | |
| LOW | tests/test_numpy_array.py | 1 | CODE | |
| LOW | tests/test_numpy_array.py | 7 | CODE | |
| LOW | tests/test_builtin_casters.py | 1 | CODE | |
| LOW | tests/test_constants_and_functions.py | 1 | CODE | |
| LOW | tests/test_exceptions.py | 1 | CODE | |
| LOW | tests/test_factory_constructors.py | 1 | CODE | |
| LOW | tests/test_factory_constructors.py | 7 | CODE | |
| LOW | tests/test_iostream.py | 1 | CODE | |
| LOW | tests/test_operator_overloading.py | 1 | CODE | |
| LOW | tests/test_union.py | 1 | CODE | |
| LOW | tests/test_kwargs_and_defaults.py | 1 | CODE | |
| 59 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .pre-commit-config.yaml | 1 | # To use: | COMMENT |
| LOW | .cmake-format.yaml | 21 | # arguments, then force it to a vertical layout. | COMMENT |
| LOW | tools/check-style.sh | 1 | #!/bin/bash | COMMENT |
| LOW | include/pybind11/numpy.h | 21 | #include <cstdlib> | COMMENT |
| LOW | include/pybind11/numpy.h | 461 | PYBIND11_NUMPY_SCALAR_IMPL(std::complex<double>, NPY_CDOUBLE); | COMMENT |
| LOW | include/pybind11/numpy.h | 921 | // Note: The signature, `dtype::char_` follows the naming of NumPy's | COMMENT |
| LOW | include/pybind11/numpy.h | 1801 | COMMENT | |
| LOW | include/pybind11/numpy.h | 1821 | # define PYBIND11_MAP_END(...) | COMMENT |
| LOW | include/pybind11/pybind11.h | 21 | #include "gil.h" | COMMENT |
| LOW | include/pybind11/pybind11.h | 261 | #else | COMMENT |
| LOW | include/pybind11/pybind11.h | 701 | COMMENT | |
| LOW | include/pybind11/iostream.h | 21 | COMMENT | |
| LOW | include/pybind11/subinterpreter.h | 21 | COMMENT | |
| LOW | include/pybind11/subinterpreter.h | 261 | /// A single OS thread can hold one of these per subinterpreter and alternate between them via | COMMENT |
| LOW | include/pybind11/native_enum.h | 1 | // Copyright (c) 2022-2025 The pybind Community. | COMMENT |
| LOW | include/pybind11/stl.h | 21 | #include <memory> | COMMENT |
| LOW | include/pybind11/common.h | 1 | #include "detail/common.h" | COMMENT |
| LOW | include/pybind11/cast.h | 21 | COMMENT | |
| LOW | include/pybind11/cast.h | 1121 | template <typename T> | COMMENT |
| LOW | include/pybind11/cast.h | 1141 | /// as exercised in tests/test_potentially_slicing_weak_ptr.cpp,py (look for | COMMENT |
| LOW | include/pybind11/cast.h | 2441 | /// Lets you pass a type containing a `,` through a macro parameter without needing a separate | COMMENT |
| LOW | include/pybind11/trampoline_self_life_support.h | 1 | // Copyright (c) 2021 The Pybind Development Team. | COMMENT |
| LOW | include/pybind11/gil_safe_call_once.h | 1 | // Copyright (c) 2023 The pybind Community. | COMMENT |
| LOW | include/pybind11/gil_safe_call_once.h | 21 | PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) | COMMENT |
| LOW | include/pybind11/gil_safe_call_once.h | 41 | // | COMMENT |
| LOW | include/pybind11/gil_safe_call_once.h | 61 | // normal Python code. However, this will be unnoticeable for quick call-once | COMMENT |
| LOW | include/pybind11/gil_safe_call_once.h | 261 | return detail::atomic_get_or_create_in_state_dict<storage_type>(get_storage_key().c_str()) | COMMENT |
| LOW | include/pybind11/pytypes.h | 761 | COMMENT | |
| LOW | include/pybind11/conduit/pybind11_platform_abi_id.h | 1 | #pragma once | COMMENT |
| LOW | include/pybind11/conduit/pybind11_platform_abi_id.h | 21 | # define PYBIND11_COMPILER_TYPE "mingw" | COMMENT |
| LOW | include/pybind11/conduit/pybind11_platform_abi_id.h | 41 | # if defined(_MT) && defined(_DLL) // Corresponding to CL command line options /MD or /MDd. | COMMENT |
| LOW | include/pybind11/conduit/pybind11_platform_abi_id.h | 61 | // // Assume that NVHPC is in the 1xxx ABI family. | COMMENT |
| LOW | include/pybind11/conduit/pybind11_platform_abi_id.h | 81 | # define PYBIND11_BUILD_TYPE "_debug" | COMMENT |
| LOW | include/pybind11/conduit/wrap_include_python_h.h | 1 | #pragma once | COMMENT |
| LOW | include/pybind11/conduit/wrap_include_python_h.h | 21 | // See https://github.com/pybind/pybind11/pull/3497 for full context. | COMMENT |
| LOW | include/pybind11/conduit/wrap_include_python_h.h | 41 | // C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removed | COMMENT |
| LOW | include/pybind11/conduit/wrap_include_python_h.h | 61 | # undef isalnum | COMMENT |
| LOW | include/pybind11/stl/filesystem.h | 1 | // Copyright (c) 2021 The Pybind Development Team. | COMMENT |
| LOW | include/pybind11/detail/type_caster_base.h | 21 | #include "typeid.h" | COMMENT |
| LOW | include/pybind11/detail/type_caster_base.h | 41 | /// A life support system for temporary objects created by `type_caster::load()`. | COMMENT |
| LOW | include/pybind11/detail/type_caster_base.h | 1561 | template <> | COMMENT |
| LOW | include/pybind11/detail/function_ref.h | 1 | /* | COMMENT |
| LOW | include/pybind11/detail/function_ref.h | 21 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | include/pybind11/detail/function_record_pyobject.h | 1 | // Copyright (c) 2024-2025 The Pybind Development Team. | COMMENT |
| LOW | include/pybind11/detail/function_record_pyobject.h | 41 | // unhelpful compiler warnings. | COMMENT |
| LOW | include/pybind11/detail/internals.h | 21 | #include <cstdint> | COMMENT |
| LOW | include/pybind11/detail/internals.h | 41 | #ifndef PYBIND11_INTERNALS_VERSION | COMMENT |
| LOW | include/pybind11/detail/internals.h | 61 | _Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"") /**/ \ | COMMENT |
| LOW | include/pybind11/detail/internals.h | 301 | /// `PYBIND11_INTERNALS_VERSION` must be incremented. | COMMENT |
| LOW | include/pybind11/detail/internals.h | 581 | COMMENT | |
| LOW | include/pybind11/detail/internals.h | 621 | } | COMMENT |
| LOW | include/pybind11/detail/internals.h | 821 | on_fetch_function *on_fetch_ = nullptr; | COMMENT |
| LOW | include/pybind11/detail/argument_vector.h | 21 | #include <cstring> | COMMENT |
| LOW | include/pybind11/detail/common.h | 21 | #define PYBIND11_VERSION_MINOR 1 | COMMENT |
| LOW | include/pybind11/detail/common.h | 41 | Py_PACK_FULL_VERSION(PYBIND11_VERSION_MAJOR, \ | COMMENT |
| LOW | include/pybind11/detail/common.h | 61 | // MSVC sets _MSVC_LANG rather than __cplusplus (supposedly until the standard is fully | COMMENT |
| LOW | include/pybind11/detail/common.h | 81 | COMMENT | |
| LOW | include/pybind11/detail/common.h | 101 | #else | COMMENT |
| LOW | include/pybind11/detail/common.h | 121 | # if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3) | COMMENT |
| LOW | include/pybind11/detail/common.h | 141 | # if defined(WIN32) || defined(_WIN32) | COMMENT |
| 52 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH⚡ | tests/test_methods_and_attributes.py | 594 | - Return (Class::*)(Args...) const && noexcept (peek_noexcept) | CODE |
| HIGH | tests/test_methods_and_attributes.py | 632 | - overload_cast_impl::operator()(Return (Class::*)(Args...) const && noexcept, true_type) | CODE |
| HIGH⚡ | tests/test_methods_and_attributes.py | 652 | - overload_cast_impl::operator()(Return (Class::*)(Args...) const && noexcept, true_type) | CODE |
| HIGH⚡ | tests/test_methods_and_attributes.py | 658 | assert obj.method_const_rref_noexcept(1.0) == "(double) const && noexcept" | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_eval_call.py | 1 | # This file is called from 'test_eval.py' | COMMENT |
| MEDIUM | tests/test_custom_type_setup.py | 69 | # Create a self-referential cycle that will be collected during shutdown. | COMMENT |
| MEDIUM | docs/conf.py | 6 | # This file is execfile()d with the current directory set to its | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | pybind11/__main__.py | 28 | # about nuanced counting here. | COMMENT |
| MEDIUM | tests/test_numpy_array.py | 663 | # HINT: An easy and robust way (although only manual unfortunately) to check for | COMMENT |
| LOW | tests/test_modules.py | 138 | # changes in future Python versions, simply add the new expected exception types here. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | include/pybind11/detail/class.h | 662 | // Fill in all the information, and then downgrade as requested by the caller, or raise an | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/codespell_ignore_lines_from_errors.py | 17 | CODE | |
| LOW | pybind11/setup_helpers.py | 286 | CODE | |
| LOW | tests/test_numpy_array.py | 603 | CODE | |
| LOW | tests/test_factory_constructors.py | 481 | CODE | |
| LOW | tests/test_factory_constructors.py | 499 | CODE | |
| LOW | tests/test_numpy_dtypes.py | 374 | CODE | |
| LOW | tests/test_gil_scoped.py | 170 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/conftest.py | 27 | except Exception: | CODE |
| LOW | tests/test_thread.py | 22 | except Exception as e: | CODE |
| MEDIUM | tests/test_thread.py | 18 | def run(self): | CODE |
| LOW | tests/test_multiple_interpreters.py | 115 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/libsize.py | 7 | # Usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_numpy_array.py | 670 | # value increases without bounds. (Don't forget to Ctrl-C the test!) | COMMENT |