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
{{ message }}
Repository navigation
TypedPython: an ArrayParam function that calls user code compiles and diverges from CPython #203
Defect (identity). The ArrayParam contract (ir.py) says a function holding a list copy-in runs no user code, but neither the front end nor the verifier enforces it.
Reproduction on develop: def f(xs: list[float], cb: Callable[[], None]) -> float: cb(); return xs[0] compiles. With cb setting xs[0] = 100.0, compiled f returns 1.0 (it read its copy) while the interpreter returns 100.0. A store into the array followed by a callback is also overwritten by write-back.
Fix: the verifier rejects (the function stays interpreted with a reason) a function with an ArrayParam that is not closed. Not closed means it runs GetAttr, CallObject, Truth, CompareObj, ObjToFloat or OBJ BinOp, or calls a function that runs user code (the existing closedness fixpoint), or uses FieldGet/FieldSet/New, whose slow paths run user code after a class change.
Done when: the reproduction stays interpreted and equals CPython, there are IR-level verifier tests for each open node and for the transitive case, a mutation that drops the rule makes the end-to-end test fail, and the suite is green.
Activity
Merge pull request #205 from thisisthepy/feat/tp-arrayparam-closed
b-re-w commentedon Oct 17, 2026
Landed in develop via #205.