Skip to content

Fix solve for all-0 matrices - #4766

Open
diracdeltafunk wants to merge 1 commit into
Macaulay2:developmentfrom
aimathconference:codex/fix-qq-zero-solve
Open

diracdeltafunk wants to merge 1 commit into
Macaulay2:developmentfrom
aimathconference:codex/fix-qq-zero-solve

Conversation

@diracdeltafunk

@diracdeltafunk diracdeltafunk commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

For a zero rational system, solve could crash while reading the last element of an empty pivot profile. This is a one-line fix for that problem.

Related issues and pull requests

Fixes #2831.

Testing

Built M2-engine, M2-binary, and M2-core. I felt that a new test file is not needed for this change; happy to add one if desired.

Release notes

Fix a crash in solve for zero rational systems.

AI disclosure

  • AI produced most or all of the content, which I reviewed thoroughly.

Tools and models used: OpenAI Codex (GPT-6).
How AI was used, and on which parts: Diagnosis, code, test, and PR draft.
How I verified the result: I looked at the code; it's one line.

License

  • My changes use the existing license of the affected files or package.
  • I release my new material under the GNU GPL, version 2 or later.

Checklist

  • This pull request targets the development branch.
  • I have reviewed my own changes.
  • Documentation and tests are updated as needed.

Guard the empty pivot profile produced by a zero augmented matrix so
solve returns a zero solution instead of crashing.

Fixes Macaulay2#2831.
@diracdeltafunk

Copy link
Copy Markdown
Contributor Author

This is my first AI-generated PR to M2. Please let me know if I did this in an acceptable way! I want to be helpful and not a bother.

@d-torrance d-torrance linked an issue Oct 31, 2026 that may be closed by this pull request
@d-torrance d-torrance added Engine Macaulay2/e AI-generated This PR contains AI-generated code or this issue was written by AI labels Oct 31, 2026

@d-torrance d-torrance left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Would you add a regression test (in some appropriate file in M2/Macaulay2/tests/normal) that runs some of the code that crashes prior to this fix?

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

Labels

AI-generated This PR contains AI-generated code or this issue was written by AI Engine Macaulay2/e

Projects

None yet

Development

Successfully merging this pull request may close these issues.

crash in rawLinAlgSolve over rationals

2 participants