Fix Windows 10 Game-Init crash and root-signature fallback #623

Closed
bittertea0323 wants to merge 3 commits from upstream-pr/623 into main
bittertea0323 commented 2026-11-24 06:54:02 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by bittertea0323 on 2026-11-24T05:48:51Z.


Fixes the title crashing at +0xb5a5f8 right after XUserAddAsync (issue #348) by implementing the XUser maximum-users slot, plus a token and a root-signature fallback. See #622 for reproduction and measurements.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6575546145 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/623). Originally posted by [bittertea0323](https://github.com/bittertea0323) on 2026-11-24T05:48:51Z. --- Fixes the title crashing at +0xb5a5f8 right after XUserAddAsync (issue #348) by implementing the XUser maximum-users slot, plus a token and a root-signature fallback. See #622 for reproduction and measurements.
LAKSHYA-cmd-tech commented 2026-11-24 06:54:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:03:41Z.

Review: COMMENTED


## Review: test failure in modules::xuser::tests::startup_adds_the_user_and_reads_its_id and PR overlap

Tested on Windows 11 with Rust 1.98.1 (x86_64-pc-windows-msvc).

1. Test Failure in ictory-hle

Running cargo test -p victory-hle fails on this branch:
`
---- modules::xuser::tests::startup_adds_the_user_and_reads_its_id stdout ----

thread 'modules::xuser::tests::startup_adds_the_user_and_reads_its_id' panicked at crates\victory-hle\src\modules\xuser.rs:408:9:
assertion left == right failed
left: 0
right: -1994108655
**Root cause**: Line 232 of crates/victory-hle/src/modules/xuser.rs changes oken_async's finished status from FAILED_TO_GET_TOKEN (-1994108655 / �x89240011) to S_OK (�), but the existing unit test at line 408 explicitly verifies:
ust
assert_eq!(
xasync::XAsyncGetStatus(&mut block, true),
FAILED_TO_GET_TOKEN
);
`
If returning S_OK with an empty token is intentional to satisfy title account init without contacting external servers, the test expectation must be updated to match, and any callers expecting offline error handling considered.

2. get_max_users slot 6 (0x30)

Implementing get_max_users (out = 1, S_OK) for slot 6 in VTABLE looks very clean and directly resolves the null dereference at title+0xb5a5f8 described in #348. Please consider adding a unit test for get_max_users asserting out receives 1.

3. Root signature fallback overlap

The root signature fallback change in crates/victory-gpu/src/pipeline/host.rs overlaps with PR #626. In addition to serializing without �xC01 flags, note that some host environments can fail during device.CreateRootSignature as well, which #626 also handles with unit test coverage.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034447982 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/623#pullrequestreview-6034447982). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T06:03:41Z. **Review:** COMMENTED --- ## Review: test failure in modules::xuser::tests::startup_adds_the_user_and_reads_its_id and PR overlap Tested on Windows 11 with Rust 1.98.1 (x86_64-pc-windows-msvc). ### 1. Test Failure in ictory-hle Running cargo test -p victory-hle fails on this branch: ` ---- modules::xuser::tests::startup_adds_the_user_and_reads_its_id stdout ---- thread 'modules::xuser::tests::startup_adds_the_user_and_reads_its_id' panicked at crates\victory-hle\src\modules\xuser.rs:408:9: assertion left == right failed left: 0 right: -1994108655 ` **Root cause**: Line 232 of crates/victory-hle/src/modules/xuser.rs changes oken_async's finished status from FAILED_TO_GET_TOKEN (-1994108655 / �x89240011) to S_OK (�), but the existing unit test at line 408 explicitly verifies: ` ust assert_eq!( xasync::XAsyncGetStatus(&mut block, true), FAILED_TO_GET_TOKEN ); ` If returning S_OK with an empty token is intentional to satisfy title account init without contacting external servers, the test expectation must be updated to match, and any callers expecting offline error handling considered. ### 2. get_max_users slot 6 (0x30) Implementing get_max_users (out = 1, S_OK) for slot 6 in VTABLE looks very clean and directly resolves the null dereference at title+0xb5a5f8 described in #348. Please consider adding a unit test for get_max_users asserting out receives 1. ### 3. Root signature fallback overlap The root signature fallback change in crates/victory-gpu/src/pipeline/host.rs overlaps with PR #626. In addition to serializing without �xC01 flags, note that some host environments can fail during device.CreateRootSignature as well, which #626 also handles with unit test coverage.
LAKSHYA-cmd-tech commented 2026-11-24 06:54:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:36:01Z.

Review: APPROVED


LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 86 tests in ictory-hle pass cleanly (including startup_adds_the_user_and_reads_its_id and the new unit test for get_max_users), and all 43 tests in ictory-gpu pass cleanly. Great follow-up!

<!-- greyfinch-sync:Marvisak/VIctory:review:6034736160 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/623#pullrequestreview-6034736160). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T06:36:01Z. **Review:** APPROVED --- LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 86 tests in ictory-hle pass cleanly (including startup_adds_the_user_and_reads_its_id and the new unit test for get_max_users), and all 43 tests in ictory-gpu pass cleanly. Great follow-up!
bittertea0323 commented 2026-11-24 06:56:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by bittertea0323 on 2026-11-24T06:17:47Z.


Agility SDK plan for Windows 10 hosts posted on issue #622: the two mandatory exports, the loader-lock trap, the import-lib generation, and the one remaining Rust linking gap. This PR intentionally ships without the Agility bits.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123786781 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/623#issuecomment-7123786781). Originally posted by [bittertea0323](https://github.com/bittertea0323) on 2026-11-24T06:17:47Z. --- Agility SDK plan for Windows 10 hosts posted on issue #622: the two mandatory exports, the loader-lock trap, the import-lib generation, and the one remaining Rust linking gap. This PR intentionally ships without the Agility bits.
bittertea0323 commented 2026-11-24 06:56:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by bittertea0323 on 2026-11-24T06:29:20Z.


Thanks for the review — all three points addressed in 7c01e3d.

  1. token_async reverted to FAILED_TO_GET_TOKEN. You were right to flag it. On the repro host the token path is never reached during Game Init (the "token and signature: offline" log line never fires before the +0xb5a5f8 fault), so the S_OK change was speculative and it broke the pinned test. Reverted, test passes again.

  2. Unit test added for get_max_users (slot 0x30): asserts out == 1 and S_OK, in the same style as the existing slot tests. cargo test -p victory-hle modules::xuser is green.

  3. Root signature fallback vs #626: mine handles the D3D12SerializeVersionedRootSignature refusal (the "Unsupported bit-flag set" from Windows 10's d3d12core) and retries without the two 1.1 heap-indexing flags. If #626 additionally covers CreateRootSignature failure, the two are complementary, not conflicting — happy to drop my host.rs change entirely if #626 lands first and maintainers prefer one path.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123985169 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/623#issuecomment-7123985169). Originally posted by [bittertea0323](https://github.com/bittertea0323) on 2026-11-24T06:29:20Z. --- Thanks for the review — all three points addressed in 7c01e3d. 1. **token_async reverted to `FAILED_TO_GET_TOKEN`.** You were right to flag it. On the repro host the token path is never reached during Game Init (the "token and signature: offline" log line never fires before the `+0xb5a5f8` fault), so the S_OK change was speculative and it broke the pinned test. Reverted, test passes again. 2. **Unit test added for `get_max_users`** (slot 0x30): asserts `out == 1` and `S_OK`, in the same style as the existing slot tests. `cargo test -p victory-hle modules::xuser` is green. 3. **Root signature fallback vs #626:** mine handles the `D3D12SerializeVersionedRootSignature` refusal (the "Unsupported bit-flag set" from Windows 10's d3d12core) and retries without the two 1.1 heap-indexing flags. If #626 additionally covers `CreateRootSignature` failure, the two are complementary, not conflicting — happy to drop my host.rs change entirely if #626 lands first and maintainers prefer one path.
Zilumz1 commented 2026-11-24 09:06:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Zilumz1 on 2026-11-24T08:30:02Z.


Tested 7c01e3d on Windows 10 Pro + AMD Radeon RX 580 2048SP (Polaris), driver 31.0.21925.1001, Rust 1.98.1, MSVC 14.44, in-box D3D12 runtime (no Agility SDK). No title run, only the synthetic checks below.

Tests: cargo test -p victory-hle -p victory-gpu --no-fail-fast -- --test-threads=1

  • victory-gpu: 43 passed, 0 failed, 1 ignored
  • victory-hle: 85 passed, 1 failed. The new get_max_users assertion passes inside startup_adds_the_user_and_reads_its_id. The one failure is net::tests::only_loopback_is_reachable (winhttp.dll lacks WinHttpGetProxySettingsEx). That's the Windows 10 net test fixed on main by #152, which isn't on this branch's base (d2a4bae), so it's unrelated to this PR. A rebase should clear it.

The root-signature error reproduces on this host. Empty 1.1 signature, D3D12SerializeVersionedRootSignature on the in-box runtime:

Flags Result
0x601 (input layout + both heap-indexing flags, as root_signature() builds it) 0x80070057 "Unsupported bit-flag set (root signature flags 601)."
0x001 (input layout only, the retry) S_OK

So the fallback does serialize where the original doesn't.

One question about the fallback. The translated shaders reach their descriptors through SM 6.6 ResourceDescriptorHeap[] / SamplerDescriptorHeap[] (createHandleFromHeap, emit/mod.rs:17-21). As I understand the D3D12 rules, a PSO whose shaders index the heaps needs a root signature with *_HEAP_DIRECTLY_INDEXED. So on a host where the retry kicks in, does pipeline creation then get refused instead, or do the menu's pipelines not use heap indexing? I haven't measured this, since I don't run the title. If they do, the Agility SDK route (#463 for victory.exe, #486 for the tests) would be the fix, and the retry would only move the failure into PSO creation. The extra fields in the host pipeline refused warning would show that either way.

The same flags are also set in crates/victory-shader/src/emit/host.rs:191, which this PR doesn't touch.

AI-assisted; the results above are real runs on my machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7126209625 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/623#issuecomment-7126209625). Originally posted by [Zilumz1](https://github.com/Zilumz1) on 2026-11-24T08:30:02Z. --- Tested `7c01e3d` on **Windows 10 Pro + AMD Radeon RX 580 2048SP (Polaris), driver 31.0.21925.1001**, Rust 1.98.1, MSVC 14.44, in-box D3D12 runtime (no Agility SDK). No title run, only the synthetic checks below. **Tests:** `cargo test -p victory-hle -p victory-gpu --no-fail-fast -- --test-threads=1` - `victory-gpu`: 43 passed, 0 failed, 1 ignored - `victory-hle`: 85 passed, 1 failed. The new `get_max_users` assertion passes inside `startup_adds_the_user_and_reads_its_id`. The one failure is `net::tests::only_loopback_is_reachable` (`winhttp.dll lacks WinHttpGetProxySettingsEx`). That's the Windows 10 net test fixed on main by #152, which isn't on this branch's base (`d2a4bae`), so it's unrelated to this PR. A rebase should clear it. **The root-signature error reproduces on this host.** Empty 1.1 signature, `D3D12SerializeVersionedRootSignature` on the in-box runtime: | Flags | Result | |---|---| | `0x601` (input layout + both heap-indexing flags, as `root_signature()` builds it) | `0x80070057` "Unsupported bit-flag set (root signature flags 601)." | | `0x001` (input layout only, the retry) | `S_OK` | So the fallback does serialize where the original doesn't. **One question about the fallback.** The translated shaders reach their descriptors through SM 6.6 `ResourceDescriptorHeap[]` / `SamplerDescriptorHeap[]` (`createHandleFromHeap`, `emit/mod.rs:17-21`). As I understand the D3D12 rules, a PSO whose shaders index the heaps needs a root signature with `*_HEAP_DIRECTLY_INDEXED`. So on a host where the retry kicks in, does pipeline creation then get refused instead, or do the menu's pipelines not use heap indexing? I haven't measured this, since I don't run the title. If they do, the Agility SDK route (#463 for `victory.exe`, #486 for the tests) would be the fix, and the retry would only move the failure into PSO creation. The extra fields in the `host pipeline refused` warning would show that either way. The same flags are also set in `crates/victory-shader/src/emit/host.rs:191`, which this PR doesn't touch. AI-assisted; the results above are real runs on my machine.
Zilumz1 commented 2026-11-24 09:06:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Zilumz1 on 2026-11-24T08:36:59Z.


Follow-up to my question above: measured, not guessed. Same machine (Windows 10 Pro, RX 580 / Polaris, driver 31.0.21925.1001), main at ba7d873.

I added a temporary test to emit/valu_tests.rs (not committed). It lowers a real synthetic GFX10 compute shader through the normal pipeline (build_valu_cs, a v_mov_b32 + raw UAV store, so the DXIL is cs_6_6 with createHandleFromHeap). Then it creates its root signature and compute PSO directly on the hardware device, once with the heap-indexing flags and once without (#623's fallback):

Runtime Highest SM With *_HEAP_DIRECTLY_INDEXED Without (#623 fallback)
In-box (Windows 10) 0x65 root signature refused, 0x80070057 root signature OK, PSO refused 0x80070057
Agility SDK 1.620.2 (#486 opt-in) 0x66 root signature OK, PSO OK root signature OK, PSO refused 0x80070057

So on Windows 10 the retry only moves the failure from root-signature serialization into PSO creation. The menu would still drop its draws, just with a "host pipeline refused" warning instead of a root-signature one. Even on a host that does have SM 6.6, the PSO without the flags is refused, because the shaders index the heaps.

What actually works on this machine is shader model 6.6 through the Agility runtime, with the flags kept: #463 for victory.exe, #486 for the tests.

Suggestion for #623: keep the get_max_users fix (the crash) and the extra host pipeline refused fields. Drop the root-signature retry, or have it log a clear "this host lacks SM 6.6 / the Agility runtime" error instead of retrying. I can share the probe test if useful.

AI-assisted; the results above are real runs on my machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7126350973 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/623#issuecomment-7126350973). Originally posted by [Zilumz1](https://github.com/Zilumz1) on 2026-11-24T08:36:59Z. --- Follow-up to my question above: **measured, not guessed.** Same machine (Windows 10 Pro, RX 580 / Polaris, driver 31.0.21925.1001), `main` at `ba7d873`. I added a temporary test to `emit/valu_tests.rs` (not committed). It lowers a real synthetic GFX10 compute shader through the normal pipeline (`build_valu_cs`, a `v_mov_b32` + raw UAV store, so the DXIL is `cs_6_6` with `createHandleFromHeap`). Then it creates its root signature and compute PSO directly on the hardware device, once with the heap-indexing flags and once without (#623's fallback): | Runtime | Highest SM | With `*_HEAP_DIRECTLY_INDEXED` | Without (#623 fallback) | |---|---|---|---| | In-box (Windows 10) | `0x65` | root signature refused, `0x80070057` | root signature **OK**, PSO **refused** `0x80070057` | | Agility SDK 1.620.2 (#486 opt-in) | `0x66` | root signature OK, **PSO OK** | root signature OK, PSO **refused** `0x80070057` | So on Windows 10 the retry only moves the failure from root-signature serialization into PSO creation. The menu would still drop its draws, just with a "host pipeline refused" warning instead of a root-signature one. Even on a host that does have SM 6.6, the PSO without the flags is refused, because the shaders index the heaps. What actually works on this machine is shader model 6.6 through the Agility runtime, with the flags kept: #463 for `victory.exe`, #486 for the tests. Suggestion for #623: keep the `get_max_users` fix (the crash) and the extra `host pipeline refused` fields. Drop the root-signature retry, or have it log a clear "this host lacks SM 6.6 / the Agility runtime" error instead of retrying. I can share the probe test if useful. AI-assisted; the results above are real runs on my machine.
upstream-sync closed this pull request 2026-11-25 01:04:31 +00:00
Marvisak commented 2026-11-25 01:07:47 +00:00 (Migrated from github.com)
Author
Contributor

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


Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #626.

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:7148509305 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/623#issuecomment-7148509305). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:26:17Z. --- Automated triage for the maintainers. Closing because another open pull request covers the same change. See #626. 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!623
No description provided.