Repository navigation
docs(t27o): Python debt census -- 2,126 tracked .py files, 12,547 functions, and the share that fits a convertible subset (Closes #11168) - #11176
Merged
Conversation
…ctions, and the share that fits a convertible subset (Closes #11168) Analysis only: no Python is deleted and no spec is added. docs/now/2026-10-20-python-debt.md counts the hand-written Python of the five repositories with Python's own ast and tokenize modules, classifies every function against a written subset (rules R1 to R10 in the file), and ranks files by the lines a port could delete. Measure-first step of #8995 and #9006. - 434,986 gate-counted lines in 2,126 files; 412,066 lines in 1,943 files after generated, vendored and test-only paths; 331,183 lines and 8,501 function bodies counting copies once. - Typed subset: 105 distinct functions, 812 lines (0.25%). Shape subset (types to be inferred from traces): 454 functions, 4,090 lines (1.23%). Median in-subset function: 6 lines. - No whole-file candidate of 150 lines or more; the only whole-file fit is tools/ternary_model.py (93 lines). t27c gen-python lowers no function, so a port keeps its entry point through a hand-written loader or its callers change. - Hand check: 29 of 30 verdicts agreed before one rule was added, 30 of 30 on a fresh sample. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
…d near-whole candidates in the totals table (Closes #11168) The totals table named how many whole-file and near-whole candidates each repository has but not their lines; the column now reads "files (lines)" so the table answers the issue's "whole-file candidates and their lines" directly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
PR DashboardGenerated at: 2026-10-19 23:13:58 UTC
Summary
Seal Status
|
This was referenced Oct 19, 2026
gHashTag
marked this pull request as ready for review
October 19, 2026 23:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The measure-first step of the Python front end (#8995, #9006), analysis only: no Python is deleted and no spec is added.
docs/now/2026-10-20-python-debt.mdcounts the hand-written Python of the five repositories with Python's ownastmodule, classifies every function against a written subset (rules R1 to R10 in the file), ranks files by the lines a port could delete, and checks 30 functions by hand against the scanner. Same discipline as #11149 and #11159: measure first, name the method and the commits, write a rule only above a stated threshold.Closes #11168
The ranked table, totals and answer are also posted on #11168: #11168 (comment)
Answer
.pyfiles, 434,986 gate-counted lines (t27 alone 153,503, equal togit diff --numstatof deleting every tracked.py). 1,943 files and 412,066 lines after generated (23 files), vendored (22) and test-only (138) paths; 12,547 functions, 8,501 distinct function bodies; 331,183 distinct lines.tools/ternary_model.py(93 lines, already has a spec twin). No file of 150 lines or more has every function in the typed subset. The closest,tools/gft_train_demo.py(201 lines), has 16 of 18 functions that fit the shape subset and none typed.t27c gen-pythonlowers no function (consts, enums and structs only), so a port keeps its entry point through a hand-written loader or its callers change.Not run
No
t27c,cargo,tribuild or converter ran (there is no Python front end yet; "fits" means "passes the written rules"). Callers in the four sibling repositories were searched in.py, shell, YAML, Makefile, Dockerfile and package.json files only. The local checkouts of those four repositories were not used (stale feature branches); the pinned commits of #11149 and #11159 were fetched into scratch.🤖 Generated with Claude Code