Skip to content

[RFC]: refactor strided routines returning two quantities to use separate output arrays #16965

In progress

Description

@ujjwalv01

Description

This RFC proposes refactoring strided routines which return two quantities in a single packed output array to instead use a separate output array for each quantity, following the convention used by lapack/base/dladiv and lapack/base/dlassq.

  • For the meanstdev/meanvar routines, the C APIs will use two output pointers in place of a single packed output pointer.
  • For the nannsum routines, the count output will be an Int32Array.
  • Hypothesis tests (e.g., ztest) will continue to use struct-based results and are out of scope.

For example,

// Before:
dmeanvarpn( N, correction, x, strideX, out, strideOut );
dmeanvarpn.ndarray( N, correction, x, strideX, offsetX, out, strideOut, offsetOut );

// After:
dmeanvarpn( N, correction, x, strideX, mean, variance );
dmeanvarpn.ndarray( N, correction, x, strideX, offsetX, mean, offsetMean, variance, offsetVariance );

As these are breaking changes, I will be handling all of the packages listed below in order to keep the API consistent across them.

Packages

Each package is updated in a separate PR. Packages which call another package in this list are listed after it and need to wait for it to be merged.

stats:

blas/ext/base:

Notes

  • Packages which call one of the above are updated in the same PR as the package they call. Apart from the packages in this list, these are blas/ext/base/dnansumpw, stats/strided/dnanmeanpw, and stats/strided/dnanvariancepn (all call dnannsumpw).
  • New packages returning two quantities (e.g., snannsum*) should follow the same convention. See feat: add blas/ext/base/snannsumkbn along with C implementation #14873.

Related Issues

None.

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.

Activity

  1. self-assigned this
    on Nov 28, 2026
  2. added
    RFC
    Statistics
    Accepted
    BLAS
    Tracking Issue
    JavaScript
    C
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AcceptedBLASCJavaScriptRFCStatisticsTracking Issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions