Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,23 @@ work.
> `_numpylike`, a bundled `pytest` + `pluggy` + `iniconfig` +
> `exceptiongroup` stack, and `sys.settrace` / `sys.setprofile` /
> `sys.monitoring` (PEP 669) + `tracemalloc` observability so
> debuggers, coverage tools, and profilers boot. The CPython
> `Lib/test/` allowlist remains an aspirational target — see
> `tests/regrtest/expectations.toml` for the per-test baseline.
> Expect small breaking changes around the edges as the long tail
> catches up.
> debuggers, coverage tools, and profilers boot. `RFC 0031`
> closes the observability loop: the VM dispatcher actually
> *fires* the registered hooks (call / line / return / yield /
> exception for `settrace` + `setprofile`; the PEP 669 event
> table for `sys.monitoring`; `record_alloc` from container-
> construction opcodes for `tracemalloc`; PEP 578 audit dispatch
> at open / compile / exec / eval / import / marshal sites). The
> same commit lands PEP 684 sub-interpreters (`_xxsubinterpreters`
> + a high-level `interpreters` frontend with cross-interpreter
> channels), wires `pdb` / `bdb` on top of the now-firing
> `settrace`, and grows `_pytest` to handle `@pytest.mark.parametrize`
> Cartesian matrices, indirect fixtures, `request.addfinalizer`
> LIFO ordering, and per-scope (function / class / module /
> session) fixture caching. The CPython `Lib/test/` allowlist
> remains an aspirational target — see `tests/regrtest/expectations.toml`
> for the per-test baseline. Expect small breaking changes
> around the edges as the long tail catches up.

## Repository layout

Expand Down
310 changes: 308 additions & 2 deletions crates/weavepy-vm/src/lib.rs

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions crates/weavepy-vm/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,21 @@ pub struct PyFrame {
/// The VM updates this between steps so `f_locals` reflects live
/// state. `None` once the frame has returned.
pub locals_mirror: RefCell<Option<Rc<RefCell<Vec<Object>>>>>,
/// Per-frame trace function (PEP 669 surface — `sys.settrace` is
/// a no-op today, but storage exists so user code can set/get the
/// value without raising).
/// Per-frame trace function. Returned by `sys.settrace`'s hook
/// (or by a previous per-frame trace), this callable receives
/// subsequent `'line'` / `'return'` / `'exception'` events on
/// the frame. `Object::None` disables tracing for the frame.
pub trace: RefCell<Object>,
/// Per-frame `f_lineno` override. CPython lets debuggers set
/// `f_lineno` to jump to a different line; we keep storage so
/// reads round-trip, even though writes don't actually move the
/// program counter.
pub override_lineno: Cell<Option<u32>>,
/// Most recently observed source line on this frame, used by
/// the dispatcher to know when to fire a `'line'` event. `None`
/// means "no line event has fired on this frame yet" — the
/// next `step` will fire one.
pub last_line: Cell<Option<u32>>,
}

impl fmt::Debug for PyFrame {
Expand Down
Loading
Loading