Fix Windows 10 Game-Init crash and root-signature fallback #623
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/623"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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.
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!
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.
Imported from Marvisak/VIctory. Originally posted by bittertea0323 on 2026-11-24T06:29:20Z.
Thanks for the review — all three points addressed in
7c01e3d.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+0xb5a5f8fault), so the S_OK change was speculative and it broke the pinned test. Reverted, test passes again.Unit test added for
get_max_users(slot 0x30): assertsout == 1andS_OK, in the same style as the existing slot tests.cargo test -p victory-hle modules::xuseris green.Root signature fallback vs #626: mine handles the
D3D12SerializeVersionedRootSignaturerefusal (the "Unsupported bit-flag set" from Windows 10's d3d12core) and retries without the two 1.1 heap-indexing flags. If #626 additionally coversCreateRootSignaturefailure, the two are complementary, not conflicting — happy to drop my host.rs change entirely if #626 lands first and maintainers prefer one path.Imported from Marvisak/VIctory. Originally posted by Zilumz1 on 2026-11-24T08:30:02Z.
Tested
7c01e3don 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=1victory-gpu: 43 passed, 0 failed, 1 ignoredvictory-hle: 85 passed, 1 failed. The newget_max_usersassertion passes insidestartup_adds_the_user_and_reads_its_id. The one failure isnet::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,
D3D12SerializeVersionedRootSignatureon the in-box runtime:0x601(input layout + both heap-indexing flags, asroot_signature()builds it)0x80070057"Unsupported bit-flag set (root signature flags 601)."0x001(input layout only, the retry)S_OKSo 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 forvictory.exe, #486 for the tests) would be the fix, and the retry would only move the failure into PSO creation. The extra fields in thehost pipeline refusedwarning 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.
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),
mainatba7d873.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, av_mov_b32+ raw UAV store, so the DXIL iscs_6_6withcreateHandleFromHeap). 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):*_HEAP_DIRECTLY_INDEXED0x650x800700570x800700570x660x80070057So 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_usersfix (the crash) and the extrahost pipeline refusedfields. 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.
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.
Pull request closed