Skip to content

Commit 3d60de9

Browse files
committed
Merge remote-tracking branch 'upstream/main' into tachyon_live_errors
2 parents 79e3121 + 1e17ccd commit 3d60de9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1592
-1162
lines changed

.github/workflows/tail-call.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,23 @@ jobs:
8181

8282
- name: Native Windows MSVC (release)
8383
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
84-
shell: cmd
84+
shell: pwsh
8585
run: |
8686
choco install visualstudio2026buildtools --no-progress -y --force --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --locale en-US --passive"
8787
$env:PATH = "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\bin;$env:PATH"
88-
./PCbuild/build.bat --tail-call-interp -c Release -p ${{ matrix.architecture }} "/p:PlatformToolset=v145"
88+
$env:PlatformToolset = "v145"
89+
./PCbuild/build.bat --tail-call-interp -c Release -p ${{ matrix.architecture }}
8990
./PCbuild/rt.bat -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
9091
9192
# No tests (yet):
9293
- name: Emulated Windows Clang (release)
9394
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
94-
shell: cmd
95+
shell: pwsh
9596
run: |
9697
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
97-
set PlatformToolset=clangcl
98-
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
99-
set LLVMInstallDir=C:\Program Files\LLVM
98+
$env:PlatformToolset = "clangcl"
99+
$env:LLVMToolsVersion = "${{ matrix.llvm }}.1.0"
100+
$env:LLVMInstallDir = "C:\Program Files\LLVM"
100101
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
101102
102103
- name: Native macOS (release)

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.13.2
3+
rev: v0.14.10
44
hooks:
55
- id: ruff-check
66
name: Run Ruff (lint) on Apple/
@@ -52,7 +52,7 @@ repos:
5252
files: ^Tools/wasm/
5353

5454
- repo: https://github.com/psf/black-pre-commit-mirror
55-
rev: 25.9.0
55+
rev: 25.12.0
5656
hooks:
5757
- id: black
5858
name: Run Black on Tools/jit/
@@ -83,24 +83,24 @@ repos:
8383
files: '^\.github/CODEOWNERS|\.(gram)$'
8484

8585
- repo: https://github.com/python-jsonschema/check-jsonschema
86-
rev: 0.34.0
86+
rev: 0.36.0
8787
hooks:
8888
- id: check-dependabot
8989
- id: check-github-workflows
9090
- id: check-readthedocs
9191

9292
- repo: https://github.com/rhysd/actionlint
93-
rev: v1.7.7
93+
rev: v1.7.9
9494
hooks:
9595
- id: actionlint
9696

9797
- repo: https://github.com/woodruffw/zizmor-pre-commit
98-
rev: v1.14.1
98+
rev: v1.19.0
9999
hooks:
100100
- id: zizmor
101101

102102
- repo: https://github.com/sphinx-contrib/sphinx-lint
103-
rev: v1.0.0
103+
rev: v1.0.2
104104
hooks:
105105
- id: sphinx-lint
106106
args: [--enable=default-role]

Doc/deprecations/pending-removal-in-3.15.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ Pending removal in Python 3.15
3333

3434
* ``load_module()`` method: use ``exec_module()`` instead.
3535

36-
* :class:`locale`:
37-
38-
* The :func:`~locale.getdefaultlocale` function
39-
has been deprecated since Python 3.11.
40-
Its removal was originally planned for Python 3.13 (:gh:`90817`),
41-
but has been postponed to Python 3.15.
42-
Use :func:`~locale.getlocale`, :func:`~locale.setlocale`,
43-
and :func:`~locale.getencoding` instead.
44-
(Contributed by Hugo van Kemenade in :gh:`111187`.)
45-
4636
* :mod:`pathlib`:
4737

4838
* :meth:`!.PurePath.is_reserved`

Doc/library/locale.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@ The :mod:`locale` module defines the following exception and functions:
370370
determined.
371371
The "C" locale is represented as ``(None, None)``.
372372

373-
.. deprecated-removed:: 3.11 3.15
374-
375373

376374
.. function:: getlocale(category=LC_CTYPE)
377375

Doc/library/profiling.sampling.rst

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ counts**, not direct measurements. Tachyon counts how many times each function
5353
appears in the collected samples, then multiplies by the sampling interval to
5454
estimate time.
5555

56-
For example, with a 100 microsecond sampling interval over a 10-second profile,
56+
For example, with a 10 kHz sampling rate over a 10-second profile,
5757
Tachyon collects approximately 100,000 samples. If a function appears in 5,000
5858
samples (5% of total), Tachyon estimates it consumed 5% of the 10-second
5959
duration, or about 500 milliseconds. This is a statistical estimate, not a
@@ -142,7 +142,7 @@ Use live mode for real-time monitoring (press ``q`` to quit)::
142142

143143
Profile for 60 seconds with a faster sampling rate::
144144

145-
python -m profiling.sampling run -d 60 -i 50 script.py
145+
python -m profiling.sampling run -d 60 -r 20khz script.py
146146

147147
Generate a line-by-line heatmap::
148148

@@ -326,8 +326,8 @@ The default configuration works well for most use cases:
326326

327327
* - Option
328328
- Default
329-
* - Default for ``--interval`` / ``-i``
330-
- 100 µs between samples (~10,000 samples/sec)
329+
* - Default for ``--sampling-rate`` / ``-r``
330+
- 1 kHz
331331
* - Default for ``--duration`` / ``-d``
332332
- 10 seconds
333333
* - Default for ``--all-threads`` / ``-a``
@@ -346,23 +346,22 @@ The default configuration works well for most use cases:
346346
- Disabled (non-blocking sampling)
347347

348348

349-
Sampling interval and duration
350-
------------------------------
349+
Sampling rate and duration
350+
--------------------------
351351

352-
The two most fundamental parameters are the sampling interval and duration.
352+
The two most fundamental parameters are the sampling rate and duration.
353353
Together, these determine how many samples will be collected during a profiling
354354
session.
355355

356-
The :option:`--interval` option (:option:`-i`) sets the time between samples in
357-
microseconds. The default is 100 microseconds, which produces approximately
358-
10,000 samples per second::
356+
The :option:`--sampling-rate` option (:option:`-r`) sets how frequently samples
357+
are collected. The default is 1 kHz (10,000 samples per second)::
359358

360-
python -m profiling.sampling run -i 50 script.py
359+
python -m profiling.sampling run -r 20khz script.py
361360

362-
Lower intervals capture more samples and provide finer-grained data at the
363-
cost of slightly higher profiler CPU usage. Higher intervals reduce profiler
361+
Higher rates capture more samples and provide finer-grained data at the
362+
cost of slightly higher profiler CPU usage. Lower rates reduce profiler
364363
overhead but may miss short-lived functions. For most applications, the
365-
default interval provides a good balance between accuracy and overhead.
364+
default rate provides a good balance between accuracy and overhead.
366365

367366
The :option:`--duration` option (:option:`-d`) sets how long to profile in seconds. The
368367
default is 10 seconds::
@@ -573,9 +572,9 @@ appended:
573572
- For pstats format (which defaults to stdout), subprocesses produce files like
574573
``profile_12345.pstats``
575574

576-
The subprocess profilers inherit most sampling options from the parent (interval,
577-
duration, thread selection, native frames, GC frames, async-aware mode, and
578-
output format). All Python descendant processes are profiled recursively,
575+
The subprocess profilers inherit most sampling options from the parent (sampling
576+
rate, duration, thread selection, native frames, GC frames, async-aware mode,
577+
and output format). All Python descendant processes are profiled recursively,
579578
including grandchildren and further descendants.
580579

581580
Subprocess detection works by periodically scanning for new descendants of
@@ -1389,9 +1388,9 @@ Global options
13891388
Sampling options
13901389
----------------
13911390

1392-
.. option:: -i <microseconds>, --interval <microseconds>
1391+
.. option:: -r <rate>, --sampling-rate <rate>
13931392

1394-
Sampling interval in microseconds. Default: 100.
1393+
Sampling rate (for example, ``10000``, ``10khz``, ``10k``). Default: ``1khz``.
13951394

13961395
.. option:: -d <seconds>, --duration <seconds>
13971396

Doc/tools/check-warnings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,11 @@ def main(argv: list[str] | None = None) -> int:
311311
if not Path("Doc").exists() or not Path("Doc").is_dir():
312312
raise RuntimeError(wrong_directory_msg)
313313

314-
with Path("Doc/sphinx-warnings.txt").open(encoding="UTF-8") as f:
315-
warnings = f.read().splitlines()
314+
warnings = (
315+
Path("Doc/sphinx-warnings.txt")
316+
.read_text(encoding="UTF-8")
317+
.splitlines()
318+
)
316319

317320
cwd = str(Path.cwd()) + os.path.sep
318321
files_with_nits = {

Doc/whatsnew/3.15.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ locale
562562
but included in the language code.
563563
(Contributed by Serhiy Storchaka in :gh:`137729`.)
564564

565+
* Undeprecate the :func:`locale.getdefaultlocale` function.
566+
(Contributed by Victor Stinner in :gh:`130796`.)
567+
565568

566569
math
567570
----
@@ -935,8 +938,8 @@ code results in constants, the code can be simplified by the JIT.
935938
The JIT avoids :term:`reference count`\ s where possible. This generally
936939
reduces the cost of most operations in Python.
937940

938-
(Contributed by Ken Jin, Donghee Na, Zheao Li, Savannah Ostrowski,
939-
Noam Cohen, Tomas Roun, PuQing in :gh:`134584`.)
941+
(Contributed by Ken Jin, Donghee Na, Zheao Li, Hai Zhu, Savannah Ostrowski,
942+
Noam Cohen, Tomas Roun, and PuQing in :gh:`134584`.)
940943

941944
.. rubric:: Better machine code generation
942945

Include/internal/pycore_interpframe.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static inline PyCodeObject *_PyFrame_GetCode(_PyInterpreterFrame *f) {
2727
// Similar to _PyFrame_GetCode(), but return NULL if the frame is invalid or
2828
// freed. Used by dump_frame() in Python/traceback.c. The function uses
2929
// heuristics to detect freed memory, it's not 100% reliable.
30-
static inline PyCodeObject*
30+
static inline PyCodeObject* _Py_NO_SANITIZE_THREAD
3131
_PyFrame_SafeGetCode(_PyInterpreterFrame *f)
3232
{
3333
// globals and builtins may be NULL on a legit frame, but it's unlikely.
@@ -70,7 +70,7 @@ _PyFrame_GetBytecode(_PyInterpreterFrame *f)
7070
// Similar to PyUnstable_InterpreterFrame_GetLasti(), but return NULL if the
7171
// frame is invalid or freed. Used by dump_frame() in Python/traceback.c. The
7272
// function uses heuristics to detect freed memory, it's not 100% reliable.
73-
static inline int
73+
static inline int _Py_NO_SANITIZE_THREAD
7474
_PyFrame_SafeGetLasti(struct _PyInterpreterFrame *f)
7575
{
7676
// Code based on _PyFrame_GetBytecode() but replace _PyFrame_GetCode()

Include/internal/pycore_jit.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ extern "C" {
1919
#ifdef _Py_JIT
2020

2121
typedef _Py_CODEUNIT *(*jit_func)(
22-
_PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate,
22+
_PyExecutorObject *executor, _PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate,
2323
_PyStackRef _tos_cache0, _PyStackRef _tos_cache1, _PyStackRef _tos_cache2
2424
);
2525

2626
int _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction *trace, size_t length);
2727
void _PyJIT_Free(_PyExecutorObject *executor);
28+
void _PyJIT_Fini(void);
2829

2930
#endif // _Py_JIT
3031

Include/internal/pycore_object.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -252,25 +252,6 @@ _Py_DECREF_SPECIALIZED(PyObject *op, const destructor destruct)
252252
}
253253
}
254254

255-
static inline void
256-
_Py_DECREF_NO_DEALLOC(PyObject *op)
257-
{
258-
if (_Py_IsImmortal(op)) {
259-
_Py_DECREF_IMMORTAL_STAT_INC();
260-
return;
261-
}
262-
_Py_DECREF_STAT_INC();
263-
#ifdef Py_REF_DEBUG
264-
_Py_DEC_REFTOTAL(PyInterpreterState_Get());
265-
#endif
266-
op->ob_refcnt--;
267-
#ifdef Py_DEBUG
268-
if (op->ob_refcnt <= 0) {
269-
_Py_FatalRefcountError("Expected a positive remaining refcount");
270-
}
271-
#endif
272-
}
273-
274255
#else
275256
// TODO: implement Py_DECREF specializations for Py_GIL_DISABLED build
276257
static inline void
@@ -279,12 +260,6 @@ _Py_DECREF_SPECIALIZED(PyObject *op, const destructor destruct)
279260
Py_DECREF(op);
280261
}
281262

282-
static inline void
283-
_Py_DECREF_NO_DEALLOC(PyObject *op)
284-
{
285-
Py_DECREF(op);
286-
}
287-
288263
static inline int
289264
_Py_REF_IS_MERGED(Py_ssize_t ob_ref_shared)
290265
{

0 commit comments

Comments
 (0)