Runtime: declare title-facing functions extern "win64" #524

Closed
github-bot wants to merge 2 commits from gh-pr/524/head into gh-pr/524/base
Owner

@⁠spidercraft on GitHub · 2026-11-24 04:27 UTC · original
spidercraft:win64-abi → main · +904 −812 · 48 files · 2 commits · closed without merging

What

Title code calls our exports, and is called by us, with the Windows x64 convention. extern "system" means that only on Windows: on Linux it is SysV, so a native Linux runtime would get the title's arguments in the wrong registers. Every title-facing function (808) is now extern "win64", which is the same convention on every x86-64 host, so nothing changes on Windows.

Callbacks we hand to the host's own APIs stay "system": the crash reporter's exception handlers, the write-watch handler, window and dialog procedures, EnumWindows, our TLS callback, the probe test's CreateThread start routine. The title fixture keeps "system" (it is only built as a Windows PE). The doc comment in modules/mod.rs states the rule.

Builds on #523 (its one commit is included; review the second).

Tested

  • cargo check --workspace --all-targets --all-features --target x86_64-pc-windows-msvc: no diagnostics (the type checker flagged every host callback; those are the ones kept as "system").
  • Linux: cargo test --workspace passes, 162 passed, 13 ignored.
  • cargo xtask policy ok.

🤖 Generated with Claude Code

**@⁠spidercraft** on GitHub · 2026-11-24 04:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/524) `spidercraft:win64-abi` → `main` · +904 −812 · 48 files · 2 commits · closed without merging ## What Title code calls our exports, and is called by us, with the Windows x64 convention. `extern "system"` means that only on Windows: on Linux it is SysV, so a native Linux runtime would get the title's arguments in the wrong registers. Every title-facing function (808) is now `extern "win64"`, which is the same convention on every x86-64 host, so nothing changes on Windows. Callbacks we hand to the host's own APIs stay `"system"`: the crash reporter's exception handlers, the write-watch handler, window and dialog procedures, `EnumWindows`, our TLS callback, the probe test's `CreateThread` start routine. The title fixture keeps `"system"` (it is only built as a Windows PE). The doc comment in `modules/mod.rs` states the rule. Builds on #523 (its one commit is included; review the second). ## Tested - `cargo check --workspace --all-targets --all-features --target x86_64-pc-windows-msvc`: no diagnostics (the type checker flagged every host callback; those are the ones kept as `"system"`). - Linux: `cargo test --workspace` passes, 162 passed, 13 ignored. - `cargo xtask policy` ok. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Since the world bring-up, main no longer builds on Linux: victory-gpu
names host_resource outside its cfg(windows), and victory-hle reaches
Windows-only modules (xmem, files, lifecycle, the text entry dialog).
This gates those uses only, as the smallest base for a native Linux
runtime:

- view_format and the D3D12 allocator hookup are Windows-only, like
  what they call.
- XLaunchNewGame ends the title only on Windows; the text entry dialog
  answers "dismissed" elsewhere.
- translate --validate / --pipelines refuse to start off Windows (no
  host DXIL validator or D3D12 there); translation itself runs.
- Tests that parse the test binary as a PE image, or use Windows title
  paths, are ignored off Windows with the reason.

Tested: Linux (CachyOS, rustc 1.98.1): cargo test --workspace passes
(162 passed, 13 ignored). cargo check --target x86_64-pc-windows-msvc
--all-targets gives the same diagnostics as before (none).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Title code calls our exports, and is called by us, with the Windows x64
convention. `extern "system"` is that convention only on Windows; on
Linux it is SysV, so a native Linux runtime would receive the title's
arguments in the wrong registers. `"win64"` is the same convention on
every x86-64 host, so this changes nothing on Windows.

Callbacks we hand to the host's own APIs stay `"system"` (the crash
reporter's exception handlers, the write watch handler, window and
dialog procedures, EnumWindows, our TLS callback, the probe test's
CreateThread start routine). The title fixture keeps `"system"`: it is
built only as a Windows PE.

Tested: cargo check --workspace --all-targets --all-features for
x86_64-pc-windows-msvc: no diagnostics; on Linux cargo test --workspace
passes (162 passed, 13 ignored).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:07:06 +00:00
github-bot closed this pull request 2026-11-26 04:07:06 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 17:43 UTC · original

Verification ran against PR head 53282a65ad88ff5e826585a3340ebaf806f41ca0; the PR was open at refresh.

  • Command: cargo test -j 1 -p victory-loader --test load_probe
  • Result: 2 passed: maps_a_title_dll_the_title_loads_itself and loads_binds_and_calls_probe. The probe exercises Win64 calls into a synthetic stand-in DLL and checks HLE, host, title-DLL and delay-loaded imports, plus thread attach/detach behavior.
  • Limit: this integration target is #![cfg(windows)], so it does not validate the Linux-host x86_64 ABI distinction between system and win64. No Linux cross-target check was available for this run.

This verification was AI-assisted.

**@⁠jeremygold02** on GitHub · 2026-11-24 17:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/524#issuecomment-7139603931) Verification ran against PR head `53282a65ad88ff5e826585a3340ebaf806f41ca0`; the PR was open at refresh. - Command: `cargo test -j 1 -p victory-loader --test load_probe` - Result: 2 passed: `maps_a_title_dll_the_title_loads_itself` and `loads_binds_and_calls_probe`. The probe exercises Win64 calls into a synthetic stand-in DLL and checks HLE, host, title-DLL and delay-loaded imports, plus thread attach/detach behavior. - Limit: this integration target is `#![cfg(windows)]`, so it does not validate the Linux-host x86_64 ABI distinction between `system` and `win64`. No Linux cross-target check was available for this run. This verification was AI-assisted.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:03 UTC · original

Automated triage for the maintainers. Closing because it is outside the project's scope (VIctory targets Windows hosts; ports, launchers and tooling for other platforms are not being taken).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/524#issuecomment-7148093964) Automated triage for the maintainers. Closing because it is outside the project's scope (VIctory targets Windows hosts; ports, launchers and tooling for other platforms are not being taken). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!524
No description provided.