Skip to content
t4l03Public
forked from ImperialSpy/Nova

About

Experimental Direct3D 12.X layer for Xbox Series (GDK) titles on Windows (personal research, GPL-3.0)

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nova

Nova is an experimental Direct3D 12.X layer for running Xbox Series (GDK) titles on Windows PCs with Direct3D 12. It is a personal research project: it is incomplete, rendering still has visual artifacts and performance work ahead, and it is not meant for general use.

It is not a fork. The memory model and the D3D12.X layer (devices, queues, command lists, descriptors, pipelines, textures, presentation) are written from scratch around a different architecture. Several parts are reused from, or were inspired by, VIctory and xcl (see Credits).

Why a third approach

Every PC layer for these titles has to bridge the console's unified memory and the PC's split CPU/GPU memory. VIctory bridges it with copies (shadows) plus change detection; xcl lets the GPU read system RAM. Nova chooses where each allocation lives when it is reserved, from the class the title itself declares (page protection, coherence, write-combining):

Declared class Where it lives in Nova CPU to GPU
Write-combined, GPU read-only or read-write CPU-mapped video memory (GPU upload heap, ReBAR) direct writes, no copy, no detection
GPU-only reserved resource plus tile mappings CopyPageMappings becomes UpdateTileMappings on the queue
Physical page pools video memory heaps (plus a CPU view if the title writes them) direct
CPU-cached, read by the CPU system memory the GPU reads (custom write-back heap) direct
CPU only ordinary memory none

Physical pages are numbered as the console does (4 KB frames, 64 KB pages), and the CPU window that aliases the graphics window is built from pagefile sections with per-page views.

What this buys compared to VIctory and xcl

The two existing approaches each pay a cost that grows with what the title does every frame:

  • VIctory (copies plus change detection): before each submission it has to find out what the title wrote (write watching, hashing physical-page views) and copy it to the GPU's copies. In our profiling of VIctory on this title, that machinery, not the GPU, was what its submission thread spent most of each frame on, tens of milliseconds.
  • xcl (the GPU reads system RAM): no detection, but the GPU reads hot data across PCIe. xcl's own README reports about 5 fps in the 3D world of a newer retail title.

Nova removes both costs by placing memory where its declared use says it belongs:

  • No change detection and no per-frame copies for graphics memory: the CPU writes where the GPU reads, as on the console. Measured: with draws, dispatches and mesh shaders running in gameplay, Nova's submission costs about 1 ms of CPU per frame (asynchronous, fence-based; it was about 14 ms while it still waited for the GPU).
  • No CPU reads of video memory: memory the title reads back with the CPU lives in cached system memory the GPU can read. Measured: moving those regions out of video memory took gameplay from about 12 to 30 fps (the frame cap).
  • Descriptors slot for slot: each title heap has a host heap with the same indices, so translated shaders index it directly; per draw, only the slots its shaders read that the title filled by copying are looked at.
  • Textures detiled on the GPU from the title's memory, triggered by the writes that fill them (DirectStorage), instead of being watched and re-uploaded.
  • Warm starts: translated shaders and compiled pipelines are kept on disk; on a second run 718 pipelines came from the library and compile time dropped from about 1,400 to 280 CPU seconds.

What this does not prove yet: these are CPU-side and memory-side gains, measured on one machine (an NVIDIA GPU on Windows; nothing has been tested on AMD or Intel yet) with a 30 fps cap and an incomplete frame. How the whole frame performs on the GPU can only be measured once Nova renders it correctly. (For Linux and AMD, the VIctory-xmem fork maps the title's memory straight into the GPU through a patched RADV driver and reports about 44 fps at 1080p; Nova aims at the same effect on Windows with stock drivers.)

Status

Tested only on Windows with an NVIDIA GPU. AMD and Intel GPUs are untested.

Working: memory (aliasing, 40-bit address limit, CPU-read placement), DirectStorage writes, asynchronous submission with fences, descriptor heaps mirrored on the host (including descriptors the title copies itself, found by a tag left in each slot), shader translation through victory-shader with a disk cache, pipelines with a D3D12 pipeline library on disk, draws, dispatches and mesh dispatches, 256-byte-aligned copies of the title's constant buffers (copied again at every submission that reads them), placed textures detiled on the GPU, two-plane presentation, ExecuteIndirect (one-argument signatures, records clamped on the GPU first), memory by address for translated shaders (SLOT_MEMORY directory over the host buffers themselves).

Not yet: artifact-free textures/lighting, full depth view coverage, GPU-copy texture invalidation, VRAM eviction/LRU, the raytracing structure builder (off, as in VIctory), raytracing, GDS. See docs/.

Where it stands (2026-12-01, evening)

  • Working: the menus, the map and the in-game HUD (health, money, weapon wheel) render, and in-game textures partially render: the 3D world shows lit for a while once gameplay starts.
  • Current issue: the screen goes black after about a minute of gameplay, while the HUD keeps working. Of the three tiled lighting compute passes that write the lit scene image (VIctory names f0c91b4d2578f5bf, 577248728544d74b, 348e1e8c414c7eca), only 348e1e8c produces light (about two thirds of the pixels). f0c91b4d overwrites the whole image with zeros, and 57724872 adds nothing. The auto exposure then averages a mostly black image, collapses and resets to 1.0, and the whole scene goes black. Nothing clears or copies over the lit image; the lighting passes compute zero light.
  • Lead: the inputs those two passes depend on are empty in Nova and full in VIctory-NVIDIA. The tile classifier a929109552ce1e84 writes an empty 80x45 tile mask, and the 1280x720 R32 depth texture it reads (through a shader view) is all zero in Nova. The next step is finding why that depth texture is empty when read.
  • Diagnostics added (local switches, off by default): NOVA_SNAP (copies of the lit image after named passes, with the title's submission number), NOVA_LITWATCH (every write, clear, copy and state change of the lit image), texture probes in NOVA_DUMP. NOVA_QUEUE_WAITS=1 honours the title's waits for memory values between queues (experimental: it did not change the lighting and hung the GPU once).

Earlier (2026-12-01, 3D World & Bink Video Rendering!)

Full 3D cutscene/world geometry and Bink loading videos now render on screen!

  • Root cause of black 3D world & green Bink videos fixed (memory.rs, mem.rs, present.rs): Hardware PIPELINE_STATISTICS on the 1280×720 G-Buffer ExecuteIndirect(DispatchMesh) draws showed c_inv=1408, c_prim=768, ps_inv=0 — exact multiples of 128 triangles passing the clipper with zero rasterized pixels, proving mesh vertex buffers were reading all zeros (every triangle collapsed to the object origin). Meanwhile nova memory reported mirrored_pages: 35,253 (~2.2 GiB of streamed PC-RAM pages mirrored to GPU tiles in V) with mirror_refreshes: 0! Titles map physical pages into V first and fill them afterwards via DirectStorage (write_physical) or CPU writes (including recycled Bink video planes), and nova-host never called refresh_mirrors().
    • Added O(dirty) refresh_dirty_mirrors() on every GPU submission (execute()) for DirectStorage write_physical writes, plus refresh_cpu_mirrors() (16-word page sample hash) per frame in present() (and periodic in execute()) to catch CPU-VA DirectStorage writes and CPU-rewritten video planes, also notifying placed.rs to re-detile modified textures.
    • Result: ps_inv jumped from 0 to 28,589+, 3D world geometry/lighting/foliage appeared immediately, and Bink loading videos render cleanly instead of solid green.
  • Persistent 64 MiB + 64 MiB CPU upload ring (placed.rs, descriptor.rs): 0x9... (onion/CPU-only) buffers and placed resources refresh per-submission with dedupe (CPU_QUEUED).
  • Known issues / next focus:
    • Cutscene performance is currently ~1–3 FPS due to refresh_cpu_mirrors() scanning ~54k mirrored pages too frequently inside execute() and ~15 GiB of detiled textures causing VRAM oversubscription/PCIe paging.
    • Some 3D surfaces show swizzled/block-compressed texture artifacts.

Earlier milestone (2026-12-01, GPU hangs fixed)

With the defaults below the game boots, loads, plays the cutscene and runs gameplay for minutes without a device loss (5 min tested, about 11 million indirect executions, 5 to 7 fps). The menu and the gameplay interface are drawn (health bars, money, the weapon wheel), and the first lit 3D content shows (distant lights); the 3D world is still mostly black.

  • Gameplay hang fixed (descriptor.rs): the culling chain (computes 4401d482ef24797c, a6724f20f309a480, 1ada490879c33c0e, 376a323cea463f28, 51788b20c402ace3) hung the GPU 10 to 15 s into gameplay in every run. The dynamic ring for tables past the 1M heap cap had 16,384 slots and wrapped several times a frame, so tables were written over while lists that read them still waited on the GPU (GPU-based validation caught a constant buffer view read as an unordered access view at ring slots). The ring now has 2^18 slots and a quarter is not written again before the GPU passed the lists that read it (ring_waits in the status line).
  • Defaults: draws, host descriptors and depth clears are on, and the pipelines known to hang are left out, without any switch (see Running).
  • Diagnosis: NOVA_GBV=1 (with NOVA_D3D12_DEBUG=1) turns on GPU-based validation without resource state tracking (with it, validation's own list failed to close while loading and removed the device; NOVA_GBV_STATES=1 keeps it); NOVA_GBV_FOCUS=<hash>,... logs every message naming those pipelines; debug-layer errors are logged as raised, with Nova's stack. DRED names the hung pipeline by the recording that hung, not the list's latest one. NOVA_INDIRECT=none|nodispatch|empty leaves ExecuteIndirect out or runs it with zero groups.
  • Robustness: host lists that failed to close are not run, detile copies D3D12 would refuse are left out, and the swap chain goes to the title's window, not VIctory's VictoryBackdrop popup.

Where it stood (2026-11-30, end of day)

The whole path from the title's command lists to the screen runs on the GPU without device losses as long as one compute pipeline is left out (see below). A forced clear color (NOVA_CLEAR_TEST=1) reaches the window, and the first title content appeared: whole frames of the interface plane drawn by the title's own pass (solid green frames in the menu). The screen is still black otherwise. In order of what was found last:

  1. Descriptors the title copies itself. The title fills its per-frame descriptor tables by copying the 32-byte slots with its own memory copies. Every view made through the API now leaves a tag in its slot, and before each draw or dispatch the slots its shaders read (from the console program's used-resource list) are brought into the host heap from where the view was made. This is what made the first pixels appear.
  2. A compute pipeline that never finishes (339ca8f420103222): found with DRED plus a marker naming the pipeline before every draw and dispatch (NOVA_DRED=1). It is a small shader (one table, four constants, the strides table); skipped with NOVA_SKIP=339ca8f420103222, nothing else hangs. FSR4's network also hangs the GPU; the title's own temporal pass (VICTORY_RENDERER_TEMPORAL=1, a VIctory option) replaces it.
  3. Loading is very slow (down to 1 fps): tens of thousands of detiles, each making its own staging and table buffers.

Latest session (untested beyond a few runs each; all build, none gives an image yet):

  1. ExecuteIndirect now runs (Command::Indirect, clamp.rs): the title's signatures hold one argument (draw, indexed draw, dispatch, mesh dispatch, and type 105 run as a dispatch). Records are copied and clamped on the GPU into a scratch ring first (count applied, dispatches at most 65,535 a dimension), as VIctory does. In gameplay about 1.2 million ran per run where before they were dropped; the scene is GPU-driven.
  2. Memory by address (memdir.rs): gameplay shaders read title memory through raw addresses (about 150,000 to 450,000 stages a run); they read zeros before. The directory points at the host buffers themselves, faults are read once a frame.
  3. Constant buffers not 256-aligned were copied once, when their view was made, so the GPU kept reading the first values; now each has a fixed slice re-copied at every submission whose draws read it.
  4. A second compute pipeline hangs the GPU through ExecuteIndirect (18567a5f0145bde9, about 80 s in, DRED), even with clamped records: its own loop does not end, like 339ca8f420103222. Untested next step: skip it too (NOVA_SKIP) and find what it reads.
  5. The ray-tracing structure builder (compute programs with a spilled user-data table) is skipped unless NOVA_BVH_BUILDER=1.

Diagnostics built in: per-target pixel probes every 150 frames (nova probe in the log), where each frame's draws went and the two present planes, why views were left null, what each slot of a draw's tables holds, and the first draws' state.

Possible next steps

  1. Loading speed: pooled staging and table buffers, batched detiles, no detile of levels no view uses.
  2. Depth views: placed views of depth textures are still null (about 200,000 in a run); lighting, shadows and the final composition read depth. They need typeless host depth textures.
  3. The two hanging compute pipelines (339ca8f420103222, 18567a5f0145bde9): what they read that is wrong.
  4. Textures written by the CPU (video frames) or by GPU copies: today they are detiled once, then only after DirectStorage writes.
  5. Constant buffers the GPU writes earlier in the same submission are still copied before it does (culling passes write parameters later draws read): copy them inside the list, before the draw.
  6. USER_VIEW_ADDRESS (a buffer view's address used as a pointer) is still 0; buffers and textures that alias the same physical pages (a 3 GiB pool of the title's) are separate host objects.
  7. Texture states beyond render targets and depth (shader resource and unordered access uses), FSR4 translation, raytracing, GDS.

Layout

  • crates/nova-mem: memory classes and regions.
  • crates/nova-gpu: the console's memory and queue model over an abstract host.
  • crates/nova-d3d12x: the D3D12.X objects the title calls (method tables, lists, descriptors, pipelines).
  • crates/nova-host: the Windows back end (D3D12 device, host lists, descriptors, pipelines, textures, present).
  • runtime: bundled VIctory / VIctory-NVIDIA loader, HLE runtime (VICTORY_RENDERER=nova integration), victory-shader, and victory-formats (GPL-3.0-or-later; see Credits).
  • bench: stand-alone Windows benchmarks of the memory hypotheses.
  • docs: design notes.

Building

Nova is self-contained in this repository — the compatible VIctory runtime (victory-hle with VICTORY_RENDERER=nova, victory-shader, and victory-formats) is bundled under runtime/. You need your own legally obtained game files; none are included here.

git clone https://github.com/ImperialSpy/Nova
cd Nova\runtime
cargo build --release -p victory

This produces runtime\target\release\victory.exe with the Nova renderer built in.

Running

Set VICTORY_RENDERER=nova and VICTORY_RENDERER_TEMPORAL=1 (uses the title's own temporal pass; FSR4's network hangs the GPU) when launching runtime\target\release\victory.exe:

$env:VICTORY_RENDERER = "nova"
$env:VICTORY_RENDERER_TEMPORAL = "1"
.\target\release\victory.exe "<path-to-your-game-exe>"

Nova's own switches default to the working configuration above. To change the defaults:

Switch Default Meaning
NOVA_DRAW on 0: no draws or dispatches reach the GPU
NOVA_DESC 1 0 no host heaps; heaps heaps of null views; or a list of kinds (cbv, srv, uav, placed, sampler, copy)
NOVA_DEPTH_CLEAR on 0: depth clears left out
NOVA_SKIP 339ca8f420103222,02384a60fda6f2d0,731a39171b568298 pipelines left out (Nova's or VIctory's hashes); replaces the default; none leaves out nothing
NOVA_DRED off 1: name the pipeline the GPU hung in
NOVA_D3D12_DEBUG, NOVA_GBV off debug layer, GPU-based validation (very slow)

Copyright and license

Copyright (C) 2026 ImperialSpy (https://github.com/ImperialSpy).

Nova is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. It is distributed WITHOUT ANY WARRANTY; see LICENSE.

Additional term under section 7(b) of the GPL: redistributions and modified versions must preserve this copyright notice and the attribution "Nova by ImperialSpy (https://github.com/ImperialSpy/Nova)" in their documentation or about notices.

Credits

Nova is licensed under the GNU General Public License v3.0 or later (see LICENSE), as are the projects it builds on.

  • VIctory (https://github.com/Marvisak/VIctory), GPL-3.0-or-later, and its NVIDIA fork VIctory-NVIDIA (https://github.com/trustno1-coder/VIctory-NVIDIA). Nova depends on VIctory's victory-shader (RDNA2 to DXIL shader translator) and victory-formats (console texture layouts, after AMD's addrlib, MIT) and runs inside VIctory's loader and HLE runtime. Ported or adapted from VIctory's victory-gpu: the shader cache entry encoding and translator fingerprint, the console texture layout selection, the normalization of placed view descriptions, the read-only depth view state, the console topology mapping, the rectangle-list geometry stage, the descriptor tag idea for descriptors titles copy themselves, and the root signature and binding model of translated shaders.
  • Victory-Kryogenik (https://codeberg.org/Kryogenik/Victory-Kryogenik), GPL-3.0-or-later, and Neptune (upstream commit 25fbf69): VICTORY_NAN_GUARD (clamping NaN/Inf on pixel shader float colour exports) and the D1 VICTORY_NAN_GUARD_STORES guard for typed image and buffer stores, ported into victory-shader, as well as shader and VRAM diagnostics.
  • xcl (https://github.com/xcl-dev/xcl), GPL-3.0-or-later, including the fork at https://github.com/dudenudem/xcl: the idea of keeping compiled pipelines on disk and preparing the pipelines a title used in earlier runs.
  • AMD's address library (addrlib, MIT), through victory-formats.

Xbox, DirectX and Direct3D are trademarks of Microsoft. This project is not affiliated with or endorsed by Microsoft or any game publisher, and it contains no SDK code, keys or game data.

About

Experimental Direct3D 12.X layer for Xbox Series (GDK) titles on Windows (personal research, GPL-3.0)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages