Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-numba for openSUSE:Factory 
checked in at 2024-03-25 21:07:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-numba (Old)
 and      /work/SRC/openSUSE:Factory/.python-numba.new.1905 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-numba"

Mon Mar 25 21:07:59 2024 rev:46 rq:1160819 version:0.59.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-numba/python-numba.changes        
2024-03-09 20:56:44.595110375 +0100
+++ /work/SRC/openSUSE:Factory/.python-numba.new.1905/python-numba.changes      
2024-03-25 21:09:50.308796571 +0100
@@ -1,0 +2,13 @@
+Fri Mar 22 20:05:25 UTC 2024 - Dirk Müller <dmuel...@suse.com>
+
+- update to 0.59.1:
+  * Fixed caching of kernels that use target-specific overloads
+  * Fixed a performance regression introduced in Numba 0.59 which
+    made ``np.searchsorted`` considerably slower.
+  * This patch fixes two issues with ``np.searchsorted``. First,
+    a regression is fixed in the support of ``np.datetime64``.
+    Second, adopt ``NAT``-aware  comparisons to fix mishandling
+    of ``NAT`` value.
+  * Allow use of Python 3.12 PEP-695 type parameter syntax
+
+-------------------------------------------------------------------

Old:
----
  numba-0.59.0.tar.gz

New:
----
  numba-0.59.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-numba.spec ++++++
--- /var/tmp/diff_new_pack.8ov4Ba/_old  2024-03-25 21:09:51.088825211 +0100
+++ /var/tmp/diff_new_pack.8ov4Ba/_new  2024-03-25 21:09:51.092825358 +0100
@@ -55,7 +55,7 @@
 %endif
 
 Name:           python-numba%{?psuffix}
-Version:        0.59.0
+Version:        0.59.1
 Release:        0
 Summary:        NumPy-aware optimizing compiler for Python using LLVM
 License:        BSD-2-Clause

++++++ numba-0.59.0.tar.gz -> numba-0.59.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/PKG-INFO new/numba-0.59.1/PKG-INFO
--- old/numba-0.59.0/PKG-INFO   2024-01-31 18:53:01.989844800 +0100
+++ new/numba-0.59.1/PKG-INFO   2024-03-18 14:32:45.775456000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: numba
-Version: 0.59.0
+Version: 0.59.1
 Summary: compiling Python code using LLVM
 Home-page: https://numba.pydata.org
 License: BSD
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/source/release/0.59.1-notes.rst 
new/numba-0.59.1/docs/source/release/0.59.1-notes.rst
--- old/numba-0.59.0/docs/source/release/0.59.1-notes.rst       1970-01-01 
01:00:00.000000000 +0100
+++ new/numba-0.59.1/docs/source/release/0.59.1-notes.rst       2024-03-18 
14:32:37.000000000 +0100
@@ -0,0 +1,71 @@
+Version 0.59.1 (18 March 2024)
+------------------------------
+
+This is a bug-fix release to fix regressions in 0.59.0.
+
+
+CUDA API Changes
+~~~~~~~~~~~~~~~~
+
+Fixed caching of kernels that use target-specific overloads
+===========================================================
+
+Caching of kernels using target-specific overloads now works. This includes use
+of cooperative group sync, which is now implemented with a target-specific 
overload.
+
+(`PR-#9447 <https://github.com/numba/numba/pull/9447>`__)
+
+
+Performance Improvements and Changes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Improvement to ``np.searchsorted``
+==================================
+
+Fixed a performance regression introduced in Numba 0.59 which made
+``np.searchsorted`` considerably slower.
+
+(`PR-#9448 <https://github.com/numba/numba/pull/9448>`__)
+
+
+Bug Fixes
+~~~~~~~~~
+
+Fix issues with ``np.searchsorted`` not handling ``np.datetime64``
+==================================================================
+
+This patch fixes two issues with ``np.searchsorted``. First, a regression is
+fixed in the support of ``np.datetime64``. Second, adopt ``NAT``-aware
+comparisons to fix mishandling of ``NAT`` value.
+
+(`PR-#9445 <https://github.com/numba/numba/pull/9445>`__)
+
+Allow use of Python 3.12 PEP-695 type parameter syntax
+======================================================
+
+A patch is added to properly parse the PEP 695 syntax. While Numba
+does not yet take advantage of type parameters, it will no longer erroneously
+reject functions defined with the new Python 3.12 syntax.
+
+(`PR-#9459 <https://github.com/numba/numba/pull/9459>`__)
+
+
+Pull-Requests:
+~~~~~~~~~~~~~~
+
+* PR `#9445 <https://github.com/numba/numba/pull/9445>`_: Fix #9427 
np.searchsorted on datetime64 (`sklam <https://github.com/sklam>`_)
+* PR `#9447 <https://github.com/numba/numba/pull/9447>`_: Fix Issue #9432, 
caching of kernels using target-specific overloads (such as CG sync) (`gmarkall 
<https://github.com/gmarkall>`_ `sklam <https://github.com/sklam>`_)
+* PR `#9448 <https://github.com/numba/numba/pull/9448>`_: Fix 
`np.searchsorted` regression (`guilhermeleobas 
<https://github.com/guilhermeleobas>`_)
+* PR `#9449 <https://github.com/numba/numba/pull/9449>`_: Remove deprecated 
CondaEnvironment@1 (`sklam <https://github.com/sklam>`_)
+* PR `#9450 <https://github.com/numba/numba/pull/9450>`_: Fix gpuci versions 
(`gmarkall <https://github.com/gmarkall>`_)
+* PR `#9459 <https://github.com/numba/numba/pull/9459>`_: Support pep695 type 
param syntax (`sklam <https://github.com/sklam>`_)
+* PR `#9491 <https://github.com/numba/numba/pull/9491>`_: Fix 
non-deterministic bug caused by unstableness in SSA (`sklam 
<https://github.com/sklam>`_, `loicdtx <https://github.com/loicdtx>`_)
+
+
+Authors:
+~~~~~~~~
+
+* `gmarkall <https://github.com/gmarkall>`_
+* `guilhermeleobas <https://github.com/guilhermeleobas>`_
+* `sklam <https://github.com/sklam>`_
+* `loicdtx <https://github.com/loicdtx>`_
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/source/user/installing.rst 
new/numba-0.59.1/docs/source/user/installing.rst
--- old/numba-0.59.0/docs/source/user/installing.rst    2024-01-31 
18:52:55.000000000 +0100
+++ new/numba-0.59.1/docs/source/user/installing.rst    2024-03-18 
14:32:37.000000000 +0100
@@ -262,6 +262,8 @@
 
+----------++--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
 | Numba     | Release date | Python                    | NumPy                 
     | llvmlite                     | LLVM              | TBB                   
      |
 
+===========+==============+===========================+============================+==============================+===================+=============================+
+| 0.59.1    | 2024-03-18   | 3.9.x <= version < 3.13   | 1.22 <= version < 
1.27     | 0.42.x                       | 14.x              | 2021.6 <= version 
          |
++-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
 | 0.59.0    | 2024-01-31   | 3.9.x <= version < 3.13   | 1.22 <= version < 
1.27     | 0.42.x                       | 14.x              | 2021.6 <= version 
          |
 
+-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
 | 0.58.1    | 2023-10-17   | 3.8.x <= version < 3.12   | 1.22 <= version < 
1.27     | 0.41.x                       | 14.x              | 2021.6 <= version 
          |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9048.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9048.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9048.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9048.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
-Dynamically Allocate Parfor Schedules
-=====================================
-
-This PR fixes an issue where a parallel region is executed in a loop
-many times.  The previous code used an alloca to allocate the parfor
-schedule on the stack but if there are many such parfors in a loop
-then the stack will overflow.  The new code does a pair of
-allocation/deallocation calls into the Numba parallel runtime before
-and after the parallel region respectively.  At the moment, these
-calls redirect to malloc/free although other mechanisms such as
-pooling are possible and may be implemented later.  This PR also
-adds a warning in cases where a prange loop is not converted to a
-parfor.  This can happen if there is exceptional control flow in the
-loop.  These are related in that the original issue had a prange
-loop that wasn't converted to a parfor and therefore all the parfors
-inside the body of the prange were running in parallel and adding to
-the stack each time.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9049.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9049.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9049.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9049.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-Support multiple outputs in a ``@guvectorize`` function
-=======================================================
-
-This PR fixes `Numba #9058 <https://github.com/numba/numba/pull/9058>`_
-where it is now possible to call a guvectorize with multiple outputs.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9089.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9089.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9089.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9089.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-Handling of `None` args fixed in `PythonAPI.call`.
-==================================================
-
-Fixing segfault when `args=None` was passed to `PythonAPI.call`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9123.new_feature.rst 
new/numba-0.59.1/docs/upcoming_changes/9123.new_feature.rst
--- old/numba-0.59.0/docs/upcoming_changes/9123.new_feature.rst 2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9123.new_feature.rst 1970-01-01 
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-Add support for ufunc attributes and reduce
-===========================================
-
-Support for ``ufunc.reduce`` and most ufunc attributes is added.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9126.np_support.rst 
new/numba-0.59.1/docs/upcoming_changes/9126.np_support.rst
--- old/numba-0.59.0/docs/upcoming_changes/9126.np_support.rst  2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9126.np_support.rst  1970-01-01 
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-Added support for np.indices() function.
-========================================
-
-Support is added for ``numpy.indices()``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9140.np_support.rst 
new/numba-0.59.1/docs/upcoming_changes/9140.np_support.rst
--- old/numba-0.59.0/docs/upcoming_changes/9140.np_support.rst  2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9140.np_support.rst  1970-01-01 
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-Added support for `np.polynomial.polynomial.Polynomial` class.
-==============================================================
-
-Support is added for the `Polynomial` class from the package 
`np.polynomial.polynomial`.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9141.np_support.rst 
new/numba-0.59.1/docs/upcoming_changes/9141.np_support.rst
--- old/numba-0.59.0/docs/upcoming_changes/9141.np_support.rst  2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9141.np_support.rst  1970-01-01 
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-Added support for functions ``np.polynomial.polyutils.as_series()``, as well 
as functions ``polydiv()``, ``polyint()``, ``polyval()`` from 
``np.polynomial.polynomial``.
-========================================================================================================================================================================
-
-Support is added for ``np.polynomial.polyutils.as_series()``, 
``np.polynomial.polynomial.polydiv()``, ``np.polynomial.polynomial.polyint()`` 
(only the first 2 arguments), ``np.polynomial.polynomial.polyval()`` (only the 
first 2 arguments).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9144.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9144.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9144.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9144.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-Fix propagation of literal values in PHI nodes.
-===============================================
-
-Fixed a bug in the literal propagation pass where a PHI node could be wrongly
-replaced by a constant.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9154.np_support.rst 
new/numba-0.59.1/docs/upcoming_changes/9154.np_support.rst
--- old/numba-0.59.0/docs/upcoming_changes/9154.np_support.rst  2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9154.np_support.rst  1970-01-01 
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-Added support for np.unwrap() function.
-=======================================
-
-Support is added for ``numpy.unwrap()``. The ``axis`` argument is only 
supported when its value equals -1.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9169.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9169.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9169.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9169.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-``numpy.digitize`` implementation behaviour aligned with numpy
-==============================================================
-
-The implementation of ``numpy.digitize`` is updated to behave per
-numpy in a wider set of cases, including where the supplied bins
-are not in fact monotonic.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9189.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9189.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9189.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9189.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-``numpy.searchsorted`` and ``numpy.sort`` behaviour updates
-===========================================================
-
-* ``numpy.searchsorted`` implementation updated to produce
-  identical outputs to numpy for a wider set of use cases,
-  including where the provided array `a` is in fact not
-  properly sorted.
-
-* ``numpy.searchsorted`` implementation bugfix for the case where
-  side='right' and the provided array `a` contains NaN(s).
-
-* ``numpy.searchsorted`` implementation extended to support complex
-  inputs.
-
-* ``numpy.sort`` (and ``array.sort``) implementation extended to
-  support sorting of complex data.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9223.cuda.rst 
new/numba-0.59.1/docs/upcoming_changes/9223.cuda.rst
--- old/numba-0.59.0/docs/upcoming_changes/9223.cuda.rst        2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9223.cuda.rst        1970-01-01 
01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-Added support for compiling device functions with a C ABI
-=========================================================
-
-Support for compiling device functions with a C ABI through the
-:func:`compile_ptx() <numba.cuda.compile_ptx>` API, for easier interoperability
-with CUDA C/C++ and other languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9235.cuda.rst 
new/numba-0.59.1/docs/upcoming_changes/9235.cuda.rst
--- old/numba-0.59.0/docs/upcoming_changes/9235.cuda.rst        2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9235.cuda.rst        1970-01-01 
01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-Make grid() and gridsize() use 64-bit integers
-==============================================
-
-`cuda.grid()` and `cuda.gridsize()` now use 64-bit integers, so they no longer
-overflow when the grid contains more than ``2 ** 31`` threads.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9242.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9242.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9242.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9242.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-Fix SSA to consider variables where use is not dominated by the definition
-==========================================================================
-
-A SSA problem is fixed such that a conditionally defined variable will receive
-a phi node showing that there is a path where the variable is undefined.
-This affects extension code that relies on SSA behavior.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9244.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9244.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9244.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9244.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,26 +0,0 @@
-Fixed ``RecursionError`` in ``prange``
-======================================
-
-A problem with certain loop patterns using ``prange`` leading to 
-``RecursionError`` in the compiler is fixed. An example of such loop is shown 
-below. The problem would cause the compiler to fall into an infinite recursive
-cycle trying to determine the definition of ``var1`` and ``var2``. The pattern
-involves definitions of variables within an if-else tree and not all branches 
-are defining the variables.
-
-.. code-block::
-
-    for i in prange(N):
-        for j in inner:
-            if cond1:
-                var1 = ...
-            elif cond2:
-                var1, var2 = ...
-
-            elif cond3:
-                pass
-
-            if cond4:
-                use(var1)
-                use(var2)
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9245.performance.rst 
new/numba-0.59.1/docs/upcoming_changes/9245.performance.rst
--- old/numba-0.59.0/docs/upcoming_changes/9245.performance.rst 2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9245.performance.rst 1970-01-01 
01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-Improvement to IR copying speed
-===============================
-
-Improvements were made to the deepcopying of ``FunctionIR``. 
-In one case, the ``InlineInlineables`` pass is 3x faster.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9246.highlight.rst 
new/numba-0.59.1/docs/upcoming_changes/9246.highlight.rst
--- old/numba-0.59.0/docs/upcoming_changes/9246.highlight.rst   2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9246.highlight.rst   1970-01-01 
01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
-Python 3.12 Support
-===================
-
-The standout feature of this release is the official support for Python 3.12 
-in Numba.
-
-Please note that profiling support is temporarily disabled in 
-this release (for Python 3.12) and several known issues have been identified 
-during development. The Numba team is actively working on resolving them. 
-Please refer to the respective issue pages 
-(`Numba #9289 <https://github.com/numba/numba/pull/9289>`_ and 
-`Numba #9291 <https://github.com/numba/numba/pull/9291>`_) 
-for a list of ongoing issues and updates on progress.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9249.np_support.rst 
new/numba-0.59.1/docs/upcoming_changes/9249.np_support.rst
--- old/numba-0.59.0/docs/upcoming_changes/9249.np_support.rst  2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9249.np_support.rst  1970-01-01 
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-Adds support for checking if dtypes are equal.
-==============================================
-
-Support is added for checking if two dtype objects are equal, for example 
`assert X.dtype == np.dtype(np.float64)`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9267.cuda.rst 
new/numba-0.59.1/docs/upcoming_changes/9267.cuda.rst
--- old/numba-0.59.0/docs/upcoming_changes/9267.cuda.rst        2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9267.cuda.rst        1970-01-01 
01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-Prevent kernels being dropped by implementing the used list
-===========================================================
-
-Kernels are no longer dropped when being compiled and linked using nvJitLink,
-because they are added to the ``@"llvm.used"`` list.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9279.cuda.rst 
new/numba-0.59.1/docs/upcoming_changes/9279.cuda.rst
--- old/numba-0.59.0/docs/upcoming_changes/9279.cuda.rst        2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9279.cuda.rst        1970-01-01 
01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-Support for Windows CUDA 12.0 toolkit conda packages
-====================================================
-
-The library paths used in CUDA toolkit 12.0 conda packages on Windows are
-added to the search paths used when detecting CUDA libraries.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9296.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9296.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9296.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9296.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-Support negative axis in ufunc.reduce
-"""""""""""""""""""""""""""""""""""""
-
-Fixed a bug in ufunc.reduce to correctly handle negative axis values.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9309.change.rst 
new/numba-0.59.1/docs/upcoming_changes/9309.change.rst
--- old/numba-0.59.0/docs/upcoming_changes/9309.change.rst      2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9309.change.rst      1970-01-01 
01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-Make test listing not invoke CPU compilation.
----------------------------------------------
-
-Numba's test listing command ``python -m numba.runtests -l`` has historically
-triggered CPU target compilation due to the way in which certain test functions
-were declared within the test suite. It has now been made such that the CPU
-target compiler is not invoked on test listing and a test is added to ensure
-that it remains the case.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9310.highlight.rst 
new/numba-0.59.1/docs/upcoming_changes/9310.highlight.rst
--- old/numba-0.59.0/docs/upcoming_changes/9310.highlight.rst   2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9310.highlight.rst   1970-01-01 
01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-Move minimum supported Python version to 3.9.
-=============================================
-
-Support for Python 3.8 has been removed, Numba's minimum supported Python
-version is now Python 3.9.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9315.change.rst 
new/numba-0.59.1/docs/upcoming_changes/9315.change.rst
--- old/numba-0.59.0/docs/upcoming_changes/9315.change.rst      2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9315.change.rst      1970-01-01 
01:00:00.000000000 +0100
@@ -1,36 +0,0 @@
-Semantic differences due to Python 3.12 variable shadowing in comprehensions
-============================================================================
-
-Python 3.12 introduced a new bytecode ``LOAD_FAST_AND_CLEAR`` that is only 
used 
-in comprehensions. It has dynamic semantics that Numba cannot model. 
-
-For example,
-
-.. code-block:: python
-
-    def foo():
-        if False:
-            x = 1
-        [x for x in (1,)]
-        return x  # This return uses undefined variable
-
-The variable `x` is undefined at the return statement. Instead of raising an 
-``UnboundLocalError``, Numba will raise a ``TypingError`` at compile time if 
an 
-undefined variable is used.
-
-However, Numba cannot always detect undefined variables. 
-
-For example,
-
-.. code-block:: python
-
-    def foo(a):
-        [x for x in (0,)]
-        if a:
-            x = 3 + a
-        x += 10
-        return x
-
-Calling ``foo(0)`` returns ``10`` instead of raising ``UnboundLocalError``. 
-This is because Numba does not track variable liveness at runtime. 
-The return value is ``0 + 10`` since Numba zero-initializes undefined 
variables.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9330.change.rst 
new/numba-0.59.1/docs/upcoming_changes/9330.change.rst
--- old/numba-0.59.0/docs/upcoming_changes/9330.change.rst      2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9330.change.rst      1970-01-01 
01:00:00.000000000 +0100
@@ -1,24 +0,0 @@
-Refactor and remove legacy APIs/testing internals.
-""""""""""""""""""""""""""""""""""""""""""""""""""
-
-A number of internally used functions have been removed to aid with general
-maintenance by reducing the number of ways in which it is possible to invoke
-compilation, specifically:
-
-* ``numba.core.compiler.compile_isolated`` is removed.
-* ``numba.tests.support.TestCase::run_nullary_func`` is removed.
-* ``numba.tests.support.CompilationCache`` is removed.
-
-Additionally, the concept of "nested context" is removed from
-``numba.core.registry.CPUTarget`` along with the implementation details.
-Maintainers of target extensions (those using the
-API in ``numba.core.target_extension`` to extend Numba support to
-custom/synthetic hardware) should note that the same can be deleted from
-target extension implementations of ``numba.core.descriptor.TargetDescriptor``
-if it is present. i.e. the ``nested_context`` method and associated
-implementation details can just be removed from the custom target's
-``TargetDescriptor``.
-
-Further, a bug was discovered, during the refactoring, in the typing of record
-arrays. It materialised that two record types that only differed in their
-mutability could alias, this has now been fixed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9334.bug_fix.rst 
new/numba-0.59.1/docs/upcoming_changes/9334.bug_fix.rst
--- old/numba-0.59.0/docs/upcoming_changes/9334.bug_fix.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9334.bug_fix.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-Fix issue with parfor reductions and Python 3.12.
-=================================================
-
-The parfor reduction code has certain expectations on the order of statements
-that it discovers, these are based on the code that previous versions of Numba
-generated.  With Python 3.12, one assignment that used to follow the
-reduction operator statement, such as a binop, is now moved to its own basic
-block.  This change reorders the set of discovered reduction nodes so that
-this assignment is right after the reduction operator as it was in previous
-Numba versions.  This only affects internal parfor reduction code and
-doesn't actually change the Numba IR.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9335.infrastructure.rst 
new/numba-0.59.1/docs/upcoming_changes/9335.infrastructure.rst
--- old/numba-0.59.0/docs/upcoming_changes/9335.infrastructure.rst      
2024-01-31 18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9335.infrastructure.rst      
1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-Add validation capability for user generated towncrier ``.rst`` files.
-======================================================================
-
-Added a validation script for user generated towncrier ``.rst`` files.
-The script will run as a part of towncrier Github workflow automatically
-on every PR.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9336.improvement.rst 
new/numba-0.59.1/docs/upcoming_changes/9336.improvement.rst
--- old/numba-0.59.0/docs/upcoming_changes/9336.improvement.rst 2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9336.improvement.rst 1970-01-01 
01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-Add ``TargetLibraryInfo`` pass to CPU LLVM pipeline.
-""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-The ``TargetLibraryInfo`` pass makes sure that the optimisations that take 
place
-during call simplification are appropriate for the target, without this the
-target is assumed to be Linux and code will be optimised to produce e.g. math
-symbols that do not exit on Windows. Historically this issue has been avoided
-through the use of Numba internal libraries carrying wrapped symbols, but doing
-so potentially detriments performance. As a result of this change Numba 
internal
-libraries are smaller and there is an increase in optimisation opportunity in
-code using ``exp2`` and ``log2`` functions.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9341.new_feature.rst 
new/numba-0.59.1/docs/upcoming_changes/9341.new_feature.rst
--- old/numba-0.59.0/docs/upcoming_changes/9341.new_feature.rst 2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9341.new_feature.rst 1970-01-01 
01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-Add a config variable to enable / disable the llvmlite memory manager
-=====================================================================
-
-A config variable to force enable or disable the llvmlite memory manager is
-added.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9346.deprecation.rst 
new/numba-0.59.1/docs/upcoming_changes/9346.deprecation.rst
--- old/numba-0.59.0/docs/upcoming_changes/9346.deprecation.rst 2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9346.deprecation.rst 1970-01-01 
01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-Explicitly setting ``NUMBA_CAPTURED_ERRORS=old_style`` will raise deprecation 
warnings
-======================================================================================
-
-As per deprecation schedule of old-style error-capturing, explicitly setting 
-``NUMBA_CAPTURED_ERRORS=old_style`` will raise deprecation warnings. 
-This release is the last to use "old_style" as the default.
-Details are documented at 
-https://numba.readthedocs.io/en/0.58.1/reference/deprecation.html#deprecation-of-old-style-numba-captured-errors
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/numba-0.59.0/docs/upcoming_changes/9347.improvement.rst 
new/numba-0.59.1/docs/upcoming_changes/9347.improvement.rst
--- old/numba-0.59.0/docs/upcoming_changes/9347.improvement.rst 2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9347.improvement.rst 1970-01-01 
01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-Numba deprecation warning classes are now subclasses of builtin ones
-====================================================================
-
-To help users manage and suppress deprecation warnings from Numba, the
-``NumbaDeprecationWarning`` and ``NumbaPendingDeprecationWarning`` classes are
-now subclasses of the builtin ``DeprecationWarning`` and
-``PendingDeprecationWarning`` respectively. Therefore, warning filters on
-``DeprecationWarning`` and ``PendingDeprecationWarning`` will apply to Numba
-deprecation warnings.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9352.expired.rst 
new/numba-0.59.1/docs/upcoming_changes/9352.expired.rst
--- old/numba-0.59.0/docs/upcoming_changes/9352.expired.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9352.expired.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-Object mode *fall-back* support has been removed.
-=================================================
-
-As per the deprecation schedule for Numba 0.59.0, support for
-"object mode fall-back" is removed from all Numba ``jit``-family decorators.
-Further, the default for the ``nopython`` key-word argument has been changed to
-``True``, this means that all Numba ``jit``-family decorated functions will now
-compile in ``nopython`` mode by default.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/docs/upcoming_changes/9353.expired.rst 
new/numba-0.59.1/docs/upcoming_changes/9353.expired.rst
--- old/numba-0.59.0/docs/upcoming_changes/9353.expired.rst     2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/docs/upcoming_changes/9353.expired.rst     1970-01-01 
01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-Removal of deprecated API ``@numba.generated_jit``.
-===================================================
-
-As per the deprecation schedule for 0.59.0, support for
-``@numba.generated_jit`` has been removed. Use of ``@numba.extending.overload``
-and the high-level extension API is recommended as a replacement.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/_version.py 
new/numba-0.59.1/numba/_version.py
--- old/numba-0.59.0/numba/_version.py  2024-01-31 18:53:01.989844800 +0100
+++ new/numba-0.59.1/numba/_version.py  2024-03-18 14:32:45.775456000 +0100
@@ -8,11 +8,11 @@
 
 version_json = '''
 {
- "date": "2024-01-31T10:35:08-0600",
+ "date": "2024-03-18T08:01:38-0500",
  "dirty": false,
  "error": null,
- "full-revisionid": "c6da26929c7fc18b06dd2e5fc86982cea828df6c",
- "version": "0.59.0"
+ "full-revisionid": "9ce83ef5c35d7f68a547bf2fd1266b9a88d3a00d",
+ "version": "0.59.1"
 }
 '''  # END VERSION_JSON
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/core/ir.py 
new/numba-0.59.1/numba/core/ir.py
--- old/numba-0.59.0/numba/core/ir.py   2024-01-31 18:52:54.000000000 +0100
+++ new/numba-0.59.1/numba/core/ir.py   2024-03-18 14:32:37.000000000 +0100
@@ -26,7 +26,7 @@
     """Source location
 
     """
-    _defmatcher = re.compile(r'def\s+(\w+)\(.*')
+    _defmatcher = re.compile(r'def\s+(\w+)')
 
     def __init__(self, filename, line, col=None, maybe_decorator=False):
         """ Arguments:
@@ -82,10 +82,11 @@
     def _raw_function_name(self):
         defn = self._find_definition()
         if defn:
-            return self._defmatcher.match(defn.strip()).groups()[0]
-        else:
-            # Probably exec(<string>) or REPL.
-            return None
+            m = self._defmatcher.match(defn.strip())
+            if m:
+                return m.groups()[0]
+        # Probably exec(<string>) or REPL.
+        return None
 
     def get_lines(self):
         if self.lines is None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/core/ssa.py 
new/numba-0.59.1/numba/core/ssa.py
--- old/numba-0.59.0/numba/core/ssa.py  2024-01-31 18:52:54.000000000 +0100
+++ new/numba-0.59.1/numba/core/ssa.py  2024-03-18 14:32:37.000000000 +0100
@@ -17,6 +17,7 @@
 
 from numba import config
 from numba.core import ir, ir_utils, errors
+from numba.core.utils import OrderedSet
 from numba.core.analysis import compute_cfg_from_blocks
 
 
@@ -154,8 +155,10 @@
     states = dict(defs=defs, uses=uses)
     _run_block_analysis(blocks, states, _GatherDefsHandler())
     _logger.debug("defs %s", pformat(defs))
-    # Gather violators by number of definitions
-    violators = {k for k, vs in defs.items() if len(vs) > 1}
+    # Gather violators by number of definitions.
+    # The violators are added by the order that they are seen and the algorithm
+    # scan from the first to the last basic-block as they occur in bytecode.
+    violators = OrderedSet([k for k, vs in defs.items() if len(vs) > 1])
     # Gather violators by uses not dominated by the one def
     doms = cfg.dominators()
     for k, use_blocks in uses.items():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/core/utils.py 
new/numba-0.59.1/numba/core/utils.py
--- old/numba-0.59.0/numba/core/utils.py        2024-01-31 18:52:54.000000000 
+0100
+++ new/numba-0.59.1/numba/core/utils.py        2024-03-18 14:32:37.000000000 
+0100
@@ -385,6 +385,28 @@
 T = _tp.TypeVar('T')
 
 
+class OrderedSet(MutableSet[T]):
+
+    def __init__(self, iterable: _tp.Iterable[T] = ()):
+        # Just uses a dictionary under-the-hood to maintain insertion order.
+        self._data = dict.fromkeys(iterable, None)
+
+    def __contains__(self, key):
+        return key in self._data
+
+    def __iter__(self):
+        return iter(self._data)
+
+    def __len__(self):
+        return len(self._data)
+
+    def add(self, item):
+        self._data[item] = None
+
+    def discard(self, item):
+        self._data.pop(item, None)
+
+
 class MutableSortedSet(MutableSet[T], _tp.Generic[T]):
     """Mutable Sorted Set
     """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/cuda/cudadrv/nvvm.py 
new/numba-0.59.1/numba/cuda/cudadrv/nvvm.py
--- old/numba-0.59.0/numba/cuda/cudadrv/nvvm.py 2024-01-31 18:52:54.000000000 
+0100
+++ new/numba-0.59.1/numba/cuda/cudadrv/nvvm.py 2024-03-18 14:32:37.000000000 
+0100
@@ -329,6 +329,7 @@
     (12, 0): ((5, 0), (9, 0)),
     (12, 1): ((5, 0), (9, 0)),
     (12, 2): ((5, 0), (9, 0)),
+    (12, 3): ((5, 0), (9, 0)),
 }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/cuda/dispatcher.py 
new/numba-0.59.1/numba/cuda/dispatcher.py
--- old/numba-0.59.0/numba/cuda/dispatcher.py   2024-01-31 18:52:54.000000000 
+0100
+++ new/numba-0.59.1/numba/cuda/dispatcher.py   2024-03-18 14:32:37.000000000 
+0100
@@ -564,6 +564,14 @@
     """
     _impl_class = CUDACacheImpl
 
+    def load_overload(self, sig, target_context):
+        # Loading an overload refreshes the context to ensure it is
+        # initialized. To initialize the correct (i.e. CUDA) target, we need to
+        # enforce that the current target is the CUDA target.
+        from numba.core.target_extension import target_override
+        with target_override('cuda'):
+            return super().load_overload(sig, target_context)
+
 
 class CUDADispatcher(Dispatcher, serialize.ReduceMixin):
     '''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/cuda/tests/cudapy/test_caching.py 
new/numba-0.59.1/numba/cuda/tests/cudapy/test_caching.py
--- old/numba-0.59.0/numba/cuda/tests/cudapy/test_caching.py    2024-01-31 
18:52:54.000000000 +0100
+++ new/numba-0.59.1/numba/cuda/tests/cudapy/test_caching.py    2024-03-18 
14:32:37.000000000 +0100
@@ -1,6 +1,8 @@
 import multiprocessing
 import os
 import shutil
+import subprocess
+import sys
 import unittest
 import warnings
 
@@ -170,6 +172,37 @@
         # Check the code runs ok from another process
         self.run_in_separate_process()
 
+    @skip_unless_cc_60
+    @skip_if_cudadevrt_missing
+    @skip_if_mvc_enabled('CG not supported with MVC')
+    def test_cache_cg_clean_run(self):
+        # See Issue #9432: https://github.com/numba/numba/issues/9432
+        # If a cached function using CG sync was the first thing to compile,
+        # the compile would fail.
+        self.check_pycache(0)
+
+        # This logic is modelled on run_in_separate_process(), but executes the
+        # CG usecase directly in the subprocess.
+        code = """if 1:
+            import sys
+
+            sys.path.insert(0, %(tempdir)r)
+            mod = __import__(%(modname)r)
+            mod.cg_usecase(0)
+            """ % dict(tempdir=self.tempdir, modname=self.modname)
+
+        popen = subprocess.Popen([sys.executable, "-c", code],
+                                 stdout=subprocess.PIPE,
+                                 stderr=subprocess.PIPE)
+        out, err = popen.communicate(timeout=60)
+        if popen.returncode != 0:
+            raise AssertionError(
+                "process failed with code %s: \n"
+                "stdout follows\n%s\n"
+                "stderr follows\n%s\n"
+                % (popen.returncode, out.decode(), err.decode()),
+            )
+
     def _test_pycache_fallback(self):
         """
         With a disabled __pycache__, test there is a working fallback
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/np/arraymath.py 
new/numba-0.59.1/numba/np/arraymath.py
--- old/numba-0.59.0/numba/np/arraymath.py      2024-01-31 18:52:54.000000000 
+0100
+++ new/numba-0.59.1/numba/np/arraymath.py      2024-03-18 14:32:37.000000000 
+0100
@@ -3735,46 +3735,38 @@
     return a < b
 
 
-def _searchsorted(func_1, func_2):
-    # a facsimile of:
-    # 
https://github.com/numpy/numpy/blob/4f84d719657eb455a35fcdf9e75b83eb1f97024a/numpy/core/src/npysort/binsearch.cpp#L61
  # noqa: E501
-
-    def impl(a, v):
-        min_idx = 0
-        max_idx = len(a)
+@register_jitable
+def _less_then_datetime64(a, b):
+    # Original numpy code is at:
+    # 
https://github.com/numpy/numpy/blob/3dad50936a8dc534a81a545365f69ee9ab162ffe/numpy/_core/src/npysort/npysort_common.h#L334-L346
+    if np.isnat(a):
+        return 0
 
-        out = np.empty(v.size, np.intp)
+    if np.isnat(b):
+        return 1
 
-        last_key_val = v.flat[0]
-
-        for i in range(v.size):
-            key_val = v.flat[i]
-
-            if func_1(last_key_val, key_val):
-                max_idx = len(a)
-            else:
-                min_idx = 0
-                if max_idx < len(a):
-                    max_idx += 1
-                else:
-                    max_idx = len(a)
-
-            last_key_val = key_val
+    return a < b
 
-            while min_idx < max_idx:
-                # to avoid overflow
-                mid_idx = min_idx + ((max_idx - min_idx) >> 1)
 
-                mid_val = a[mid_idx]
+@register_jitable
+def _less_then_or_equal_datetime64(a, b):
+    return not _less_then_datetime64(b, a)
 
-                if func_2(mid_val, key_val):
-                    min_idx = mid_idx + 1
-                else:
-                    max_idx = mid_idx
 
-            out[i] = min_idx
+def _searchsorted(cmp):
+    # a facsimile of:
+    # 
https://github.com/numpy/numpy/blob/4f84d719657eb455a35fcdf9e75b83eb1f97024a/numpy/core/src/npysort/binsearch.cpp#L61
  # noqa: E501
 
-        return out.reshape(v.shape)
+    def impl(a, key_val, min_idx, max_idx):
+        while min_idx < max_idx:
+            # to avoid overflow
+            mid_idx = min_idx + ((max_idx - min_idx) >> 1)
+            mid_val = a[mid_idx]
+            if cmp(mid_val, key_val):
+                min_idx = mid_idx + 1
+            else:
+                max_idx = mid_idx
+        return min_idx, max_idx
 
     return impl
 
@@ -3785,21 +3777,29 @@
 def make_searchsorted_implementation(np_dtype, side):
     assert side in VALID_SEARCHSORTED_SIDES
 
-    lt = _less_than
-    le = _less_than_or_equal
+    if np_dtype.char in 'mM':
+        # is datetime
+        lt = _less_then_datetime64
+        le = _less_then_or_equal_datetime64
+    else:
+        lt = _less_than
+        le = _less_than_or_equal
 
     if side == 'left':
-        _impl = _searchsorted(lt, lt)
+        _impl = _searchsorted(lt)
+        _cmp = lt
     else:
         if np.issubdtype(np_dtype, np.inexact) and numpy_version < (1, 23):
             # change in behaviour for inexact types
             # introduced by:
             # https://github.com/numpy/numpy/pull/21867
-            _impl = _searchsorted(lt, le)
+            _impl = _searchsorted(le)
+            _cmp = lt
         else:
-            _impl = _searchsorted(le, le)
+            _impl = _searchsorted(le)
+            _cmp = le
 
-    return register_jitable(_impl)
+    return register_jitable(_impl), register_jitable(_cmp)
 
 
 @overload(np.searchsorted)
@@ -3817,18 +3817,40 @@
         v_dt = as_dtype(v)
 
     np_dt = np.promote_types(as_dtype(a.dtype), v_dt)
-    _impl = make_searchsorted_implementation(np_dt, side_val)
+    _impl, _cmp = make_searchsorted_implementation(np_dt, side_val)
 
     if isinstance(v, types.Array):
         def impl(a, v, side='left'):
-            return _impl(a, v)
+            out = np.empty(v.size, dtype=np.intp)
+            last_key_val = v.flat[0]
+            min_idx = 0
+            max_idx = len(a)
+
+            for i in range(v.size):
+                key_val = v.flat[i]
+
+                if _cmp(last_key_val, key_val):
+                    max_idx = len(a)
+                else:
+                    min_idx = 0
+                    if max_idx < len(a):
+                        max_idx += 1
+                    else:
+                        max_idx = len(a)
+
+                last_key_val = key_val
+                min_idx, max_idx = _impl(a, key_val, min_idx, max_idx)
+                out[i] = min_idx
+
+            return out.reshape(v.shape)
     elif isinstance(v, types.Sequence):
         def impl(a, v, side='left'):
-            return _impl(a, np.array(v))
+            v = np.asarray(v)
+            return np.searchsorted(a, v, side=side)
     else:  # presumably `v` is scalar
         def impl(a, v, side='left'):
-            return _impl(a, np.array([v]))[0]
-
+            r, _ = _impl(a, v, 0, len(a))
+            return r
     return impl
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/tests/parfor_iss9490_usecase.py 
new/numba-0.59.1/numba/tests/parfor_iss9490_usecase.py
--- old/numba-0.59.0/numba/tests/parfor_iss9490_usecase.py      1970-01-01 
01:00:00.000000000 +0100
+++ new/numba-0.59.1/numba/tests/parfor_iss9490_usecase.py      2024-03-18 
14:32:37.000000000 +0100
@@ -0,0 +1,77 @@
+"""
+This is a testcase for https://github.com/numba/numba/issues/9490.
+The bug is very sensitive to the control-flow and variable uses.
+It is impossible to shrink the reproducer in any meaningful way.
+
+The test is also sensitive to PYTHONHASHSEED.
+PYTHONHASHSEED=1 will trigger the bug.
+
+Example of traceback:
+
+  File "/numba/parfors/parfor.py", line 2070, in _arrayexpr_to_parfor
+    index_vars, loopnests = _mk_parfor_loops(pass_states.typemap, size_vars,
+                                             scope, loc)
+  File "/numba/parfors/parfor.py", line 1981, in _mk_parfor_loops
+    for size_var in size_vars:
+TypeError: Failed in nopython mode pipeline (step: convert to parfors)
+'NoneType' object is not iterable
+"""
+
+import numba
+import numpy as np
+
+
+@numba.jit(nopython=True, parallel=True)
+def stable_fit(X, y, threshold=3):
+    min_obs = int(X.shape[1] * 1.5)
+    beta = np.zeros((X.shape[1], y.shape[1]), dtype=np.float64)
+    residuals = np.full_like(y, np.nan)
+    stable = np.empty((y.shape[1]))
+    for idx in numba.prange(y.shape[1]):
+        y_sub = y[:, idx]
+        isna = np.isnan(y_sub)
+        X_sub = X[~isna]
+        y_sub = y_sub[~isna]
+        is_stable = False
+
+        # Run until minimum observations
+        # or until stability is reached
+        for jdx in range(len(y_sub), min_obs - 1, -2):
+            # Timeseries gets reduced by two elements
+            # each iteration
+            y_ = y_sub[-jdx:]
+            X_ = X_sub[-jdx:]
+            beta_sub = np.linalg.solve(np.dot(X_.T, X_), np.dot(X_.T, y_))
+            resid_sub = np.dot(X_, beta_sub) - y_
+            # Check for stability
+            rmse = np.sqrt(np.mean(resid_sub ** 2))
+            first = np.fabs(resid_sub[0]) / rmse < threshold
+            last = np.fabs(resid_sub[-1]) / rmse < threshold
+            # Break if stability is reached
+            is_stable = first & last
+            if is_stable:
+                break
+
+        beta[:, idx] = beta_sub
+        residuals[-jdx:, idx] = resid_sub
+        stable[idx] = is_stable
+    return beta, residuals, stable.astype(np.bool_)
+
+
+def check():
+    np.random.seed(0)
+    X_shape = (10, 4)
+    y_shape = (10, 5)
+    X = np.random.random(X_shape)
+    y = np.random.random(y_shape)
+
+    got_beta, got_residuals, got_stable = stable_fit(X, y)
+    exp_beta, exp_residuals, exp_stable = stable_fit.py_func(X, y)
+
+    np.testing.assert_allclose(got_beta, exp_beta)
+    np.testing.assert_allclose(got_residuals, exp_residuals)
+    np.testing.assert_allclose(got_stable, exp_stable)
+
+
+if __name__ == "__main__":
+    check()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/tests/support.py 
new/numba-0.59.1/numba/tests/support.py
--- old/numba-0.59.0/numba/tests/support.py     2024-01-31 18:52:55.000000000 
+0100
+++ new/numba-0.59.1/numba/tests/support.py     2024-03-18 14:32:37.000000000 
+0100
@@ -150,6 +150,14 @@
                                           "parameter area' in "
                                           "LowerCall_64SVR4"))
 
+# LLVM PPC issue.
+# Sample error message:
+#   Invalid PPC CTR loop!
+#   UNREACHABLE executed at /llvm/lib/Target/PowerPC/PPCCTRLoops.cpp:179!
+skip_ppc64le_invalid_ctr_loop = unittest.skipIf(
+    platform.machine() == 'ppc64le',
+    "Invalid PPC CTR loop")
+
 # fenv.h on M1 may have various issues:
 # https://github.com/numba/numba/issues/7822#issuecomment-1065356758
 _uname = platform.uname()
@@ -549,7 +557,8 @@
             _assertNumberEqual(first, second, delta)
 
     def subprocess_test_runner(self, test_module, test_class=None,
-                               test_name=None, envvars=None, timeout=60):
+                               test_name=None, envvars=None, timeout=60,
+                               _subproc_test_env="1"):
         """
         Runs named unit test(s) as specified in the arguments as:
         test_module.test_class.test_name. test_module must always be supplied
@@ -560,7 +569,8 @@
             environment variable name (str) -> value (str)
         It is most convenient to use this method in conjunction with
         @needs_subprocess as the decorator will cause the decorated test to be
-        skipped unless the `SUBPROC_TEST` environment variable is set to 1
+        skipped unless the `SUBPROC_TEST` environment variable is set to
+        the same value of ``_subproc_test_env``
         (this special environment variable is set by this method such that the
         specified test(s) will not be skipped in the subprocess).
 
@@ -575,7 +585,7 @@
         fully_qualified_test = '.'.join(x for x in parts if x is not None)
         cmd = [sys.executable, '-m', 'numba.runtests', fully_qualified_test]
         env_copy = os.environ.copy()
-        env_copy['SUBPROC_TEST'] = '1'
+        env_copy['SUBPROC_TEST'] = _subproc_test_env
         try:
             env_copy['COVERAGE_PROCESS_START'] = os.environ['COVERAGE_RCFILE']
         except KeyError:
@@ -601,15 +611,18 @@
         subprocess_test_runner."""
         def wrapper(func):
             def inner(self, *args, **kwargs):
-                if os.environ.get("SUBPROC_TEST", None) != "1":
+                if os.environ.get("SUBPROC_TEST", None) != func.__name__:
                     # Not in a subprocess test env, so stage the call to run 
the
                     # test in a subprocess which will set the env var.
                     class_name = self.__class__.__name__
-                    self.subprocess_test_runner(test_module=self.__module__,
-                                                test_class=class_name,
-                                                test_name=func.__name__,
-                                                timeout=timeout,
-                                                envvars=envvars,)
+                    self.subprocess_test_runner(
+                        test_module=self.__module__,
+                        test_class=class_name,
+                        test_name=func.__name__,
+                        timeout=timeout,
+                        envvars=envvars,
+                        _subproc_test_env=func.__name__,
+                    )
                 else:
                     # env var is set, so we're in the subprocess, run the
                     # actual test.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/tests/test_exceptions.py 
new/numba-0.59.1/numba/tests/test_exceptions.py
--- old/numba-0.59.0/numba/tests/test_exceptions.py     2024-01-31 
18:52:55.000000000 +0100
+++ new/numba-0.59.1/numba/tests/test_exceptions.py     2024-03-18 
14:32:37.000000000 +0100
@@ -3,7 +3,7 @@
 import traceback
 
 from numba import jit, njit
-from numba.core import types, errors
+from numba.core import types, errors, utils
 from numba.tests.support import (TestCase, expected_failure_py311,
                                  expected_failure_py312,
                                  )
@@ -309,9 +309,18 @@
         # issue #3428
         simple_raise = "def f(a):\n  raise exc('msg', 10)"
         assert_raise = "def f(a):\n  assert a != 1"
-        for f_text, exc in [(assert_raise, AssertionError),
-                            (simple_raise, UDEArgsToSuper),
-                            (simple_raise, UDENoArgSuper)]:
+        py312_pep695_raise = "def f[T: int](a: T) -> T:\n  assert a != 1"
+        py312_pep695_raise_2 = "def f[T: int\n](a: T) -> T:\n  assert a != 1"
+        test_cases = [
+            (assert_raise, AssertionError),
+            (simple_raise, UDEArgsToSuper),
+            (simple_raise, UDENoArgSuper),
+        ]
+        if utils.PYVERSION >= (3, 12):
+            # Added for https://github.com/numba/numba/issues/9443
+            test_cases.append((py312_pep695_raise, AssertionError))
+            test_cases.append((py312_pep695_raise_2, AssertionError))
+        for f_text, exc in test_cases:
             loc = {}
             exec(f_text, {'exc': exc}, loc)
             pyfunc = loc['f']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/tests/test_npdatetime.py 
new/numba-0.59.1/numba/tests/test_npdatetime.py
--- old/numba-0.59.0/numba/tests/test_npdatetime.py     2024-01-31 
18:52:55.000000000 +0100
+++ new/numba-0.59.1/numba/tests/test_npdatetime.py     2024-03-18 
14:32:37.000000000 +0100
@@ -971,21 +971,7 @@
     def test_sub_td_no_match(self):
         self._test_add_sub_td_no_match(np.subtract)
 
-    def _test_min_max(self, operation, parallel, method):
-        if method:
-            if operation is np.min:
-                def impl(arr):
-                    return arr.min()
-            else:
-                def impl(arr):
-                    return arr.max()
-        else:
-            def impl(arr):
-                return operation(arr)
-
-        py_func = impl
-        cfunc = njit(parallel=parallel)(impl)
-
+    def _get_testcases(self):
         test_cases = [
             np.array([
                 DT(0, "ns"),
@@ -1067,7 +1053,24 @@
                 TD("NaT", "ns"),
             ]),
         ]
+        return test_cases
+
+    def _test_min_max(self, operation, parallel, method):
+        if method:
+            if operation is np.min:
+                def impl(arr):
+                    return arr.min()
+            else:
+                def impl(arr):
+                    return arr.max()
+        else:
+            def impl(arr):
+                return operation(arr)
+
+        py_func = impl
+        cfunc = njit(parallel=parallel)(impl)
 
+        test_cases = self._get_testcases()
         for arr in test_cases:
             py_res = py_func(arr)
             c_res = cfunc(arr)
@@ -1111,6 +1114,31 @@
     def test_max_method_parallel(self):
         self._test_min_max(np.max, True, True)
 
+    def test_searchsorted_datetime(self):
+        from .test_np_functions import (
+            searchsorted, searchsorted_left, searchsorted_right,
+        )
+        pyfunc_list = [searchsorted, searchsorted_left, searchsorted_right]
+        cfunc_list = [jit(fn) for fn in pyfunc_list]
+
+        def check(pyfunc, cfunc, a, v):
+            expected = pyfunc(a, v)
+            got = cfunc(a, v)
+            self.assertPreciseEqual(expected, got)
+
+        cases = self._get_testcases()
+        for pyfunc, cfunc in zip(pyfunc_list, cfunc_list):
+            for arr in cases:
+                arr = np.sort(arr)
+                for n in range(1, min(3, arr.size) + 1):
+                    idx = np.random.randint(0, arr.size, n)
+                    vs = arr[idx]
+                    if n == 1:
+                        [v] = vs
+                        check(pyfunc, cfunc, arr, v)
+                    check(pyfunc, cfunc, arr, vs)
+
+
 
 if __name__ == '__main__':
     unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/tests/test_parfors.py 
new/numba-0.59.1/numba/tests/test_parfors.py
--- old/numba-0.59.0/numba/tests/test_parfors.py        2024-01-31 
18:52:55.000000000 +0100
+++ new/numba-0.59.1/numba/tests/test_parfors.py        2024-03-18 
14:32:37.000000000 +0100
@@ -44,7 +44,8 @@
                                  override_env_config, linux_only, tag,
                                  skip_parfors_unsupported, _32bit, needs_blas,
                                  needs_lapack, disabled_test, 
skip_unless_scipy,
-                                 needs_subprocess)
+                                 needs_subprocess,
+                                 skip_ppc64le_invalid_ctr_loop)
 from numba.core.extending import register_jitable
 from numba.core.bytecode import _fix_LOAD_GLOBAL_arg
 from numba.core import utils
@@ -2368,6 +2369,25 @@
         self.assertEqual(expected, njit(parallel=False)(def_in_loop)(4))
         self.assertEqual(expected, njit(parallel=True)(def_in_loop)(4))
 
+    @needs_lapack  # use of np.linalg.solve
+    @skip_ppc64le_invalid_ctr_loop
+    def test_issue9490_non_det_ssa_problem(self):
+        cmd = [
+            sys.executable,
+            "-m",
+            "numba.tests.parfor_iss9490_usecase",
+        ]
+
+        try:
+            subp.check_output(cmd, env={**os.environ,
+                                        "PYTHONHASHSEED": "1",
+                                        "NUMBA_NUM_THREADS": "1"},
+                              stderr=subp.STDOUT,
+                              encoding='utf-8')
+        except subp.CalledProcessError as e:
+            msg = f"subprocess failed with output:\n{e.output}"
+            self.fail(msg=msg)
+
 
 @skip_parfors_unsupported
 class TestParforsLeaks(MemoryLeakMixin, TestParforsBase):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba/tests/test_unicode.py 
new/numba-0.59.1/numba/tests/test_unicode.py
--- old/numba-0.59.0/numba/tests/test_unicode.py        2024-01-31 
18:52:55.000000000 +0100
+++ new/numba-0.59.1/numba/tests/test_unicode.py        2024-03-18 
14:32:37.000000000 +0100
@@ -2667,11 +2667,11 @@
         """
         # requires formatting (FORMAT_VALUE) and concatenation (BUILD_STRINGS)
         def impl1(a):
-            return f"AA_{a+3}_B"
+            return f"AA_{a + 3}_B"
 
         # does not require concatenation
         def impl2(a):
-            return f"{a+2}"
+            return f"{a + 2}"
 
         # no expression
         def impl3(a):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba.egg-info/PKG-INFO 
new/numba-0.59.1/numba.egg-info/PKG-INFO
--- old/numba-0.59.0/numba.egg-info/PKG-INFO    2024-01-31 18:53:01.000000000 
+0100
+++ new/numba-0.59.1/numba.egg-info/PKG-INFO    2024-03-18 14:32:45.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: numba
-Version: 0.59.0
+Version: 0.59.1
 Summary: compiling Python code using LLVM
 Home-page: https://numba.pydata.org
 License: BSD
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/numba-0.59.0/numba.egg-info/SOURCES.txt 
new/numba-0.59.1/numba.egg-info/SOURCES.txt
--- old/numba-0.59.0/numba.egg-info/SOURCES.txt 2024-01-31 18:53:01.000000000 
+0100
+++ new/numba-0.59.1/numba.egg-info/SOURCES.txt 2024-03-18 14:32:45.000000000 
+0100
@@ -106,6 +106,7 @@
 docs/source/release/0.58.0-notes.rst
 docs/source/release/0.58.1-notes.rst
 docs/source/release/0.59.0-notes.rst
+docs/source/release/0.59.1-notes.rst
 docs/source/user/5minguide.rst
 docs/source/user/cfunc.rst
 docs/source/user/cli.rst
@@ -126,39 +127,6 @@
 docs/source/user/troubleshoot.rst
 docs/source/user/vectorize.rst
 docs/source/user/withobjmode.rst
-docs/upcoming_changes/9048.bug_fix.rst
-docs/upcoming_changes/9049.bug_fix.rst
-docs/upcoming_changes/9089.bug_fix.rst
-docs/upcoming_changes/9123.new_feature.rst
-docs/upcoming_changes/9126.np_support.rst
-docs/upcoming_changes/9140.np_support.rst
-docs/upcoming_changes/9141.np_support.rst
-docs/upcoming_changes/9144.bug_fix.rst
-docs/upcoming_changes/9154.np_support.rst
-docs/upcoming_changes/9169.bug_fix.rst
-docs/upcoming_changes/9189.bug_fix.rst
-docs/upcoming_changes/9223.cuda.rst
-docs/upcoming_changes/9235.cuda.rst
-docs/upcoming_changes/9242.bug_fix.rst
-docs/upcoming_changes/9244.bug_fix.rst
-docs/upcoming_changes/9245.performance.rst
-docs/upcoming_changes/9246.highlight.rst
-docs/upcoming_changes/9249.np_support.rst
-docs/upcoming_changes/9267.cuda.rst
-docs/upcoming_changes/9279.cuda.rst
-docs/upcoming_changes/9296.bug_fix.rst
-docs/upcoming_changes/9309.change.rst
-docs/upcoming_changes/9310.highlight.rst
-docs/upcoming_changes/9315.change.rst
-docs/upcoming_changes/9330.change.rst
-docs/upcoming_changes/9334.bug_fix.rst
-docs/upcoming_changes/9335.infrastructure.rst
-docs/upcoming_changes/9336.improvement.rst
-docs/upcoming_changes/9341.new_feature.rst
-docs/upcoming_changes/9346.deprecation.rst
-docs/upcoming_changes/9347.improvement.rst
-docs/upcoming_changes/9352.expired.rst
-docs/upcoming_changes/9353.expired.rst
 docs/upcoming_changes/README.rst
 docs/upcoming_changes/template.rst
 numba/__init__.py
@@ -695,6 +663,7 @@
 numba/tests/matmul_usecase.py
 numba/tests/orphaned_semaphore_usecase.py
 numba/tests/overload_usecases.py
+numba/tests/parfor_iss9490_usecase.py
 numba/tests/parfors_cache_usecases.py
 numba/tests/parfors_max_label_error.py
 numba/tests/pdlike_usecase.py

Reply via email to