Python → typed Cython
Select an example from the sidebar
Python input
mode:
an annotation is a proof, not a guess · every declaration is emitted only when py2cy has proved the type;
anything unprovable is left as plain Python and listed in the refusal manifest.
▾Generated typed Cython
▾Proof / declarations
what the abstract interpreter proved, and the Cython type it assigned and the reason why.
▾Refusal manifest
the constructs py2cy will not annotate. The output stays plain Python.
▾Hand-written .pyx golden
the human-typed Cython from
py-sh-go/profile_example/bench/cython/*_typed.pyx (AUTO_CYTHON §2) — the acceptance oracle. Shown for the bench examples only.▾Hand-written C reference
the byte-exact oracle for the python-O4 bench appendix:
bash-o4/bench/c/*.c. The benchmark's agreement gate requires every leg's stdout to match this program, so it is a stronger check than a golden — but it does not show the declarations py2cy should emit (plain C has no `cdef`). Present only where the bench problem has a C counterpart.▾generated .pyx vs hand-written golden
▾Original stdout (CPython shape)
the input run in the browser's Python (micropython.wasm). Annotating must never change what the program prints — pure-Python mode is the same source plus inert declarations. This stage runs in micropython's own classic Web Worker, so a long loop cannot freeze the page.
▾Cython 3.3.0 — real compiler (wasm)
the generated file compiled by the real Cython 3.3.0: CPython 3.12 in wasm (Pyodide) running the pure-Python Cython wheel, both vendored under
www/vendor/ so it works offline. This is the same gate as bench/py2cy-smoke.mjs (cython --embed), live in the browser — 0 errors means the annotated file is valid Cython. Building the emitted C into a loadable extension needs emscripten + the Python headers, so that stays a CI step.