|
|
16 ساعت پیش | |
|---|---|---|
| .. | ||
| README-fxceless.md | 1 روز پیش | |
| architecture.md | 1 روز پیش | |
| asset-policy.md | 1 روز پیش | |
| bug-journal.md | 16 ساعت پیش | |
| findings.md | 1 روز پیش | |
| fork-ray-tracing.md | 1 روز پیش | |
| replay.md | 1 روز پیش | |
This is the README of fxceless/victory-fork as this fork had it, kept for its description of upstream, the commands and the debugging switches. What it says of speed and state is of that fork and another PC; this fork: README.
A work-in-progress fork of VIctory, a
compatibility layer that runs an Xbox Series title natively on Windows from
files the user supplies. This fork follows upstream
main and adds fixes aimed at one goal: getting the game's world to render
correctly and playably on one particular PC.
This repository contains no game files, code or assets. You need your own copy of the game. It is not affiliated with or endorsed by the game's developer or publisher.
c6dc4d8), which
adapts pull request #115 here by Spexivus, its correction by joroyt and a part of
VIctory #1122 by tightfall. The read-beside fix for kernel reads into title
memory is by Joshua Odom (commit 10ea38e of the same fork family). Both
are carried here unchanged apart from one merge conflict.Not playable yet: 2.5 to 4 frames per second, and shadowed areas are black. Tested on one machine: Windows 11, Intel i7-14700KF, NVIDIA RTX 4070 12 GB, 32 GB RAM. The Series X profile is used throughout.
| Stage | State in this fork |
|---|---|
| Boot, menus, start screen | works, 30 fps (as upstream) |
| Opening cutscene | plays from start to finish, in order, lit: title cards, credits cards, night and dusk shots |
| Saves | the game autosaves a checkpoint and loads it again |
| First gameplay scene (the prologue) | renders: characters, textures, sky, sunlit exterior; HUD, pause menu and pad input work |
| Light in shadow | missing: the game's ray-traced bounce light and ray-traced lamp and sun shadows do not run yet, so anything the sun does not hit directly is black |
| Frame rate in the world | 2-4 fps: 420-450 ms per frame by default, 240-350 ms with the newer switches (VICTORY_RELAY=2, or VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024); it started at 3-6 seconds per frame |
| Stability | no driver hang or device loss in normal runs (a hang introduced by the wave64 update was found and fixed: its barrier form for 64-lane programs is now off unless VICTORY_WAVE_WIDE=1) |
Update, the same night: the first room now renders right on the test machine (walls, textures, people, lamps), at 190 to 450 ms a frame (2 to 5 frames a second): the picture work has caught up, the frame rate has not. What did it, on top of the list below:
86a5ed6). Measured here: about 40,000 records a frame
that no call had announced; their host slots were empty or stale.86a5ed6): 3 to 6 such views a frame.VICTORY_LEVELS_ON_DEMAND=1, still off by default; with the fixes of
pull request #747 by AscilCH): 3.1 GB of the card not allocated for
texture levels the title does not hold, no device loss.Memory sync between the title's memory and the copies on the card:
VICTORY_VIEW_GUARD=0 turns it off). The title
shows one page at several addresses and a copy was guarded at one of them
only. Measured on the test machine: 0.8 to 1.0 million such writes in a
five-minute run, every one of which used to leave a copy stale. Since it
went in, the first room had its walls in the later frames of 4 runs out of
4 (2 of 5 before); the room's very first shot still comes up without walls
in some runs.VICTORY_PAGE_WRITES=guards (off by default; 1, slots, all do more).VICTORY_DSTORAGE_RETRIES=0 = as before).Card memory (the test card is full from the first frame of the world: 85 to 99 % of its budget for a whole run, about 26,000 texture copies let go and 3,400 made again in five minutes, 2.8 GB of render targets that are all in use):
VICTORY_LEVELS_ON_DEMAND=1): a
texture the title fills takes card memory only for the levels the title
holds (2.2 to 3.0 GB of the copies were levels it does not hold). Its test
runs on the software adapter; it has not run on a card yet.VICTORY_FULL_CARD_PASS=0 = as before);
room can be kept for the card copies of title buffers
(VICTORY_CARD_ROOM_FOR_BUFFERS=1, off).Tools and diagnostics:
victory translate <shader file> --warm all --jobs N translates every
shader ahead of a run, on the processor only (about 4.5 to 6.5 minutes
here); the shader cache is keyed on the translator's source, so a new
build that does not touch the translator starts warm.VICTORY_MERGE_RACE=1 (title bytes
a copy-back is about to put back to older values: none found in 138,000
copy-backs), VICTORY_WALLS_TRACE, VICTORY_CARD_ACCOUNTING, and a census
of the copies the texture sweep never lets go.Rendering:
Speed and memory:
VICTORY_LATE_WAIT), with a relay thread that lands results as the card finishes (VICTORY_RELAY): in a first five-minute run the card's idle time behind the submitting thread fell from about 136 to 30 ms per frame.VICTORY_WIDE_REFRESH=0 disables this; =1 forces it). This targets the serial memory reads that previously cost about 45–50 ms per frame on the test run.VICTORY_INPLACE, first stage only; a probe confirmed the approach on the test GPU).An intermittent device loss was traced to the pipeline library file being replaced while mapped; fixed.
Translated shaders get clean-up passes over the finished module (dead code, constant folding, reuse of values, branch facts); the pack's host instruction count falls by about 43 %, worth about 20 ms of GPU time per frame on the test machine (VICTORY_SHADER_OPT=0 turns them off).
Most of the newer speed changes sit behind environment switches that are off
by default (VICTORY_LATE_WAIT, VICTORY_RELAY, VICTORY_WIDE_BACK,
VICTORY_CARD_BUFFERS_MIN_MB, VICTORY_INPLACE, VICTORY_BVH_BUILDER, ...).
Independent host-copy refreshes are the exception: they use parallel workers
automatically on systems with at least four logical CPUs. Each switch is
described in a comment where it is read.
Cargo.toml until the newer code is tidied.shortcut: in the code where they approximate what the console does.Everything below this line is upstream VIctory's own README, unchanged; its status section describes upstream, not this fork.
Runs the title (Xbox Series X|S) natively on Windows, from files the user supplies.
The title's x86-64 code runs unchanged inside our process; VIctory supplies the platform underneath it and converts the title's data, ahead of time where it can (shaders and pipelines too, see Getting started) and on first use otherwise. See docs/architecture.md.
Not playable yet. The title boots, runs its menus at its own 30 fps, loads the world and shows it: slowly, and with rendering defects.
| Stage | State |
|---|---|
| Boot, first-boot screens (accessibility, language, settings, legal) | works, 30 fps |
| Intro video with sound | works |
| Start screen, profile and saves | works |
| Loading into the world (about 50 s) | works |
| The world (first mission's intro) | drawn and shown: streets, buildings, vehicles, characters, the title card and credits; 1-2 s per frame. Surfaces are unlit, a band of distant geometry is missing, characters come out broken in some shots |
Tested on one machine: Windows 11, AMD RX 6700 XT.
Warning. Entering the world on a real GPU has hung it in earlier builds, and Windows then resets the display driver (every monitor goes black for a moment). The latest runs did not, but it is not ruled out; a run can also end on a GPU fault (
crashes.log). A diagnostics build withVICTORY_D3D12_WARP=1renders on the software adapter instead (too slow to reach the world in minutes).
What each part does today and what it still needs:
| Subsystem | Today | Needs |
|---|---|---|
| Loader | Runs the title's executable and its DLLs in our process; crash reports name the faulting code and are kept in crashes.log |
– |
| Runtime services | One signed-in offline user, licences, packages, saves that survive a kill at any step, text entry dialog | Speech is silent; the dialog and relaunch are untested live |
| Network | Offline by design: the title cannot reach the network | – |
| Files and streaming | Archives and streamed data read, zlib and BCPack decoded in parallel | Loading is limited by writes into title memory |
| Input | XInput pads, keyboard, keyboard stand-in pad | Trigger rumble |
| Audio | Menu, video and loading sound; XMA voices and Opus streams decode | Reverb is silent; Opus results unverified against the title |
| GPU: menus | Draws, compute and presentation on host D3D12; only changed title memory is copied | Frame pacing drifts on one screen in release builds |
| GPU: world | The scene is drawn and presented: mesh pipelines, indirect execution, views the shaders pick from the heap themselves, title memory read by address (ray-tracing structures), depth written from compute, pipelines pre-built or made by worker threads and kept on disk | Lighting (surfaces are unlit) and some missing geometry; frames take 1-2 s; draws of untranslated shaders are dropped; real queries, depth bounds, HDR and scaling are missing |
| Shaders | Console GPU code recompiled to DXIL, ahead of time (translate --cache) or at first use, cached on disk. Menus: all. World: mesh 8,765 of 8,765, vertex/pixel 12,550 of 12,592, compute 2,579 of 2,637 |
Merged geometry stages (195 programs) and about 100 others; fused multiply-adds follow the host GPU; some compute programs need a GPU with 64-lane waves |
| Textures | Console tiled layouts and detiling for the modes the title uses | Render-target metadata planes |
| Series S mode | Runs through the menus to the loading screen | The world, as above |
Requirements: Windows 10/11 x64, a CPU with AVX2, a Direct3D 12 GPU with
shader model 6.6 (and mesh shaders for the world), Rust (pinned in
rust-toolchain.toml).
To install Rust, use rustup (winget install --id Rustlang.Rustup -e, or
the installer from https://rustup.rs). The first cargo command in this
repository then fetches the pinned toolchain. Building needs the MSVC C++
build tools: Visual Studio or its Build Tools with the "Desktop development
with C++" workload.
The title also needs several GiB of available Windows commit at startup.
Check Committed under Task Manager → Performance → Memory. If
crashes.log reports Windows error 1455, close other applications or increase
the Windows paging file size, then retry.
cargo xtask install-hooks # asset-policy check on every commit
copy victory.example.toml victory.toml # then set your paths (outside the repo)
cargo test --workspace # needs no game data
cargo run -p victory -- config # check your paths
Run the title:
cargo build --release -p victory
target\release\victory.exe run <game dir>\<the title's exe> --execute
The window caption shows the framerate. Saves, settings and crashes.log
are kept under the data folder (default %LOCALAPPDATA%\victory\data), derived
data under the cache folder.
Set VICTORY_WINDOW_MAX=1920x1080 before launching to limit the title's
top-level window to that bounding box. Smaller windows keep their size,
larger windows keep their proportions, and the monitor's work area still
limits them. This scales the displayed image; it does not change the
console render resolution or the swap-chain buffers. With the variable
unset, window sizing is unchanged.
Input: XInput pads. With none connected the keyboard is a pad while the title's window has focus:
| Keys | Pad |
|---|---|
| W A S D / I J K L | left / right stick |
| arrows | D-pad |
| Enter, Backspace, X, Y | A, B, X, Y |
| Q / E, Z / C | shoulders, triggers |
| F / H | stick clicks |
| Esc, Tab | Menu, View |
victory inspect <exe|dll> [--imports] [--exports]
victory census [paths...] [--missing] [--strict]
victory lib-exports <import.lib> [--list]
victory shader-info [paths...] [--verbose] [--disasm]
victory translate [paths...] [--validate] [--pipelines] [--list] [--jobs N]
victory run <exe> [--execute] [--unimplemented trap|zero] [--strict]
[--console series-x|series-s] [-- <title arguments>]
victory config
Logging: VICTORY_LOG=victory_loader=trace,info (a release build logs
info and above).
The shader tests use dxil.dll to validate Shader Model 6.6 containers.
An older Windows SDK validator can load successfully but reject them with
Unknown shader model 'ps_6_6'. If this happens, use a current x64 validator
from Microsoft's DirectX Shader Compiler releases
or a current Windows SDK. Set its path for the test session:
$env:VICTORY_DXIL = 'C:\tools\dxc\bin\x64\dxil.dll'
cargo test -p victory-shader --lib --locked -- --test-threads=1
Without this override, the validator loader selects the newest installed
Windows SDK's bin/<version>/x64/dxil.dll, then falls back to the DLL search
path when no SDK copy is found. This is a test/offline-validation dependency;
the translated shaders do not require it at runtime.
A release build has no debugging aids. Build them in with
cargo build --profile diag -p victory --features diagnostics # target\diag\victory.exe
The on/off switches below (...=1) are off when unset or set to 0.
| Variable | Effect |
|---|---|
VICTORY_LOG=<target>=debug,... |
debug and trace output |
VICTORY_STACKS=20,60 |
every thread's stack at those seconds |
VICTORY_WATCH=<rva>,... |
logs a title u32 when it changes |
VICTORY_POKE=<rva>:<byte>,... |
writes a title byte twice a second (a hang watchdog's tick, say) |
VICTORY_KEYS=30:Enter,35:X |
presses keys at those seconds, focus or not |
VICTORY_CRASH_SAVE=<rva>:<len>,... |
saves title memory to the cache folder on a crash |
VICTORY_CAPTURE=<dir> |
saves presented frames (powers of two, or VICTORY_CAPTURE_FRAMES=<list>) |
VICTORY_DUMP_TARGETS=1 |
with the two above, saves every render target of those frames |
VICTORY_D3D12_DEBUG=1 |
host debug layer |
VICTORY_D3D12_GBV=1 |
with the above, GPU-based validation (bad descriptor use reported, not faulted; slow) |
VICTORY_D3D12_DRED=1 |
on a GPU failure, the allocation hit and the commands in flight |
VICTORY_PIPELINE_WAIT_MS=24 |
reduce the per-frame wait for background pipeline creation from the default of 500 ms. A draw can be omitted until its pipeline is ready |
VICTORY_SKIP_PIPELINES=<hash>,... |
omit draws and dispatches, including indirect ones, whose pipeline contains a listed 16-digit shader hash |
VICTORY_GPU_TIMING=1 |
with the above, each list of a submission run and timed on its own; slow lists logged with their slowest commands |
VICTORY_D3D12_WARP=1 |
host device on the software adapter (slow; cannot reset the driver) |
VICTORY_SHADER_LOOP_LIMIT=<n> |
translated shader loops stop after n iterations per lane instead of 2^20 (own shader cache entries); if a lower n makes world frames much faster, loops hitting the limit are what makes them slow |
VICTORY_AUDIO_CAPTURE=<file.wav> |
records what the title plays (our process only) |
VICTORY_XMA_DUMP=<dir> |
saves the first 32 XMA voices' context and input |
Every build appends crashes and host GPU failures to crashes.log in the
title's data folder.
GPL-3.0-or-later. See LICENSE.