Linux: a native runtime, no Wine #526
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!526
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/526/head"
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?
@spidercraft on GitHub · 2026-11-24 04:27 UTC · original
spidercraft:linux-native-runtime→main· +38365 −1640 · 155 files · 71 commits · closed without mergingWhat
A native Linux build of the runtime:
victory run <exe> --executeruns the title as an ELF program, with no Wine and no Windows DLL. The title's x86-64 code still runs unchanged in our process; on Linux we also supply what the Windows loader, kernel and system DLLs supply on Windows. The Windows build is unchanged (it type-checks with no diagnostics after every commit here). The design, the rules each part follows and the status are indocs/linux.md.Builds on #523 and #524 (their commits are the first two here) and includes #177's commits, the fix for image atomics on float-read textures that NVIDIA's compiler crashed on (with the test from #226).
Where things live
victory-loader/src/linux/{image,teb,tls,thread}.rsEXCEPTION_RECORD/CONTEXT,.pdatadispatcher and unwinder, host frames between title frames, crash reportvictory-loader/src/linux/{seh,signals,unwind,context,asm}.rsVirtualAlloc(64 KiB granularity, guard pages, placeholders, memfd physical pool)victory-loader/src/linux/vm.rsHostPolicypasses through on Windows: kernel32/ntdll (handle table, waits, locks, threads, thread pool, time, memory, heap, files, text), the UCRT, ws2_32/winhttp (offline), bcrypt, crypt32, advapi32, COM, user32, XAudio2, Spatial Audio, Media Foundation stubsvictory-hle/src/linux/<dll>_<slice>.rs, found byhost::imp::resolveon Linuxvictory-hle/src/modules/*(per-OS host functions only where they differ)windows0.62 does not build on Linux)victory-gpu,victory-shader,crates/victory-windowsThe title-facing ABI is
win64everywhere (#524); the CRT-style exports (exit, the CRT file functions) wereextern "C"and are fixed here too.How to run
docs/linux.md: build vkd3d-proton natively (meson), pointVICTORY_VKD3Dat it; optionally Microsoft's DXC Linux release forVICTORY_DXIL/VICTORY_DXCOMPILER(Arch'sdirectx-shader-compiler1.10.2605 asserts on every shader). SDL3 and the Vulkan loader come from the distribution.Tested
Linux (CachyOS, Ryzen 9 7950X3D, RTX 5090, NVIDIA 620.73):
cargo test --workspace: 416 passed, 0 failed, 12 ignored, without game data. Guest code under test is PE fixtures we build withlld-linkagainst an xwin SDK (skipped without it): the loader probe, an SEH fixture (__try/__exceptaround real faults, C++ throw/catch/rethrow across threads, unhandled-fault report), and device tests withVICTORY_VKD3D(compute, clear and readback, pipelines from translated shaders, 120 frames to a window).cargo check --workspace --all-targets --all-features --target x86_64-pc-windows-msvc: no diagnostics.victory translate --validateover the title's shaders on Linux: the same validated counts as the validator reports there; every emitted vertex, pixel and mesh program makes a pipeline.Two fixes found on Linux that also concern Windows
victory-loader/src/linux/{vm,watch}.rs, the GPU journal invictory-gpu/src/watch.rsshared): world copies of title memory fell from 6-11 GB to 0.2-0.4 GB a frame (0.6 to 1.1-1.8 fps). Overlaps the Windows-side work in #464 and #490 only invictory-gpu/src/watch.rs.victory-shader/src/emit/lower.rs): a compute program in the world load computes raw offsets that wrap to near 2^32; the console reads 0 there, while on vkd3d-proton/NVIDIA the access hit an MMU fault (kernelXid 13), the channel stopped and the submission's fence never signalled, which is what stalled most world loads (before: 4 of 5 runs ended by the title's watchdog; after: none in 9). Offsets are now kept at or below0x7FFF_FFF0(still past any view: reads give 0, writes drop). The same commit bounds root SRV reads by their host buffer's length, which overlaps #493 (root SRVs as bounded one-view tables); if #493 lands first this part can go.Not done yet
No game data in the repository, the tests or this description.
🤖 Generated with Claude Code
@KoLolX3 on GitHub · 2026-11-24 05:35 UTC · original
Check on Linux, not Windows: pass. Head
323168050merged ontomaind2a4bae1f(clean merge).core,formats,game,loader,pe,pipeline,shader): PR140 passed, 0 failed,main92 passed, 7 failed. The 7 tests that fail onmainno longer fail.cargo check --workspace --all-targetsok andcargo test --workspaceok: 412 passed, 0 failed, 12 ignored. Onmainthe same check fails to build (3 errors). Only the test run, not the new native runtime itself (no game, no GPU host).cargo xwin check --workspace --target x86_64-pc-windows-msvc, coversvictory-gpu,victory-hleand the app): PR ok,mainok.cfg(windows)modules, thevictory-gpuandvictory-hlecrates, or ignored tests), and were not run.main168.mainhere as well (not this PR): 7 tests invictory-loaderandvictory-pethat parse their own test binary as a PE image, which is an ELF file on Linux.victory-gpu/victory-hletests and the game itself.On: AMD Ryzen 7 5700, 62 GB RAM, Artix Linux 7.3.4-artix1-2, rustc 1.98.1 (the repo's pinned toolchain), cargo-xwin 0.24.1. No game data. Automated check only: the code itself was not reviewed.
@cobrabm12 on GitHub · 2026-11-24 10:10 UTC · original · edited 2026-11-24 10:23 UTC
Linux hardware test on an 8 GB Radeon RX 7600 (Navi 33), Mesa RADV 26.2.5, SDL 3.4.18. I built the Linux runtime at
d46727f, native vkd3d-proton at 30b0eb9bc12d and used Microsoft's Linux DXC v1.9.2609. I used the default Series X profile and a local save that had completed first-boot setup. The native runtime used its own storage implementation.The account picker responded to keyboard input. The illustrated load advanced to the “Vice City, Two Years Ago” chapter card. The runtime logged 240 successful mesh pipeline creations before I stopped the run. In four successive intervals during the transition it reported 0.9, 0.5, 0.9 and 1.0 fps. The final visible frame was black. Player movement and a visible world remain unverified.
On the same PC, the Windows runtime at
ffe310eunder Wine 11.21 exited at the first mesh pipeline, both with the default storage implementation and with a Leonida provider. Across these tests the graphics software versions also differ, so this comparison identifies a working route to the chapter card without establishing the cause of the difference.CPU validation of the shaders used in this run
I matched all 1,257 distinct shader containers seen during startup, loading and the first scene to the local installation. For each build I called the same translator as the native runtime and checked every emitted module with Microsoft's Linux DXIL validator (DXC v1.9.2609).
d46727fAll 958 baseline successes still validated. Of the 45 additional successes, 37 were compute, six pixel and two mesh shaders. On the #180 + #193 build, applying the signature ordering change alone cleared the remaining mesh output-signature error. The #704 integration also includes its descriptor-heap prerequisites
cbb50b8,3c81420ande8d3b64and builds natively. Rendering and frame rate on that build are still unverified.@onpeek on GitHub · 2026-11-24 16:58 UTC · original
Ran GTA VI on this branch natively (RTX 4070, Arch) and hit three bugs. Fixes against
linux-native-runtimeare in spidercraft/VIctory#2:GetProcAddressreturned null for title DLLs mapped by our PE loader. GTA VI's FidelityFX loader looks upffxCreateContextinamd_fidelityfx_upscaler_xbox.dlland calls it, so the game crashed about 4 s in (call to 0x0). With the fix it gets past the menus to the world load.cas16(cmpxchg16b) could get rbx as anin(reg)operand, which the manual rbx swap then clobbered. The SList tests segfaulted. Fixed registers now.host_and_guest_blocks_mixwas flaky under parallel tests (it read an uninitializedmallocbyte and used a wrong upper bound).@toothpaste011 on GitHub · 2026-11-24 15:57 UTC · original · edited 2026-11-24 17:23 UTC
Tested
linux-native-runtime(d46727f) on Gentoo (kernel 7.0.10, Niri/Wayland, Intel Core Ultra 7 265K, RTX 5070 Ti, native vkd3d-protonec20719452e916b, Microsoft Linux DXC v1.9.2609).Intel CPU boot crash (
0xc000001d/SIGILL)On Intel CPUs, boot traps immediately with an unhandled
0xc000001d(SIGILL) onclzero(0f 01 fc) becausecrash.rs::emulate_amd_only(clzero,monitorx/mwaitx,clwb, SSE4aextrq/insertq) isn't ported tovictory_loader::linux::signalsyet.Opened a fix against
linux-native-runtimein spidercraft/VIctory#3 (handlesSIGILLdirectly onucontext_t, collapsesclzeroloops, updates XSAVExstate_bvbit 1 for SSE4a, and adds syntheticucontext_tunit tests so AMD hosts and CI exercise every branch alongside the live-execution test).Hardware results after the fix (RTX 5070 Ti, Wayland/Niri)
1.2–2.6 msGPU; DXC indirect argument clamp compiles and runs).116host pipelines refused by vkd3d-proton (Required WaveSize range [64, 64], but supported range is [32, 32]).1xWARN victory_gpu::descriptor::host: no free dynamic descriptor slots: a table is not made n=7on world entry.@x3ero0 on GitHub · 2026-11-24 19:27 UTC · original
Test report for
d46727fon NVIDIA, with every run inside a bubblewrap sandbox. (I left the review comment aboutlistenearlier; the fix for that is spidercraft/VIctory#1.)Setup: RTX 5080, driver 620.70, Ryzen 7 9800X3D, CachyOS (kernel 7.3.5), KDE Wayland, SDL3 on Wayland. Native vkd3d-proton built from
30b0eb9. Diagnostics build, Series X 1.0.2.1, an existing local save, menus driven byVICTORY_KEYS.Sandbox:
bwrap --unshare-all --clearenv, no network namespace beyond loopback, no home directory, the game folder read-only, only the cache and data folders writable, the Wayland socket and the NVIDIA device nodes bound. The runtime needs nothing else. Audio was not exposed, sopa_simple_newfails and it plays silently, as designed.Build and tests
runmaps and binds with 0 missing imports.cargo test --workspace: 416 passed, 0 failed.linux::vm::tests::physical_pages_map_alias_and_freefailed once in five full-workspace runs (region_size65536, expected 196608 atvm.rs:1875) and passed alone six times in a row. It looks order- or parallelism-dependent; I have not looked into it.Title runs
0xc0000005atgame_scarlett_master.exe+0xc4b94e(write0x670fc04), in the worldVICTORY_DXCOMPILER)main+ #177 + #259 under GE-Proton on the same machine stops about a minute into the world at the title's+0x23cf683(#1118). None of the native runs hit that in up to six minutes of world time.What the log gives as causes
not bounded (no clamp...)Required WaveSize range [64, 64], but supported range is [32, 32]no host texture(2560x1440, formats 86 and 115)host view heap capped at 1000000, asked 12451840x1c8and0x218With DXC the indirect draws run, more of the title's pipelines get requested (hence the higher counts), frames get slower (mean 2.2 fps against 3.2 in run 4), and the scene is still dark. So on this card the missing picture is not the dropped indirect execution.
On the DXC dependency: without
VICTORY_DXCOMPILERevery indirect execution is dropped, and Arch's package is unusable asdocs/linux.mdsays. #190 builds the same clamp with the shader crate's own writer, so merging or rebasing onto it would remove the need for a compiler here too. I tried that design on this branch: with the clamp emitted that way and no DXC, a run reaches the world with zeronot boundeddrops.Single machine, one GPU, runs of a few minutes; I did not play past the opening sequence.
@ -0,0 +414,4 @@let fd = fd_or_fail!(s);// SAFETY: plain call on our descriptor.if unsafe { libc::listen(fd, backlog) } != 0 { os_fail() } else { 0 }}@x3ero0 on GitHub · 2026-11-24 16:04 UTC · original
listengoes straight to the kernel, and Linux binds an unbound socket to all interfaces at that point (0.0.0.0and a port it chooses), so other machines can connect in. That gets around the narrowingbinddoes. Winsock returnsWSAEINVALforlistenon an unbound socket, so refusing it here matches Windows.The same happens with a first
sendtofrom an unbound datagram socket: it is bound to0.0.0.0and can then receive datagrams from the network.spidercraft/VIctory#1 fixes both against this branch, with a test:
listenfails withWSAEINVALunless the socket has a loopback address, andsendtobinds an unbound datagram socket to loopback first.@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).
Native Linux runtime, 38,000 lines over 155 files (own loader, SEH, a new crate with a build script, libc and serde_json, a docs/linux.md design document, an edit to xtask/src/policy.rs): a port, out of scope.
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.
github-bot referenced this pull request2026-11-26 11:08:22 +00:00
Pull request closed