Skip to content

Fix block Svd_truncate and Gesvd_truncate return_err output#767

Open
yingjerkao wants to merge 1 commit intomasterfrom
fix/762-block-truncation-return-err
Open

Fix block Svd_truncate and Gesvd_truncate return_err output#767
yingjerkao wants to merge 1 commit intomasterfrom
fix/762-block-truncation-return-err

Conversation

@yingjerkao
Copy link
Copy Markdown
Collaborator

@yingjerkao yingjerkao commented Apr 3, 2026

Fixes #762.

Summary

  • make block Svd_truncate and Gesvd_truncate return discarded singular values in the return_err path
  • make return_err == 1 return the first discarded singular value instead of the smallest kept value
  • keep block output ordering consistent with the dense truncation path
  • add regressions for both block APIs and the return_err == 1 edge case

Verification

  • ./build/openblas-cpu/tests/test_main --gtest_filter="linalg_Test.BkUt_Svd_truncate_return_err_returns_discarded_values:linalg_Test.BkUt_Gesvd_truncate_return_err_returns_discarded_values:linalg_Test.BkUt_Svd_truncate_return_err_one_returns_first_discarded_value:linalg_Test.BkUt_Gesvd_truncate_return_err_one_returns_first_discarded_value"
  • ./build/openblas-cpu/tests/test_main --gtest_filter="Svd_truncate.*:Gesvd_truncate.*:linalg_Test.BkUt_Svd_truncate1:linalg_Test.BkUt_Svd_truncate2:DenseUt_Svd_truncate:DenseUt_Gesvd_truncate"

@yingjerkao yingjerkao changed the title Fix block truncation return_err semantics Fix block Svd_truncate and Gesvd_truncate return_err output Apr 3, 2026
@yingjerkao yingjerkao marked this pull request as ready for review April 3, 2026 16:19
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.58%. Comparing base (a22dd1e) to head (1ede487).
⚠️ Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
src/linalg/Gesvd_truncate.cpp 75.00% 3 Missing and 1 partial ⚠️
src/linalg/Svd_truncate.cpp 75.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #767      +/-   ##
==========================================
+ Coverage   35.47%   35.58%   +0.11%     
==========================================
  Files         214      214              
  Lines       33007    33013       +6     
  Branches    13130    13145      +15     
==========================================
+ Hits        11709    11748      +39     
+ Misses      19376    19350      -26     
+ Partials     1922     1915       -7     

☔ View full report in Codecov by Sentry.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Svd_truncate/Gesvd_truncate return wrong discarded singular values for symmetric UniTensor

1 participant