-
Notifications
You must be signed in to change notification settings - Fork 10
maintenance/improve test coverage #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
maintenance/improve test coverage #213
Conversation
|
@phlexbot format |
|
Automatic cmake-format fixes pushed (commit e60d811). |
|
@phlexbot format |
|
No automatic cmake-format fixes were necessary. |
|
Automatic clang-format fixes pushed (commit 2aa7957). |
|
@phlexbot python-fix |
|
Automatic Python linting fixes pushed (commit 092dec4). |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (65.87%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## main #213 +/- ##
==========================================
+ Coverage 75.87% 78.70% +2.82%
==========================================
Files 124 124
Lines 2898 3156 +258
Branches 506 576 +70
==========================================
+ Hits 2199 2484 +285
+ Misses 483 429 -54
- Partials 216 243 +27
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
38fc738 to
47661fa
Compare
|
@phlexbot format |
|
No automatic clang-format fixes were necessary. |
|
Automatic cmake-format fixes pushed (commit bb954c8). |
|
@phlexbot python-fix |
|
Automatic Python linting fixes pushed (commit cfdb09a). |
c9ccf06 to
1159796
Compare
|
@phlexbot format |
|
Automatic clang-format fixes pushed (commit b145a22). |
|
@phlexbot format |
|
Automatic cmake-format fixes pushed (commit cc928e7). |
|
No automatic clang-format fixes were necessary. |
|
Automatic cmake-format fixes pushed (commit 38a38fe). |
|
No automatic clang-format fixes were necessary. |
|
@phlexbot python fix |
|
@phlexbot format |
|
No automatic clang-format fixes were necessary. |
|
Automatic cmake-format fixes pushed (commit 1354192). |
|
@phlexbot python-fix |
|
Automatic Python linting fixes pushed (commit 6b1f634). |
d48f0ff to
b0b30b1
Compare
|
@phlexbot python-fix |
|
@phlexbot format |
|
Automatic Python linting fixes pushed (commit b1c55bf). |
|
No automatic clang-format fixes were necessary. |
|
@phlexbot format |
|
No automatic clang-format fixes were necessary. |
|
Automatic cmake-format fixes pushed (commit f8a3c8d). |
Non-test changes:
1. Python/C++ Interoperability Enhancements
Files: modulewrap.cpp, lifelinewrap.cpp
Feature: RAII for Python Objects
PyObjectPtr(astd::shared_ptralias with a customPyObjectDeleter) to manage Python object reference counts.Py_INCREF/Py_DECREF) is error-prone, especially in the presence of C++ exceptions. If an exception is thrown, manual decrements might be skipped, leading to memory leaks.PyObjectPtrensures thatPy_DECREFis called automatically when the pointer goes out of scope, even during stack unwinding.Fix: Robust Annotation Parsing
parse_argsto iterate over the__annotations__dictionary usingPyDict_Nextand explicitly skip the"return"key.PyDict_Values, which returns all values including the return type annotation. Depending on dictionary iteration order (which can vary or be insertion-ordered), the return type could be mistakenly interpreted as an input argument type.Fix: Flexible Input Conversion (List vs. NumPy)
py_to_vint,py_to_vuint, etc.) that accept both Pythonlistand NumPyndarrayobjects.PyList_CheckvsPyArray_Check) and handle data extraction accordingly.Fix: Memory Safety in Cyclic GC
PyObject_GC_UnTrack(pyobj)inll_dealloc(lifelinewrap.cpp).Fix: Type String Matching
inp_type.compare(pos, ...)) with robust substring searching (suffix.find(...)). Corrected a typo wheredouble64]]was checked instead offloat64]].float64arrays from being correctly identified.2. Build System & CI Improvements
Files: CMakeLists.txt, CMakeLists.txt
Enhancement: Reduced Build Dependencies
packagingPython module in CMakeLists.txt.packaging.versionto check module versions. This required thepackaginglibrary to be installed in the build environment..) to perform the check using only the standard library.Fix: GCC 14+ Warning Suppression
-Wno-maybe-uninitializedto compile options for GCC 14.1+.3. Documentation
Files: copilot-instructions.md
Test code changes and additions:
1. New Tests:
py:vectypesandpy:typesFiles: vectypes.py, test_types.py, pyvectypes.jsonnet, pytypes.jsonnet, verify_extended.py
Rationale:
float,double).unsigned int,unsigned long).long,int64_t).modulewrap.cppconverters.Coverage Improvements:
py:types: Validates scalar type conversion between C++ and Python forfloat,double, andunsigned int.py:vectypes: Validates vector/array conversion. It tests:collectify_*).sum_array_*).int32,uint32,int64,uint64,float32,float64.VerifierFloat,VerifierUInt, etc.) that handle type-specific assertions (e.g., epsilon comparison for floats).Problems Exposed:
py:vectypestest exposed a logic error in source.cpp where large 64-bit hashes were being used in arithmetic (100 - id), causing underflow for unsigned types and wrapping for signed types. This was fixed by introducing modulo arithmetic to keep values small and predictable.modulewrap.cpp.Regression Detection:
modulewrap.cppbreak the mapping between C++ types (likestd::vector<int>) and Python types (likenumpy.ndarrayorlist).UINT_MAXas-1).2. Test Infrastructure Enhancements
Files: CMakeLists.txt, source.cpp
Rationale:
Changes:
py:vectypesandpy:typesto the test suite.PYTHONPATHsetup to explicitly includePython_SITELIBandPython_SITEARCH. This ensures tests running in embedded environments (like Spack) can find installed packages.packagingdependency with a simple inline version parser for the module check.float,double,uint,int64,uint64).id.number()toid.number() % Nto prevent integer overflow and ensure deterministic summation results.3. Code Quality & Modernization
Files: adder.py, all_config.py, reducer.py, sumit.py, verify.py
Rationale:
ruff,mypy) introduced in this commit.Changes:
False(changed== Falsetois Falseor kept as is with# noqaif intentional for testing).mypy.Regression Detection: