Skip to content

t27o: Python front end, with types inferred from oracle traces #8995

Open

Description

@gHashTag

Part of the t27o service epic. A Python front end for t27o. Python has no static types, so they are inferred from oracle traces: run the original on sample and boundary inputs on the lab, then record argument and result types. Python ints are unbounded, so pick widths from the traces and refuse beyond them.

Priority: this is the largest hand-written foreign debt in our own repos (scripts/.py, tools/.py; see the only-t27 rule, #8236).

Acceptance: a coverage and equivalence table over scripts/ and tools/, and the first verified ports land as .t27 with the Python deleted (net-negative PRs).

Activity

  1. gHashTag commented on Oct 19, 2026

    @gHashTag
    OwnerAuthor

    Measured 2026-10-20 (census #11168, document docs/now/2026-10-20-python-debt.md in PR #11176): of 331,183 distinct hand-written, non-test Python lines in the five repositories, 812 (0.25%) sit in the 105 functions that fit a typed subset today and 4,090 (1.23%) in the 454 that fit once parameter types are inferred from traces (this issue's design). No file is a whole-file candidate of 150 lines or more, and the median in-subset function has 6 lines, so a Python port deletes functions, not files, and t27c gen-python lowers no function today. Pure code blocked only by heap values (owned strings, dict/set, comprehensions, union/None returns, pure stdlib imports) is a further 1,293 fns / 16,577 lines (5.0%): the same wall as the Rust census.

    Verdict from the loop, on the threshold set before the measurement (a whole-file candidate of at least 150 lines): not met, so no Python front end is being built now. This issue stays open as the roadmap item; what would change the answer is t27 gaining the heap values named above, which is the decision recorded in the t27o report (default: not started).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions