Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
bd8ce29
Add LightFrame for unobserved Python-to-Python calls
youknowone Jul 23, 2026
abdd876
Streamline with_frame: inline recursion check, skip tracing dispatch
youknowone Jul 23, 2026
b136b85
Address review findings for LightFrame correctness
youknowone Jul 23, 2026
ffa8ec9
Fix CI failures: cspell, stale materialized state, f_back chain gaps
youknowone Jul 23, 2026
c345e35
Unify frame chain: replace dual-chain with single FrameChainPtr
youknowone Jul 23, 2026
62b6f2c
Fix light frame materialization: current_frame, f_back, and GC tracking
youknowone Jul 24, 2026
2d112c2
Limit light frame materialization to super() only
youknowone Jul 24, 2026
ab5d493
Fix remaining CI failures: C stack check, GC tracking threshold, expe…
youknowone Jul 24, 2026
4183d0b
Avoid materialization in hot paths: add light-frame-aware accessors
youknowone Jul 24, 2026
8f7d907
Fix current_locals() to include light frames
youknowone Jul 24, 2026
44791d2
Fix clippy, profile tracing, resume_gen_frame, and faulthandler issues
youknowone Jul 24, 2026
ce98370
Fix materialized frame refcount: transfer localsplus ownership on exit
youknowone Jul 25, 2026
9be07fe
Fix rustfmt, increase stack margin, address review comments
youknowone Jul 25, 2026
f085a22
Remove redundant test override in test_futures2
youknowone Jul 25, 2026
31b9ab0
Fix test_pdb and test_functools CI failures
youknowone Jul 25, 2026
2cfc5cc
Rename Frame to FrameObject, FrameRef to FrameObjectRef
youknowone Jul 25, 2026
32c71bb
Remove Deref<Target = InterpreterFrame> from FrameObject
youknowone Jul 25, 2026
deb6f06
Move InterpreterFrame identity fields to raw pointers
youknowone Jul 25, 2026
f176cc8
Remove LightFrame, FrameChainPtr, and dual-frame-type infrastructure
youknowone Jul 26, 2026
909f248
Clean up invoke_light_slots and _vm function variants
youknowone Jul 26, 2026
d241489
Fix CI lint issues
youknowone Jul 27, 2026
fe31b63
Stack-allocate InterpreterFrame for non-generator function calls
youknowone Jul 28, 2026
be7d5ca
Remove unnecessary refcount and atomic ops from fast call path
youknowone Jul 29, 2026
03243e1
Change trace field to Option<PyObjectRef>, remove vm from Interpreter…
youknowone Jul 29, 2026
f50325e
Store current frame pointer on VirtualMachine for fast lookup
youknowone Jul 29, 2026
0588068
Apply rustfmt
youknowone Jul 29, 2026
fac79d8
Fix clippy use_self warnings, add inline hints for hot path
youknowone Jul 29, 2026
70d93e1
Remove code refcount clone from fast call path
youknowone Jul 29, 2026
815b8d0
Remove VM current_frame_ptr Cell (fix SIGSEGV in threading builds)
youknowone Jul 29, 2026
a836ff2
Fix CI failures: GC frame assertion, faulthandler Radium import, dead…
youknowone Jul 29, 2026
ccb9d57
Fix materialized frame: copy localsplus, clear stale previous pointers
youknowone Jul 29, 2026
ad11ab1
Fix Windows clippy: gate unix-only imports and variables
youknowone Jul 29, 2026
6d77f60
Fall back to FrameObject when tracing; fix cross-thread frame access
youknowone Jul 29, 2026
2a391a9
Apply rustfmt
youknowone Jul 29, 2026
b35ee12
Fix Windows: gate unix-only top_iframe_ptr variable
youknowone Jul 29, 2026
cd641f7
Fix frame chain: f_back, retained_back, owner, faulthandler
youknowone Jul 29, 2026
949de0f
Apply rustfmt
youknowone Jul 29, 2026
8f202f4
Refine with_frame retained_back: use frame_obj instead of materialize
youknowone Jul 29, 2026
61a209b
Fix f_lineno: use Cell<u32> for prev_line, update on every instruction
youknowone Jul 29, 2026
fc0a2cf
Fix f_lineno for materialized frames: read live prev_line from TLS chain
youknowone Jul 29, 2026
fee3604
Sync live frame state for materialized frames
youknowone Jul 30, 2026
0ad9d24
Fix retained_back: use materialize_chain and strong_count check
youknowone Jul 30, 2026
d49253f
Fix cross-thread f_back chain for sys._current_frames/exceptions
youknowone Jul 30, 2026
ed9b586
Fix monitoring LINE events and faulthandler thread dump
youknowone Jul 30, 2026
b09f35b
Fix clippy: remove duplicate Radium import, use previous() helper
youknowone Jul 30, 2026
873aaaa
Fix materialized frame issues: GC tracking, live locals, f_trace prop…
youknowone Jul 30, 2026
383f842
Fix faulthandler crashes, GC tracking timing, and test_generators
youknowone Jul 30, 2026
4a43c98
Fix Windows frame dump and remove dead code
youknowone Jul 30, 2026
71ba6d2
Fix ThreadSlot init on all platforms, skip test_pdb_await_support
youknowone Jul 30, 2026
8c050c4
Remove dead faulthandler code (dump_frame_from_ref, dump_traceback_th…
youknowone Jul 30, 2026
ac58fbe
Fix Windows sys._current_frames: materialize full frame chain
youknowone Jul 30, 2026
750e3a0
Use STW-based cross-thread f_back on all platforms
youknowone Jul 30, 2026
39ea28a
Fix set_f_lineno to write to live iframe, use STW for cross-thread ac…
youknowone Jul 30, 2026
8264e2c
Guard current_location() against lasti==0, always capture retained_back
youknowone Jul 30, 2026
e6efa79
Fix format, revert eager retained_back materialization
youknowone Jul 30, 2026
4b7ae50
Remove rustpython-unicode-isolation-issue.md from gitignore
youknowone Jul 31, 2026
fddc73c
Remove test_pdb_await_support skip: async pdb now works correctly
youknowone Jul 31, 2026
2d9876a
Fix STOP_ITERATION monitoring: wrap value in StopIteration instance
youknowone Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.dict/rust-more.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ modpow
msvc
muldiv
nanos
noalias
nonoverlapping
objclass
peekable
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/cron-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
env:
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
GITHUB_ACTOR: ${{ github.actor }}
run: |
echo "$SSHKEY" >~/github_key
chmod 600 ~/github_key
Expand All @@ -95,7 +94,7 @@ jobs:
cd website
cp ../extra_tests/cpython_tests_results.json ./_data/regrtests_results.json
git add ./_data/regrtests_results.json
if git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update regression test results" --author="$GITHUB_ACTOR"; then
if git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update regression test results"; then
git push
fi

Expand Down Expand Up @@ -127,7 +126,6 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
env:
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
GITHUB_ACTOR: ${{ github.actor }}
run: |
echo "$SSHKEY" >~/github_key
chmod 600 ~/github_key
Expand Down Expand Up @@ -158,7 +156,7 @@ jobs:
}
EOF
git add -A
if git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update what is left results" --author="$GITHUB_ACTOR"; then
if git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update what is left results"; then
git push
fi

Expand Down Expand Up @@ -204,6 +202,8 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
env:
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
COMMIT_SHA: ${{ github.sha }}
REF_NAME: ${{ github.ref_name }}
run: |
echo "$SSHKEY" >~/github_key
chmod 600 ~/github_key
Expand All @@ -215,8 +215,8 @@ jobs:
cp -r ../target/criterion ./assets/criterion
printf '{\n "generated_at": "%s",\n "rustpython_commit": "%s",\n "rustpython_ref": "%s"\n}\n' \
"$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
"${{ github.sha }}" \
"${{ github.ref_name }}" > ./_data/criterion-metadata.json
"$COMMIT_SHA" \
"$REF_NAME" > ./_data/criterion-metadata.json
git add ./assets/criterion ./_data/criterion-metadata.json
if git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update benchmark results"; then
git push
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/lib-deps-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
paths:
- "Lib/**"

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
Expand All @@ -26,13 +28,17 @@ jobs:
persist-credentials: false

- name: Fetch PR head
env:
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
git fetch origin ${{ github.event.pull_request.head.sha }}
git fetch origin "$PR_HEAD_SHA"

- name: Checkout PR Lib files
env:
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
# Checkout only Lib/ directory from PR head for accurate comparison
git checkout ${{ github.event.pull_request.head.sha }} -- Lib/
git checkout "$PR_HEAD_SHA" -- Lib/

- name: Get target CPython version
id: cpython-version
Expand All @@ -51,14 +57,17 @@ jobs:

- name: Get changed Lib files
id: all-changed-files
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
# Get the list of changed files under Lib/
{
echo 'changed<<EOF'

git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- 'Lib/*.py' 'Lib/**/*.py'
git diff --name-only "$PR_BASE_SHA" "$PR_HEAD_SHA" -- 'Lib/*.py' 'Lib/**/*.py'

echo 'EOF'
echo 'EOF'
} >> "$GITHUB_OUTPUT"

- name: Parse changed files
Expand Down
5 changes: 5 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
rules:
excessive-permissions:
ignore:
# pull_request_target is needed to post PR comments with pull-requests: write.
# Workflow-level permissions: {} restricts defaults; only the job has write access.
- lib-deps-check.yaml:3
unpinned-uses:
config:
policies:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ Lib/site-packages/*
Lib/test/data/*
!Lib/test/data/README
cpython/
.claude/scheduled_tasks.lock
.claude/
docs/superpowers/
1 change: 0 additions & 1 deletion Lib/test/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ def gen():
self.assertEqual(len(resurrected), 1)
self.assertIsInstance(resurrected[0].gi_code, types.CodeType)

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: <frame object at 0xb4000073269f09e0> is not None
def test_exhausted_generator_frame_cycle(self):
def g():
yield
Expand Down
18 changes: 13 additions & 5 deletions crates/capi/src/ceval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub extern "C" fn PyEval_GetBuiltins() -> *mut PyObject {
with_vm(|vm| {
vm.current_frame().map_or_else(
|| vm.builtins.as_object().as_raw(),
|frame| frame.builtins.as_object().as_raw(),
|frame| frame.iframe().builtins().as_raw(),
)
})
}
Expand All @@ -78,7 +78,7 @@ pub extern "C" fn PyEval_GetFrameBuiltins() -> *mut PyObject {
with_vm(|vm| {
vm.current_frame().map_or_else(
|| vm.builtins.as_object().to_owned(),
|frame| frame.builtins.as_object().to_owned(),
|frame| frame.iframe().builtins().to_owned(),
)
})
}
Expand All @@ -87,7 +87,15 @@ pub extern "C" fn PyEval_GetFrameBuiltins() -> *mut PyObject {
pub extern "C" fn PyEval_GetFrameGlobals() -> *mut PyObject {
with_vm(|vm| {
vm.current_frame()
.map(|frame| frame.globals.as_object().to_owned().into_raw().as_ptr())
.map(|frame| {
frame
.iframe()
.globals()
.as_object()
.to_owned()
.into_raw()
.as_ptr()
})
.unwrap_or_default()
})
}
Expand All @@ -107,7 +115,7 @@ pub extern "C" fn PyEval_GetFrameLocals() -> *mut PyObject {
pub extern "C" fn PyEval_GetGlobals() -> *mut PyObject {
with_vm(|vm| {
vm.current_frame()
.map(|frame| frame.globals.as_object().as_raw())
.map(|frame| frame.iframe().globals().as_object().as_raw())
.unwrap_or_default()
})
}
Expand All @@ -119,7 +127,7 @@ pub extern "C" fn PyEval_GetLocals() -> *mut PyObject {
return Ok(core::ptr::null_mut());
};
let _ = frame.locals(vm)?;
Ok(frame.locals.as_object(vm).as_raw().cast_mut())
Ok(frame.iframe().locals.as_object(vm).as_raw().cast_mut())
})
}

Expand Down
4 changes: 2 additions & 2 deletions crates/capi/src/pyframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use crate::pystate::with_vm;
use core::ffi::c_int;
use rustpython_vm::Py;
use rustpython_vm::builtins::PyCode;
use rustpython_vm::frame::Frame;
use rustpython_vm::frame::FrameObject;

pub type PyFrameObject = Py<Frame>;
pub type PyFrameObject = Py<FrameObject>;
pub type PyCodeObject = Py<PyCode>;

#[unsafe(no_mangle)]
Expand Down
Loading
Loading