feat(tools): label technical debt entries by what would close them, missing tests and removed links #15470

Merged
LeandroLP23 merged 13 commits from upstream-pr/15470 into main 2026-11-07 06:20:49 +00:00
LeandroLP23 commented 2026-11-03 13:55:06 +00:00 (Migrated from github.com)

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


What

tools/debt_report.py labels every technical debt entry in docs/dev/TechnicalDebt.md and docs/dev/debt/*.md, so the entries someone can close can be found without rereading 345 files. The proposal, counts and accuracy measurements are in #15469.

  • What would close it: console, firmware, gpu, title or code. Read from the Closes when: text if there is one, otherwise from the entry:
    • an unknown or unverified signature, or a parameterless declaration for import resolution, gives firmware;
    • "not measured on a console" or "unverified on a PS5" gives console;
    • "fails on RADV" or "not measured on other drivers" gives gpu;
    • anything else is code.
  • no-test: none of the functions the entry names (its link text, and lowercase identifiers in backticks) appears in a test source. Calls through _nid_postfix and _nid_no_patch count. A name of only lowercase letters (start, size, writes) counts only when a library exports it (APS5_VABI name( or name_nid_postfix), so plain words don't mark an entry as tested.
  • Platform: windows, macos and linux for each platform the entry names, unless it names all three.
  • stale?: a linked core/ file no longer exists. On main this finds one entry, in libScePlayerInvitationDialog.md, which links the Export.cpp that 19044c17b5 removed.

It prints one line per entry and the counts per label, or JSON with --json. Debt file names and --label (repeatable) filter the output, and it always exits 0. For example, python3 tools/debt_report.py --label code --label no-test lists the 265 entries that need only code and have no test.

An entry may end with a Labels: trailer, as with Closes when:. A label given there replaces the inferred labels of its family, and tested removes an inferred no-test. check_conventions.py gets a debt-labels warning for an unknown label in a trailer on an entry line, its indented lines included. The trailer ends the entry and stays on its line. TechnicalDebt.md gets one sentence on the trailer, next to the Closes when: one. The root CMakeLists.txt registers the two new test scripts (conventions_debt_labels, debt_report). No debt entry changes.

Conflicts:

  • #13801 adds rules next to the new ones in check_conventions.py (the end of RULES, the constants after DEBT_ENTRY_LIMIT, and Check.debt_entries). The additions are independent; whichever merges second rebases.
  • #14212 also touches TechnicalDebt.md and check_conventions.py. The blank lines it adds between entries don't affect the parser, which reads entries through debt_entries.

Tested

Windows 11, Python 3.13.

  • python3 -m unittest tools/tests/test_debt_report.py tools/tests/test_check_conventions_debt_labels.py tools/tests/test_check_conventions_debt_length.py: 17 tests pass. They cover sections and entries, names, every closer rule, platforms, test words with the _nid_ suffixes, missing links, the trailer override, the command line, and the warning, which applies only to entry lines and their indented lines.

  • python3 -m unittest discover -s tools/tests -p "test_check_conventions*.py": 202 tests pass.

  • python3 tools/check_conventions.py --base origin/main: all checks pass.

  • A full run on main b11c7bf84f takes about 6 s: 5615 entries: 2499 no-test, 2444 firmware, 1952 code, 1201 console, 311 windows, 130 linux, 51 macos, 16 gpu, 2 title, 1 stale?.

  • Accuracy against hand labels, on 100 random entries used to tune the rules, then 60 that were not:

    Label 100 60
    What would close it, matches 83/100 52/60
    no-test, labelled entries that have no test 37/40 9/11
    Platform, exactly right 95/100 57/60

    In the second sample no-test counts only the first 30 entries: the verdicts for the other 30 were recorded out of order.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: Fixes #15469
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5138440980 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15470). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-11-03T13:55:06Z. --- ### What `tools/debt_report.py` labels every technical debt entry in `docs/dev/TechnicalDebt.md` and `docs/dev/debt/*.md`, so the entries someone can close can be found without rereading 345 files. The proposal, counts and accuracy measurements are in #15469. - **What would close it:** `console`, `firmware`, `gpu`, `title` or `code`. Read from the `Closes when:` text if there is one, otherwise from the entry: - an unknown or unverified signature, or a parameterless declaration for import resolution, gives `firmware`; - "not measured on a console" or "unverified on a PS5" gives `console`; - "fails on RADV" or "not measured on other drivers" gives `gpu`; - anything else is `code`. - **`no-test`:** none of the functions the entry names (its link text, and lowercase identifiers in backticks) appears in a test source. Calls through `_nid_postfix` and `_nid_no_patch` count. A name of only lowercase letters (`start`, `size`, `writes`) counts only when a library exports it (`APS5_VABI name(` or `name_nid_postfix`), so plain words don't mark an entry as tested. - **Platform:** `windows`, `macos` and `linux` for each platform the entry names, unless it names all three. - **`stale?`:** a linked `core/` file no longer exists. On `main` this finds one entry, in `libScePlayerInvitationDialog.md`, which links the `Export.cpp` that 19044c17b5 removed. It prints one line per entry and the counts per label, or JSON with `--json`. Debt file names and `--label` (repeatable) filter the output, and it always exits 0. For example, `python3 tools/debt_report.py --label code --label no-test` lists the 265 entries that need only code and have no test. An entry may end with a `Labels:` trailer, as with `Closes when:`. A label given there replaces the inferred labels of its family, and `tested` removes an inferred `no-test`. `check_conventions.py` gets a `debt-labels` warning for an unknown label in a trailer on an entry line, its indented lines included. The trailer ends the entry and stays on its line. `TechnicalDebt.md` gets one sentence on the trailer, next to the `Closes when:` one. The root `CMakeLists.txt` registers the two new test scripts (`conventions_debt_labels`, `debt_report`). No debt entry changes. Conflicts: - #13801 adds rules next to the new ones in `check_conventions.py` (the end of `RULES`, the constants after `DEBT_ENTRY_LIMIT`, and `Check.debt_entries`). The additions are independent; whichever merges second rebases. - #14212 also touches `TechnicalDebt.md` and `check_conventions.py`. The blank lines it adds between entries don't affect the parser, which reads entries through `debt_entries`. ### Tested Windows 11, Python 3.13. - `python3 -m unittest tools/tests/test_debt_report.py tools/tests/test_check_conventions_debt_labels.py tools/tests/test_check_conventions_debt_length.py`: 17 tests pass. They cover sections and entries, names, every closer rule, platforms, test words with the `_nid_` suffixes, missing links, the trailer override, the command line, and the warning, which applies only to entry lines and their indented lines. - `python3 -m unittest discover -s tools/tests -p "test_check_conventions*.py"`: 202 tests pass. - `python3 tools/check_conventions.py --base origin/main`: all checks pass. - A full run on `main` `b11c7bf84f` takes about 6 s: `5615 entries: 2499 no-test, 2444 firmware, 1952 code, 1201 console, 311 windows, 130 linux, 51 macos, 16 gpu, 2 title, 1 stale?`. - Accuracy against hand labels, on 100 random entries used to tune the rules, then 60 that were not: | Label | 100 | 60 | |---|---|---| | What would close it, matches | 83/100 | 52/60 | | `no-test`, labelled entries that have no test | 37/40 | 9/11 | | Platform, exactly right | 95/100 | 57/60 | In the second sample `no-test` counts only the first 30 entries: the verdicts for the other 30 were recorded out of order. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: Fixes #15469 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
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!15470
No description provided.