test(relinker): split TLS coverage into bounded CTest groups #1913

Merged
gunerky merged 3 commits from upstream-pr/1913 into main 2026-10-10 08:13:08 +00:00
gunerky commented 2026-10-08 23:28:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gunerky on 2026-10-08T23:28:41Z.


What

Split tls_function_coverage into 30 independently registered CTest groups. The displacement cases run per destination register and the ALU encoding cases per operation; smaller metadata, padding, execution and rejection groups remain together. Each group uses an isolated temporary directory and a 30-second CTest timeout. Use ctest -L tls_function_coverage to run the whole family. Calling the Python script with only the relinker path still runs all cases; an invalid group fails.

Preserve all 451 existing fixture conversions, 256 generated executable runs and existing assertions. This changes test scheduling and registration; runtime behavior is unchanged.

Grouping bounds each entry's workload but does not establish or fix the underlying cause. The unexplained CI delay and independently reproduced Windows diagnostic write failure are documented in this PR description; a shared cause has not been established.

The contribution guidelines ask for slow tests to be split. In the inspected earlier Windows CI job for #1358, this test passed once in 14.71 s and timed out on its next repeat at 120.03 s; the HMD tests passed. This patch bounds work per CTest entry. It has not yet been validated on that hosted-runner workload and does not identify the precise cause of the intermittent delay.

Related: #1358, which reported the Windows CI timeout in the existing TLS test. This scheduling change is independent of its HMD registration change.

Tested

Windows x64, WinLibs MinGW-w64 GCC 15.2.0 UCRT/POSIX/SEH, Python 3.10.6; Release, ANYPS5_RELINKER_ONLY=ON, BUILD_TESTING=ON, based on upstream main 6cc0503dacc9d9697d23001d4103780ad2e9acba.

  • After the earlier rebase, the relinker-only build passed. Full relinker CTest suite with --parallel 4 --timeout 30: 65/65 passed, zero skipped; longest TLS group 3.46 seconds. On the earlier base f145139676a48306681d3a4d5fabf83938759daf, the full suite also passed 65/65, and a separate TLS-only --repeat until-fail:3 --parallel 4 run passed all 30 groups three times (90/90 runs). These are local measurements; hosted CI timing has not been established.
  • Earlier full-suite repetition on base ae91d978 passed all 90 TLS runs but failed windows_dependency_diagnostics with Cannot write diagnostic fixture after one successful repeat. Its source and registration are unchanged. On unmodified main db1391dc, all 36 relinker tests passed three repeats; a focused diagnostic-only control then reproduced the same write failure on run 17, and the candidate's focused control reproduced it on run 15. No TLS tests were running in those focused controls. The failure exists without this patch; its underlying Windows I/O cause remains unresolved.
  • Actual baseline, grouped and all-mode runs on base ae91d978 matched fixture names and SHA-256s, conversion contracts and return codes, executable return codes, and 1,713 assertion evaluations. All 16 original assertion ASTs were preserved; no case was omitted or duplicated by the registered groups.
  • All 30 group registrations, their label and timeout were verified; invalid displacement_r4 was rejected with exit code 2.
  • check_test_registration.py: seven test executables, all registered. Official conventions rules and git diff --check passed.
  • Documentation-only review revision: removed the TechnicalDebt entry requested in review. Both TLS implementation/registration files are unchanged from 9fa937f193dc5dcb4fc42f8bf0d42a14d194cb1b. Conventions (including this description), test registration and whitespace checks passed; CTest was not rerun for this documentation-only removal. Earlier test results above are retained with their original scope.
  • Linux and macOS: Not tested locally. Game, title or homebrew: Not run. No GPU or shader cache is involved in these tests. A successful hosted CI run is still needed before calling the reported CI timeout fixed.

Checklist

  • Based on upstream main at the recorded revision; no matching open test-splitting PR found in the recorded searches
  • One topic per PR; follow-ups go in a new PR
  • No comments added in code
  • No new unimplemented paths or silent stubs
  • No notes, investigation .md files or images added to the repository
  • No new third-party code or dependencies
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4794008399 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1913). Originally posted by [gunerky](https://github.com/gunerky) on 2026-10-08T23:28:41Z. --- ### What Split `tls_function_coverage` into 30 independently registered CTest groups. The displacement cases run per destination register and the ALU encoding cases per operation; smaller metadata, padding, execution and rejection groups remain together. Each group uses an isolated temporary directory and a 30-second CTest timeout. Use `ctest -L tls_function_coverage` to run the whole family. Calling the Python script with only the relinker path still runs all cases; an invalid group fails. Preserve all 451 existing fixture conversions, 256 generated executable runs and existing assertions. This changes test scheduling and registration; runtime behavior is unchanged. Grouping bounds each entry's workload but does not establish or fix the underlying cause. The unexplained CI delay and independently reproduced Windows diagnostic write failure are documented in this PR description; a shared cause has not been established. The contribution guidelines ask for slow tests to be split. In the inspected [earlier Windows CI job for #1358](https://github.com/boykopovar/AnyPS5/actions/runs/37831724401/job/113525563486), this test passed once in 14.71 s and timed out on its next repeat at 120.03 s; the HMD tests passed. This patch bounds work per CTest entry. It has not yet been validated on that hosted-runner workload and does not identify the precise cause of the intermittent delay. Related: #1358, which reported the Windows CI timeout in the existing TLS test. This scheduling change is independent of its HMD registration change. ### Tested Windows x64, WinLibs MinGW-w64 GCC 15.2.0 UCRT/POSIX/SEH, Python 3.10.6; Release, `ANYPS5_RELINKER_ONLY=ON`, `BUILD_TESTING=ON`, based on upstream main `6cc0503dacc9d9697d23001d4103780ad2e9acba`. - After the earlier rebase, the relinker-only build passed. Full relinker CTest suite with `--parallel 4 --timeout 30`: 65/65 passed, zero skipped; longest TLS group 3.46 seconds. On the earlier base `f145139676a48306681d3a4d5fabf83938759daf`, the full suite also passed 65/65, and a separate TLS-only `--repeat until-fail:3 --parallel 4` run passed all 30 groups three times (90/90 runs). These are local measurements; hosted CI timing has not been established. - Earlier full-suite repetition on base `ae91d978` passed all 90 TLS runs but failed `windows_dependency_diagnostics` with `Cannot write diagnostic fixture` after one successful repeat. Its source and registration are unchanged. On unmodified main `db1391dc`, all 36 relinker tests passed three repeats; a focused diagnostic-only control then reproduced the same write failure on run 17, and the candidate's focused control reproduced it on run 15. No TLS tests were running in those focused controls. The failure exists without this patch; its underlying Windows I/O cause remains unresolved. - Actual baseline, grouped and all-mode runs on base `ae91d978` matched fixture names and SHA-256s, conversion contracts and return codes, executable return codes, and 1,713 assertion evaluations. All 16 original assertion ASTs were preserved; no case was omitted or duplicated by the registered groups. - All 30 group registrations, their label and timeout were verified; invalid `displacement_r4` was rejected with exit code 2. - `check_test_registration.py`: seven test executables, all registered. Official conventions rules and `git diff --check` passed. - Documentation-only review revision: removed the TechnicalDebt entry requested in review. Both TLS implementation/registration files are unchanged from `9fa937f193dc5dcb4fc42f8bf0d42a14d194cb1b`. Conventions (including this description), test registration and whitespace checks passed; CTest was not rerun for this documentation-only removal. Earlier test results above are retained with their original scope. - Linux and macOS: Not tested locally. Game, title or homebrew: Not run. No GPU or shader cache is involved in these tests. A successful hosted CI run is still needed before calling the reported CI timeout fixed. ### Checklist - [x] Based on upstream `main` at the recorded revision; no matching open test-splitting PR found in the recorded searches - [x] One topic per PR; follow-ups go in a new PR - [x] No comments added in code - [x] No new unimplemented paths or silent stubs - [x] No notes, investigation `.md` files or images added to the repository - [x] No new third-party code or dependencies - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
klosixgaming-arch commented 2026-10-09 00:47:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-09T00:47:21Z.

Review: APPROVED


This is a legitimate test-scheduling change and I can approve it.

  • Splitting tls_function_coverage into 30 independently registered CTest groups directly addresses the intermittent 120 s CI timeout you cite (#1358), and a 30 s TIMEOUT per group + isolated temp dir per group means one slow case can't drag the whole suite over the bar. That's the right shape of the fix for a scheduling problem.
  • The Python refactor is mechanical and correct: the group dispatch preserves the original case set. You verified the baseline vs grouped runs match on fixture names/SHA-256, conversion contracts, return codes, and 1,713 assertion evaluations, and that all 16 original assertion ASTs are preserved with no omission/duplication. That's the kind of "I didn't accidentally drop a test" proof I'd want for a split like this.
  • Invalid group names fail cleanly (exit 2), and ctest -L tls_function_coverage still runs the whole family. Good.

Non-blocking notes:

  1. You're honest that this bounds per-entry work but "does not identify the precise cause of the intermittent delay." That's the right framing — don't oversell it. If the root cause is a hosted-runner I/O stall (your windows_dependency_diagnostics write-failure control suggests something in that direction), the split hides the symptom rather than fixing it. Worth a line in the debt entry saying the timeout is masked, not root-caused, so the next person investigating the I/O failure knows the test split is not a fix.
  2. The --repeat until-fail:3 evidence is local, and you explicitly say hosted CI timing isn't established. That's fine for approving the scheduling change, but I'd want one green hosted run before this is considered "done" for the CI-flake it targets.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5464521870 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1913#pullrequestreview-5464521870). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-09T00:47:21Z. **Review:** APPROVED --- This is a legitimate test-scheduling change and I can approve it. - Splitting `tls_function_coverage` into 30 independently registered CTest groups directly addresses the intermittent 120 s CI timeout you cite (#1358), and a 30 s `TIMEOUT` per group + isolated temp dir per group means one slow case can't drag the whole suite over the bar. That's the right shape of the fix for a scheduling problem. - The Python refactor is mechanical and correct: the group dispatch preserves the original case set. You verified the baseline vs grouped runs match on fixture names/SHA-256, conversion contracts, return codes, and 1,713 assertion evaluations, and that all 16 original assertion ASTs are preserved with no omission/duplication. That's the kind of "I didn't accidentally drop a test" proof I'd want for a split like this. - Invalid group names fail cleanly (exit 2), and `ctest -L tls_function_coverage` still runs the whole family. Good. Non-blocking notes: 1. You're honest that this *bounds* per-entry work but "does not identify the precise cause of the intermittent delay." That's the right framing — don't oversell it. If the root cause is a hosted-runner I/O stall (your `windows_dependency_diagnostics` write-failure control suggests something in that direction), the split hides the symptom rather than fixing it. Worth a line in the debt entry saying the timeout is masked, not root-caused, so the next person investigating the I/O failure knows the test split is not a fix. 2. The `--repeat until-fail:3` evidence is local, and you explicitly say hosted CI timing isn't established. That's fine for approving the scheduling change, but I'd want one green hosted run before this is considered "done" for the CI-flake it targets. Written with AI assistance.
oneandonlydean commented 2026-10-09 20:14:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:14:50Z.


Please drop the docs/dev/TechnicalDebt.md entry. TechnicalDebt lists shortcuts in the code; the unexplained CI delay and the windows_dependency_diagnostics write failure belong in the PR description, which already has them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088511901 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1913#issuecomment-6088511901). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T20:14:50Z. --- Please drop the `docs/dev/TechnicalDebt.md` entry. TechnicalDebt lists shortcuts in the code; the unexplained CI delay and the `windows_dependency_diagnostics` write failure belong in the PR description, which already has them.
oneandonlydean commented 2026-10-10 05:17:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T05:17:12Z.


This now conflicts with main in test_tls_function_coverage.py (#2238 added cases there); please rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094131748 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1913#issuecomment-6094131748). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T05:17:12Z. --- This now conflicts with main in `test_tls_function_coverage.py` (#2238 added cases there); please rebase.
adriadam10 commented 2026-10-10 08:08:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T08:08:51Z.


Rebased onto current main as @oneandonlydean asked; the only conflict was test_tls_function_coverage.py after #2238:

  • address-taken-tls-callback goes into the metadata group.
  • The register_alu_cases loop goes into register_address_loads.
  • short-alu-before-return goes into rejected, and register-address-alu is dropped there as on main.

Relinker build + ctest after the rebase: 86/86 pass. The TechnicalDebt entry is already gone from the head. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095534600 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1913#issuecomment-6095534600). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T08:08:51Z. --- Rebased onto current `main` as @oneandonlydean asked; the only conflict was `test_tls_function_coverage.py` after #2238: - `address-taken-tls-callback` goes into the `metadata` group. - The `register_alu_cases` loop goes into `register_address_loads`. - `short-alu-before-return` goes into `rejected`, and `register-address-alu` is dropped there as on `main`. Relinker build + ctest after the rebase: 86/86 pass. The TechnicalDebt entry is already gone from the head. Merging once CI is green.
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!1913
No description provided.