Conversation
Add complete JavaScript and native factor-storage conversion and reversion under accepted LAPACK RFC stdlib-js#2464. Preserve signed rook pivots, validate indexed buffers before writes, and retain Reference-LAPACK provenance. AI-assisted implementation, tests, documentation and independent automated review by OpenAI Codex; no applicant manual review is claimed.
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/dsyconvf-rookto convert symmetric indefinite factor storage fromDSYTRF_ROOKto theDSYTRF_RKlayout and revert it. Conversion separates the two-by-two diagonal off-diagonal values intoE; reversion restores them. The signed, one-based LAPACK pivots remain unchanged, including distinct negative pair values and target-1.This pull request supplies one complete package with JavaScript and C implementations, a Node-API binding, JavaScript fallback, contiguous and independently strided APIs, declarations, examples and bounded benchmarks. Both directions follow the pinned Reference-LAPACK extraction/permutation/restoration order. Malformed pivots and used indexed metadata are validated before routine writes. The C implementation uses the existing
dswapdependency and validates its configured integer widths and post-iteration arithmetic before any permutation.Related Issues
DSYCONVF_ROOKunit rather than closing the whole RFC.Questions
This package proposes an eight-argument main API and thirteen-argument ndarray API. It deliberately retains LAPACK's signed, one-based pivot encoding because subtracting one would lose the sign of target
-1and invalidate distinct rook pivot pairs. Please review this proposed convention and API alongside the implementation.Other
Reference implementation:
DSYCONVF_ROOKat Reference-LAPACK commit2e5d9c1. The BSD attribution and license are retained inNOTICE, the derived C source and documentation.Public active buffers must be ordinary
ArrayBuffer-backedFloat64Array/Int32Arrayviews with disjoint indexed-byte envelopes. Shared backing stores are rejected using intrinsic branding. Foreign addons must not supply externally aliased ordinary buffers to the pure JavaScript path; the private native bridge independently checks physical pointer envelopes. Empty validated calls return before buffer access. Native dispatch uses a conservative signed32 metadata domain and falls back for valid wider unused JavaScript metadata.Validation executed on Linux x64 with Node 24.19.0, GCC and GNU Fortran 14.2:
DSWAPbackend.Finite authentic factor storage is compared with the unchanged pinned reference; this does not claim universal nonfinite factorization or JavaScript NaN payload parity. Other platforms and upstream CI have not been executed by this contribution session.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored primarily by OpenAI Codex. The implementation agent generated the JavaScript/native binding, tests and build configuration; a delegated agent generated the C core, and another generated documentation, declarations, examples and benchmarks. A separate Codex agent performed independent reference-backed code and runtime review. All agents used the existing upstream contribution rules and supplied APIs. No applicant manual authorship, personal understanding or human review is claimed. Generated code and checks require the same upstream scrutiny as other contributions.
@stdlib-js/reviewers
Runtime metadata correction
A follow-up commit changes only
package.json'sengines.nodefrom the copied>=0.10.0value to a conservative proposed>=8.0.0floor. Mandatory validation imports rely on intrinsic typed-array and ArrayBuffer getters plus Symbol; optional addon requirements alone were not used to raise other packages' JavaScript floors. Actual isolated metadata/format checks and independent import/empty-input checks passed on Node 24 with the addon physically absent. This does not establish an exact historical minimum or claim tested Node 8/native compatibility. The algorithm, tests and original frozen validation evidence remain unchanged. This correction and its independent review were performed by Codex; no applicant manual review is claimed.