GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Updated level2 Q generation functions by jprhyne · Pull Request #1216 · Reference-LAPACK/lapack

Conversation

@jprhyne

@jprhyne jprhyne commented Mar 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

  1. 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.

  2. 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.

All reactions
jprhyne added 2 commits March 26, 2026 18:04
@jprhyne
updating level2 q generation functions (ungX,orgX family) to take adv…
72debbe
…antage of assumed 0s and 1s instead of explicitly setting them
@jprhyne
fixed some documentation inconsistencies noticed in the PR interface
848369a
@langou langou mentioned this pull request Mar 27, 2026
typo, thanks to @jasonriedy for letting me know #1215
Merged
@jprhyne
Fixed out of bounds array access in xorg2r/xung2r and xorgl2/xungl2 a…
88aac6c
…nd removed erronous zero setting in xorg2l/xung2l
@jprhyne jprhyne mentioned this pull request Oct 26, 2026
Xorgqr #1112
Draft
2 tasks done
jprhyne added 5 commits October 26, 2026 11:46
@jprhyne
updating level2 q generation functions (ungX,orgX family) to take adv…
ee3546c
…antage of assumed 0s and 1s instead of explicitly setting them. Rebasing onto new Master branch
@jprhyne
fixed some documentation inconsistencies noticed in the PR interface
e8c1e1f
@jprhyne
Fixed out of bounds array access in xorg2r/xung2r and xorgl2/xungl2 a…
d5d0524
…nd removed erronous zero setting in xorg2l/xung2l
@jprhyne
removing lapack_64.h from this branch
d6cc931
@jprhyne
Merge branch 'master' into level2Q
1a650c2
@jprhyne

jprhyne commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

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)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Oct 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ 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.

Files with missing lines Patch % Lines
SRC/clarf0c2.f 95.55% 4 Missing ⚠️
SRC/dlarf0c2.f 95.55% 4 Missing ⚠️
SRC/slarf0c2.f 95.55% 4 Missing ⚠️
SRC/zlarf0c2.f 95.55% 4 Missing ⚠️
SRC/cungl2.f 93.33% 1 Missing ⚠️
SRC/dorgl2.f 93.33% 1 Missing ⚠️
SRC/sorgl2.f 93.33% 1 Missing ⚠️
SRC/zungl2.f 93.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Components Coverage Δ
BLAS 99.73% <ø> (-0.03%) ⬇️
CBLAS 96.95% <ø> (-0.04%) ⬇️
LAPACK 83.79% <96.66%> (+1.12%) ⬆️
LAPACKE 4.18% <ø> (+2.02%) ⬆️
TMGLIB 55.69% <ø> (ø)
BLAS testing 88.79% <ø> (+0.02%) ⬆️
CBLAS testing 89.65% <ø> (+0.01%) ⬆️
LAPACK testing 82.41% <ø> (+0.16%) ⬆️
LAPACKE testing ∅ <ø> (∅)
Files with missing lines Coverage Δ
SRC/cung2l.f 100.00% <100.00%> (ø)
SRC/cung2r.f 100.00% <100.00%> (ø)
SRC/cungr2.f 100.00% <100.00%> (ø)
SRC/dorg2l.f 100.00% <100.00%> (ø)
SRC/dorg2r.f 100.00% <100.00%> (ø)
SRC/dorgr2.f 100.00% <100.00%> (ø)
SRC/sorg2l.f 100.00% <100.00%> (ø)
SRC/sorg2r.f 100.00% <100.00%> (ø)
SRC/sorgr2.f 100.00% <100.00%> (ø)
SRC/zung2l.f 100.00% <100.00%> (ø)
... and 10 more

... 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jprhyne added 2 commits October 27, 2026 16:44
@jprhyne
fixing compilation related errors for the github CI Tests
c21283d
@jprhyne
Merge branch 'level2Q' of github.com:jprhyne/lapack into level2Q
a4fb8e0
@jprhyne

jprhyne commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

If all these pass, all edits are done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jprhyne

jprhyne commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jprhyne

jprhyne commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

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)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jprhyne
jprhyne marked this pull request as draft October 29, 2026 15:22
@langou

langou commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jprhyne
jprhyne force-pushed the level2Q branch from e5e26d9 to a4fb8e0 Compare November 2, 2026 15:24
jprhyne added 3 commits November 24, 2026 22:21
@jprhyne
level 2 larf0c2 is working correctly. todo: port to complex precisions
1c31e7b
@jprhyne
all precisions now work for level 2 stuff. Pushing to test CI
e16f02c
@jprhyne
removing unnecessary blas-like routines
5e6433f
@jprhyne

jprhyne commented Nov 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jprhyne
jprhyne marked this pull request as ready for review November 25, 2026 20:38
langou
langou reviewed Nov 27, 2026
View reviewed changes
Comment thread SRC/clarf0c2.f
END DO
ELSE
*
* C1 = -tau * v'*C2

@langou langou Nov 27, 2026

Copy link
Copy Markdown
Contributor

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.

All reactions

This branch has not been deployed

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

Reviewers

@langou 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

Labels

None yet

Projects

None yet

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.

2 participants

@jprhyne @langou
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.