fix: output collision and progress fixes (4 commits) #6127
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6127"
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 nabil88 on 2026-10-14T22:51:39Z.
Summary
Four independent fixes in the relinker CLI's pre-write collision checksand write-stage progress, prepared as an atomic commit series:
1-Remove unreachable Windows output-identity probe (spurious failures)
2-Disambiguate registry names for same-named guest modules
3-Make write-stage progress cover every output file
4-Canonicalize output paths once instead of per comparison pair
Testing
Full conversion run ×2 on NTFS with --write-registry
Same-named modules in different directories
stdout identical before/after for a plain run (no flags)
Build clean on Linux (GCC/Clang) — Windows build pending CI
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T23:16:25Z.
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.
core/relinker/main.cppcore/relinker/main.cppcore/relinker/main.cppcore/relinker/main.cppcore/relinker/main.cppcore/relinker/main.cppcore/relinker/main.cppcore/relinker/main.cppImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-14T23:34:13Z.
Review: COMMENTED
Static read of head
8166150bd(not built). Two things incore/relinker/main.cpplook wrong independent of platform:.needed.jsonfiles are no longer written. The old--write-registryblock wrote bothregistryPaths[i]andneededPaths[i]for every executable and guest module. The new block only callswriteAndReportfor the registry files, andneededPathsis still computed and collision-checked but never written.outputCountalso only countsregistryPaths.size(), so the progress total matches the reduced set.registryPaths.insert(...)the hunk addsfor (...) checkOutputInputs(path, "Registry");and then a}. That}closesif (args.writeRegistry)before the originalcheckOutputInputsloop, theneededPathsderivation and the closing brace that follow it. A rough brace count on the file gives one more}than onmain. With the current CI onlyconventionsran (it fails), so the build hasn't checked this yet.Also, the
// ...comments added inSameOutputFileand before the output collision loop conflict with the comments rule indocs/dev/CONVENTIONS.md, andreturn false;after the newreturnis unreachable.Written with AI assistance (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T04:28:32Z.
Review: COMMENTED
Revalidated on the new head. It does not compile with Apple clang.
Machine: Apple M2 Max, macOS 27.2, Xcode 27 (Apple clang), cmake 4.4.4,
/usr/bin/python33.9.6.Head:
7d5848a97(previously looked at8166150bd). Base: maind92a8dad3(PR diff taken from its merge-baseeea428ca8, applies cleanly). Relinker-only build,-DANYPS5_RELINKER_ONLY=ON.Build error (arm64 and x86_64/Rosetta):
Line 338 in
7d5848a97isif (args.writeRegistry) outputCount += registryPaths.size()<U+200F>;. There is an invisible RIGHT-TO-LEFT MARK between)and;. It was introduced by the last commit and was not in8166150bd. Deleting that one character is enough for the file to build.Tests with the character stripped (arm64, Python 3.9): 155/163. Base on the same setup is 158/163 (the 5 known Python 3.9 / Linux-only failures). The three extra failures are caused by the PR no longer writing
*.needed.json:guest_registry(FileNotFoundError: .../output.needed.json)needed_libraries(tools/import_audit.pyread_needed_registry)call_registryIf dropping
.needed.jsonis intended, those tests andimport_audit.pyneed to be updated in the same PR.Not covered: the new head adds no test for the collision behaviour, so there was nothing to check for "fails without the fix".
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-15T19:22:40Z.
I prepared an applicable repair candidate for head
7d5848a97f, following jotitadev's review and the workaround-removal risk documented in #6328. AI-assisted; native Windows verification below.The bundle contains two sequential patches and one combined patch, confined to main.cpp:
eea428ca8. Keep this PR's cached canonical paths and registry naming changes.The output-identity workaround is exercised on this machine. A real NTFS hard link between output.exe and a converted module output has the same native file ID, but without the workaround conversion returns 0 and overwrites the previous output bytes. Restoring the helper returns 2 with Output paths collide and preserves all five existing output files and both inputs. This is output/output protection; #6328's additional input/output checks remain separate.
The missing companions also change audit behavior: four synthetic cases (Linux/Windows conversion output, dependency in the main image or bundled module) return conversion success and 100% write progress. Without companions, the real import_audit CLI incorrectly exits 0 while Party.prx is absent. The repair writes ["Party.prx"], and the same audit correctly exits 1 reporting that missing dependency with zero imports. Input hashes remain unchanged.
Windows 11, WinLibs GCC 15.2 r7 UCRT, CMake/Ninja Release, Python 3.12.14, relinker-only:
44df21632passes the candidate's incremental diff against this PR head; git diff --check passes. The combined patch applies to the original and reproduces the compiled source bytes with autocrlf=false.Bundle: patches, original/intermediate/repaired source, raw results, build/CTest logs and reproducible native probes. No new PR or push, current-main merge/rebase, composition with #6115/#6328, full system-library build, Linux/macOS host run, real title, GPU or FPS claim. Please review/apply as appropriate; the remaining full-suite failures still need resolution.
relinker-important-repairs-pr6127.zip
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T23:33:25Z.
Closing this one, for these reasons:
core/relinker/main.cpp:338contains a stray U+200F (right-to-left mark) afterregistryPaths.size(); it does not compile (confirmed by @jotitadev with Apple clang), which contradicts "Build clean on Linux" in the description..needed.jsonfiles are no longer written with--write-registry:neededPathsis still computed and collision-checked, but nothing writes it, and the progress total hides the omission.SameOutputFileWindows read-only/permission-mismatch handling is removed as "unreachable", but #6328 documents that it works around a real case; no evidence is given that it is dead.main, the Conventions check is red, and there are no tests for any of the four fixes.You're welcome to reopen, or open separate small PRs, rebased on
main, one fix each, with a test that fails without it.Pull request closed