Repository navigation
Conversation
maurycy
force-pushed
the
generator-stable-control-record
branch
from
October 25, 2026 22:33
a08299b to
95a4506
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep generator control records in
gi_iframeacross resume/yield. Each generator's control-stack slot has a fixedCONTROL_INDIRECTtag; activation state lives only ingi_iframe. Ordinary calls write state directly, and return paths resolve generator slots only when encountered. This avoids copying the record and repointing escaped frame objects. Free-threaded locking is retained.Base:
dual-stack-proto(48370ac99b4); head:548b797518e.Across 31 microbenchmarks, runtime geomean is +0.45% and instruction-count geomean is -1.15% versus the base. Results are mixed; this remains an experimental draft.
AMD EPYC 4484PX, GCC 13.3, PGO+LTO, CPU 4; one build per revision. Both use the
Tools/dualstackharness atfabb6188. Instructions: N=200,000 and 4N subtraction. Times: geometric means of six interleaved paired process-mean ratios, three values each, one warmup, 50 ms minimum. Negative values mean less time/fewer instructions; individual timing differences may be noise.call_returncall_return_kwargsgen_for_loopgen_sendnext_from_cyield_from_depth5await_chainasyncio_pingpongrecursion_depth200recursion_depth600exception_unwind10init_shimproperty_getsort_key_callbackdel_finalizerframe_object_accessframe_noescapereturn_depth10exception_unwind20asyncio_short_tasksasyncio_short_tasks_sleep0asyncio_tree_gatherasyncio_callbacksgen_close_finallyframe_return_dropframe_return_fbackgen_finish_nextgen_finish_closegen_finish_next_frame_heldgen_finish_close_frame_heldgen_finish_next_frame_releasedValidation: 2,578 macOS debug tests ran without failures. Linux debug ran 51,729 tests with one failure: generator size 192 vs expected 184 in
test_sys, also present on the unchanged base. Free-threaded: 5,536 selected tests plus 40 concurrency tests, no failures. All 15 frame traces matched the base; recursion limits were unchanged;-R 3:3checks passed for generators, coroutines, async generators and frames. Generated cases andgit diff --checkare clean.