Skip to content
erdemcissePublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

VIvidia

VIvidia is an experimental, research-oriented Xbox Series (Scarlett) compatibility, binary-recompilation/HLE runtime, and shader-translation layer targeting native Windows x86-64 execution on NVIDIA GeForce RTX GPUs (Direct3D 12, Shader Model 6.6+, Wave32). It currently focuses on running GTA VI (game_scarlett_master.exe, Xbox Series build v1.0.2.1) using user-supplied files.

Legal & Asset Safety Notice This repository contains zero proprietary game files, binaries, shaders, textures, archives, keys, or screenshots. Users must supply their own legally obtained dump of the title outside the repository directory. See Asset Policy.
VIvidia is an independent technical project and is not affiliated with, endorsed by, or supported by the title's developer or publisher, Microsoft, AMD, or NVIDIA.


Table of Contents


Project Scope & Architecture

VIvidia executes native console x86-64 title code under Windows while translating console graphics, system APIs, and asset formats on the fly:

  1. PE Mapping & TLS Redirection (victory-pe, victory-loader): Validates and maps the title executable and companion DLLs into the host address space, redirects static TLS slot accesses, and installs a structured crash handler (module+rva unwind reporting).
  2. Console High-Level Emulation (victory-hle): Implements console-only runtime modules (xgameruntime.dll, virtual storage path mapping under VICTORY_DATA_DIR, offline service stubs, audio, and GameInput/DualSense/DualShock 4 USB & Bluetooth support) while enforcing a strict host DLL pass-through policy (HostPolicy).
  3. GFX10/RDNA2 → DXIL Shader Translation (victory-shader): Lifts native GPU shader binaries to an SSA IR, strips hardware EXEC masks via control-flow structurization, traces descriptor/memory lineage back to root signatures, performs Wave64 → Wave32 lowering (widen, with_pair_meetings, split_lds_kernel with SLOT_GROUP_SCRATCH, and SLOT_VIEW_ADDRESSES), and emits Shader Model 6.6 DXIL bitcode validated against dxil.dll.
  4. D3D12.X Command & Memory Bridge (victory-gpu, victory-formats): Translates console D3D12.X command buffers, tracks unified-memory modifications via Windows GetWriteWatch, manages tiled-to-linear texture detiling / BCPack decoding, maintains block-pooled VRAM and staging allocators (pool.rs) with host commit-headroom admission (residency.rs), and supports the title's BVH/ray-tracing workload (VICTORY_BVH_BUILDER=1).

All converted caches, pipeline libraries, and runtime save data are written strictly outside the source tree via victory_core::ensure_outside_repo.


Workspace Crates

Component Responsibility
crates/victory-core Configuration (victory.toml), asset-policy path guards, logging initialization
crates/victory-pe Read-only PE32+ and import-library inspection
crates/victory-loader Console image mapping, import binding, TLS redirection, crash diagnostics
crates/victory-hle Console OS/WinRT/XGameRuntime/filesystem/input HLE and HostPolicy
crates/victory-gpu D3D12.X command replay, write-watch tracking, pools, descriptors, BVH host bridge
crates/victory-shader GFX10/RDNA2 disassembler, SSA IR, structurizer, Wave32 lowering, DXIL emitter
crates/victory-formats Console texture tiling/detiling, BCPack decompression, audio format decoding
crates/victory-pipeline Converter trait and content-addressed conversion cache
crates/victory-game Build identities (v1.0.2.1), title-specific format hooks and patches
apps/victory CLI front end (play, run, shaders, translate, warm, preload, census)
xtask Asset-policy verifier (cargo xtask policy) and git hook installer
tests/fixtures/hle-probe Self-authored synthetic PE fixture for loader verification tests

Milestones & Current Status

Self-Reported Verification Note: All measurements and stability observations below are self-reported from local testing on the hardware profile documented in the next section using native rendering (no DLSS, no Frame Generation).

Milestone Status Technical Notes
Executable boot ✅ Verified game_scarlett_master.exe (Xbox Series v1.0.2.1) boots and initializes under HLE modules.
Shader & Wave32 translation 🔧 Nearly Complete 25,787 / 25,787 runnable containers translate in default cache census; 1 compute shader (6b82bc7d22016cb5) currently panics when explicitly lowered under VICTORY_HOST_WAVE=32 (tracked below).
Menu & input ✅ Verified Title menu renders and responds to DualSense/DS4, XInput, and keyboard input.
In-world rendering & RT ✅ Functional Opening cutscenes, street traversal, shoreline/ocean physics, and optional ray tracing (VICTORY_BVH_BUILDER=1) execute in-world.
Target 30 FPS (≤ 33.3 ms) 🔧 In Progress Light scenes (1,500 draws) reach 30.7 FPS / 32.6 ms; dense scenes (3,100–4,200 draws) reach 23.7–26.2 FPS / 38.1–42.1 ms, still CPU-bound in submission preparation and refresh/landing work.

Self-Reported Hardware & Performance

Test Environment

  • GPU: NVIDIA GeForce RTX 4090 (24 GB VRAM, native Wave32, SM 6.8, driver 32.0.16.1714)
  • CPU: Intel Core i9-13900K (24 cores / 32 threads)
  • Memory & OS: 64 GB DDR5, Windows 11 (x86_64-pc-windows-msvc)
  • Execution Profile: Series S (1280x720 internal), native rendering (no DLSS / no FrameGen), release build, VICTORY_HOST_WAVE=32, VICTORY_COPY_BESIDE=1, VICTORY_STORE_BESIDE=1

Baseline Frame-Time Measurements (opt1, Release Build, Non-RT)

Scene Complexity Draws / Frame Median Frame Time Approximate FPS
Opening cutscene (title-locked) 8–10 33.3 ms 30.0 FPS
World — light / open water 800–1,500 28.9–30.0 ms 33.3–34.6 FPS
World — medium 1,500–2,500 33.2–35.5 ms 28.2–30.1 FPS
World — dense street 2,500–3,500 37.3–38.5 ms 26.0–26.8 FPS
World — heavy 3,500–7,900 42.8–44.9+ ms 14–23 FPS
  • Primary Bottleneck (CPU vs GPU): On the RTX 4090, GPU utilization sits around ~55–71% with 0.0 ms GPU wait time. Frame pacing is strictly limited by single-threaded CPU preparation (preparing 35–45 ms/frame in heavy scenes: copy_mapped at ~70–100 MB/frame, readback/landing at ~21–22 MB/frame, GetWriteWatch span queries, and texture refreshes).

2026-11-29 CPU Submission Pass (Native, Series S)

Measured on the same RTX 4090 / i9-13900K profile with a release build, native 1280x720 rendering, no DLSS and no Frame Generation. The game was entered from the same autosave and allowed to stream before sampling; figures are the in-game ten-second frame lines.

Scene (draws/frame) Median frame time FPS Preparing Copy-back
Light (1,507) 32.6 ms 30.7 27.6 ms 8.9 ms
Heavy street (3,133) 38.1 ms 26.2 30.4 ms 13.5 ms
Heavy street (3,230) 39.8 ms 25.2 30.3 ms 13.4 ms
Densest sampled (4,187) 42.1 ms 23.7 30.1 ms 12.5 ms

The remaining CPU wall in a 3,100-draw frame is dominated by: refreshes of host copies 9.5 ms, copies in the card's memory (card_before) 6.4 ms, the one write-watch asking 4.3 ms, planning the steps done on the card 3.2 ms, and title bytes put under flights' writes 2.7 ms. Copy-back runs on the relay thread and overlaps preparing, but its tail still contributes roughly 13 ms when the card is behind.

Verified lossless CPU/scheduling changes kept in this pass:

  • Neptune worker affinity: turbo::parallel_for helpers now request the fast-core set and helper priority, like the existing wide/landing pools. In a comparable 3,080-draw window this moved refreshes from 10.8 ms to 9.4 ms.
  • Declared passes: VICTORY_JOIN_PARTS=16 reduced fixed per-submission overhead in the sampled heavy windows; 8 remains the conservative default in the launcher, 16 is the tested tuning value.
  • Pointer lookups: card_before and relay range merging now use address-keyed fast sets/maps instead of nested Arc::ptr_eq scans.
  • Instrumentation: per-frame lines now split card_before, refresh-front, and write-watch costs so the next pass can be measured without a profiler.

Rejected after measurement (not enabled): deferred pre-write snapshot batching (cross-copy aliasing can corrupt host copies and regressed to 8–12 FPS), 10 turbo workers, 8 landing threads, VICTORY_ASK_EARLY, a 32 MiB write-watch merge gap, and VICTORY_CARD_STEPS=1 (saved 2.4 ms of planning but added 8.8 ms of flight waits).

Status: the native 30 FPS target is not yet met in the densest scenes. The next viable work is narrower than thread-count tuning: reduce the 9.5 ms refresh and 6.4 ms card-copy preparation without changing the writing/snapshot order, and shorten the relay landing tail.


Shader & Wave64 → Wave32 Lowering Status

  • Default Cache Census (victory.exe shaders, non-host-wave): 25,787 runnable shaders translated and cached (198 skipped: 195 unreferenced dead-code Gs-only containers and 3 empty containers).
  • Dynamic Descriptor View Addresses: All 5 dynamic-offset shadowmask:CS_TraceShadowRays_Half variants translate and validate (SLOT_VIEW_ADDRESSES SRV table t251 + Wave32 MASK_ELSEWHERE handling).
  • Full-LDS Wave64 Compute Shaders: Both 32 KiB LDS vfx_triangleClip kernels map per-group spill storage via SLOT_GROUP_SCRATCH UAV u250 (32 MiB bounded backing).

Known Issues & Active Investigations

  1. Wave32 Lowering Panic in 6b82bc7d22016cb5 (vfx_triangleClip:CS_CollectTriangles*):
    • Running with VICTORY_HOST_WAVE=32 triggers a compiler panic on a background pipeline worker (forward reference outside a phi in crates/victory-shader/src/emit/bitcode.rs, observed via widen where Cast(Bitcast, Inst(90)) references Extract(Inst(89), 0) before its block order position). Until resolved, dispatches using this compute pipeline are dropped.
  2. Heavy-Scene & Ray-Tracing CPU Overhead (< 30 FPS):
    • Scenes exceeding ~2,500 draws/frame and ray-traced runs (VICTORY_BVH_BUILDER=1, which adds substantial GetWriteWatch scanning and BVH memory traffic) currently exceed the 33.3 ms budget.
  3. Observed Visual & Streaming Artifacts (diag Captures on RTX 4090):
    • Localized black pixel clusters near volumetric/headlight fog, dynamic gray mosaic artifacts on ocean surfaces, black in-game phone display surface, and intermittent corrupted/rainbow skin textures on specific NPCs in crowded interior scenes.
    • Multi-frame texture/prop pop-in when launch configs aggressively throttle texture staging (VICTORY_TEXTURE_STAGE_MS=16, VICTORY_TEXTURE_CATCHUP=0, VICTORY_SHOW_NEW_LATER=1).
  4. Windows Commit-Limit Throttling (residency.rs):
    • When available OS commit falls below 4 GiB (even with > 16 GiB physical RAM free), residency.rs enters host memory pressure mode and throttles speculative texture prefetch and spare pool retention.
  5. NVIDIA Diagnostic False Positives in pool.rs:
    • In --features diagnostics builds, where_the_card_reads logs POOL: the card reads a pooled texture's first level past the end of the piece it was placed in with multi-gigabyte offsets (into > 0x10_0000_0000) because its descriptor-base subtraction assumes AMD-style flat GPU virtual addresses inside a heap.

Prerequisites & Building from Source

Requirements

  • OS: Windows 11 (x64), or Windows 10 22H2+ with Direct3D 12 Agility SDK (victory get-d3d12 / D3D12\D3D12Core.dll)
  • GPU: NVIDIA GeForce RTX GPU (or D3D12 SM 6.6 + mesh-shader capable adapter) with current drivers
  • RAM / Storage: 32 GB+ system RAM (64 GB recommended; ensure sufficient Windows pagefile/commit headroom), NVMe SSD
  • Build Tools:
    • Rust toolchain pinned in rust-toolchain.toml (1.98.1, x86_64-pc-windows-msvc, Rust edition 2024)
    • Visual Studio Build Tools with Desktop development with C++ (MSVC & Windows SDK, including dxil.dll for --validate)

Build Commands

# Verify asset policy compliance before building or committing
cargo xtask policy

# Optional: install git pre-commit asset-policy hook
cargo xtask install-hooks

# Release build (standard runtime)
cargo build --release

# Diagnostics build (separate target\diag profile with tracing/diagnostics enabled)
cargo build --profile diag -p victory --features diagnostics

Usage & Key Environment Variables

Configure your external game dump path in victory.toml (outside the repository) or pass it on the command line:

# Inspect missing/covered console imports without executing title code
target\release\victory.exe census C:\Path\To\TitleDump --missing

# Pre-translate shaders into the external cache
target\release\victory.exe shaders C:\Path\To\TitleDump

# Validate shader translation under explicit Wave32 host constraints
$env:VICTORY_HOST_WAVE = "32"
target\release\victory.exe translate C:\Path\To\TitleDump --validate --pipelines

# Launch via the play launcher (or direct HLE execution)
target\release\victory.exe play C:\Path\To\TitleDump\game_scarlett_master.exe --series-s
target\release\victory.exe run --execute C:\Path\To\TitleDump\game_scarlett_master.exe --console series-s

Selected Runtime Flags

Variable Purpose
VICTORY_GAME_DIR / VICTORY_CACHE_DIR / VICTORY_DATA_DIR External paths for title dump, derived caches, and saves (kept outside the repo)
VICTORY_HOST_WAVE Target wave width override (e.g., 32 for NVIDIA GeForce RTX Wave32 testing)
VICTORY_BVH_BUILDER Enables title compute/BVH ray tracing (1)
VICTORY_COPY_BESIDE / VICTORY_STORE_BESIDE Side-channel copy/store optimizations for host memory bridging
VICTORY_TEXTURE_POOL / VICTORY_POOL_SMALL Controls 64 MiB heap/staging block pooling (0 disables pooling)
VICTORY_TEXTURE_STAGE_MS / VICTORY_TEXTURE_CATCHUP Per-pass texture upload millisecond cap (default 250) and 3× backlog catch-up (0 disables)
VICTORY_SHOW_NEW_LATER / VICTORY_TEXTURE_NO_WAIT Delays showing newly pooled textures / avoids blocking texture refreshes during title remaps
VICTORY_EARLY_DEPTH / VICTORY_LEAVE_OUT Keeps console early-depth behavior / skips specific shader hashes by 16-hex ID
VICTORY_PIPELINE_BOOK Records created pipelines for victory warm driver-cache prewarming
VICTORY_JOIN_PARTS Joins independently-preparable submission parts; 16 measured as a small fixed-overhead win on the 13900K.
VICTORY_AHEAD_GAP_MB Write-watch merge gap in MiB (default 8); larger values reduced ask calls but increased ask time in testing.

Repository Safety & Policy Enforcement

  1. Pre-commit & CI Policy Check: cargo xtask policy (xtask/src/policy.rs) enforces an allowlist of source/documentation extensions, rejects files ≥ 640 KiB, blocks binary signatures, and flags long hex/base64 sequences.
  2. Permitted Sole Binary Exception: crates/victory-formats/src/bcpack-tables.bin (~78 KB) holds standard BCPack entropy/dictionary tables required for format decoding and is explicitly registered in xtask/src/policy.rs (not covered by the repository source license; see docs/asset-policy.md).
  3. Runtime Path Isolation: Runtime outputs are checked with victory_core::ensure_outside_repo so derived artifacts never enter the git working tree.

License & Upstream Acknowledgements

  • License: Workspace crates are licensed under GPL-3.0-or-later (see Cargo.toml; excluding the documented bcpack-tables.bin format-constant table).
  • Upstream Acknowledgements: VIvidia builds directly upon and gratefully credits the open-source research and engineering of the VIctory community:
    • trustno1-coder/VIctory-NVIDIA — primary upstream base for NVIDIA Wave32 lowering, beside copy/store optimizations, DualSense/DS4 input HLE, Streamline integration, and memory-packing work.
    • fxceless/victory-fork, Marvisak/VIctory, DexNom/VIctory, Belobug/VIctory-Belobug-AMD, and FQY55kai/ZJOU-VICTORY — foundational shader translator, GPU memory/write-watch tracking, BVH ray-tracing work, pool diagnostics, and HLE contributions documented in docs/findings.md and docs/bug-journal.md.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages