-
Notifications
You must be signed in to change notification settings - Fork 52
Workflow for 3.12 cycle
Mark Shannon edited this page Aug 23, 2022
·
17 revisions
graph LR
%% High level goals
CompactObject[["Compact objects"]]
ReducedRefcount[["Reduced reference counting overhead"]]
SpecDone[["Finish specialization"]]
Traces[["Projected (short) trace opimitized interpreter"]]
InterpretersInPythonCode[["Expose multiple interpreters to Python code"]]
PerInterpreterGIL[["A per-interpreter GIL"]]
%% Tasks
Compiler("Bytecode compiler enhancements<br/><b>Irit</b>")
StaticRefcntReduction("Use static analysis to reduce<br/>reference count operations")
SpecSeq("Specialize FOR_ITER for sequences<br/><b>Dennis</b>")
SpecGen("Specialize FOR_ITER for generator")
SpecClass("Specialize CALL for Python classes")
CtoPy("Identify main sources of<br/>calls to PyEval_EvalFrame")
ShimFrame("Shim frames on entry<br/>to PyEval_EvalDefault")
SpecSend("Specialize SEND")
SatRefcnt("Saturating refcounts")
380("Move PEP 380 logic into compiler<br/><b>Brandt</b> ")
EncapsulateGIL("Encapasulate GIL code and<br/>move it out of ceval.c #93177")
OpcodesOwnFile("Move opcode definitions to their own file<br/>and generate PyEval_EvalDefault")
CycleGC("Improve cycle GC<br/>(Task needs breaking up)")
MiniOps("Breakup instruction definitions into 'mini-ops'")
SmallGCHead("One word GC header")
MergeDictValuePointers("Merge managed dict and values<br/>pointer into one word")
TrackRefsInC("Identify flow of references in C")
OptRefsInC("Optimize flow of references in C,<br/>transferring ownership when needed")
GuardOpt("Optimize traces:<br/>Guard stengthening and elimination")
AllocSinking("Optimize traces:<br/>Allocation elimination")
AllBranchesForward("Only unconditional jumps should go backwards")
HotSpotDetection("Detect hotspots in code")
TraceProjection("Trace projection:<br/>Create traces from hotspots")
TraceEval("Trace interpreter")
OptAPI("Implement optimizer API")
Deferred("Deferred reference counts")
StaticRefcntReduction("Static reduction in refcount operations")
WebAssemblyFriendlyInterpreter("Generate version of the interpreter better<br/>suited to emscripten and web assembly")
PEP554("PEP 554 - Multiple Interpreters in the Stdlib")
PEP554Impl("Implement PEP 554")
ExtensionIsolation("Per-interpreter isolation for extension modules")
CAnalyzer("Tooling to identify global variables in CPython code")
GlobalsCICheck("A CI check to prevent new globals in CPython code")
ConsolidateGlobals("Consolidate global state to _PyRuntimeState")
ImmortalObjects("PEP 683 - immortal objects")
Mimalloc("mimalloc")
InterpreterIsolation("Interpreter isolation (_PyRuntimeState -> PyInterpreterState)")
InterpretersAPI("Per-interpreter config & func to specify restrictions")
InterpreterRestrictions("Restrictions on interpreter capability (e.g. no threading)")
PEP684("PEP 684 - A Per-Interpreter GIL")
%% Dependencies
380 --> OpcodesOwnFile
380 --> SpecSend
subgraph Trace optimized interpreter
AllBranchesForward --> HotSpotDetection
HotSpotDetection --> TraceProjection
OpcodesOwnFile --> MiniOps
EncapsulateGIL --> OpcodesOwnFile
OpcodesOwnFile --> WebAssemblyFriendlyInterpreter
OptAPI --> TraceProjection
MiniOps --> TraceProjection
TraceProjection --> TraceEval
MiniOps --> TraceEval
TraceEval --> GuardOpt
TraceEval --> AllocSinking
GuardOpt --> Traces
AllocSinking --> Traces
end
subgraph Specialization
CtoPy --> ShimFrame
SpecSeq --> SpecGen
ShimFrame --> SpecGen
SpecGen --> SpecSend
SpecSend --> SpecDone
SpecClass --> SpecDone
end
subgraph Compact Objects
SatRefcnt --> SmallGCHead
MergeDictValuePointers --> CompactObject
SmallGCHead --> CompactObject
end
subgraph Reduced Reference Count Overhead
TrackRefsInC --> OptRefsInC
OptRefsInC --> ReducedRefcount
Compiler --> StaticRefcntReduction
Deferred --> StaticRefcntReduction
Deferred --> ReducedRefcount
StaticRefcntReduction --> ReducedRefcount
end
subgraph Multi-core Python
ExtensionIsolation --> PerInterpreterGIL
CAnalyzer --> ConsolidateGlobals
CAnalyzer --> GlobalsCICheck
GlobalsCICheck --> PerInterpreterGIL
ConsolidateGlobals --> InterpreterIsolation
ImmortalObjects --> InterpreterIsolation
Mimalloc --> InterpreterIsolation
InterpreterIsolation --> PerInterpreterGIL
InterpretersAPI --> InterpreterRestrictions
InterpreterRestrictions --> PerInterpreterGIL
PEP684 --> PerInterpreterGIL
PEP554 --> PEP554Impl
PEP554Impl --> InterpretersInPythonCode
end
%% Links and colors
click TrackRefsInC "https://github.com/faster-cpython/ideas/issues/441"
click OptRefsInC "https://github.com/faster-cpython/ideas/issues/442"
click Deferred "https://github.com/faster-cpython/ideas/issues/443"
click StaticRefcntReduction "https://github.com/faster-cpython/ideas/issues/444"
click ShimFrame "https://github.com/faster-cpython/ideas/issues/436"
click SpecSeq "https://github.com/faster-cpython/ideas/issues/67"
click SpecClass "https://github.com/python/cpython/pull/31707"
click 380 "https://github.com/python/cpython/pull/31968"
click MergeDictValuePointers "https://github.com/python/cpython/pull/95278"
style MergeDictValuePointers fill:#88f
click PEP554 "https://peps.python.org/pep-0554/"
click ImmortalObjects "https://peps.python.org/pep-0683/"
click PEP684 "https://peps.python.org/pep-0684/"