GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Await fsm checkpoint by yusufyian · Pull Request #6765 · RustPython/RustPython

Await fsm checkpoint #6765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
yusufyian wants to merge 47 commits into RustPython:main
base: main
Loading
Loading
from yusufyian:await_fsm_checkpoint

Uh oh!

There was an error while loading. Please reload this page.

Draft

Await fsm checkpoint #6765

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e9a70c7
Update dependencies in Cargo.lock and add Cargo.lock to .gitignore
shawhanken Dec 18, 2025
68da611
Merge branch 'main' of https://github.com/yusufyian/RustPython
shawhanken Dec 18, 2025
1bf2bdf
Update dependencies in Cargo.lock and add Cargo.lock to .gitignore
shawhanken Dec 19, 2025
1726b36
Add additional reference files to .gitignore
shawhanken Dec 19, 2025
fd57302
Update .gitignore to exclude additional files and improve dependency …
shawhanken Dec 19, 2025
ecfabb8
Merge branch 'RustPython:main' into main
yusufyian Dec 19, 2025
bc9b80a
Merge branch 'main' of https://github.com/yusufyian/RustPython
shawhanken Dec 19, 2025
1a1c97a
Add checkpoint functionality to VirtualMachine
shawhanken Dec 19, 2025
3997507
Add checkpoint request handling and update checkpoint functionality
shawhanken Dec 19, 2025
551d025
Enhance demo script with additional print statements for debugging
shawhanken Dec 19, 2025
665790f
Update demo user and enhance README with testing instructions
shawhanken Dec 24, 2025
c2edc6b
Update .gitignore to include demo files
shawhanken Dec 24, 2025
4dc6120
Update .gitignore and demo script for type checking
shawhanken Dec 25, 2025
9ac5e54
Rename RustPython binary to "pvm" in Cargo.toml and update demo.py fo…
yusufyian Dec 26, 2025
8ea2822
Rename RustPython binary to 'pvm' in Cargo.toml and update demo.py fo…
yusufyian Dec 26, 2025
66dc584
Update README and test script to reflect binary name change from 'rus…
yusufyian Dec 29, 2025
6c26391
Refactor demo.py for improved clarity and structure in checkpointing …
yusufyian Dec 29, 2025
a1c1891
Update demo.py and README for financial trading scenario simulation
yusufyian Dec 29, 2025
f41b080
Enhance demo.py with additional trading scenario features and update …
yusufyian Dec 29, 2025
5f547a5
Implement PVM host and runtime modules with initial configurations
yusufyian Dec 29, 2025
3ed0799
Update various files for improved functionality and clarity
yusufyian Dec 29, 2025
9704677
Enhance VM functionality and code clarity
yusufyian Dec 29, 2025
965b201
Enhance demo script and update .gitignore
yusufyian Dec 30, 2025
9f354c2
Update .gitignore to include all reference files and remove specific …
yusufyian Dec 30, 2025
b50f1f3
Remove obsolete reference files for PVM integration and continuation …
yusufyian Dec 30, 2025
f8fc889
Remove obsolete demo files for checkpoint/resume functionality
yusufyian Dec 30, 2025
26ac488
Remove obsolete binary snapshot file for demo functionality
yusufyian Dec 30, 2025
b2ba6ea
Remove obsolete test script for checkpoint/resume functionality
yusufyian Dec 30, 2025
2dfed2d
Refactor comments in state_store.py for clarity and consistency
yusufyian Dec 30, 2025
d8aabdd
Enhance checkpoint functionality and update .gitignore
yusufyian Dec 30, 2025
6d54427
Update source location handling in compiler-source
yusufyian Dec 30, 2025
a1a7ec6
Refactor checkpoint and snapshot handling for improved functionality
yusufyian Dec 30, 2025
3620c13
Update version formatting in version.rs to reflect PVM 0.0.2 integration
yusufyian Dec 31, 2025
fe31a3d
Add PVM versioning support and update build script
yusufyian Dec 31, 2025
8eaf89f
Implement multi-frame checkpoint support and enhance stack management
yusufyian Dec 31, 2025
5544761
Enhance checkpoint functionality and update demo scripts
yusufyian Dec 31, 2025
13117d6
Add support for enumerate, zip, map, and filter in snapshot handling
yusufyian Dec 31, 2025
63c44b5
Enhance checkpoint and block stack management in VM
yusufyian Dec 31, 2025
c6806af
Add support for ListIterator and RangeIterator in snapshot handling
yusufyian Jan 3, 2026
9844d0d
Add comprehensive demo snapshot to .gitignore
yusufyian Jan 3, 2026
a07fed6
Remove Cargo.lock file to prevent unnecessary tracking of dependencies
yusufyian Jan 5, 2026
06e9e6a
Add error handling and execution options in PVM runtime
yusufyian Jan 5, 2026
072c0cc
Add determinism support and enhance error handling in PVM runtime
yusufyian Jan 8, 2026
5e01466
Enhance PVM runtime with import tracing and version updates
yusufyian Jan 8, 2026
b9dc39d
Add new business scenario demos to README
yusufyian Jan 8, 2026
d5afdde
Fix formatting issue in escrow_marketplace_demo.py by adding a newlin…
yusufyian Jan 12, 2026
9f3c462
Enhance PVM runtime with continuation support and new features
yusufyian Jan 18, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
Rename RustPython binary to 'pvm' in Cargo.toml and update demo.py fo…
…r improved clarity and context. Changed user references in demo script and enhanced comments for better understanding of checkpoint phases.
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@yusufyian
yusufyian committed Dec 26, 2025
commit 8ea28224ee84aec4e158f93cf2d48ef28de83ec1

There are no files selected for viewing

63 changes: 63 additions & 0 deletions 63 examples/breakpoint_resume_demo/demo_en.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from __future__ import annotations

from pathlib import Path

import rustpython_checkpoint as rpc # type: ignore

# Checkpoint file path as a string to keep it serializable.
CHECKPOINT_PATH = str(Path(__file__).with_suffix(".rpsnap"))


def section(title: str) -> None:
print("\n" + "=" * 60)
print(title)
print("=" * 60)


section("PVM Breakpoint/Resume Showcase")
print("[run] phase=init")
customer = "Acme Corp"
order_id = "ORD-2049"
items = [f"sku_{i:02d}" for i in range(3)]
score = 0.87
notes = ["session started", "items captured"]
print(f"[run] customer={customer} order_id={order_id}")
print(f"[run] items={items} score={score}")
print(f"[run] notes={notes}")

# Breakpoint 1: must be a standalone statement.
# RustPython saves VM state here and exits the process.
rpc.checkpoint(CHECKPOINT_PATH)

# Re-import after resume so the next checkpoint works.
import rustpython_checkpoint as rpc # type: ignore

section("Resume #1: state restored")
print("[run] phase=after_checkpoint_1")
priced = [f"{item}:$99" for item in items]
total = 99 * len(priced)
notes.append("pricing complete")
print(f"[run] priced={priced}")
print(f"[run] total={total} notes={notes}")

# Breakpoint 2: save state again and exit; next run continues below.
rpc.checkpoint(CHECKPOINT_PATH)

import os

section("Resume #2: finishing up")
print("[run] phase=after_checkpoint_2")
receipt = {
"customer": customer,
"order_id": order_id,
"total": total,
"status": "ok",
}
notes.append("receipt issued")
print(f"[run] receipt={receipt}")
print(f"[run] notes={notes}")

# Clean up so a fresh run starts from the top.
if os.path.exists(CHECKPOINT_PATH):
os.remove(CHECKPOINT_PATH)
print("[run] done")
Binary file added BIN +379 Bytes examples/breakpoint_resume_demo/demo_en.rpsnap
Show comments
View file
Open in desktop
Binary file not shown.
45 changes: 45 additions & 0 deletions 45 src/interpreter.rs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use rustpython_vm::{Interpreter, PyRef, Settings, VirtualMachine, builtins::PyModule};
#[cfg(not(feature = "freeze-stdlib"))]
use std::path::Path;

pub type InitHook = Box<dyn FnOnce(&mut VirtualMachine)>;

Expand Down Expand Up @@ -122,5 +124,48 @@ pub fn init_stdlib(vm: &mut VirtualMachine) {
}

settings.path_list.extend(path_list);

ensure_stdlib_path(settings);
}
}

#[cfg(not(feature = "freeze-stdlib"))]
fn ensure_stdlib_path(settings: &mut Settings) {
if settings
.path_list
.iter()
.any(|path| has_encodings_path(Path::new(path)))
{
return;
}

let mut add_candidate = |candidate: std::path::PathBuf| -> bool {
if !has_encodings_path(&candidate) {
return false;
}

let candidate = match candidate.into_os_string().into_string() {
Ok(path) => path,
Err(_) => return false,
};
if !settings.path_list.iter().any(|path| path == &candidate) {
settings.path_list.push(candidate);
}
true
};

if let Some(manifest_dir) = option_env!("CARGO_MANIFEST_DIR") {
if add_candidate(Path::new(manifest_dir).join("Lib")) {
return;
}
}

if let Ok(cwd) = std::env::current_dir() {
let _ = add_candidate(cwd.join("Lib"));
}
}

#[cfg(not(feature = "freeze-stdlib"))]
fn has_encodings_path(path: &Path) -> bool {
path.join("encodings").join("__init__.py").is_file()
}
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.