Skip to content

feat: add lapack/base/dsyconvf-rook - #15821

Open
benatsf wants to merge 2 commits into
stdlib-js:developfrom
benatsf:feat/lapack-dsyconvf-rook
Open

benatsf wants to merge 2 commits into
stdlib-js:developfrom
benatsf:feat/lapack-dsyconvf-rook

Conversation

@benatsf

@benatsf benatsf commented Oct 2, 2026 •

Copy link
Copy Markdown

Description

Add lapack/base/dsyconvf-rook to convert symmetric indefinite factor storage from DSYTRF_ROOK to the DSYTRF_RK layout and revert it. Conversion separates the two-by-two diagonal off-diagonal values into E; 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 dswap dependency and validates its configured integer widths and post-iteration arithmetic before any permutation.

Related Issues

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 -1 and invalidate distinct rook pivot pairs. Please review this proposed convention and API alongside the implementation.

Other

Reference implementation: DSYCONVF_ROOK at Reference-LAPACK commit 2e5d9c1. The BSD attribution and license are retained in NOTICE, the derived C source and documentation.

Public active buffers must be ordinary ArrayBuffer-backed Float64Array/Int32Array views 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:

  • Direct public/JavaScript suite: 3,856 assertions; direct compiled-native suite: 3,305 assertions, both exit zero with zero skips. Direction-specific fixtures include authentic upper/lower ROOK and RK factorizations, distinct signed pivot pairs, strided/offset layouts, guards and prewrite invalid-input checks.
  • Independent automated review ran 10,200 fresh-oracle layout cases with 5,200 measured native calls, metadata and physical-alias checks. Five sanitized C width/dependency configurations cover LP64, ILP64, suffixed symbols, mixed LAPACK/BLAS widths and the actual Fortran DSWAP backend.
  • Physical addon absence separately verifies the JavaScript fallback and portable native-test loading; missing-native skips are excluded from compiled-native evidence.
  • Scoped JavaScript/C/README/declaration/type/REPL/metadata/license/EditorConfig checks, actual C and JavaScript examples, and bounded C/native JavaScript benchmarks pass. JavaScript lint reports 23 warnings and zero errors. Benchmarks establish execution, with no comparative performance claim.

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

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

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's engines.node from the copied >=0.10.0 value to a conservative proposed >=8.0.0 floor. 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.

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.
@benatsf
benatsf requested a review from a team October 2, 2026 18:53
@stdlib-bot stdlib-bot added LAPACK Issue or pull request related to the Linear Algebra Package (LAPACK). Needs Review A pull request which needs code review. First-time Contributor A pull request from a contributor who has never previously committed to the project repository. labels Oct 2, 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