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

Closed
spidercraft wants to merge 2 commits from upstream-pr/524 into main
spidercraft commented 2026-11-24 04:27:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by spidercraft on 2026-11-24T04:27:22Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6574612373 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/524). Originally posted by [spidercraft](https://github.com/spidercraft) on 2026-11-24T04:27:22Z. --- ## 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)
catminou4 commented 2026-11-24 13:01:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T12:44:27Z.

Review: COMMENTED


Test-merge with current main (ffe310e) conflicts — needs a rebase. Main moved recently (PR #566 waterfall loops touched lower.rs/resource.rs/valu_tests.rs), so shader PRs opened before it need rebasing. I'll re-review once it merges cleanly.

<!-- greyfinch-sync:Marvisak/VIctory:review:6039403579 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/524#pullrequestreview-6039403579). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T12:44:27Z. **Review:** COMMENTED --- Test-merge with current main (`ffe310e`) **conflicts** — needs a rebase. Main moved recently (PR #566 waterfall loops touched `lower.rs`/`resource.rs`/`valu_tests.rs`), so shader PRs opened before it need rebasing. I'll re-review once it merges cleanly.
jeremygold02 commented 2026-11-24 18:05:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T17:43:08Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139603931 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/524#issuecomment-7139603931). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T17:43:08Z. --- 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.
upstream-sync closed this pull request 2026-11-25 00:05:34 +00:00
Marvisak commented 2026-11-25 00:06:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:03:41Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148093964 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/524#issuecomment-7148093964). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:03:41Z. --- 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

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