You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Scope recap:** Update `RuntimeTracer::interest` to include `PY_YIELD`, `PY_UNWIND`, `PY_RESUME`, and `PY_THROW`; ensure installer wiring respects the expanded mask; document the call/return mapping in `design-001`.
21
+
-**Status:**_Completed_
22
+
-`RuntimeTracer::interest` now subscribes to the four additional events plus `LINE`.
23
+
-`design-docs/design-001.md` documents the call vs return mapping and clarifies how each event is encoded.
24
+
- Verification: `just test codetracer-python-recorder --all-targets` (passes).
25
+
26
+
### WS2 – Call/Return Edge Helpers
27
+
-**Status:** Not started (awaiting WS1 completion).
28
+
29
+
### WS3 – Activation & Lifecycle Behaviour
30
+
-**Status:** Not started.
31
+
32
+
### WS4 – Testing & Validation
33
+
-**Status:** Not started.
34
+
35
+
## Next Checkpoints
36
+
1. Modify `RuntimeTracer::interest` and related tests to assert the expanded mask.
37
+
2. Update `design-docs/design-001.md` to document the event-to-writer mapping.
38
+
3. Capture verification notes (e.g., `just test codetracer-python-recorder --all-targets`) once WS1 lands.
Copy file name to clipboardExpand all lines: design-docs/design-001.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -157,12 +157,14 @@ allowing tracers to implement just the methods they care about.
157
157
158
158
Each bullet below represents a low-level operation translating a single `sys.monitoring` event into the `runtime_tracing` stream.
159
159
160
+
To keep the trace stack balanced we subscribe to `PY_START`, `PY_RESUME`, `PY_RETURN`, `PY_YIELD`, `PY_UNWIND`, `PY_THROW`, and `LINE`. `PY_START`/`PY_RESUME`/`PY_THROW` map to `TraceWriter::register_call`, while `PY_RETURN`/`PY_YIELD`/`PY_UNWIND` map to `TraceWriter::register_return`.
161
+
160
162
### Control Flow
161
163
-**PY_START** – Create a `Function` event for the code object and push a new activation ID onto the thread's stack.
-**PY_RESUME** – Emit an `Event` log noting resumption and update the current activation's state.
167
+
-**PY_RESUME** – Emit `TraceWriter::register_call` for the suspended activation (empty argument vector; CPython does not expose the `send()` payload) and update the current activation's state.
-**PY_YIELD** – Record a `Return` event flagged as a yield and keep the activation on the stack for later resumes.
176
+
-**PY_YIELD** – Call `TraceWriter::register_return` with the yielded value (subject to value-capture policy), mark it as a yield, and keep the activation on the stack for later resumes.
-**PY_UNWIND** – Mark the beginning of stack unwinding and note the target handler in an `Event`.
184
+
-**PY_UNWIND** – Treat as a return edge by calling `TraceWriter::register_return` with the active exception so the activation closes even when an exception propagates.
-**PY_THROW** – Emit an `Event` describing the thrown value and the target generator/coroutine.
188
+
-**PY_THROW** – Emit `TraceWriter::register_call` for the resumed activation and include a single argument named `exception` whose value is the thrown object.
0 commit comments