fix(relinker): keep fixed-base test compatible with Python 3.9 #6843

Closed
MarcZX10 wants to merge 1 commit from upstream-pr/6843 into main
MarcZX10 commented 2026-10-16 14:07:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T14:07:02Z.


What

Keep test_linux_fixed_base.py compatible with Python 3.9. The test used zip(..., strict=True), which was added in Python 3.10 and caused the linux_fixed_base relinker test to fail on Python 3.9. It now checks the dynamic-tag list lengths explicitly before pairing them, retaining the mismatch assertion without the newer keyword.

This is the remaining Python 3.9 test failure reported during review of #6728; the change is separate from #6728 and #6734.

Tested

  • Linux, GCC 12.2, Python 3.11.2.
  • Relinker-only Release build: cmake --build /tmp/build-aps5-python39-fixed-base --target relinker -j2 passed.
  • ctest --test-dir /tmp/build-aps5-python39-fixed-base -R '^linux_fixed_base$' --output-on-failure: passed (1/1).
  • python3 tools/check_conventions.py --base upstream/main: passed.
  • Python 3.9 was not available locally; the change removes the Python 3.10-only call and preserves its equal-length check.

Checklist

  • Based on current main; #6224 and #6403 also touch this test. #6224 covers the relocated-table behavior and merges cleanly with this Python 3.9 compatibility change; #6403 has overlapping test changes.
  • One topic per PR; follow-ups go in a new PR
  • No comments in code added
  • No stubs or unimplemented paths introduced
  • No notes, investigation files or images added to the repository
  • New third-party code: none
  • Generic behavior; not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4889541207 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T14:07:02Z. --- ### What Keep `test_linux_fixed_base.py` compatible with Python 3.9. The test used `zip(..., strict=True)`, which was added in Python 3.10 and caused the `linux_fixed_base` relinker test to fail on Python 3.9. It now checks the dynamic-tag list lengths explicitly before pairing them, retaining the mismatch assertion without the newer keyword. This is the remaining Python 3.9 test failure reported during review of #6728; the change is separate from #6728 and #6734. ### Tested - Linux, GCC 12.2, Python 3.11.2. - Relinker-only Release build: `cmake --build /tmp/build-aps5-python39-fixed-base --target relinker -j2` passed. - `ctest --test-dir /tmp/build-aps5-python39-fixed-base -R '^linux_fixed_base$' --output-on-failure`: passed (1/1). - `python3 tools/check_conventions.py --base upstream/main`: passed. - Python 3.9 was not available locally; the change removes the Python 3.10-only call and preserves its equal-length check. ### Checklist - [x] Based on current `main`; #6224 and #6403 also touch this test. #6224 covers the relocated-table behavior and merges cleanly with this Python 3.9 compatibility change; #6403 has overlapping test changes. - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code added - [x] No stubs or unimplemented paths introduced - [x] No notes, investigation files or images added to the repository - [x] New third-party code: none - [x] Generic behavior; not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-16 14:14:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T14:14:15Z.


Hosted validation is complete: conventions, eligibility, intake, and the relinker-only CTest matrix pass on Ubuntu, Windows, and macOS. The general Linux and Windows application jobs were skipped by the repository path filters; this change only touches a relinker test.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6217409991 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6217409991). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T14:14:15Z. --- Hosted validation is complete: conventions, eligibility, intake, and the relinker-only CTest matrix pass on Ubuntu, Windows, and macOS. The general Linux and Windows application jobs were skipped by the repository path filters; this change only touches a relinker test.
jotitadev commented 2026-10-16 14:45:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T14:45:01Z.

Review: COMMENTED


Ran this with Python 3.9, the run the description could not do: Intel i7-8700, Ubuntu 26.04, GCC 15.2, CMake 4.2.3, CPython 3.9.25 (uv build). Head f6f78d6192ae4a383080230227c01b2eafc21624 merged on main 82ddae75b, relinker-only Release build with -DPython3_EXECUTABLE=<python3.9>.

  • linux_fixed_base: on main it fails with TypeError: zip() takes no keyword arguments; with this PR it passes (5 of 5 repeated runs).
  • Relinker-only ctest with Python 3.9: main 175/182, this PR 176/182, this PR + #6728 + #6734 178/182. pr_overlap_tools and release_package pass with #6734 and #6728, as on macOS.

The four that remain are not about this PR:

  • file_writer_binary/file_writer_text also fail on this machine with Python 3.14 (Ubuntu 26.04 coreutils).
  • tls_function_coverage_alu_execution and tls_function_coverage_moved_branch segfault (('alu-exec-xor-3', -11, b''), ('moved-rel8-branch', -11, b'')) with Python 3.9 only. They pass with Python 3.14 against the same relinker binaries. These cases run the converted image through windows_image_runner.py on Linux x86_64 hosts, so the macOS Rosetta runs do not reach them. The test bodies write rbx (mov rbx, -16 in the moved-branch prologue, and rbx is one of the ALU targets) and return without restoring it, but rbx is callee-saved in the SysV ABI. Python 3.9's ctypes caller relies on it after the call and crashes, while 3.14 happens not to. When I wrapped the entry call in a trampoline that saves rbx (push rbx; call; pop rbx; ret), both groups passed on 3.9 and 3.14. I can open that as a separate PR if it helps.

Not checked: macOS/Windows with this head (the hosted matrix covers them on newer Python).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5549399839 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#pullrequestreview-5549399839). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-16T14:45:01Z. **Review:** COMMENTED --- Ran this with Python 3.9, the run the description could not do: Intel i7-8700, Ubuntu 26.04, GCC 15.2, CMake 4.2.3, CPython 3.9.25 (uv build). Head `f6f78d6192ae4a383080230227c01b2eafc21624` merged on `main` `82ddae75b`, relinker-only Release build with `-DPython3_EXECUTABLE=<python3.9>`. - `linux_fixed_base`: on `main` it fails with `TypeError: zip() takes no keyword arguments`; with this PR it passes (5 of 5 repeated runs). - Relinker-only ctest with Python 3.9: `main` 175/182, this PR 176/182, this PR + #6728 + #6734 178/182. `pr_overlap_tools` and `release_package` pass with #6734 and #6728, as on macOS. The four that remain are not about this PR: - `file_writer_binary`/`file_writer_text` also fail on this machine with Python 3.14 (Ubuntu 26.04 coreutils). - `tls_function_coverage_alu_execution` and `tls_function_coverage_moved_branch` segfault (`('alu-exec-xor-3', -11, b'')`, `('moved-rel8-branch', -11, b'')`) with Python 3.9 only. They pass with Python 3.14 against the same relinker binaries. These cases run the converted image through `windows_image_runner.py` on Linux x86_64 hosts, so the macOS Rosetta runs do not reach them. The test bodies write `rbx` (`mov rbx, -16` in the moved-branch prologue, and `rbx` is one of the ALU targets) and return without restoring it, but `rbx` is callee-saved in the SysV ABI. Python 3.9's ctypes caller relies on it after the call and crashes, while 3.14 happens not to. When I wrapped the entry call in a trampoline that saves `rbx` (`push rbx; call; pop rbx; ret`), both groups passed on 3.9 and 3.14. I can open that as a separate PR if it helps. Not checked: macOS/Windows with this head (the hosted matrix covers them on newer Python). Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Dextroid17 commented 2026-10-16 14:49:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-16T14:49:36Z.


The Python 3.9 run is covered above, so only one addition: the description says no other open PR changes this test, but #6224 and #6403 both change test_linux_fixed_base.py.

  • #6224 merges cleanly with this PR. On the merged tree the file has no strict=True left, and linux_fixed_base passes 3 of 3 on Python 3.9.25 (Linux, GCC 16.2.1, relinker-only Release build). So #6224's added checks also run on 3.9.
  • #6403 conflicts with this PR in that file. You said on #6224 that you would close #6403 once its coverage is there; Agnibha folded it in at 2cf75dbbf, so this conflict goes away if #6403 closes.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6218093670 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6218093670). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-16T14:49:36Z. --- The Python 3.9 run is covered above, so only one addition: the description says no other open PR changes this test, but #6224 and #6403 both change `test_linux_fixed_base.py`. - #6224 merges cleanly with this PR. On the merged tree the file has no `strict=True` left, and `linux_fixed_base` passes 3 of 3 on Python 3.9.25 (Linux, GCC 16.2.1, relinker-only Release build). So #6224's added checks also run on 3.9. - #6403 conflicts with this PR in that file. You said on #6224 that you would close #6403 once its coverage is there; Agnibha folded it in at 2cf75dbbf, so this conflict goes away if #6403 closes. AI-assisted: yes
MarcZX10 commented 2026-10-16 15:19:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T15:19:25Z.


Thanks for checking the Python 3.9 case and the open-PR overlap. I corrected the checklist in this PR: #6224 and #6403 both touch test_linux_fixed_base.py; #6224's relocated-table test runs with this compatibility change, while #6403 has overlapping test edits. The current PR's relinker matrix remains green on Ubuntu, Windows, and macOS.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6218659964 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6218659964). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T15:19:25Z. --- Thanks for checking the Python 3.9 case and the open-PR overlap. I corrected the checklist in this PR: #6224 and #6403 both touch `test_linux_fixed_base.py`; #6224's relocated-table test runs with this compatibility change, while #6403 has overlapping test edits. The current PR's relinker matrix remains green on Ubuntu, Windows, and macOS.
MarcZX10 commented 2026-10-16 16:00:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T16:00:10Z.


Thanks for checking the Python 3.9 composition and for confirming #6224 carries the missing checks. I will keep #6403 open per Marc’s standing request to keep all current PRs open. The shared test_linux_fixed_base.py conflict with #6843 still needs coordination; this report confirms #6224 composes cleanly, but does not make #6403’s separate program-header change redundant.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6219428946 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6219428946). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T16:00:10Z. --- Thanks for checking the Python 3.9 composition and for confirming #6224 carries the missing checks. I will keep #6403 open per Marc’s standing request to keep all current PRs open. The shared `test_linux_fixed_base.py` conflict with #6843 still needs coordination; this report confirms #6224 composes cleanly, but does not make #6403’s separate program-header change redundant.
MarcZX10 commented 2026-10-16 20:01:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T20:01:44Z.


Thanks for the Python 3.9 cross-run and the overlap note. Your reported run shows #6224 now carries the changed fixed-base test and passes on Python 3.9 when composed with #6224. Since you asked to keep all current PRs open, I will leave #6843 open; I’ve updated its checklist to name both #6224 and #6403 as overlapping work, and I’ll leave consolidation to maintainers.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223646299 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6223646299). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T20:01:44Z. --- Thanks for the Python 3.9 cross-run and the overlap note. Your reported run shows #6224 now carries the changed fixed-base test and passes on Python 3.9 when composed with #6224. Since you asked to keep all current PRs open, I will leave #6843 open; I’ve updated its checklist to name both #6224 and #6403 as overlapping work, and I’ll leave consolidation to maintainers.
MarcZX10 commented 2026-10-17 14:13:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T14:13:56Z.


I checked the new overlap notice against #7142. Both branches edit the same test_linux_fixed_base.py loop for Python 3.9: the same explicit length check and non-strict zip; #7142 also updates the release-notes and overlap tools. This is duplicate behavior and the file edits conflict, rather than a dependency. I will keep #6843 open per the instruction and leave consolidation to maintainers; no follow-up implementation is planned here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234939035 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6234939035). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T14:13:56Z. --- I checked the new overlap notice against #7142. Both branches edit the same `test_linux_fixed_base.py` loop for Python 3.9: the same explicit length check and non-strict `zip`; #7142 also updates the release-notes and overlap tools. This is duplicate behavior and the file edits conflict, rather than a dependency. I will keep #6843 open per the instruction and leave consolidation to maintainers; no follow-up implementation is planned here.
blawesom commented 2026-10-17 19:02:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-17T19:02:55Z.


Rebase handoff — rebased onto current main (authorship unchanged). One conflict in test_linux_fixed_base.py: main's assertion-message form kept over your older naming (same check).

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; the fixed-base test passes; conventions pass; full suite green apart from the known main regression (agc_driver_tessellation segfault — Mesa, #5444), not this PR.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/6843
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is f219248f0.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6239143473 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6239143473). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-17T19:02:55Z. --- **Rebase handoff** — rebased onto current `main` (authorship unchanged). One conflict in `test_linux_fixed_base.py`: `main`'s assertion-message form kept over your older naming (same check). Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): builds; the fixed-base test passes; conventions pass; **full suite green apart from the known `main` regression** (`agc_driver_tessellation` segfault — Mesa, #5444), not this PR. **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/6843 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Head is `f219248f0`.
MarcZX10 commented 2026-10-17 20:49:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T20:49:58Z.


Thanks for the Python 3.9 report and the concrete callee-saved-register diagnosis. I checked for an existing fix before acting: #6929 by jotitadev already adds rbx save/restore to the TLS coverage fixtures, and its current Ubuntu/Windows/macOS relinker checks are green. That matches the two Python 3.9-only crash cases you identified, so I won’t open a duplicate PR. The other 3.9-only failures you mention are outside #6843’s fixed-base change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6240829194 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6240829194). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T20:49:58Z. --- Thanks for the Python 3.9 report and the concrete callee-saved-register diagnosis. I checked for an existing fix before acting: #6929 by jotitadev already adds `rbx` save/restore to the TLS coverage fixtures, and its current Ubuntu/Windows/macOS relinker checks are green. That matches the two Python 3.9-only crash cases you identified, so I won’t open a duplicate PR. The other 3.9-only failures you mention are outside #6843’s fixed-base change.
MarcZX10 commented 2026-10-18 12:18:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T12:18:45Z.


I checked current upstream main: the Python 3.9-compatible non-strict zip plus explicit length check is already present, merged in #7142 (02c7da767). Rebasing #6843 onto current main therefore produces an empty diff. I left this PR open and its published branch unchanged; maintainers can decide how to handle the now-redundant patch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6249827148 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6249827148). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T12:18:45Z. --- I checked current upstream `main`: the Python 3.9-compatible non-strict `zip` plus explicit length check is already present, merged in #7142 (`02c7da767`). Rebasing #6843 onto current `main` therefore produces an empty diff. I left this PR open and its published branch unchanged; maintainers can decide how to handle the now-redundant patch.
adriadam10 commented 2026-10-19 10:15:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T10:15:53Z.


Closing: main already contains this change (test_linux_fixed_base.py no longer uses zip(strict=True), fixed in 02c7da767 / #7142), the branch conflicts with main, and rebased it would be an empty diff, as you noted. Thanks for the fix and the follow-up; feel free to reopen if something is left that main doesn't cover.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6264890899 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6843#issuecomment-6264890899). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T10:15:53Z. --- Closing: `main` already contains this change (`test_linux_fixed_base.py` no longer uses `zip(strict=True)`, fixed in 02c7da767 / #7142), the branch conflicts with `main`, and rebased it would be an empty diff, as you noted. Thanks for the fix and the follow-up; feel free to reopen if something is left that `main` doesn't cover.

Pull request closed

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!6843
No description provided.