fix(tools): detect NID alias overlaps between exports #8961
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8961"
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 xdCloudy on 2026-10-21T07:26:16Z.
What
Normalize
_nid_postfixand_nid_disambigNexport names in PR overlap comparisons so aliases that resolve to the same NID are detected.Tested
Windows local Python:
python -m unittest tools.tests.test_pr_overlap_exports tools.tests.test_pr_overlap_wrapped_exportspassed (10 tests).git diff --checkpassed. The normalized export check covered 813 open PRs; 3 unrelated diffs could not be retrieved.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T07:30:06Z.
The current Conventions job fails for two fixable reasons: the three-line explanatory comment above the canonicalization in
tools/pr_overlap.pyviolates the repository rule that code comments belong only to technical debt, and the PR body is missing the required### What,### Tested, and### Checklistsections. The code change itself is focused; moving the rationale into the PR description and filling the template should clear these findings.relinker-asanand the Ubuntu relinker job pass; macOS/Windows relinker jobs are still pending.Imported from boykopovar/AnyPS5. Originally posted by xdCloudy on 2026-10-21T07:30:39Z.
I found a gap in my overlap checker: it compared export names literally and did not normalize
_nid_postfix/_nid_disambigNaliases, which can resolve to the same NID as a plain name. I updated the checker to compare normalized names and checked this PR against currentmainand the available open PR diffs; no remaining normalized-name overlap turned up for this PR.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T07:31:14Z.
I independently ran the focused tests from exact head
3a1acb576b:python3 -m unittest tools.tests.test_pr_overlap_exports tools.tests.test_pr_overlap_wrapped_exportspasses (10 tests). The remaining red check is the conventions/template failure above; I used an isolated temporary worktree and removed it afterward.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T07:32:14Z.
Review: APPROVED
The author removed the disallowed implementation comment and completed the required PR sections; the latest Conventions check passes. I independently ran the focused overlap tests on the previous head and all 10 passed; the implementation changes since then are documentation/comment cleanup. The cross-platform relinker jobs are still pending, so this approval reflects the focused code and convention review, not those unfinished jobs.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T07:32:15Z.
Thanks for fixing the template and comment issue. The current Conventions check is green. My 10-test focused run was on the preceding code-equivalent head; the remaining platform jobs are still running.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T07:33:30Z.
@xdCloudy thanks, the alias check reads right and its normalisation matches
tools/nid_names.py. A non-blocking idea for a follow-up, not this PR:pr_overlap.pycompares open pull requests with each other, but the duplicates we have been finding in the stub PRs are againstmainitself, where a plain-name stub exports the same NID as an existing_nid_postfiximplementation. A check of each PR's new exports againstmain's (includingAPS5_ASM_FUNCTIONand rawAPS5_EXPORTNIDs) would catch those automatically. Full CI on this head is next.Imported from boykopovar/AnyPS5. Originally posted by xdCloudy on 2026-10-21T07:36:30Z.
Thanks, agreed. This PR stays focused on normalizing aliases between open PRs. I separately checked this batch against current
main, includingAPS5_VABIdefinitions,APS5_ASM_FUNCTIONexports, and namedAPS5_EXPORTaliases; no matches turned up. An automated PR-versus-main export inventory check would be a useful separate follow-up.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T07:44:12Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
tools/pr_overlap.pyImported from boykopovar/AnyPS5. Originally posted by xdCloudy on 2026-10-21T07:46:57Z.
I manually reviewed #988's change to
tools/pr_overlap.py. It adds end-of-run summary logging near the script entry point; this PR changes export-name normalization inexports(). The edits are independent, and a direct three-way merge check found no conflict intools/pr_overlap.py. The bot warning reflects #988's conflict with its base branch, so this file should combine cleanly after the branches are rebased.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-21T07:55:09Z.
Review: APPROVED
Reviewed at
39b0c5cb4, with both commits cherry-picked onto main44e3389c8on Windows.test_pr_overlap*.pysuite: 61 passed, 4 platform-specific skips (65 run).Nid::Internal::StripNidPostfix, compiled with GCC 15.2; all matched.overlaps()probes reproduce missed collisions on main and detect them with this change. Distinct names and no-patch helpers remain excluded.No actionable findings. Linux-only cases and a live exhaustive PR audit were not run.
AI-assisted: yes (Codex); results above were run locally.