Read-only copy of github.com/xavisauque1/victory-sauque1
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-12-03 23:07:38 +01:00
.cargo
.githooks
.github/workflows
apps/victory
crates
docs
scripts
tests/fixtures/hle-probe
xtask
.gitattributes
.gitignore
.victory-root
Cargo.lock
Cargo.toml
LICENSE
README.md
rust-toolchain.toml
rustfmt.toml
victory.example.toml

victory-sauque1

victory-sauque1 is an experimental Xbox Series X|S (Scarlett) user-mode compatibility layer and D3D12.X-to-D3D12 translation runtime written in Rust. This fork focuses on pushing real-world playability, CPU/PCIe pipeline throughput, visual correctness, and AMD RDNA 3 stability on modern Windows 11 PC hardware.

Legal Notice: This repository contains original Rust translation and runtime source code only. No game assets, encryption keys, copyrighted binaries, Xbox system files, or proprietary AMD SDK DLLs are hosted, distributed, or linked here. Users must supply their own legally obtained files locally.


Current Progress & Milestone Status

Tested on AMD Ryzen 7 5800X / Radeon RX 7800 XT (16 GB VRAM) / 48 GB DDR4-3000 / Windows 11 (RDNA 3):

Milestone Status Notes
Executable Loads & Boots Achieved PE loader, HLE bindings, and D3D12.X runtime initialization
First Frame Rendered Achieved Native D3D12 swap chain presentation with Scarlett XOR texture deswizzling
Main Menu & UI Achieved Responsive profile selector, menus, and HUD rendering
In-Game (Exteriors & Interiors) Achieved Playable driving in dense city traffic, NPC interactions, and interior shops with fixed HDR exposure
15–30 FPS Target In Progress Currently ~7–10+ FPS in dense city scenes; CPU-bound in the submission thread (victory-queue-behind)
Long-Session Stability In Progress Multi-minute city & interior runs without TDR (0x887A0006) or memory faults

Key Engineering Improvements in This Fork

1. RDNA 3 Stability & Visual Accuracy

  • Interior HDR Auto-Exposure Fix: Preserves deferred readback ranges (deferred.backs) for small luminance/exposure targets (5×1 / 1×1), eliminating blown-out white flashes and overexposure inside buildings and doorways.
  • TDR-Safe Synchronization: Preserves RDNA 3–safe memory run granularity (word_runs / dword_runs) and write-watch guard boundaries (PAGE_READONLY checks) to prevent DXGI_ERROR_DEVICE_REMOVED (0x887A0006) and access violations.
  • Scarlett Texture Deswizzling: Hardware-accurate XOR tiling and fast texture refresh paths in victory-formats and victory-gpu.

2. CPU, Memory & PCIe Pipeline Optimizations (victory-gpu)

  • 16 GB VRAM Card-Buffer Budgeting: Defaults card_buffers_min_kb to 1 MiB on 16 GB GPUs, cutting per-frame CPU snapshot volume from >120 MB down to ~28 MB.
  • GPU-Only Readback Skipping & Relay Coalescing: Buffers >= 8 MiB without recent CPU reads or writes skip redundant CARD_COMPARE and PCIe readbacks (~260 MB/frame skipped in city scenes, cutting PCIe fetch traffic by >55%), while relay_worker coalesces back-to-back flights when no thread is waiting.
  • Lock-Free Descriptor Heap Sync (descriptor::sync_heaps): Adds a lock-free placed_slots bitset, atomic due-time fast paths, and hierarchical 4 KiB SIMD memcmp scanning across descriptor heaps.
  • Submission Thread (Host::submit / watch.rs) Overhaul:
    • Atomic KEPT fast path and merged interval binary search (O(log N)) in watch.rs to eliminate linear scans and redundant GetWriteWatch syscalls on guarded ranges.
    • Single-pass Batch::refresh_front with Largest-Processing-Time (LPT) worker scheduling and Step::GpuWrite deduplication.
    • Batched per-list locking in card_steps and single-pass run classification in send::take.
    • Exact 1× per-frame stage telemetry (submit stages, refresh_and_steps breakdown, and submit outer).

3. Dynamic AMD FidelityFX SDK 2.4.0 Bridge

  • Dynamically loads user-supplied signed PC binaries (amd_fidelityfx_loader_dx12.dll / amd_fidelityfx_upscaler_dx12.dll) via VICTORY_FIDELITYFX_DIR or [paths].fidelityfx_dir with full graceful fallback when absent.
  • Supports querying and selecting runtime upscaler versions (4.1.2, 3.1.6, 2.3.4).
  • Disabled by default in Host::present (opt-in via VICTORY_FSR=1) while native HLE interception of amd_fidelityfx_loader_xbox.dll is implemented to avoid duplicate post-present scaling.

Workspace Layout

  • apps/victory — CLI entry point (run, inspect) and runtime configuration wiring.
  • crates/victory-core — Configuration parser (victory.toml + environment overrides) and shared utilities.
  • crates/victory-formats — Scarlett texture formats, swizzle/deswizzle routines, and binary parsers.
  • crates/victory-gpu — D3D12.X-to-D3D12 command translation, shadow memory coherence, descriptor heaps, write-watch tracking, and FidelityFX DX12 bridge.
  • crates/victory-hle — High-level Xbox OS, DirectStorage, and title DLL module bindings.

Building & Running

Prerequisites

  • Windows 10/11 (x86_64) with a DirectX 12 Feature Level 12_2 GPU
  • Rust toolchain (stable, MSVC target)

Build & Verify

cargo test --offline -p victory-core
cargo test --offline -p victory-formats
cargo test --offline -p victory-gpu
cargo clippy --offline --workspace --all-targets -- -D warnings
cargo build --offline --release

Configuration

Copy victory.example.toml to victory.toml (git-ignored) and set your local paths. Key runtime environment variables:

Variable Default Description
VICTORY_CARD_BUFFERS_MIN_MB 1 (on 16 GB GPUs) Minimum buffer size kept resident in VRAM
VICTORY_GPU_ONLY_MB 8 Minimum size for GPU-only readback skipping (0 disables)
VICTORY_RELAY_COALESCE_US 1500 Flight coalescing window in microseconds (0 disables)
VICTORY_TEXTURE_STORE 0 Enables persistent texture store caching (1 enables)
VICTORY_FRAME_INTERVAL_MS 16.667 Target frame pacing interval in ms
VICTORY_FIDELITYFX_DIR (unset) Path to local AMD FidelityFX SDK 2.4.0 signed DX12 DLLs
VICTORY_FSR 0 Opt-in toggle (1) for the Present-stage FidelityFX bridge

Launch Example

.\target\release\victory.exe run "<path-to-your-title-executable>" --execute

Current Blockers & Roadmap

  1. CPU Submission Bottleneck (victory-queue-behind): Further reducing refresh_and_steps and copy/shadow synchronization overhead to push city frame times below 50–65 ms (15–20+ FPS).
  2. HLE Interception of amd_fidelityfx_loader_xbox.dll: Intercepting the 5 exported FFX API entry points (ffxCreateContext, ffxDestroyContext, ffxConfigure, ffxQuery, ffxDispatch) directly in victory-hle to feed real pre-HUD color, depth, motion vectors, and jitter to the native PC FidelityFX runtime (3.1.6 / 4.1.2) and control internal render resolution via ffxQuery.
  3. Long-Term Frame Pacing: Smoothing frame delivery once CPU submit times drop below the GPU frame budget.

License & Disclaimer

Unofficial, independent compatibility research project. Not affiliated with, endorsed by, or connected to Microsoft, AMD, Rockstar Games, or Take-Two Interactive.