Skip to content

Fix boosting buffer leaks and purification edge cases - #693

Closed
paulbkoch wants to merge 2 commits into
mainfrom
paulbkoch-clang-tidy-warnings
Closed

paulbkoch wants to merge 2 commits into
mainfrom
paulbkoch-clang-tidy-warnings

Conversation

@paulbkoch

@paulbkoch paulbkoch commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Narrowed at the author's request to only three runtime bugs identified while investigating the Windows analysis job:

  • Free aWeights on all eight early returns after its allocation in multidimensional boosting. No allocation reordering or cleanup refactor.
  • Reject overflow when summing purification surface-bin counts.
  • Skip the randomization-buffer allocation when the surface-bin count is zero, avoiding a false out-of-memory error on platforms where malloc(0) returns null.

The production diff is eight added cleanup calls, a four-line overflow guard, and one changed allocation condition. Two focused purification regression tests are retained. All analyzer-only assertions, pointer initialization, string-copy changes, build warning suppression, and other refactoring have been removed. This PR no longer aims to eliminate every static-analysis warning.

Validation

Rebuilt the final Windows x64 release library and passed all 348 native C API tests, including the two purification regressions. Changed-file formatting and git diff --check pass.

Local validation used Visual Studio 2026 v145. Local-only /wd4875 and /IGNORE:4315 options accommodated existing compiler/linker deprecations; these options are not included in the changes.

Correct multidimensional boosting cleanup and purification allocation edge cases, replace the exponent string copy, and expose bounds and flag invariants to static analysis.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a4c53337-212c-416f-87b1-6848855a668b
@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.28%. Comparing base (7becc92) to head (3f6a89a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #693      +/-   ##
==========================================
- Coverage   67.30%   67.28%   -0.02%     
==========================================
  Files          77       77              
  Lines       11739    11739              
==========================================
- Hits         7901     7899       -2     
- Misses       3838     3840       +2     
Flag Coverage Δ
bdist_linux_311_python 67.05% <ø> (ø)
bdist_linux_312_python ?
bdist_linux_313_python ?
bdist_linux_314_python 66.96% <ø> (ø)
bdist_linuxarm_311_python 67.07% <ø> (ø)
bdist_linuxarm_312_python ?
bdist_linuxarm_313_python ?
bdist_linuxarm_314_python 66.98% <ø> (ø)
bdist_mac_311_python 67.22% <ø> (ø)
bdist_mac_312_python ?
bdist_mac_313_python ?
bdist_mac_314_python 67.12% <ø> (ø)
bdist_win_311_python 67.22% <ø> (-0.02%) ⬇️
bdist_win_312_python ?
bdist_win_313_python ?
bdist_win_314_python 67.14% <ø> (ø)
sdist_linux_311_python ?
sdist_linux_312_python ?
sdist_linux_313_python ?
sdist_linux_314_python ?
sdist_linuxarm_311_python ?
sdist_linuxarm_312_python ?
sdist_linuxarm_313_python ?
sdist_linuxarm_314_python ?
sdist_mac_311_python ?
sdist_mac_312_python ?
sdist_mac_313_python ?
sdist_mac_314_python ?
sdist_win_311_python ?
sdist_win_312_python ?
sdist_win_313_python ?
sdist_win_314_python ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Remove analyzer-only changes and reduce the boosting leak fix to freeing the purification buffer on each early return. Keep the two purification fixes and their regression tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a4c53337-212c-416f-87b1-6848855a668b
@paulbkoch paulbkoch changed the title Fix remaining Windows clang-tidy warnings Fix boosting buffer leaks and purification edge cases Oct 17, 2026
@paulbkoch

Copy link
Copy Markdown
Collaborator Author

Closing since I corrected these in main branch

@paulbkoch paulbkoch closed this Oct 17, 2026
@paulbkoch
paulbkoch deleted the paulbkoch-clang-tidy-warnings branch October 17, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant