Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Add
lapack/base/dpstf2to compute an unblocked complete-pivoting Cholesky factorization of a symmetric matrix. The routine updates the stored triangle, returns numericINFO, writes the complete positive, one-based permutation toPIV, writes the computed rank toRANK, and preserves the reference workspace mutation order.INFO=1still produces the complete permutation and rank; it does not certify positive semidefiniteness.This is one complete package with JavaScript and C implementations, a guarded Node-API binding, explicit JavaScript fallback, contiguous and independently strided APIs, declarations, examples and bounded benchmarks. Package-local allocation-free candidate maximum and ordered GEMV loops retain finite first-tie and reference update semantics. Existing DSCAL/DSWAP dependencies remain unchanged; the adopted DGEMV and IDAMAX implementations are not used.
Related Issues
DPSTF2and leaves the broader tracking RFC open.Questions
Please review the proposed nine-argument main and fifteen-argument ndarray signatures. Both return scalar
INFOand accept output-onlyInt32Arraypermutation/rank buffers. Pivot values remain positive and one-based for interoperability with LAPACK.The required tolerance is a primitive finite Number, validated before main
LDAand output buffers. Pass a negative tolerance for the reference automatic cutoff. The initial positive pivot is accepted before the later tolerance test, including a one-element matrix with a large positive tolerance.The documented
N=0behavior is a new safe package convention: validate scalar arguments and the activeRANKslot, write zero to that slot and return zero, without accessing inactive matrix/permutation/scratch arguments. The pinned unchanged reference returned with its incoming rank sentinel unchanged; this package convention is not claimed as reference parity or an upstream reference correction.Other
Reference implementation:
DPSTF2at Reference-LAPACK commit2e5d9c1. Derived private DGEMV loops retain the reference author attribution. Full BSD copyright, conditions and disclaimer are retained in source,NOTICEand documentation.Active public buffers must be intrinsic ordinary
ArrayBuffer-backedFloat64Array/Int32Arrayviews with disjoint indexed-byte envelopes. Shared backing stores are rejected before writes. Foreign addons must not provide externally aliased ordinary buffers to the pure JavaScript path; the raw bridge and C core independently check physical pointer envelopes. Full-view capacity/injectivity, arithmetic and actual LAPACK/BLAS helper bounds are validated before writes. Native dispatch conservatively bounds signed32 metadata and falls back for valid wider JavaScript views. Configured-width permutation/rank staging is output-only and allocated before mutation; noInt32Arrayis cast to an ILP64 output pointer.The package Node >=8 engine field is a proposed JavaScript runtime floor. The actual Node24-built addon registers Node-API8 and includes a shared Node-API6 bigint import; compiled Node8 support is not claimed.
Executed validation on Linux x64 with Node 24.19.0, GCC and GNU Fortran 14.2:
Finite supplied symmetric matrices are compared with unchanged pinned reference executions and independent reconstruction. This does not claim universal exceptional-value or JavaScript NaN-payload parity, stability for arbitrary extreme inputs, other-platform execution, or upstream CI execution. The API and runtime constraints remain proposed for maintainer review.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored primarily by OpenAI Codex under benatsf's explicit authorization. The checked contributing acknowledgment describes the delegated agents' workflow; no personal applicant reading is claimed. The implementation agent generated the JavaScript paths, validation, native staging, build metadata and checked-in tests. A delegated Codex agent generated the C core and bounded standalone validation; another generated documentation, declarations, examples and benchmarks. A separate Codex agent performed independent reference-backed source and runtime review. All agents followed the live contribution rules and the explicitly proposed package contract. No applicant manual authorship, personal understanding or human review is claimed. Generated code and evidence require normal upstream scrutiny.
@stdlib-js/reviewers