Skip to content

Commit a439ed5

Browse files
committed
merge main
Signed-off-by: Manjusaka <me@manjusaka.me>
2 parents 6c83c72 + 54f1ed0 commit a439ed5

File tree

16 files changed

+281
-192
lines changed

16 files changed

+281
-192
lines changed

Doc/library/os.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,15 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
15561556
.. versionadded:: 3.15
15571557

15581558

1559+
.. data:: RWF_ATOMIC
1560+
1561+
Write data atomically. Requires alignment to the device's atomic write unit.
1562+
1563+
.. availability:: Linux >= 6.11
1564+
1565+
.. versionadded:: next
1566+
1567+
15591568
.. function:: ptsname(fd, /)
15601569

15611570
Return the name of the slave pseudo-terminal device associated with the
@@ -1598,6 +1607,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
15981607
- :data:`RWF_SYNC`
15991608
- :data:`RWF_APPEND`
16001609
- :data:`RWF_DONTCACHE`
1610+
- :data:`RWF_ATOMIC`
16011611

16021612
Return the total number of bytes actually written.
16031613

Doc/whatsnew/3.15.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,11 @@ Results from the `pyperformance <https://github.com/python/pyperformance>`__
891891
benchmark suite report
892892
`3-4% <https://github.com/facebookexperimental/free-threading-benchmarking/blob/main/results/bm-20251214-3.15.0a2%2B-6cddf04-JIT/bm-20251214-vultr-x86_64-python-6cddf04344a1e8ca9df5-3.15.0a2%2B-6cddf04-vs-base.svg>`__
893893
geometric mean performance improvement for the JIT over the standard CPython
894-
interpreter built with all optimizations enabled. The speedups for JIT
894+
interpreter built with all optimizations enabled on x86-64 Linux. On AArch64
895+
macOS, the JIT has a
896+
`7-8% <https://raw.githubusercontent.com/facebookexperimental/free-threading-benchmarking/refs/heads/main/results/bm-20260103-3.15.0a3%2B-9609574-JIT/bm-20260103-macm4pro-arm64-python-9609574e7fd36edfaa8b-3.15.0a3%2B-9609574-vs-base.svg>`__
897+
speedup over the :ref:`tail calling interpreter <whatsnew314-tail-call-interpreter>`
898+
with all optimizations enabled. The speedups for JIT
895899
builds versus no JIT builds range from roughly 20% slowdown to over
896900
100% speedup (ignoring the ``unpack_sequence`` microbenchmark) on
897901
x86-64 Linux and AArch64 macOS systems.

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_ids.h

Lines changed: 138 additions & 136 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_metadata.h

Lines changed: 11 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/test/test_capi/test_opt.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,6 +2952,25 @@ def f(n):
29522952
self.assertLessEqual(count_ops(ex, "_POP_TOP"), 3)
29532953
self.assertIn("_POP_TOP_NOP", uops)
29542954

2955+
def test_to_bool_always_true(self):
2956+
def testfunc(n):
2957+
class A:
2958+
pass
2959+
2960+
a = A()
2961+
for _ in range(n):
2962+
if not a:
2963+
return 0
2964+
return 1
2965+
2966+
res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
2967+
self.assertEqual(res, 1)
2968+
self.assertIsNotNone(ex)
2969+
uops = get_opnames(ex)
2970+
self.assertNotIn("_REPLACE_WITH_TRUE", uops)
2971+
self.assertIn("_INSERT_1_LOAD_CONST_INLINE_BORROW", uops)
2972+
self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 1)
2973+
29552974
def test_attr_promotion_failure(self):
29562975
# We're not testing for any specific uops here, just
29572976
# testing it doesn't crash.

0 commit comments

Comments
 (0)