Skip to content

Resolve nightly Windows native analysis warnings - #694

Merged
paulbkoch merged 6 commits into
mainfrom
paulbkoch-clang-warning-cleanup
Oct 18, 2026
Merged

paulbkoch merged 6 commits into
mainfrom
paulbkoch-clang-warning-cleanup

Conversation

@paulbkoch

@paulbkoch paulbkoch commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Resolve the diagnostics in the Windows x64 win test_native (Schedule) step from run 39065771156.

  • Restore analysis past the obsolete unconditional StopClangAnalysis() in BoosterCore.
  • Express proven nonempty-allocation and bounds invariants using paired debug and analysis assertions. Preserve the one-dimensional purification path.
  • Reuse purification flags so the analyzer can follow allocation conditions.
  • Preserve Flatten's original ppBinCur-based branches and conditional pUpdateScore initialization. Add ANALYSIS_ASSERT(!bNominal).
  • Give ANALYSIS_ASSERT explicit clang, MSVC, and no-op fallback branches. Clang comes first because clang-cl also defines _MSC_VER; MSVC uses analysis-only __analysis_assume.
  • Keep the validated exponent copy as a single strcpy call, as requested. Remove the strcpy_NO_WARNINGS analysis-stopping wrapper and document a suppression scoped only to clang-analyzer-security.insecureAPI.strcpy at this call. All other path analysis remains enabled. Bound mantissa traversal by the validated decimal-point position.
  • Ignore only unused compiler-driver arguments introduced by MSBuild's /c; keep other source analyzer diagnostics enabled.

Verification

The earlier revision ef7312cd completed the scheduled Windows release x64 job with zero warning diagnostics, four ClangTidy invocations, passing C API tests, and a final build reporting 0 warnings and 0 errors.

Latest revision: 1039c9023d6c3a305f1e44785f02de5deabae281.

  • Preprocessor checks confirm the intended expansion for clang, clang-cl (both compiler macros defined), MSVC, GCC, and the generic fallback.
  • Targeted clang 22 and MSVC static analysis pass after the final compiler-branch revision. The single intentional strcpy NOLINT suppresses only the known-safe API-use diagnostic; no other diagnostics are emitted.
  • Full native debug rebuild and all 346 tests passed after adding MSVC assertion support, with no compiler warnings.
  • Rebuilt the debug DLL after restoring strcpy; all 189 existing numeric/purification regression cases passed.
  • Touched C++ files are formatted with clang-format 16; git diff --check is clean.

Manually dispatched nightly run 39103196729 with run_as_scheduled=true for the exact latest commit. The scheduled Windows x64 job passed: checkout confirmed 1039c9023d6c3a305f1e44785f02de5deabae281, win test_native (Schedule) succeeded, and the ordinary CI step was skipped. Its log contains all four ClangTidy invocations, passing C API tests, zero emitted warning diagnostics, and a final build reporting 0 warnings and 0 errors. Clang-tidy explicitly reports the one intentional strcpy NOLINT suppression described above. This verifies the requested step, not the completion of the entire workflow.

Additional earlier checks: native release suite (346 cases); 120 randomized purification checks across one through four dimensions including singleton dimensions; LLVM 19 and LLVM 22 analysis of the initial fixes.

Superseded CI runs for earlier PR commits were canceled.

Make existing bounds and allocation invariants visible to analysis, reuse purification and nominal flags consistently, initialize update pointers, and replace the strcpy wrapper. Restore BoosterCore analysis and ignore MSBuild-only unused driver arguments without disabling source diagnostics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a145ac79-0374-48e4-b265-e745cb43bb0d
@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.32%. Comparing base (2d36fba) to head (1039c90).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #694      +/-   ##
==========================================
+ Coverage   67.30%   67.32%   +0.01%     
==========================================
  Files          77       77              
  Lines       11739    11739              
==========================================
+ Hits         7901     7903       +2     
+ Misses       3838     3836       -2     
Flag Coverage Δ
bdist_linux_311_python 67.05% <ø> (ø)
bdist_linux_312_python 67.04% <ø> (-0.02%) ⬇️
bdist_linux_313_python 67.01% <ø> (-0.05%) ⬇️
bdist_linux_314_python 66.96% <ø> (ø)
bdist_linuxarm_311_python 67.07% <ø> (+0.01%) ⬆️
bdist_linuxarm_312_python 67.07% <ø> (+0.01%) ⬆️
bdist_linuxarm_313_python 67.07% <ø> (+0.01%) ⬆️
bdist_linuxarm_314_python 66.98% <ø> (ø)
bdist_mac_311_python 67.22% <ø> (+0.01%) ⬆️
bdist_mac_312_python 67.20% <ø> (-0.02%) ⬇️
bdist_mac_313_python 67.22% <ø> (ø)
bdist_mac_314_python 67.12% <ø> (ø)
bdist_win_311_python 67.23% <ø> (ø)
bdist_win_312_python 67.23% <ø> (+0.01%) ⬆️
bdist_win_313_python 67.22% <ø> (ø)
bdist_win_314_python 67.14% <ø> (ø)
sdist_linux_311_python 66.99% <ø> (-0.02%) ⬇️
sdist_linux_312_python 66.97% <ø> (-0.04%) ⬇️
sdist_linux_313_python 67.00% <ø> (+0.01%) ⬆️
sdist_linux_314_python 66.89% <ø> (ø)
sdist_linuxarm_311_python 66.99% <ø> (ø)
sdist_linuxarm_312_python 66.99% <ø> (ø)
sdist_linuxarm_313_python 66.99% <ø> (ø)
sdist_linuxarm_314_python 66.90% <ø> (ø)
sdist_mac_311_python 67.13% <ø> (+0.03%) ⬆️
sdist_mac_312_python 67.11% <ø> (-0.02%) ⬇️
sdist_mac_313_python 67.11% <ø> (ø)
sdist_mac_314_python 67.02% <ø> (ø)
sdist_win_311_python 67.23% <ø> (+0.02%) ⬆️
sdist_win_312_python 67.22% <ø> (ø)
sdist_win_313_python 67.23% <ø> (+0.01%) ⬆️
sdist_win_314_python 67.12% <ø> (-0.02%) ⬇️

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.

Keep the zero-dimensional and one-dimensional exits unchanged while recording the nonempty-surface invariant for higher-dimensional randomized purification.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a145ac79-0374-48e4-b265-e745cb43bb0d
Use the fixed decimal-point position of the validated float format instead of relying on character contents for the lower traversal bound. Keep the character invariant checked in debug builds.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a145ac79-0374-48e4-b265-e745cb43bb0d
Restore Flatten's original ppBinCur checks and initialize pUpdateScore only in the non-nominal branch. State the non-nominal invariant with ANALYSIS_ASSERT and use MSVC's analysis-only __analysis_assume intrinsic so C6001 is resolved without changing the runtime branching.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a145ac79-0374-48e4-b265-e745cb43bb0d
Restore strcpy instead of strlen plus memcpy. Document why the validated exponent fits after truncation and suppress only clang-analyzer-security.insecureAPI.strcpy at that call, without stopping subsequent path analysis.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a145ac79-0374-48e4-b265-e745cb43bb0d
Keep clang first because clang-cl defines both __clang__ and _MSC_VER. Use __analysis_assume only for MSVC and a no-op for compilers without the supported analysis intrinsics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a145ac79-0374-48e4-b265-e745cb43bb0d
@paulbkoch
paulbkoch merged commit d82ea62 into main Oct 18, 2026
155 of 156 checks passed
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