Skip to content

Incomplete tests: default arguments #439

Description

@ev-br

A kind of related to gh-301: I asked GPT5.4 to write a wrapper on top of array-api-strict which, for each function call, looks at the arguments the function is called with, and compares the actual argument with the default value for the corresponding formal parameter. The goal is to find functions where the test suite never generates non-default parameter values.

Then, running the test suite produces the output below.

 +---------------------------+----------------------------------------------------+
   | function                  | arguments                                          |
   +---------------------------+----------------------------------------------------+
   | Array.__array_namespace__ | api_version=ONLY_DEFAULT_USED                      |
   | arange                    | device=ONLY_DEFAULT_USED                           |
   | asarray                   | device=ONLY_DEFAULT_USED                           |
   | astype                    | device=ONLY_DEFAULT_USED                           |
   | empty_like                | device=ONLY_DEFAULT_USED                           |
   | eye                       | device=ONLY_DEFAULT_USED                           |
   | fft.fftfreq               | device=ONLY_DEFAULT_USED                           |
   | fft.rfftfreq              | device=ONLY_DEFAULT_USED                           |
   | full                      | device=ONLY_DEFAULT_USED                           |
   | full_like                 | device=ONLY_DEFAULT_USED                           |
   | linalg.cholesky           | upper=ONLY_DEFAULT_USED                            |
   | linalg.matrix_norm        | keepdims=ONLY_DEFAULT_USED                         |
   | linalg.trace              | dtype=ONLY_DEFAULT_USED                            |
   | linalg.vector_norm        | axis=ONLY_DEFAULT_USED                             |
   | linspace                  | device=ONLY_DEFAULT_USED                           |
   | ones                      | device=ONLY_DEFAULT_USED                           |
   | ones_like                 | device=ONLY_DEFAULT_USED                           |
   | reshape                   | copy=ONLY_DEFAULT_USED                             |
   | stack                     | axis=ONLY_DEFAULT_USED                             |
   | sum                       | axis=ONLY_DEFAULT_USED, keepdims=ONLY_DEFAULT_USED |
   | tril                      | k=ONLY_DEFAULT_USED                                |
   | triu                      | k=ONLY_DEFAULT_USED                                |
   | zeros                     | device=ONLY_DEFAULT_USED                           |
   | zeros_like                | device=ONLY_DEFAULT_USED                           |
   +---------------------------+----------------------------------------------------+

   SQL:

   SELECT
       CASE
           WHEN function LIKE 'recording_backend.%' THEN substr(function, 
   length('recording_backend.') + 1)
           ELSE function
       END AS function_name,
       group_concat(name || '=' || status, ', ') AS arguments
   FROM (
       SELECT function, name, status
       FROM function_arguments
       WHERE status = 'ONLY_DEFAULT_USED'
       ORDER BY function, name
   ) AS filtered
   GROUP BY function
   ORDER BY function_name;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions