Tests: add synthetic Xbox runtime conformance under Wine #505

Open
pedrofort wants to merge 1 commit from upstream-pr/505 into main
pedrofort commented 2026-11-24 04:17:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pedrofort on 2026-11-24T04:17:10Z.


Objective

Add a reproducible synthetic runtime conformance harness for VIctory's Windows loader under Wine, initially validated on Apple Silicon.

Coverage

  • PE mapping and relocation

  • Xbox HLE initialization and uninitialization

  • Series X and Series S configurations

  • AVX2 and FMA arithmetic

  • Multithreading and synchronization

  • TLS callbacks and static thread-local storage

  • Virtual memory allocation

  • Virtual G: drive file access

  • Imported and dynamically loaded title DLLs

  • Missing import reporting and zero-return stubs

  • Map-only execution and alternate exit codes

Validation

Apple M5, macOS 27.2.1, Rosetta, Sikarugir Wine 10.0 and LLVM/LLD 23.1.6.

Check | Result -- | -- Fixture compilation | 12/12 Direct execution controls | 9/9 VIctory loader checks | 16/16 Total | 37/37 Failed | 0 Blocked | 0 Asset policy | PASS

The harness was rerun successfully after packaging it for this PR.

Scope

No runtime implementation changes. All fixtures are generated from original synthetic source outside the repository.

These results demonstrate the tested CPU and loader functionality under Wine on Apple Silicon, not commercial title compatibility or integrated graphics support.

Independent Linux/Wine validation is welcome.

No game files or proprietary assets were used.

AI-assisted implementation, with execution and validation performed locally on Apple Silicon.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6574500015 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/505). Originally posted by [pedrofort](https://github.com/pedrofort) on 2026-11-24T04:17:10Z. --- <h2><span>Objective</span></h2><p><span>Add a reproducible synthetic runtime conformance harness for VIctory's Windows loader under Wine, initially validated on Apple Silicon.</span></p><h2><span>Coverage</span></h2><ul><li><p><span>PE mapping and relocation</span></p></li><li><p><span>Xbox HLE initialization and uninitialization</span></p></li><li><p><span>Series X and Series S configurations</span></p></li><li><p><span>AVX2 and FMA arithmetic</span></p></li><li><p><span>Multithreading and synchronization</span></p></li><li><p><span>TLS callbacks and static thread-local storage</span></p></li><li><p><span>Virtual memory allocation</span></p></li><li><p><span>Virtual G: drive file access</span></p></li><li><p><span>Imported and dynamically loaded title DLLs</span></p></li><li><p><span>Missing import reporting and zero-return stubs</span></p></li><li><p><span>Map-only execution and alternate exit codes</span></p></li></ul><h2><span>Validation</span></h2><p><span>Apple M5, macOS 27.2.1, Rosetta, Sikarugir Wine 10.0 and LLVM/LLD 23.1.6.</span></p> Check | Result -- | -- Fixture compilation | 12/12 Direct execution controls | 9/9 VIctory loader checks | 16/16 Total | 37/37 Failed | 0 Blocked | 0 Asset policy | PASS <p><span>The harness was rerun successfully after packaging it for this PR.</span></p><h2><span>Scope</span></h2><p><span>No runtime implementation changes. All fixtures are generated from original synthetic source outside the repository.</span></p><p><span>These results demonstrate the tested CPU and loader functionality under Wine on Apple Silicon, not commercial title compatibility or integrated graphics support.</span></p><p><span>Independent Linux/Wine validation is welcome.</span></p><p><span>No game files or proprietary assets were used.</span></p><p><span>AI-assisted implementation, with execution and validation performed locally on Apple Silicon.</span></p>
MichaelSmithAI commented 2026-11-24 11:04:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T10:19:28Z.


Independent x86-64 Linux replay passed all 37 checks with Wine 11.22: 12 fixture builds, 9 direct execution controls, and 16 VIctory loader checks. All 37 ran, including thread-local storage, threading and the Series S HLE case.

We used the unmodified harness files from this PR with a Win64 GNU/LLVM build of VIctory main ffe310e. A fresh Wine prefix initially timed out during initialization. Disabling the optional mscoree and mshtml components alongside winemenubuilder let initialization finish and the harness run to completion. This was a synthetic CPU and loader run.

AI-assisted setup and verification.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7128620540 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/505#issuecomment-7128620540). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T10:19:28Z. --- Independent x86-64 Linux replay passed all 37 checks with Wine 11.22: 12 fixture builds, 9 direct execution controls, and 16 VIctory loader checks. All 37 ran, including thread-local storage, threading and the Series S HLE case. We used the unmodified harness files from this PR with a Win64 GNU/LLVM build of VIctory main `ffe310e`. A fresh Wine prefix initially timed out during initialization. Disabling the optional `mscoree` and `mshtml` components alongside `winemenubuilder` let initialization finish and the harness run to completion. This was a synthetic CPU and loader run. AI-assisted setup and verification.
Marvisak commented 2026-11-25 02:06:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:28:00Z.


Automated triage for the maintainers.

Needs work. This needs the maintainer's decision.

tests/runtime/run.sh is a bash wrapper around about 880 lines of embedded Python. It creates a Wine prefix, runs clang, lld-link and llvm-dlltool, and starts wine and victory.exe as subprocesses, with macOS-specific DYLD_* setup. A harness that spawns external tools needs the maintainer's sign-off. It also adds a second test toolchain (Python, LLVM, Wine) next to the Rust one, and CI does not run it.

Concrete points:

  • main already covers synthetic loader and HLE loading in Rust: crates/victory-loader/tests/load_probe.rs builds tests/fixtures/hle-probe and runs it in CI. Cases this harness adds that are missing there could go into that fixture or test instead. These cases are relocation, TLS callbacks, the G: drive, missing-import stubs and Series S.
  • Running under Wine is being discussed separately in #1218 (xtask wine-test). A Wine-specific harness belongs with that decision.
  • The README's validation section (Apple M5, macOS version, Wine build) is a run report. It doesn't belong in the repo docs.

A smaller PR that adds the missing cases to the existing Rust fixture test would be easier to review.

CI: no check runs on the head commit.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149577640 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/505#issuecomment-7149577640). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:28:00Z. --- <!-- victory-triage v1 head=d4c8abf932a1a5b62b75b4eeb5c2fb39c55f13aa verdict=needs-work at=2026-11-25T01:27:59Z --> Automated triage for the maintainers. **Needs work.** This needs the maintainer's decision. `tests/runtime/run.sh` is a bash wrapper around about 880 lines of embedded Python. It creates a Wine prefix, runs `clang`, `lld-link` and `llvm-dlltool`, and starts `wine` and `victory.exe` as subprocesses, with macOS-specific `DYLD_*` setup. A harness that spawns external tools needs the maintainer's sign-off. It also adds a second test toolchain (Python, LLVM, Wine) next to the Rust one, and CI does not run it. Concrete points: - `main` already covers synthetic loader and HLE loading in Rust: `crates/victory-loader/tests/load_probe.rs` builds `tests/fixtures/hle-probe` and runs it in CI. Cases this harness adds that are missing there could go into that fixture or test instead. These cases are relocation, TLS callbacks, the G: drive, missing-import stubs and Series S. - Running under Wine is being discussed separately in #1218 (`xtask wine-test`). A Wine-specific harness belongs with that decision. - The README's validation section (Apple M5, macOS version, Wine build) is a run report. It doesn't belong in the repo docs. A smaller PR that adds the missing cases to the existing Rust fixture test would be easier to review. CI: no check runs on the head commit. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/505:upstream-pr/505'
git switch 'upstream-pr/505'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/505'
git switch 'upstream-pr/505'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/505'
git switch 'upstream-pr/505'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/505'
git switch 'main'
git merge --squash 'upstream-pr/505'
git switch 'main'
git merge --ff-only 'upstream-pr/505'
git switch 'main'
git merge 'upstream-pr/505'
git push origin 'main'
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
Marvisak/VIctory!505
No description provided.