92 Commits

Author SHA1 Message Date
chemelnucfin f4f82f0ab6 gh-133560: Clarified parser.md doc for pegen parser issue in using the existing Grammar/python.gram file. (GH-139194)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-05-01 10:11:53 +02:00
Sergey Miryanov 1575a81bf2 GH-148726: Forward-port generational GC. (GH-148746)
The replaces the incremental GC with a forward port (from 3.13) of the generational GC.

Co-Authored-By: Neil Schemenauer <nas@arctrix.com>
Co-Authored-By: Zanie Blue <contact@zanie.dev>
Co-Authored-By: Sergey Miryanov <sergey.miryanov@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-30 12:19:13 -07:00
sobolevn 85d3bcd4f3 gh-134690: Removed deprecated codetype.co_lnotab (#134691) 2026-04-25 19:13:48 +03:00
Stan Ulbrych 0274d8304e InternalDocs: Correct struct path for latin1 singletons in string_interning.md (GH-148358) 2026-04-13 11:45:41 +02:00
Chris Eibl 668c5723eb GH-139922: add interpreter types to InternalDocs/interpreter.md (GH-148035) 2026-04-05 23:25:14 +08:00
Ken Jin 362145c20e gh-139109: Document the trace recording interpreter in internaldocs (GH-146110) 2026-03-31 23:25:54 +08:00
Sam Gross 60093096ba gh-146041: Avoid lock in sys.intern() for already interned strings (gh-146072)
Fix free-threading scaling bottleneck in sys.intern and `PyObject_SetAttr` by
avoiding the interpreter-wide lock when the string is already interned and
immortalized.
2026-03-24 14:29:37 -04:00
Hai Zhu 81ef1b7317 gh-144888: Replace bloom filter linked lists with continuous arrays to optimize executor invalidating performance (GH-145873) 2026-03-16 15:58:18 +00:00
Sam Gross 7ebe924395 gh-144969: Document that the free threading GC can change ob_tid (#144972) 2026-02-19 01:49:09 +01:00
Pablo Galindo Salgado 7c44f37170 gh-138122: Extend binary profiling format with full source location and opcode (#143088)
Co-authored-by: Stan Ulbrych <stan@ulbrych.org>
2025-12-24 16:15:11 +00:00
Pablo Galindo Salgado 9e51301234 gh-138122: Allow tachyon to write and read binary output (#142730) 2025-12-22 23:57:20 +00:00
Mikhail Efimov cf7a309fbf gh-119786: Remove mention of _PyThreadState_BumpFramePointer from InternalDocs/interpreter.md (#141816)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-12-16 13:49:14 +02:00
Sam Gross a882ae198a gh-142472: Clean-up _PyStackRef functions (gh-142479)
This combines most _PyStackRef functions and macros between the free
threaded and default builds.

- Remove Py_TAG_DEFERRED (same as Py_TAG_REFCNT)
- Remove PyStackRef_IsDeferred (same as !PyStackRef_RefcountOnObject)
2025-12-15 12:03:49 -05:00
Stan Ulbrych a7501f07da Move doc on structure from devguide to InternalDocs (GH-142237)
Co-Authored-By: Paul Ross <apaulross@gmail.com>
Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com>
Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-12-15 15:19:02 +01:00
Petr Viktorin af2b3e98d8 Link listsort.txt in InternalDocs/README.md (#142619) 2025-12-12 10:16:55 +00:00
Sam Gross f2fba4c99a gh-124379: Document _PyStackRef (gh-142321) 2025-12-08 12:14:50 -05:00
Pablo Galindo Salgado d6d850df89 gh-138122: Don't sample partial frame chains (#141912) 2025-12-07 15:53:48 +00:00
Pablo Galindo Salgado 572c780aa8 gh-138122: Implement frame caching in RemoteUnwinder to reduce memory reads (#142137)
This PR implements frame caching in the RemoteUnwinder class to significantly reduce memory reads when profiling remote processes with deep call stacks.

When cache_frames=True, the unwinder stores the frame chain from each sample and reuses unchanged portions in subsequent samples. Since most profiling samples capture similar call stacks (especially the parent frames), this optimization avoids repeatedly reading the same frame data from the target process.

The implementation adds a last_profiled_frame field to the thread state that tracks where the previous sample stopped. On the next sample, if the current frame chain reaches this marker, the cached frames from that point onward are reused instead of being re-read from remote memory.

The sampling profiler now enables frame caching by default.
2025-12-06 22:37:34 +00:00
Mark Shannon c25a070759 GH-139653: Only raise an exception (or fatal error) when the stack pointer is about to overflow the stack. (GH-141711)
Only raises if the stack pointer is both below the limit *and* above the stack base.
This prevents false positives for user-space threads, as the stack pointer will be outside those bounds
if the stack has been swapped.
2025-11-19 10:16:24 +00:00
Mikhail Efimov c2470b39fa gh-137959: Fix TIER1_TO_TIER2 macro name in JIT InternalDocs (GH-141496)
JIT InternalDocs fix
2025-11-13 14:44:40 +00:00
AN Long 6393068bde fix some typos (#138977) 2025-09-16 18:33:39 +05:30
Bartosz Sławecki 097fc12149 Fix typo in stack_protection.md (GH-138876) 2025-09-15 04:53:13 -04:00
yihong a1707e4516 gh-138081: fix some dead links in InternalDocs (#138082) 2025-09-11 10:54:16 +02:00
Mark Shannon 923d68655b Add internal doc describing the stack protection mechanism (GH137663) 2025-08-13 19:04:25 +01:00
Neil Schemenauer 350c58ba4e GH-135552: Make the GC clear weakrefs later (GH-136189)
Fix a bug caused by the garbage collector clearing weakrefs too early.  The
weakrefs in the ``tp_subclasses`` dictionary are needed in order to correctly
invalidate type caches (for example, by calling ``PyType_Modified()``).
Clearing weakrefs before calling finalizers causes the caches to not be
correctly invalidated.  That can cause crashes since the caches can refer to
invalid objects.  Defer the clearing of weakrefs without callbacks until after
finalizers are executed.
2025-08-07 16:32:17 -07:00
Weilin Du 698bab5a40 Doc: fix duplicated words (#136086)
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-06-29 18:04:02 -04:00
Neil Schemenauer ceae4edf81 gh-119786: Add InternalDocs/qsbr.md. (gh-135411)
Add internal doc for the Quiescent-State Based Reclamation (QSBR) implementation.
2025-06-23 22:09:40 +00:00
Kumar Aditya 0d9d48959e add async generators section to asyncio internal docs (#135674) 2025-06-23 06:22:28 +00:00
Kumar Aditya cb39410111 Initial internal asyncio docs (#135469)
Currently focused on `_asynciomodule.c` but could also receive updates about internals of the Python package.
2025-06-17 12:21:41 -07:00
sobolevn 5507eff19c Improve format of InternalDocs/exception_handling.md (#134969) 2025-05-31 14:56:33 +03:00
Nybblista 2cc99b3dd3 Docs: Fix the _PyGenObject_HEAD reference in the InternalDocs/generators.md (#133739) 2025-05-18 21:56:58 +05:30
Yan Yanchii 0a1fedb70b gh-126835: Rename ast_opt.c to ast_preprocess.c and related stuff after moving const folding to the peephole optimizier (#131830) 2025-05-04 21:07:35 +03:00
Yongzi Li 814ca116d5 Docs: fix typo in InternalDocs/garbage_collector.md (gh-133151)
Fix typo in `InternalDocs/garbage_collector.md`.
2025-04-29 17:20:50 +00:00
Neil Schemenauer 31a500a92b Add internal docs about the free-threaded GC. (gh-132562) 2025-04-28 13:32:39 -07:00
Nybblista 210f027d02 Fix typo in the garbage_collector.md file (#132803) 2025-04-24 16:46:39 +03:00
Alper dc4a7077ac InternalDocs: Fix outdated struct references in frames.md (#132613)
Docs: Fix outdated struct references in frames.md

Co-authored-by: alperyoney <alperyoney@fb.com>
2025-04-20 23:24:21 +01:00
Yongzi Li a985c9262f Fix some typos in various doc files (GH-132589) 2025-04-16 18:11:47 +00:00
Tomas R. bfc292abc1 Docs: Fix typo in InternalDocs/jit.md (#132119) 2025-04-05 12:36:16 +02:00
Nybblista 149fbb01f2 gh-119786: Fix _PyExecutorObject link at jit.md file (#131382) 2025-03-17 21:22:12 +00:00
Nybblista 23cda58348 gh-119786: add JUMP_BACKWARD macro to the Jumps section (#131213)
add JUMP_BACKWARD opcode macro to the Jumps section

JUMP_BACKWARD opcode macro added to the Jumps section in
interpreter.md file at InternalDocs.
2025-03-16 20:04:39 +00:00
Tomas R. d07e9ebbe8 gh-131306: Remove unused code related to BINARY_SUBSCR (#131307) 2025-03-16 16:37:29 +00:00
Nybblista e9d210bfc2 gh-131170: fix duplicated sections in frames.md file (#131177)
fix duplicated sections in frames.md file

In the frames.md file at InternalDocs, change the first
duplicated title to Specials, and remove unnecessary content
under the Specials section.
2025-03-13 16:59:19 +03:00
AN Long 798f8d3ea9 Replace non-breaking spaces with normal spaces (#130116)
Using normal spaces in place of non-breaking spaces.
2025-02-16 09:33:14 +08:00
Brandt Bucher 828b27680f GH-126599: Remove the PyOptimizer API (GH-129194) 2025-01-28 16:10:51 -08:00
Sergey Miryanov a5075cd5bd gh-119786: Fix small typo in AST to CFG to bytecode section in compiler.md (#129322) 2025-01-27 16:36:09 +02:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) 211f41316b Fix typo in doc (#128917) 2025-01-16 16:32:17 +00:00
Irit Katriel e81fe940c9 gh-119786: added InternalDocs/generators.md (#128524) 2025-01-16 13:15:52 +00:00
Yan Yanchii 2cf396c368 gh-119786: Fix typos in InternalDocs/parser.md (#128314) 2024-12-28 17:05:00 +02:00
Yan Yanchii c6563f3f22 gh-119786: Fix typos in InternalDocs/frames.md (#128275)
Fix typos in `InternalDocs/frames.md`
2024-12-26 20:09:15 +05:30
Yan Yanchii f420bdd29f gh-119786: Fix typos in InternalDocs/interpreter.md (#128174) 2024-12-22 18:34:16 +02:00