test(victory-loader): pin seh::Context thread-state mapping and FXSAVE accessors #594

Open
github-bot wants to merge 1 commit from github-bot/gh-590 into main AGit
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 10:27 UTC · original
AnastasisKon:vibe/context-mapping-tests-1705ac → main · +70 −0 · 1 files · 1 commits · open

What this changes

Pins seh::Context::set_from_thread_state and the FXSAVE accessors in crates/victory-loader/src/native/seh/context.rs with unit tests: gpr order (rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8-r15), rip, eflags truncation to u32, cs/fs/gs from the Mach state, ds/es/ss fixed to 0x2B, set_mxcsr writing mx_csr + LE bytes in flt[1][8..12], and xmm(i) = flt[10 + i]. No behaviour change. Refs #593

How it was tested

  • cargo test --target x86_64-apple-darwin -p victory-loader — 33 passed (4 new context tests), 0 failed, 8 consecutive clean runs under Rosetta (one unrelated one-off flake seen once in a native test, not reproducible)
  • cargo test -p victory-hle -p victory -p victory-gpu -p xtask (host arm64) — all ok
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings — clean (RC=0)
  • cargo xtask policy — 404 files ok
  • Not needed (no game run; pure register mapping)

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md — n/a, no behaviour change
  • New diagnostics are behind a VICTORY_* variable and documented — n/a, no new diagnostics
**@⁠AnastasisKon** on GitHub · 2026-11-28 10:27 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/590) `AnastasisKon:vibe/context-mapping-tests-1705ac` → `main` · +70 −0 · 1 files · 1 commits · open ## What this changes Pins `seh::Context::set_from_thread_state` and the FXSAVE accessors in `crates/victory-loader/src/native/seh/context.rs` with unit tests: gpr order (rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8-r15), rip, eflags truncation to u32, cs/fs/gs from the Mach state, ds/es/ss fixed to 0x2B, `set_mxcsr` writing `mx_csr` + LE bytes in `flt[1][8..12]`, and `xmm(i)` = `flt[10 + i]`. No behaviour change. Refs #593 ## How it was tested - [x] `cargo test --target x86_64-apple-darwin -p victory-loader` — 33 passed (4 new context tests), 0 failed, 8 consecutive clean runs under Rosetta (one unrelated one-off flake seen once in a native test, not reproducible) - [x] `cargo test -p victory-hle -p victory -p victory-gpu -p xtask` (host arm64) — all ok - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` — clean (RC=0) - [x] `cargo xtask policy` — 404 files ok - [x] Not needed (no game run; pure register mapping) ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md — n/a, no behaviour change - [x] New diagnostics are behind a `VICTORY_*` variable and documented — n/a, no new diagnostics
Unit tests for set_from_thread_state (gpr order, rip, eflags truncation,
cs/fs/gs from the state, ds/es/ss fixed to 0x2B), set_mxcsr's write to
mx_csr and flt[1][8..12], and xmm(i) addressing flt[10 + i]. Runs under
the x86_64-apple-darwin test target.

Refs #589
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 10:29:08 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/594/head:github-bot/gh-590'
git switch 'github-bot/gh-590'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-590'
git switch 'github-bot/gh-590'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-590'
git switch 'github-bot/gh-590'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-590'
git switch 'main'
git merge --squash 'github-bot/gh-590'
git switch 'main'
git merge --ff-only 'github-bot/gh-590'
git switch 'main'
git merge 'github-bot/gh-590'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.