Skip to content

Misc bugfixes#117

Merged
JordiManyer merged 3 commits into
masterfrom
bugfixes
Mar 11, 2026
Merged

Misc bugfixes#117
JordiManyer merged 3 commits into
masterfrom
bugfixes

Conversation

@JordiManyer

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a couple of PETSc backend interface bugs and extends the serial test suite to cover the corrected behaviors.

Changes:

  • Fix Algebra.muladd! for PETScVector × PETScMatrix to use the correct destination vector.
  • Fix Algebra.add_entry!(..., ::Nothing, ...) for PETScMatrix to delegate to the mutating add_entry! implementation.
  • Add/extend serial tests to exercise add_entry!(..., ::Nothing, ...) and muladd!.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/PETScAssembly.jl Corrects PETSc assembly API wrappers (muladd! and add_entry! specialization).
test/serial/PETScAssemblyTests.jl Adds coverage for add_entry! with Nothing values.
test/serial/PETScArraysTests.jl Adds a call to muladd! in array/matrix-vector tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

y = C*x
@test typeof(y) == typeof(x)
@test y == [2,3,3,3]
muladd!(y,C,x)

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

muladd! isn’t brought into scope in this test module (it’s defined under Gridap.Algebra and isn’t exported by GridapPETSc). As written, this line is likely to throw UndefVarError: muladd! not defined. Import/qualify it (e.g., using Gridap.Algebra or call Gridap.Algebra.muladd!).

Copilot uses AI. Check for mistakes.
y = C*x
@test typeof(y) == typeof(x)
@test y == [2,3,3,3]
muladd!(y,C,x)

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call isn’t currently asserting anything about the muladd! semantics (i.e., that y is updated as y ← C*x + y). Adding an explicit @test after this call would prevent regressions and ensure the new codepath is actually validated.

Suggested change
muladd!(y,C,x)
muladd!(y,C,x)
@test y == [4,6,6,6]

Copilot uses AI. Check for mistakes.
@JordiManyer
JordiManyer merged commit e8c3832 into master Mar 11, 2026
8 checks passed
@JordiManyer
JordiManyer deleted the bugfixes branch March 11, 2026 23:04
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.

2 participants