Skip to content

feat: add lapack/base/dgbtf2 - #15833

Open
benatsf wants to merge 1 commit into
stdlib-js:developfrom
benatsf:feat/lapack-dgbtf2
Open

benatsf wants to merge 1 commit into
stdlib-js:developfrom
benatsf:feat/lapack-dgbtf2

Conversation

@benatsf

@benatsf benatsf commented Oct 3, 2026

Copy link
Copy Markdown

Description

Add @stdlib/lapack/base/dgbtf2 with JavaScript, C and optional Node-API implementations of the unblocked LU factorization of a general band matrix. This is one complete routine under accepted RFC #2464 and the band-LU work tracked in #14631. Its proposed main8/ndarray11 interface supports full H×N compact band storage, independent signed strides and offsets, and output-only positive one-based stepwise row swaps. Repeated pivot targets are intentional, rather than a final permutation.

The translation preserves pinned Reference-LAPACK elimination order, first absolute-maximum ties, singular continuation, and original fixed-alpha GER update order. It uses allocation-free private pivot/update helpers and unchanged DSCAL/DSWAP leaves. It preserves the reference's finite tiny-pivot reciprocal overflow behavior; INFO0 certifies neither stable arithmetic nor finite factors. The package retains the original BSD license and helper attribution.

Both public APIs validate intrinsic current ordinary typed-array views, full-view injectivity, capacities and conservative byte envelopes before writes. Resizable ordinary backing is supported under the documented stable synchronous lifetime precondition; shared backing is rejected. Native staging validates independently configured integer widths and physical pointer envelopes before allocating output pivot state or mutating inputs. Public native selection conservatively uses a signed32 domain and falls back before dispatch for wider valid metadata. Validated empty public calls return0 without accessing inactive arrays, dispatching or writing. The exact API remains a contribution proposal, not prior maintainer adoption.

Related issues

Validation

  • Actual direct package tests pass on Node24/Linuxx64: pure/public1580 assertions, API35, and compiled-native794 with zero skips. They compare unchanged reference factor/INFO/pivot/whole-buffer results, independent PA=LU reconstruction, rectangular/overband/singular cases, tiny reciprocal overflow classes, byte offsets, signed layouts, guards, RAB extents and pre-write rejection.
  • Actual standalone C checks pass16 strict O3 portable/Fortran integer-width and suffix configurations, including14,880 positive factorizations, independent reconstruction and full-buffer mutation checks. Sixteen ASan/UBSan configurations execute4,464 positive factorizations, with empty cases recorded separately; eight UBSan boundary configurations execute110,600 arithmetic/geometry assertions rather than numerical credit.
  • Scoped JavaScript/C/declaration/type/README/REPL/schema/filename/header/license and both EditorConfig checks pass. Exact current716 tool modules are verified process-locally; JavaScript advisory warnings remain disclosed. Actual C/JS examples and bounded correctness benchmarks pass through both real native dispatch and physically absent-addon fallback. No performance claim is made.
  • Proposed Node>=8 metadata is a pure-JavaScript floor only. Execution was Node24.19.0/Linuxx64; the actual compiled binary registers Node-API8 and imports a shared Node-API6 symbol. No Node8 native or untested platform support is claimed.

Checklist

  • Read, understood, and followed the contributing guidelines.
  • Added meaningful tests and documentation for the complete routine.
  • Applicable local checks pass against the submitted source.

AI Assistance

  • Yes
  • No

How AI assistance was used:

  • Code generation (implementation and native validation)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

OpenAI Codex agents authored the implementation, reference harnesses, tests, benchmarks and documentation under benatsf's authorization. Separate Codex agents performed the independent automated review of the exact final source and actual execution evidence; the final reviewer was /root/dgbtf2_review_resume. This is an AI-authored and AI-reviewed contribution. The guideline acknowledgment describes the agents' execution of those rules and does not claim benatsf personally authored, manually reviewed or understands the generated changes. Failed and superseded checks remain preserved, and prerequisite model checks are distinguished from actual package execution. Upstream CI and maintainer review are independent and are not claimed to have passed.

Implement one complete JavaScript/C/native unblocked band LU routine with validated views, output-only stepwise pivots and reference-backed regression coverage.

Assisted-by: OpenAI Codex agents
@benatsf
benatsf requested a review from a team October 3, 2026 01:24
@stdlib-bot stdlib-bot added LAPACK Issue or pull request related to the Linear Algebra Package (LAPACK). First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels Oct 3, 2026

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

Labels

First-time Contributor A pull request from a contributor who has never previously committed to the project repository. LAPACK Issue or pull request related to the Linear Algebra Package (LAPACK). Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants