Commit Graph
456 Commits
Author SHA1 Message Date
Manuel PérezandClaude Opus 5.5 fba9d1d3a9 Audio: reduce the title's XMA read advance before adding it
ADVANCE_XMA_READ added the title's block count to the 5-bit read block
in u32 before taking it modulo the ring size, so a count near u32::MAX
overflowed (a panic in debug builds). The count is reduced modulo the
ring first; the result is the same for every count that did not
overflow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 01:21:41 +01:00
Jeremy Goldberg 82bbcc7586 fix(gpu): average copy statistics over the full reporting interval 2026-11-23 19:21:40 -05:00
tedin7 d46789485c Shaders: set SCC from the carry of s_addc_u32 and s_subb_u32
Both returned no carry, so SCC was missing and a branch or select on a 64-bit scalar add or subtract failed to translate. They now share the carry logic of v_add_co_ci_u32 and v_sub_co_ci_u32.
2026-11-24 01:17:24 +01:00
tedin7 ee6041788f fix: read a far jump's offset as signed so backward far jumps decode 2026-11-24 01:17:00 +01:00
TG0000andClaude Opus 5.5 2ef31abee1 GPU: check a sampled texture once per submission, not once per list
A title texture's staging refresh ran as a host step of every list that
sampled it. When several lists in one submission sampled the same
texture, it was checked again for each of them. In physical-page memory,
which cannot be write-watched, each check is a VirtualQuery walk and a
blake3 hash of the whole texture. Every list's GPU copy reads the same
staging buffer after all submission-time steps have run, so checks after
the first one in a submission did nothing unless title memory had been
written in between.

Texture refreshes are now their own step. The submission's Batch, which
already merges buffer refreshes, records the staging buffers it has
refreshed. A Copy into title memory or a Run step (work that may write
title memory) clears that record, so a texture is checked again after
any such write, as buffer refreshes are.

A synthetic benchmark (ignored test, release build, 12 lists sampling
48 textures of 4 MiB): 576 hashes in ~690 ms before, 48 in ~60 ms
after (~11x).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 01:16:34 +01:00
ExorionandClaude Opus 5.5 bedd85e4ed GPU: keep a guarded block's write fault from being declined in a race
The write-fault handler opens the guarded block under the guard lock,
then, if it found none, asks whether the address is writable without
it. Between the two, another thread's fault could open the block and a
copy could guard it again: the handler then saw a read-only block that
is in fact ours, declined the fault, and the title crashed on a plain
write (seen 1-3 minutes into the world under Wine, where exception
dispatch is slow enough to hit it every run).

The lock is now held across both checks, so a block that is not ours
while it is held really is not ours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 01:15:23 +01:00
tedin7 85d03354fb fix: skip unused export address slots instead of reporting them at RVA 0 2026-11-24 01:15:10 +01:00
Henrique Bueno 0369ebe42a loader: a clwb write-back loop runs in one exception 2026-11-23 21:14:15 -03:00
FIockerandClaude Opus 5.5 3c96ef4734 GPU diagnostics: skip pipelines by shader hash
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-24 01:12:41 +01:00
meower 4841cc7107 xmem: commit physical-page sections whole under Wine
XMemAllocatePhysicalPages makes SEC_RESERVE sections and commits their
pages one view at a time. Under Wine each commit is a wineserver request
that scans every range committed so far, so wineserver ran at full load
while the title's threads waited on it, and loading hardly moved.

Under Wine (detected by ntdll's wine_get_version export) the sections
are now SEC_COMMIT and the per-view commit is skipped. Wine backs a
committed section with a sparse file, so untouched pages still cost
nothing. Windows keeps SEC_RESERVE, since a busy host may be unable to
commit the 6.1 GiB the title asks for in one go.

Tested: Linux (Wine 11.21), i7-12700K, RTX 4070. wineserver load drops
after the first seconds and the title gets to its loading screen,
drawing and dispatching.
2026-11-24 00:08:51 +00:00
ifBars 178bbb7915 Keep an empty import descriptor so Windows assigns static TLS
Use the descriptor count already validated by the PE parser, so the directory size need not include the null terminator. Check the OS-assigned static TLS index on a mapped test DLL.
2026-11-23 16:07:09 -08:00
Manuel PérezandClaude Opus 5.5 3c12f385a5 GPU: leave rectangle vertex components past the stride alone
Expanding a rectangle list makes the fourth corner from the other three,
element by element. An element that reaches past the vertex stride (the
input layout allows it to overlap the next vertex) was read and written
past the vertex's bytes, which panicked at submission. Only the
components inside the vertex are computed now; the rest keep the first
vertex's bytes, as unknown formats already do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 01:06:44 +01:00
MarvisandClaude Fable 5.2 62b737a69b GPU: pipelines off the render thread and cached; indirect execution on
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]>
2026-11-24 01:02:11 +01:00
ifBars 8eaaf79c7b Reuse texture row spans when converting Xbox pixel layouts 2026-11-23 15:59:58 -08:00
TG0000andClaude Opus 5.5 cf703ccf77 xmem: write DirectStorage page destinations one view per run
write_physical mapped, committed and unmapped a view for every 64 KiB
page it wrote, and DirectStorage decoded each page-destination request
into a zeroed buffer first, then copied it. Every unmap flushes every
core's TLB, so with all the workers loading at once these writes were a
serial cost per page.

Pages are now looked up once and grouped into runs of consecutive slices
of one section (how titles allocate them), and each run is written
through one view. When a request's pages form a single run, DirectStorage
inflates or unpacks straight into that view instead of a buffer; pages of
several allocations still go through the buffer, written run by run.

Synthetic release benchmark (16 MiB destinations, Ryzen 9 5900X):
8 threads 3.5 -> 7.8 GiB/s; one thread, buffered then copied 0.96 GiB/s
vs in place 2.1 GiB/s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 00:59:56 +01:00
Yaekai e3e6dafd97 Shaders: lower v_xnor_b32 and v_swap_b32
Add lowering for v_xnor_b32 and v_swap_b32 (seen in GTA VI world compute shaders), and record v.dst as a read in ir.rs for v_swap_b32 / v_swaprel_b32 since both operands are read before being swapped.
2026-11-24 00:59:52 +01:00
Yaekai 720c23161f GPU: emit null buffer SRV/UAV when descriptor names a buffer with null resource
When a title creates a null buffer view (resource == 0, ViewDimension == BUFFER), buffer_bytes(0) returns None, so null_for() fell through to null_like() / null_view() (or a 2D texture UAV) and emitted a 2D texture descriptor into a slot where a shader expects a buffer.

Check desc[1] == 1 (D3D12_SRV_DIMENSION_BUFFER / D3D12_UAV_DIMENSION_BUFFER) in null_for() for both View::Shader and View::Unordered so null buffer views get a matching null buffer descriptor.
2026-11-24 00:59:49 +01:00
9hvn9yt2vk-netizen 0f198bf66b shader: look up an input channel without underflowing
find_input matched each input element with
`(row and channel in the element).then_some((id, channel - e.col))`.
then_some evaluates its argument first, so the subtraction ran for every
element, also those whose first channel is past the one asked for. In a
build with overflow checks (tests, debug runs) a pixel shader reading a
channel below any element that starts at z or w panicked, whichever row
that element was in, and packed inputs such as a float2 in .zw are
common. Release builds wrapped and threw the value away.

then() computes it only when the element holds the channel.

Found with a random-input harness over pixel, vertex and mesh programs
with matching signatures. The new test panics without the fix.
2026-11-24 00:57:59 +01:00
ifBars 47f321ed15 Clear the IAT directory alongside the import directory
Windows 10 maps the prepared image with both entries empty. The binder already retains the original slot RVAs, so preparation need not locate a linker-provided terminator.
2026-11-23 15:55:36 -08:00
alessiodeiaandBlueKaiman a95f6aec42 shader: keep fract(NaN) as NaN on NVIDIA and add synthetic GPU VALU tests
Fixes a real-hardware NVIDIA bug in fract() from 36eb0b4 and adds synthetic GFX10 -> DXIL -> GPU/WARP regression tests for the RDNA2 VALU lowerings from #2:

- fract(): select(OGT(r, k), k, r) is folded by NVIDIA's DXIL compiler into FMNMX (minNum), which swallows NaN and turns v_fract_f32(NaN) into 0x3f7fffff (and v_fract_f16(NaN) into 0x3bff). Comparing with pred::OGE against a distinct threshold (1.0 for f32, 1 - 2^-12 for f16) prevents the minNum fold and preserves NaN and +/-inf -> NaN on both NVIDIA hardware and WARP.
- valu_tests.rs: builds minimal synthetic GFX10 compute shaders, lowers them through the full pipeline (ir::build -> resource::track -> io::raise -> structure -> lower), validates with dxil.dll when present, and executes them via Host::dispatch on both hardware GPU and WARP without requiring console dxc. Covers v_fract_f32/f16, v_med3_f32/f16, v_sin/v_cos_f32/f16, and v_bfe_i32/u32 + s_bfe_i32.

Co-authored-by: BlueKaiman <[email protected]>
2026-11-24 00:51:42 +01:00
Manuel Pérez 058fab325d PE: remove leftover dbg_tls test and check layout offsets
Removes the print-only dbg_tls test in image.rs (TLS presence is already asserted in parses_own_test_binary) and switches layout.rs offset helpers (read_u32, read_u64, optional_header_offset, file_header_offset, data_directory_offset) to checked arithmetic so extreme offsets return None instead of overflowing.
2026-11-24 00:48:47 +01:00
BaggyALPHA 5a9ecf0f61 Report Windows commit-limit failures in crashes.log 2026-11-23 18:48:23 -05:00
Vanthys 536c5d4371 Reject empty XMA test fixture directories 2026-11-24 00:46:54 +01:00
Vanthys 7078f1e744 Guard texture and XMA offsets against overflow 2026-11-24 00:46:54 +01:00
9hvn9yt2vk-netizen eec3e06f7a shader: VICTORY_SHADER_LOOP_LIMIT to find what makes world frames slow
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.
2026-11-24 00:45:30 +01:00
Henrique Bueno 8b8ca7e746 loader: emulate clwb on Intel CPUs before Ice Lake 2026-11-23 20:43:13 -03:00
9hvn9yt2vk-netizen a0f45928d6 shader: a lane mask that needs its own value fails instead of overflowing the stack
In a wave64 compute program, writing only EXEC's high dword (for
example s_mov_b32 exec_hi, 0) and then running any vector instruction
crashed the whole process with a stack overflow. The new mask is opaque
and keyed by the unchanged low dword, so lowering the instruction's guard
asked for that dword's value, the value is a lane mask read as data, its
ballot needs the mask's lane bit, and that bit needs the value again:
mask_dword -> boolean -> atom -> get -> mask_dword, without end.

mask_dword now notes the masks whose ballot it is building, and a mask
reached again on the way fails with a reason. The instruction then fails
like any other that cannot be expressed: its result is missing, and only
a side effect that uses it stops the translation. A shader the translator
cannot handle must not take the title down at pipeline creation.

Found with a random-input harness over the whole translation (ir,
resource, io, structure, emit) of random decodable compute programs. The
new test overflows the stack without the fix. One million further
programs (about 160,000 fully translated) gave no panic, hang or
overflow.
2026-11-24 00:42:03 +01:00
LaunchDoesntCode 9fa1b43e8a GPU: verify WARP adapter is software before using it 2026-11-23 17:38:24 -06:00
raffclar d1aa2093b8 Loader: test 64-bit extrq at index 0, not in AMD's undefined range 2026-11-23 23:34:49 +00:00
Marvis b9aff99b98 Merge pull request #21 from Nostyxx/fix/nvidia-view-heap-cap
GPU: make tables past a capped host view heap afresh (NVIDIA menu hang)
2026-11-24 00:34:23 +01:00
Marvis 6d7df474b3 Merge pull request #19 from raffclar/exit-watchdog
Process exit: start the watchdog before other threads end
2026-11-24 00:31:26 +01:00
raffclar 27b5152288 Loader: test the AMD-only instruction emulation on any CPU
The test for the emulation runs the real instructions. AMD CPUs, and
most CI runners, execute them natively, so the emulation was tested
only on Intel CPUs.

The new tests give the emulation instruction bytes and saved registers
directly, so they work on any CPU. They cover clzero, monitorx/mwaitx,
the immediate and register forms of extrq/insertq, xmm8 to xmm15,
length 0, and the instructions and exceptions it must not emulate.

The old test stays: on an Intel CPU it is the only test of the full
path through the vectored handler.
2026-11-23 23:30:15 +00:00
Marvis c07f19d559 Merge pull request #15 from 9hvn9yt2vk-netizen/fix-texture-extents
texture: refuse extents past 16384 texels instead of overflowing
2026-11-24 00:28:40 +01:00
Jeremy Goldberg 352ba0997d test(gpu): use the SDK root parameter in the serializer fixture 2026-11-23 18:27:12 -05:00
ifBars 96a964e16c Keep an empty import descriptor for the Windows 10 loader 2026-11-23 15:20:22 -08:00
Manuel PérezandClaude Opus 5.5 8661578c1b PE: checked file offset in rva_to_file_offset
A section whose PointerToRawData lies near 4 GiB made
file_offset + delta overflow: a panic in debug builds, a wrong offset in
release ones. The section now yields no offset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 00:19:38 +01:00
Marvis b8000d18dc Merge pull request #14 from 9hvn9yt2vk-netizen/fix-xma-zero-length
xma: stop at a zero-length frame instead of looping forever
2026-11-24 00:18:09 +01:00
NostyxxandClaude Opus 5.5 f3ae2edbd4 GPU: make tables past a capped host view heap afresh
The title's shader-visible view heap has 1,245,184 slots. NVIDIA caps
shader-visible view heaps at 1,000,000, so HostHeap::new falls back to a
heap of 1,000,000 whose title part ends at 934,464, with the dynamic
slots after it. The title binds a per-frame table ring in its top slots
(934,464 to 1,245,184, moving 4,096 slots a frame), so those tables'
host offsets either aliased the dynamic slots or ran past the heap's
end. On NVIDIA the GPU then hangs within the first-boot screens
(DXGI_ERROR_DEVICE_HUNG), after black and glitched frames.

A table that reaches past the host heap's title slots is now made
afresh in dynamic slots, as tables holding constant buffers already
are, and the shader is given the new offset. Hosts that take the whole
heap (AMD) are unchanged. mirror() logs the highest title slot it
meets past the host heap, once per new maximum.

Tested on an RTX 3080 (driver 32.0.16.2114): the first-boot screens and
menus run without glitches, and the title loads into the intro with no
device loss (before: device removed about 45-60 s in, 3 of 3 runs). The
slot warning went from 78 lines to none. cargo test --workspace passes.

Refs #16, #11

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 06:16:01 +07:00
MarvisandClaude Fable 5.2 d50f2368cb GPU: the world stays up; indirect execution behind a switch
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]>
2026-11-24 00:13:19 +01:00
MarvisandClaude Fable 5.2 1922261412 Shaders: sine and cosine in turns, exact zeros at half and quarter turns
v_sin and v_cos (f32 and f16) take an angle in turns. The whole turns
now come off first (x - round_even(x), exact), so a large angle keeps
its fraction of a turn instead of losing it when scaled to radians.
The sine of a half turn and the cosine of a quarter turn are exactly +0,
as the hardware gives; the host's functions of the rounded angle give
about 1e-7. A zero operand passes unreduced, so sin(-0) stays -0.

float_semantics_are_the_consoles asserts the exact zeros (it failed
before this change). The compiler the tests use takes whole turns off
itself, so the large-angle path cannot be reached from HLSL and rests
on the measurements cited in issue #2.

Left from the issue: denormal operands of the legacy multiply, which
needs the float mode register as state first.

Refs #2

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 00:13:19 +01:00
MarvisandClaude Fable 5.2 5d52765de7 Shaders: med3 with NaN, fract below 1.0, signed bit fields past bit 31
Three lowerings gave results the console's GPU does not (issue #2, from
hardware measurements published by another project):

- v_med3_f32/f16: with a NaN operand the hardware gives the minimum of
  the three; we gave the median of the other two.
- v_fract_f32/f16: the hardware never reaches 1.0 (a tiny negative
  input gives the largest value below it); the host's own fract differs
  by vendor and can give 1.0.
- v_bfe_i32/s_bfe_i32: a signed field running past bit 31 extends from
  bit 31; the shift is arithmetic now. Fields that fit are unchanged.

The fract case is asserted in float_semantics_are_the_consoles (the
console compiler emits v_fract_f32 for frac). The other two cannot be
produced from HLSL with the compiler the tests use and rest on the
measured values in the issue.

Still open from the issue: range reduction before sine and cosine, and
denormal operands of the legacy multiply.

Refs #2

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 00:13:19 +01:00
9hvn9yt2vk-netizen 2ad0a1ef74 texture: refuse extents past 16384 texels instead of overflowing
Layout::new checked that width, height and depth are non-zero but not that
they are bounded, so values a title passes unchecked (up to u32::MAX)
overflowed the size arithmetic: `offset * depth` in the linear layout,
`slice_size * slices` and the per-mip sizes in the tiled one, and a u32
next_multiple_of in Layout::tiled. Debug builds panicked; release builds
wrapped silently and returned a wrong size.

Refuse anything past 16384 texels per side, the most a GFX10 image
descriptor holds, so no texture the GPU can use is affected.

Found with a random-input harness (four distinct overflow sites, none left
after this change).
2026-11-24 00:08:59 +01:00
Marvis abb8d9fe14 Merge pull request #10 from ismailchaka1/emulate-amd-only-instructions
loader: emulate AMD-only instructions on Intel CPUs
2026-11-24 00:08:20 +01:00
raffclar 1d1f82651a Process exit: start the watchdog before other threads end
The exit code ended the other threads first and then started the
watchdog. A thread that ends can hold the heap lock or the loader lock.
A new thread needs both, so the watchdog did not start and the exit did
not stop.

Now the exit code starts the watchdog and waits until it runs its own
code: only then are its loader notices and Rust's thread set-up done.
The watchdog publishes its thread id, and end_other_threads does not
end it. The wait has the same deadline as the detach, because this
thread, or a thread that waits for it, can hold the loader lock; then
the watchdog cannot start.

After the deadline the watchdog only ends the process. It does not
log, because logging needs the heap and the lock of the log writer.

The exit test now also checks that a thread in `keep` is not ended.
2026-11-23 23:08:01 +00:00
9hvn9yt2vk-netizen 72fbbc3f87 xma: stop at a zero-length frame instead of looping forever
next_frame walks the frames before `start` to learn whether the frame at
`start` is the packet's last. A damaged packet whose earlier frame has a
length of 0 never advanced `at`, so the walk spun forever (in a debug build
it overflowed `number` after about 4 billion rounds and panicked).

Apply the rule read_frame already uses: a length that does not cover its
own 15-bit field is not a frame, and the search ends.

Found with a random-input harness. The new test hangs without the fix and
passes at once with it.
2026-11-24 00:08:01 +01:00
ismailchaka1andClaude Opus 5.5 934e67fbad loader: emulate AMD-only instructions on Intel CPUs
The title is built for Zen 2 and uses clzero, monitorx/mwaitx and SSE4a's
extrq/insertq, which Intel CPUs lack: it died at startup with an illegal
instruction on an i7-14700KF. The vectored handler now does their job and
resumes: clzero zeroes the 64-byte line at rax, monitorx is skipped, mwaitx
yields, extrq/insertq run on the saved XMM registers.

Tested: victory-loader crash tests (new one runs each instruction), and the
title now gets past startup on an i7-14700KF with an RTX 4070 SUPER.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 22:49:54 +00:00
Marvis 4776fb84d0 Merge pull request #4 from Exorion1er/fix/tls-callbacks-reloc
Loader: keep the cleared TLS callback pointer out of base relocations
2026-11-23 23:45:26 +01:00
ExorionandClaude Opus 5.5 c21208c18a Loader: keep the cleared TLS callback pointer out of base relocations
prepare() zeroes the title's TLS AddressOfCallBacks but left the
IMAGE_REL_BASED_DIR64 entry that patches it. When the loader maps the
prepared copy away from its preferred base, that entry turns the 0 into
the rebase delta and the loader reads TLS callbacks from there. On
Windows the copy lands at 0x140000000 so the delta is 0; under Wine,
which maps DYNAMIC_BASE images high, LoadLibraryExW faults in ntdll
before any title code runs.

The entry is now rewritten as IMAGE_REL_BASED_ABSOLUTE (a no-op), and
the prepare test checks that no relocation targets the cleared field.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 23:37:05 +01:00
MarvisandClaude Fable 5.2 015d45bfff README: status, subsystem table, how to run, debugging switches
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]>
2026-11-23 23:15:07 +01:00
MarvisandClaude Fable 5.2 2849477415 Run Grand Theft Auto VI from first boot into the world
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]>
2026-11-23 23:10:01 +01:00