GeezerVison is showing github.com — Updated level2 Q generation functions by jprhyne · Pull Request #1216 · Reference-LAPACK/lapack
Conversation
jprhyne
commented
Mar 27, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Description
During my work on the draft pr #1112 we found that the level2 factorization does not properly take advantage of (1) the initial application of the ``first'' reflector to the identity and the 0s in the subsequent blocks. The advantages are as follows
-
We no longer require a workspace for the level2 Q generation functions. I did not remove this array from the interface
as I am unsure if we want to actually change the interface and instead say we no longer use this array potentially for backwards compatibility on future releases.
-
We perform fewer operations overall
One slight drawback is in the case of complex arithmetic, we need to compute a kernel of the form
y = alpha*A*conjg(x) + beta*y
which is a gemv but conjugating x without conjugating the matrix A. I implemented this in a way to compute elements of y sequentially and did not investigate other methods. I only wrote tests in a personal repo that I can attempt to port or attach to this PR. I only tested the cases of when incx and incy are positive as I do not have a use case for the negative increment cases.
If there is anything I missed or any questions just let me know!
Checklist
- The documentation has been updated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…antage of assumed 0s and 1s instead of explicitly setting them
…nd removed erronous zero setting in xorg2l/xung2l
…antage of assumed 0s and 1s instead of explicitly setting them. Rebasing onto new Master branch
…nd removed erronous zero setting in xorg2l/xung2l
|
Just tried rebasing to new master and letting tests run before doing another pass. Will comment again once my pass is done (should probably make it a draft but oh well)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codecov
Bot
commented
Oct 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
❌ Patch coverage is 96.66667% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.67%. Comparing base (6a1a8b8) to head (5e6433f).
⚠️ Report is 114 commits behind head on master.
✅ All tests successful. No failed tests found.
Additional details and impacted files

@@ Coverage Diff @@
## master #1216 +/- ##
==========================================
+ Coverage 69.72% 70.67% +0.95%
==========================================
Files 6204 6247 +43
Lines 497194 501701 +4507
Branches 23430 23516 +86
==========================================
+ Hits 346652 354571 +7919
+ Misses 150116 146267 -3849
- Partials 426 863 +437
... and 428 files with indirect coverage changes
Continue to review full report in Codecov by Harness.
Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a1a8b8...5e6433f. Read the comment docs.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
If all these pass, all edits are done
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I plan to work on fixing the errors sourced from my changes this evening, but it seems that things I didn't touch are affected: like zlange
Here are two snippets from the logs: (first indicates I may be to blame the second indicates that it affects things that I didn't touch as well)
2026-10-28T01:44:57.3801001Z ==33847== Conditional jump or move depends on uninitialised value(s)
2026-10-28T01:44:57.3801986Z ==33847== at 0x61329AB: zgeru_ (zgeru.f:194)
2026-10-28T01:44:57.3802617Z ==33847== by 0x57D87C2: zlarf0c2_ (zlarf0c2.f:318)
2026-10-28T01:44:57.3803224Z ==33847== by 0x592745C: zung2r_ (zung2r.f:196)
2026-10-28T01:44:57.3803815Z ==33847== by 0x592C67F: zungqr_ (zungqr.f:243)
2026-10-28T01:44:57.3804783Z ==33847== by 0x5927CC0: zungbr_ (zungbr.f:264)
2026-10-28T01:44:57.3805177Z ==33847== by 0x560214D: zgesvd_ (zgesvd.f:941)
2026-10-28T01:44:57.3805597Z ==33847== by 0x59DF7AD: zgedmd_ (zgedmd.f90:929)
2026-10-28T01:44:57.3806015Z ==33847== by 0x114DC6: MAIN__ (zchkdmd.f90:508)
2026-10-28T01:44:57.3806373Z ==33847== by 0x11C71F: main (zchkdmd.f90:751)
2026-10-28T01:44:57.3806746Z ==33847== Uninitialised value was created by a heap allocation
2026-10-28T01:44:57.3807548Z ==33847== at 0x4846828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
2026-10-28T01:44:57.3808490Z ==33847== by 0x11472C: MAIN__ (zchkdmd.f90:365)
2026-10-28T01:44:57.3809042Z ==33847== by 0x11C71F: main (zchkdmd.f90:751)
2026-10-28T01:44:57.3809527Z ==33847==
2026-10-28T01:44:57.3810001Z ==33847== Conditional jump or move depends on uninitialised value(s)
2026-10-28T01:44:57.3810705Z ==33847== at 0x6528470: hypot@@GLIBC_2.35 (e_hypot.c:99)
2026-10-28T01:44:57.3811313Z ==33847== by 0x5792A30: zlange_ (zlange.f:159)
2026-10-28T01:44:57.3812142Z ==33847== by 0x55D1E5B: zgeev_ (zgeev.f:329)
2026-10-28T01:44:57.3812700Z ==33847== by 0x59E0949: zgedmd_ (zgedmd.f90:496)
2026-10-28T01:44:57.3813363Z ==33847== by 0x114DC6: MAIN__ (zchkdmd.f90:508)
2026-10-28T01:44:57.3813921Z ==33847== by 0x11C71F: main (zchkdmd.f90:751)
2026-10-28T01:44:57.3814566Z ==33847== Uninitialised value was created by a heap allocation
2026-10-28T01:44:57.3815436Z ==33847== at 0x4846828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
2026-10-28T01:44:57.3816241Z ==33847== by 0x11472C: MAIN__ (zchkdmd.f90:365)
2026-10-28T01:44:57.3816794Z ==33847== by 0x11C71F: main (zchkdmd.f90:751)
Not sure if this is affecting other PRs or this is just 1 issue being propagated due to weird memory corruption
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Converting to a draft as more development than a simple bug fix is required. Will either reopen or make a new PR with everything a little more digestible (trying out using git squash)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @jprhyne. Let us see if we can get this to pass the test suite. There is an issue right now somewhere.
You list two advantages:
( 1 / 2 ) We no longer require a workspace for the level2 Q generation functions.
That's great!
( 2 / 2 ) We perform fewer operations overall
Good. But super minimal since we only save O(n²) for an O(n³) algorithm. But good to save a few FLOPS.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
jprhyne
commented
Nov 25, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
I tried squashing this into two commits but it kept taking me through several hundred unrelated commits likely due to how I merged master instead of rebasing onto it.
Removing the unnecessary blas-like kernels since gemm can effectively do the job. Maybe consider adding a routine that does
y = A*conjg(x) + \alpha y
in a separate pull request. I have an implementation already written and can open this if we would like (in which case we can change the {c,z}larf0c2 routines to now use these routines).
I'm opening this for review since no actually called code was changed between the previous CI tests where all passed. Hopefully no black magic happens to make it fail now.
edit: do vs due
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
END DO
|
|
|
ELSE
|
|
|
*
|
|
|
* C1 = -tau * v'*C2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jprhyne: can you add a comment here that you are using GEMM on vectors because GEMV does not have a flag to conjugate the "x" vector? So, in essence, this GEMM call is a Level 2 BLAS operation. Ditto for Z arithmetic. Here is a suggested wording.
We call GEMM on vector "v". Indeed GEMV does not enable to conjugate input-only vector "x", so to use GEMV, we would have to conjugate "v", call GEMV, and then "un-conjugate" "v". In essence, this GEMM call is a Level 2 BLAS call since it performs "matrix times vector".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Reviewers
langou
langou left review comments
At least 1 approving review is required to merge this pull request.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|