- Clean-up passes over each translated module (VICTORY_SHADER_OPT bits: dead
code, folding, reuse, branch facts, loads within a block, wave64 first-lane
exchange), part of the shader cache key. About 43 % fewer host instructions
over the pack; about 20 ms less GPU time per frame on the test machine.
- translate: a census of the emitted code.
- Checked with plain game runs of this tree on the test machine.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The update moved the particle light-atlas compute programs to a form that
puts group barriers inside branches and loops; a dispatch of them stood on
the card until the device was reset. That form is now off unless
VICTORY_WAVE_WIDE=1, and the shader cache key includes the wave switches.
Checked with a plain run of this tree on the test machine.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
- Shader tests: a software adapter given as the default device is not taken
for a hardware device, so the tests that need a real card skip there.
- Diagnostics: the stencil plane of dumped depth-stencil targets and the
title's descriptions of its stencil views.
- README: the newest commits lose the GPU device shortly after start on the
test machine; the cause is not found yet.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
- 59 of the 64 trace programs and the irradiance-cache shading program
translate; 51 programs leave the approximate wave64 forms.
- The workspace passes the lint with warnings as errors in both feature sets;
a few style lints are let through in Cargo.toml for this fork.
- README status updated (relay and in-place memory results);
docs/fork-ray-tracing.md describes what the title does and what is built.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
World rendering, lighting, frame-rate and memory work for Grand Theft Auto VI
(Xbox Series X profile) on one Windows PC with an NVIDIA RTX 4070. The README
describes the state, the changes and the credits. Based on VIctory by Marvisak
and contributors (GPL-3.0-or-later); XCL by ivall and contributors was used as
a reference. No game files are included.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
With indirect execution the world's first frame asked for over 1,200
pipelines at once and took more than 30 s, so the title's own GPU
watchdog ended the run. Host pipelines are now made by worker threads: a
first use waits at most 0.5 s per title frame, and that pipeline's draws
are dropped until it is ready. The world presents frames again, and
indirect execution is the default (the switch is gone).
Pipelines are cached across runs:
- every host pipeline goes into a pipeline library saved under the cache
folder (named by a hash of the translated code, our root signature and
the state; a blob the device rejects starts an empty library);
- the pipelines drawn with are remembered and started during loading on
the next run.
One cold and one warm run: the last pipeline was ready 38 s after the
world's first frame cold, 1.4 s warm; the first world frame took 3.2 s
cold, 0.37 s warm.
Also:
- Copy-backs of shader-written ranges return only the bytes the GPU
changed; they used to overwrite what the title's CPU wrote meanwhile,
which crashed the title.
- Indirect dispatch records are bounded (group counts were not), and the
console's single-dispatch argument type runs as a dispatch.
- Per-shader counts of dropped draws in the diagnostics log; a switch
that submits and times each list alone.
Not working yet: the world shows no geometry, and runs end on a GPU page
fault after at most about 55 s.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Translated loops stop after 2^20 iterations per lane so that a loop
over not yet mirrored data (zeros) cannot run four billion times. A pass
where every lane reaches that limit still takes seconds, though: 2^20
iterations times a 4K screen's 8 million pixels is about 10^13 loop
bodies. The world's frames now take 1.5-3 s, and loops spinning to the
limit on data that reads as zeros are one candidate.
A diagnostics build now reads VICTORY_SHADER_LOOP_LIMIT (decimal or 0x
hex, at least 1). If a low value such as 4096 makes world frames much
faster, loops hitting the limit are what makes them slow. If not, they
are ruled out. The limit is part of the translation, so the shader cache
keys on it, and a run that overrides it logs a warning. Release builds
always use 2^20.
The host device was removed seconds into the world because a shader read
a descriptor of the wrong kind: empty slots held a null 2D texture view
where the shader expected a buffer, which gave a garbage heap index and
a read far past the view heap. Null descriptors now have the kind the
shader expects (raw buffer, constant buffer, or a texture of the title's
own dimension). The world then ran to a 240 s time limit with no removal.
Also:
- Host lists hold the textures, pipelines, root signatures and heaps they
name, and heap slots hold the resource they view (the title releases
objects before submitting lists that use them).
- The device-removed report places the fault against the host descriptor
heaps and names our own uploads; VICTORY_D3D12_GBV turns on GPU-based
validation, VICTORY_DUMP_TARGETS works.
- Indirect execution (draw, indexed draw, dispatch, mesh dispatch): the
world draws most of its geometry this way. Arguments are clamped and
charged to a per-list budget by a small compute pass first, so garbage
cannot hang the GPU. Off by default (VICTORY_INDIRECT=1): with it on
the title's own GPU watchdog ends the run about 30 s into the world.
- Shader-written ranges are copied back once per submission and only
where they differ; refreshes beside them copy only stale pages. The
frame-rate line counts copy-backs and dropped draws.
Not working yet: the world's picture is black (indirect draws off, and
hundreds of draws per frame have no translated shader).
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Says how far the title gets (menus at 30 fps, the world reached but not
rendering), what each subsystem does and still needs, and warns that the
world can reset the display driver on a real GPU. Adds how to run the
title, the translate command, and tables for the keyboard pad and the
debugging switches.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The title now boots through every first-boot and menu screen at its own
30 fps, drawing with translated shaders, with input, sound, saves and
loading served; it reaches the world, where the host GPU path still
fails (see "Not working yet").
Loader and runtime
- Crash reports unwind properly, name C++ throws and host GPU failures,
carry the title's last debug lines and are appended to crashes.log.
- Thread notices on our own threads, reentrant late DLL loading, exit in
the console's order, relaunch on a launch-new-game request.
- Offline guard: the title cannot reach the network (sockets, name
lookups, WinHTTP, the media source resolver); by-name lookups and
loads follow the import rules.
- Every runtime area the title calls is served (networking hint,
packages, store, saves, display, UI, speech stubs, user, async pool).
Saves persist; an update is one rename and survives a kill at any step.
- DirectStorage reads for real: shared worker pool, priorities, zlib and
BCPack. BCPack is our own decoder; the format's constant tables ship in
crates/victory-formats/src/bcpack-tables.bin (the asset policy's one
exception, see docs/asset-policy.md).
- GameInput from XInput pads and the keyboard, with a keyboard stand-in
pad; console timers (1 ms) for the whole process.
- Audio: XMA2 decoding on the emulated contexts, Opus on the decoder
queues, the DSP interface as a stub; title memory placed below 2^40.
- Console texture layouts (sizes, tiling, detiling) and the layout
library's imports.
GPU
- Draws, mesh dispatches and compute dispatches run on the host with
shaders translated at first use and cached on disk; descriptor heaps,
views, root signatures, barriers and host texture states; rectangle
lists; comparison samplers.
- Title memory reaches the host through persistent mirrors that copy
only pages written since the last copy; shader-written buffers are
copied back.
- Presentation with frame pacing per event kind; framerate in the window
caption.
Shaders
- DXIL emission for vertex, pixel, compute and mesh programs from the
console's native code, with a differential test suite against the PC
compile. World set: mesh 8,191 of 8,506, vertex/pixel 10,617 of
12,346, compute 1,643 of 2,539; utility set complete.
Build
- Debugging aids (debug logs, frame capture, stack dumps, scripted keys,
the host debug layer, the software adapter) exist only with the
`diagnostics` feature; `[profile.diag]` keeps that build apart.
Not working yet
- In the world the host device is removed within seconds (descriptor
handling fixes are in, unproven by a surviving run) and frames present
black.
- 64-bit image atomics, merged geometry stages and the BVH builder's own
shaders do not translate; reverb is silent.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Rust workspace for VIctory: PE analysis, loader, HLE skeleton,
DXBC/DXIL parsing with a GFX10 decoder, conversion cache, CLI and
asset-policy enforcement.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>