feat(tools): keep technical debt in one file per library #4411
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4411"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T09:48:36Z.
What
docs/dev/TechnicalDebt.mdhad 684 entries in four sections, and most pull requests append to the same section ends, so it was the most common conflict: 176 open pull requests touch it. This keeps one file per library or component underdocs/dev/debt/, withTechnicalDebt.mdas the index.docs/dev/debt/<name>.md: an entry goes to the file named after the firstcore/path it links:<name>forcore/libs/prx/<name>/..., otherwisecore/<name>/...(shader,relinker,libs), so a recompiler entry that also cites a driver test stays inshader.md, under the same###sections and order as before. Entries that link neither (Build, the 4 cross-library "Unknown function info" lines, 3 Functional lines) and the Silent stubs preamble stay in the index;#silent-stubsand#functionalanchors still exist there. Links are rewritten to../../../.python3 tools/debt_split.py split, nothing edited by hand; on a rebase it is regenerated rather than rebased.tools/debt_split.py:splitmoves every library or component entry in the index to its file, appending to existing files (idempotent: also fixes an entry a clean merge left in the index).resolve, run during a rebase stopped onTechnicalDebt.md, takes the stopped commit's change between the merge base and its version (stages 1 and 3), applies its added, edited and removed entries to the debt files (an addition goes after the entry it followed), keepsmain's index and stages everything. It refuses, leaving the conflict as it was, when the change also edits lines that stay in the index or when an edited/removed entry was also changed onmain.check_conventions.py):debt-filerule: an added entry whose name is not the file it is in (including the index) fails, naming the right file. The naming rule lives once, incheck_conventions.debt_name, whichdebt_split.pyimports.stubgen.pydefault debt link is relative todocs/dev/debt/.resolve.Tested
doc-link.tools/tests/test_debt_split.py(registered asdebt_split): split by first core link, split appending to existing files without duplicating the index note, andresolvein real rebases: added + edited + removed entries (order kept, emptied file deleted, index equal tomain's), refusal on index lines, refusal on an entrymainalso changed, refusal outside a conflict. Mutations (drop the delete, drop the index-line guard, always insert the note) each fail a test.test_check_conventions_comments.py: silent-stub cases moved to a library file; new cases fordebt-file(library entry in the index, in another library's file, component file, entry without a core link stays, entry filed by its first core link). Mutations (rule disabled; links resolved from the index instead of their own file) fail 2 and 4 tests.tools/testssuites pass;check_conventions.py --base upstream/mainpasses.TechnicalDebt.mdonto this branch, runningresolveat every stop:mainresolvehandles every stopdebt-filereports andsplitmoves (2)main(checked for all 6)resolvehandles theTechnicalDebt.mdpartSo no pull request gets a new conflict it cannot resolve with
resolveexcept the 4 that edit index lines (the same hand merge as today).@boykopovar this changes where technical debt lives (layout call). @oneandonlydean after merge, authors rebase and run
python3 tools/debt_split.py resolvewhenTechnicalDebt.mdconflicts; I can run it on the open pull requests we have edit access to.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by Mouad-Scriptz-0 on 2026-10-12T12:03:51Z.
Dry run from the other side: I rebased each of my open pull requests onto this branch (
git rebase --onto docs/debt-per-library <its base>, so only the PR's own commits replay) and ranpython3 tools/debt_split.py resolveat every stop ondocs/dev/TechnicalDebt.md. Fedora 44, git 2.53.resolvelibSceAgcDriver.mdlibSceAgcDriver.mdlibkernel.mdlibSceAgcDriver.mdlibSceVideoOut.mdlibSceAgcDriver.mdcheck_conventions.py --base docs/debt-per-librarypasses on every result, with the link prefixes rewritten to../../../.One placement to consider:
debt_namepicks the firstcore/libs/prx/<name>link anywhere in the entry and only falls back tocore/<name>when there is none. #4048's entry is about the shader recompiler (its first link iscore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvMemoryInstructions.cpp) but also citesVulkanDevice.cppfor the feature it enables, so it was filed underlibSceAgcDriver.mdrather thanshader.md, anddebt-fileaccepted it there. Every recompiler entry that mentions a driver file will go the same way; taking the entry's first link, whichever tree it is in, would file it with its subject.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T13:29:19Z.
Thanks for the dry run. Agreed on the placement:
debt_namenow takes the entry's firstcore/link, whichever tree it is in (<name>forcore/libs/prx/<name>/..., otherwisecore/<name>/...).libSceAgcDriver.mdtoshader.md(s_subvector_loop_*, the twos_memtimeentries, flat SRT reads through a null pointer, f32 denormals): all recompiler entries that cite a driver test or file as evidence. Nothing else moves.debt-filenow rejects a recompiler entry filed in a library file (new testtest_entry_goes_with_its_first_core_link), andtest_debt_splithas a shader entry that also links a library test.mainand regenerated the split commit (684 entries, 0 lost); reran the full rebase trial on the 176 open pull requests that touch the file, table in the description updated. #4448 and #4048 now conflict withmainitself in code files (BdaResources.cpp,ShaderReplay.cpp), unrelated to this; the other five still resolve.Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-12T13:49:31Z.
+1
Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-12T13:52:48Z.
Strong +1.
Keeping
TechnicalDebt.mdin sync across orthogonal PRs (libSceAgcDriver,shader,libSceSysmodule) was consistently the primary source of rebase churn. Modularizing intodocs/dev/debt/<component>.mdand providingdebt_split.py resolvecleanly eliminates cross-subsystem collisions while making rebases effortless for open branches.Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-12T13:55:05Z.
LGTM.
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T15:38:34Z.
Rebase handoff — rebased onto current
main, authorship unchanged. This one needed a real semantic docs resolution, so here's what it involves:This PR restructures the technical-debt ledger into one file per library (
docs/dev/debt/<name>.md), whilemainkept adding new entries to the old single file — 10 entries landed since this PR's base. A plain union would have re-broken the PR's own convention (and thedebt-filecheck enforces it). The rebased branch instead routes each of main's 10 new entries to its per-library file by the firstcore/path it links (libSceHttp2,libSceRtc,libkernel,libSceNgs2.native,shader,libkernel_sys,libc×2,libSceAgcDriver,shader), with the relative links adjusted for the deeper directory.One consequence worth knowing for future PRs: any PR that adds a technical-debt entry while this one is open should target
docs/dev/debt/<library>.mddirectly, or it will conflict here again.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesTo pick it up:
Head is
63851a36c.Imported from boykopovar/AnyPS5. Originally posted by Mouad-Scriptz-0 on 2026-10-12T16:07:20Z.
Thanks, the first-
core/link rule reads right, and the five recompiler entries belong inshader.md.On the two conflicts: #4448 is rebased on current
main(f82f49d69, mergeable again; theBdaResources.cppoverlap was the failed-import test from #1357 next to mine). #4048's conflict is theagc_shader_replayusage line against #4325's--prepare; I'll rebase it today.