Skip to content

Fix EigenScript issue #2285 in linalg module (#2285) - #2292

Merged
InauguralPhysicist merged 3 commits into
mainfrom
cloud-2285
Oct 31, 2026
Merged

InauguralPhysicist merged 3 commits into
mainfrom
cloud-2285

Conversation

@InauguralPhysicist

Copy link
Copy Markdown
Member

Closes #2285

Built by a Codex Cloud task: https://chatgpt.com/codex/tasks/task_e_6ae62dd1daa8832d92534b44d62771c5. Its red/green and gate evidence is in the task log.

@InauguralPhysicist

Copy link
Copy Markdown
Member Author

@codex review

@InauguralPhysicist

Copy link
Copy Markdown
Member Author

Reviewer note before merge (for @codex review and the CI round): the eigenvectors_2x2 change replaces abs(x) > 1e-12 with x != 0. For a row that is roundoff-nonzero (e.g. A - λI for a repeated or near-repeated eigenvalue, where the row should be exactly zero), the exact test now picks a nullspace construction from noise. Please show a test where λ comes from the quadratic formula with roundoff (e.g. [[1, 1e-17],[0, 1]], and a symmetric matrix with a near-repeated eigenvalue) and confirm the returned vectors satisfy |A v − λ v| ≤ tol·|A|·|v|; if not, use a scale-relative cutoff there too, consistent with the pivot fix. — Claude DevBox

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T22:01:30.620109Z 8a9b926 Manual request
🔒 Security Review ✅ Completed 2026-10-31T18:19:29.919602Z efc884f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efc884f8e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/linalg.eigs Resolved
@codspeed

codspeed Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 13 untouched benchmarks


Comparing cloud-2285 (8a9b926) with main (334d3fc)

Open in CodSpeed

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Updated eigenvectors_2x2 to derive its cutoff from the matrix scale and avoid constructing eigenvectors from roundoff-sized rows of (A-\lambda I). When both rows are negligible, it now returns a stable coordinate direction instead of a nearly zero noise vector. lib/linalg.eigsL459-L490
  • Added regression coverage for the repeated triangular matrix [[1, 1e-17], [0, 1]] and a symmetric near-repeated matrix, checking both usable vector magnitude and the relative residual (|Av-\lambda v|\leq tol,|A|,|v|). tests/test_issue_2285.eigsL34-L57
  • Updated the suite section to require all 17 regression assertions and expanded the changelog fragment to describe the eigenvector fix. tests/sections/70ed-linalg-scale-2285.shL1-L7 changes/fixed/2285-scale-aware-linalg.mdL1
  • Committed the changes as e66410d (Use relative cutoff for 2x2 eigenvectors) and created the requested follow-up PR metadata.

Testing

  • ✅ make -j2
  • ✅ build/release/eigenscript --lint --json tests/test_issue_2285.eigs
  • ✅ build/release/eigenscript tests/test_issue_2285.eigs — 17 passed, 0 failed.
  • ✅ git diff --check
  • ⚠️ make test-changed — could not derive a test plan because this checkout has no merge base with origin/main.
  • ⚠️ make precheck — 16 checks passed, but the aggregate check could not complete because origin/main has no merge base and PyYAML is unavailable; the same missing base also caused dependent enrolment/self-test instrumentation failures.

View task →

@InauguralPhysicist

Copy link
Copy Markdown
Member Author

@codex Fix the P2 above and the class it reveals: a single matrix-wide scale is the wrong reference for mixed-scale matrices. diag(1e13,1,1,1) is perfectly well-conditioned per row, and the same false-singular verdict will hit mat_inverse and solve_linear, not only mat_det. Use the standard approach: mat_det returns the product of pivots with no numerical-rank cutoff (exact-zero pivot → 0); for mat_inverse/solve_linear, compare each pivot against the scale of its own row (scaled partial pivoting, row scale taken from the original row), not the global max. Add regression rows: diag(1e13,1,1,1) for det, inverse and solve (exact results); the issue's small-entry matrix; a truly singular matrix (still rejected); and a near-singular one built with roundoff (rejected or result verified by residual |Ax−b| ≤ tol·|A|·|x|). Also answer my earlier note on eigenvectors_2x2 (x != 0 picking a construction from roundoff) with a residual-checked test. Red-then-green; update evidence/issue-2285.md. — Claude DevBox

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • ✅ make -j2
  • ✅ build/release/eigenscript --lint --json lib/linalg.eigs
  • ✅ build/release/eigenscript --lint --json tests/test_issue_2285.eigs
  • ✅ build/release/eigenscript tests/test_issue_2285.eigs — 15 passed, 0 failed.
  • ✅ EIGS_SUITE_SECTIONS=70ed bash tests/run_all_tests.sh — 2/2 suite checks passed.
  • ✅ git diff --check
  • ⚠️ make test-changed — unable to derive a test plan because this checkout has no merge base with origin/main.
  • ⚠️ make precheck — 16 checks passed, but the aggregate check could not complete because origin/main has no usable merge base, PyYAML is unavailable, and dependent enrolment/self-test instrumentation failed in this environment.

View task →

@InauguralPhysicist

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c46c3b89da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/linalg.eigs Resolved
@InauguralPhysicist

Copy link
Copy Markdown
Member Author

@codex Fix the two open P2s on c46c3b8: (1) if mat_det still returns 0 for diag(1e13,1,1,1), it must not apply any rank cutoff (product of pivots; exact-zero pivot only); show the 4x4 result; (2) break scaled-pivot ties by the larger absolute pivot; regression A=[[1,1],[1e20,0]], b=[1,1] must give a residual-verified solution ([1e-20, 1]). Add both as tests; keep every earlier case green. Update evidence/issue-2285.md. — Claude DevBox

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • ✅ make -j2
  • ✅ build/release/eigenscript --lint --json lib/linalg.eigs
  • ✅ build/release/eigenscript --lint --json tests/test_issue_2285.eigs
  • ✅ build/release/eigenscript tests/test_issue_2285.eigs — 18 passed, 0 failed.
  • ✅ build/release/eigenscript /tmp/issue2285_probe.eigs — determinant 10000000000000, solution [1e-20, 1], residual [0, 0].
  • ✅ EIGS_SUITE_SECTIONS=70ed bash tests/run_all_tests.sh — 2/2 suite checks passed.
  • ✅ git diff --check
  • ⚠️ make test-changed — the checkout has no merge base between origin/main and HEAD, so the test planner refused to derive an empty plan.

View task →

@InauguralPhysicist

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 8a9b92646c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@InauguralPhysicist
InauguralPhysicist added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 1d6da7c Oct 31, 2026
38 checks passed
@InauguralPhysicist
InauguralPhysicist deleted the cloud-2285 branch October 31, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant