Skip to content

test(relinker): isolate Windows diagnostic fixtures - #2154

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
gunerky:codex/diagnostic-fixture
Oct 10, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
gunerky:codex/diagnostic-fixture

Conversation

@gunerky

@gunerky gunerky commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What

windows_dependency_diagnostics reuses the same fixture directory and rewrites diagnostic-runner.exe on each invocation. An unchanged-main control passed 17 times before failing with Cannot write diagnostic fixture. Instrumentation identified the runner's truncating open as the failing operation: CRT errno 22, native error 1224 (ERROR_USER_MAPPED_FILE). The process holding the intermittent mapping has not been identified.

Exclusively create a separate fixture directory for each invocation, remove it on success, and retain it on failure for diagnosis. Check opening, writing and closing explicitly; failures name the path, operation, requested byte count and error values. Existing generated images, dependency scenarios and assertions remain unchanged. No write retries, sleeps or production behavior changes are added.

Register a Windows-only integration regression that holds a previous fixture in a read-only data mapping, runs the actual diagnostic executable once and then twice concurrently, and checks that the previous file and directory remain untouched and successful runs clean up their own files. This deterministically exercises the mapped-file truncation restriction; it does not identify the owner or type of the mapping in the natural failure.

Related: #1913, where the independently reproduced write failure was recorded. This PR is separate from TLS test scheduling and does not claim to fix the TLS timeout.

The Windows-only Python regression registration is at the end of the Python-enabled test block. This leaves the insertion point used by the independent CLI help PR #2117 free. Neither PR depends on the other.

Tested

Latest publication head a58fe0cd72a44bc472d01e5681c66f2a665caeab, rebased onto upstream main 4c3674192964a3b316d694161593a593012ea537. Windows x64 (10.0.26300.0), WinLibs MinGW-w64 GCC 15.2.0 UCRT/POSIX/SEH, Python 3.12.14; Release, ANYPS5_RELINKER_ONLY=ON, BUILD_TESTING=ON.

  • Relinker-only configure/build passed. Full candidate CTest with --parallel 4 --timeout 120: 41/41 passed, zero skipped, 39.19 seconds total. Both diagnostic tests passed ten repetitions each with --parallel 2 (20/20 runs, 20.37 seconds total). The new isolation regression took 2.77 seconds in the full suite and at most 2.48 seconds in those focused repeats. Its registered 30-second timeout is unchanged; no repository timeout was increased. The unchanged TLS coverage test took 39.18 seconds in the full run; its scheduling is the separate work in test(relinker): split TLS coverage into bounded CTest groups #1913.
  • Earlier integration validation on the previous publication base d70b89989473ba1f6ae13e44e079e67f1f8a44b0, with feat(relinker): support explicit CLI help #2117 head 0cdc998863ba79f763ec9bf1344c9e346d1a2f94: both merge orders are automatic and produce the same tree. An actual temporary merge was configured and built separately; cli_help and windows_diagnostic_fixture_isolation are each registered exactly once. Full combined CTest passed 42/42, zero skipped, 23.79 seconds total. CLI help plus both diagnostic tests passed ten repetitions each (30/30 runs). The combined snapshot was saved locally and the candidate was restored cleanly; this PR contains only the three fixture-isolation files.
  • This update only rebases the existing three-file patch onto the recorded main revision. git range-diff reports equivalent patches before and after the rebase (12ef4bdf and a58fe0cd); the C++ fixture handling, Python regression and CMake addition are unchanged. The test-registration relocation for feat(relinker): support explicit CLI help #2117 was part of the previous publication update; the integration results above are earlier measurements, not a new integration run.
  • Initial controls on main 6a2b99b8, Python 3.10.6: unchanged test failed on run 18 after 17 passes; instrumented unchanged fixture handling failed on run 23 with native error 1224. The isolation candidate passed 100/100 consecutive runs. The mapped-fixture regression fails against the original binary and passes with the fix. These are the earlier controls; the process holding the natural mapping remains unidentified.
  • All eight built test executables are registered. Both diagnostic tests are registered exactly once, and the isolation test retains TIMEOUT 30. Committed-head conventions (including this PR description), test registration and git diff origin/main...HEAD --check passed.
  • Linux, macOS, hosted CI and title/homebrew execution: Not tested. No game, SDK or firmware files were used.

Checklist

  • Rebased onto upstream main at the exact revision recorded above; no other open PR implements this fixture isolation fix
  • One topic per PR; follow-ups go in a new PR
  • No comments added in code
  • No unimplemented paths or silent stubs added
  • 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; implementation, testing and this description were prepared with OpenAI Codex assistance

@github-actions github-actions Bot mentioned this pull request Oct 9, 2026
9 tasks done
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2196 core/relinker/CMakeLists.txt L273
#2206 core/relinker/CMakeLists.txt L273
#2330 core/relinker/CMakeLists.txt L273
#2332 core/relinker/CMakeLists.txt L273
#2545 core/relinker/elfpatcher/tests/test_windows_diagnostic_fixture_isolation.py

@MarcZX10

MarcZX10 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

I reviewed the full diff and the reported Windows relinker-only build/CTest results. The change is distinct from #2117: that PR adds the CLI help process test, while this adds Windows fixture-isolation coverage. Both insert separate add_test entries in the same Python-enabled block; a sequential merge of both currently conflicts in core/relinker/CMakeLists.txt.

This head is based on 47d25447; current main is 745b775e. Please rebase and keep both registrations when resolving the CMake conflict. I have not approved while the PR is behind current main and the combined merge needs resolution.

@gunerky
gunerky force-pushed the codex/diagnostic-fixture branch from 12ef4bd to a58fe0c Compare October 9, 2026 21:02
oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
@oneandonlydean
oneandonlydean merged commit 661295e into boykopovar:main Oct 10, 2026
5 of 6 checks passed
SleglJan pushed a commit to SleglJan/AnyPS5 that referenced this pull request Oct 10, 2026
test(relinker): isolate Windows diagnostic fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants