tools: label technical debt entries by what would close them, missing tests and removed links #15469

Closed
opened 2026-11-03 13:46:49 +00:00 by LeandroLP23 · 0 comments
LeandroLP23 commented 2026-11-03 13:46:49 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-11-03T13:46:49Z.


Finding which technical debt entries someone can close today means rereading 345 files. On main (4f41f4c375) they hold 5,518 entries, and 121 of them say what would close them with Closes when: (#6758). I'd like to add a report that labels every entry, so a contributor can ask for, say, entries that need only code and have no test.

What it reports

tools/debt_report.py reads TechnicalDebt.md and docs/dev/debt/*.md with the helpers check_conventions.py already has. It labels each entry and prints one line per entry with counts, or JSON with --json. It filters by debt file and by --label. It changes no file and always exits 0.

Family Labels Inferred from
What would close it console, firmware, gpu, title or code the Closes when: text if there is one, otherwise the entry: e.g. "unknown signature" or "parameterless declaration for import resolution" give firmware; "not measured on a console" or "unverified on a PS5" give console; "fails on RADV" or "not measured on other drivers" give gpu; anything else is code
Tests no-test none of the functions the entry names (its link text, and lowercase identifiers in backticks) appears in a test source; tests that call <name>_nid_postfix count
Platform windows, macos, linux the platforms the entry names, unless it names all three
stale? a linked core/ file no longer exists

Counts on main:

5518 entries: 2467 firmware, 2460 no-test, 1858 code, 1175 console, 300 windows, 128 linux, 51 macos, 16 gpu, 2 title, 1 stale?

python3 tools/debt_report.py --label code --label no-test lists 207 entries. The one stale? entry is in libScePlayerInvitationDialog.md: it links Export.cpp, which 19044c17b5 removed.

Accuracy

I checked entries by hand against the text and the code:

  • Sample 1: 100 entries drawn at random, used to tune the rules.
  • Sample 2: 60 entries, drawn afterwards with another seed and not used for tuning.
Label Sample 1, after tuning Sample 2
What would close it: matches the hand label 83/100 (41/100 before tuning) 52/60
no-test: labelled entries that have no test 37/40 9/11
Platform: exactly right 95/100 57/60

The no-test row for sample 2 counts only its first 30 entries: the verdicts for the other 30 were recorded out of order.

Most remaining errors:

  • What would close it: an entry that describes the implementation at length and mentions the missing console check only in passing comes out as code.
  • no-test: entries whose names sit only in the NID table below them get no label.

I also tried two more stale? rules and dropped them. "The entry says the function throws but its body does not" and "a silent stub whose function now throws" were right in 0 of 44 flags. Functions throw through helpers and macros, or only for some inputs, and entries name functions they don't claim throw.

An optional Labels: trailer

Where the inference is wrong, an entry can end with Labels:, the way Closes when: works: Labels: console, windows. A label given there replaces the inferred labels of its family. tested removes an inferred no-test. check_conventions.py gets a warning, not an error, for a label outside that list. It checks only entry lines.

No entry has to be edited for this. The trailer is added only when someone already changes that entry. A mass edit of the debt files would conflict with most open pull requests (#12521), and the blank-line reformat in #14212 doesn't affect the parser.

Proposed pull request

  • tools/debt_report.py and tools/tests/test_debt_report.py;
  • the debt-labels warning in check_conventions.py with its test;
  • one sentence in TechnicalDebt.md next to the Closes when: one.

It changes no debt entry. The branch is ready: https://github.com/LeandroLP23/AnyPS5/tree/tools/debt-labels

Questions:

  • Is a report plus an optional trailer the right shape, or would you rather have only the report?
  • Should the label set be different? code is the default and covers a third of the entries.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6183863770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/15469). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-11-03T13:46:49Z. --- Finding which technical debt entries someone can close today means rereading 345 files. On `main` (`4f41f4c375`) they hold 5,518 entries, and 121 of them say what would close them with `Closes when:` (#6758). I'd like to add a report that labels every entry, so a contributor can ask for, say, entries that need only code and have no test. ### What it reports `tools/debt_report.py` reads `TechnicalDebt.md` and `docs/dev/debt/*.md` with the helpers `check_conventions.py` already has. It labels each entry and prints one line per entry with counts, or JSON with `--json`. It filters by debt file and by `--label`. It changes no file and always exits 0. | Family | Labels | Inferred from | |---|---|---| | What would close it | `console`, `firmware`, `gpu`, `title` or `code` | the `Closes when:` text if there is one, otherwise the entry: e.g. "unknown signature" or "parameterless declaration for import resolution" give `firmware`; "not measured on a console" or "unverified on a PS5" give `console`; "fails on RADV" or "not measured on other drivers" give `gpu`; anything else is `code` | | Tests | `no-test` | none of the functions the entry names (its link text, and lowercase identifiers in backticks) appears in a test source; tests that call `<name>_nid_postfix` count | | Platform | `windows`, `macos`, `linux` | the platforms the entry names, unless it names all three | | `stale?` | | a linked `core/` file no longer exists | Counts on `main`: ``` 5518 entries: 2467 firmware, 2460 no-test, 1858 code, 1175 console, 300 windows, 128 linux, 51 macos, 16 gpu, 2 title, 1 stale? ``` `python3 tools/debt_report.py --label code --label no-test` lists 207 entries. The one `stale?` entry is in `libScePlayerInvitationDialog.md`: it links `Export.cpp`, which 19044c17b5 removed. ### Accuracy I checked entries by hand against the text and the code: - **Sample 1:** 100 entries drawn at random, used to tune the rules. - **Sample 2:** 60 entries, drawn afterwards with another seed and not used for tuning. | Label | Sample 1, after tuning | Sample 2 | |---|---|---| | What would close it: matches the hand label | 83/100 (41/100 before tuning) | 52/60 | | `no-test`: labelled entries that have no test | 37/40 | 9/11 | | Platform: exactly right | 95/100 | 57/60 | The `no-test` row for sample 2 counts only its first 30 entries: the verdicts for the other 30 were recorded out of order. Most remaining errors: - **What would close it:** an entry that describes the implementation at length and mentions the missing console check only in passing comes out as `code`. - **`no-test`:** entries whose names sit only in the NID table below them get no label. I also tried two more `stale?` rules and dropped them. "The entry says the function throws but its body does not" and "a silent stub whose function now throws" were right in 0 of 44 flags. Functions throw through helpers and macros, or only for some inputs, and entries name functions they don't claim throw. ### An optional `Labels:` trailer Where the inference is wrong, an entry can end with `Labels:`, the way `Closes when:` works: `Labels: console, windows`. A label given there replaces the inferred labels of its family. `tested` removes an inferred `no-test`. `check_conventions.py` gets a warning, not an error, for a label outside that list. It checks only entry lines. No entry has to be edited for this. The trailer is added only when someone already changes that entry. A mass edit of the debt files would conflict with most open pull requests (#12521), and the blank-line reformat in #14212 doesn't affect the parser. ### Proposed pull request - `tools/debt_report.py` and `tools/tests/test_debt_report.py`; - the `debt-labels` warning in `check_conventions.py` with its test; - one sentence in `TechnicalDebt.md` next to the `Closes when:` one. It changes no debt entry. The branch is ready: https://github.com/LeandroLP23/AnyPS5/tree/tools/debt-labels Questions: - Is a report plus an optional trailer the right shape, or would you rather have only the report? - Should the label set be different? `code` is the default and covers a third of the entries. AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#15469
No description provided.