Commit Graph
451 Commits
Author SHA1 Message Date
localandClaude Opus 5.5 8a8ad353d4 Crash tracing that can stay on: VICTORY_D3D12_DRED=light and =faults; lost texture writes named
A removed device is reported by whoever finds it first, and the list it
stopped in by its name. The window stand-in of VIctory 9145d9d is left out
until it has been tried.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:15:58 -06:00
local d1c8acd527 Revert "HLE: show title windows through a stand-in that always reads its messages"
This reverts commit 9820bdc45e.
2026-11-25 01:14:23 -06:00
localandClaude Opus 5.5 ff1bd66387 Merge local/upcopies
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:12:28 -06:00
localandClaude Opus 5.5 751bc32dfc Merge local/lighting
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:12:28 -06:00
localandClaude Opus 5.5 b9c18b0685 VIctory e29391f, 13185f5 and 4fc9d70, by hand
16-bit interpolations write the half op_sel picks, with omod and clamp; the
device says whether it was removed; detiling ends with its staging buffer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:12:28 -06:00
AnoHunted 64c3178097 Audio: an XMA write block past the ring's end wraps before the first write
The write block (context word 0, bits 27-31) was used as it is for the first
block of a pass, so one at or past the ring size (bits 22-26) was written
past the ring's end, possibly into another APU allocation, before it wrapped
with (write + 1) % size. Take it modulo the ring first, as the read block is
taken, and as advance_read does.

(cherry picked from commit 7a5d85e6a2867081ed54515ce7f33bae3fcb643d)
2026-11-25 01:08:05 -06:00
quaternion 913d4f0c5d fix(hle): keep apostrophes intact when splitting relaunch args
Windows command lines quote only with double quotes. split_args treated an apostrophe as a quote too, so -name=O'Brien swallowed the following argument. Only toggle on ", and add the apostrophe case to the relaunch test (review note on #455).

(cherry picked from commit eb8067f2eae84cb64081af357cd03a48944a42b2)
2026-11-25 01:08:05 -06:00
localandClaude Opus 5.5 daeeb28c1e VIctory's 88 commits fitted in; clzero loops end as the console's do
The fork's emulation of a clzero loop zeroed from the start to the end and
left rax at the end: the instruction zeroes whole lines and the test comes
after it (VIctory's own test of it failed here). The title's descriptor
heaps are held shared while their slots are written (VIctory 628b95d held
them alone, for every thread that writes descriptors).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:06:46 -06:00
moe-miau 70868f8c88 XGameSave: a stray or unreadable version folder never costs the save
Recovery took any name `v<digits>` as a version, so a leftover `v01`
next to a committed `v1` parsed as version 1, and the cleanup rebuilt
the name as `v1` and deleted the committed save (#870). A correctly
named but unreadable newer entry (an empty `v2`, a file, a broken
manifest) did the same: `v1` was pruned as older, the read failed, and
the next update committed a fresh `v1` holding only the changed blobs,
which the following read pruned again.

Now only `v<N>` exactly as `commit` writes it is a version. `current`
takes the newest version whose manifest reads, removes only versions
below it, and leaves unreadable newer entries alone. An update goes
above the highest version name present, so a stray entry neither hides
the save nor blocks writes. With no readable version at all, reads and
updates still fail and nothing is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b8dbcba260d1012dca8f06ee572e5244bffba1ac)
2026-11-25 01:03:03 -06:00
pes7 3729ba04d5 gfx10: resolve the opcode name once, at decode time
`Instruction::name()` binary-searches the opcode table, and the pipeline
asks about every instruction eight times per translation: `ir::build`,
`structure`, `resource` (which has the most call sites), `io` and
`lower`. The answer cannot change - the encoding and opcode are decoded
from the words and never rewritten - so resolve it once when the
instruction is built and read the field after that.

Measured with the synthetic bench from #1002 (no game data), sixteen
interleaved rounds per arm, best of each, nanoseconds per instruction, at
256/1k/4k/16k instructions:

  resource     17 -> 9, 15 -> 7, 24 -> 16, 23 -> 15    (0.47-0.67)
  lower       511 -> 479, 428 -> 411, 440 -> 401, 477 -> 428  (0.90-0.96)
  io           27 -> 23, 26 -> 21, 26 -> 22, 30 -> 22   (0.73-0.85)
  whole       926 -> 881, 920 -> 874, 958 -> 921, 1019 -> 939 (0.92-0.96)

`decode` pays the one search it used to be spared (112 -> 115 at 16k,
inside the run-to-run spread); every stage after it reads a field. The
emitted DXIL is byte-identical at all four sizes.

cargo test --workspace --locked: 342 passed, 0 failed, 7 ignored.
Both clippy configurations clean; cargo xtask policy ok.

(cherry picked from commit 146dfef67a3ecd2c4fd8f9cff8de149c65dfe6f0)
2026-11-25 01:03:03 -06:00
Marvis 137bdb5567 README: status of 2026-11-24
Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 70564ae08c82d43df5fad97b08d34628b07b1d9d)
2026-11-25 01:03:03 -06:00
Marvis 3f0055e213 Diagnostics: VICTORY_POKE writes title bytes twice a second
A title that ends itself when its main loop has not ticked for a while
runs on through slower frames.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 532cb7cdfee02e6139a683f79ee4c9b4a92828a4)
2026-11-25 01:03:03 -06:00
给伊莉雅补魔 f4d1863f25 gpu(list): log initial pipeline bound on reset/reset_x for parity with create_list
(cherry picked from commit 8d3a025df199e6e26ccb404d4cf0f172fdde8b1c)
2026-11-25 01:03:03 -06:00
Vax 9820bdc45e HLE: show title windows through a stand-in that always reads its messages
A title makes its window on one of its own threads and reads its messages
only when that thread reaches its PeekMessage loop. In slow frames and
loads that is seconds apart, so the system shows the busy cursor over the
window and a click turns it into a "Not responding" ghost.

A top-level title window is now made message-only (it can never be shown),
and a stand-in window with the title's text, style, icon and fitted size is
made on a thread of ours that does nothing but pump its messages. The
title's ShowWindow shows the stand-in, its window text follows, closing the
stand-in suspends and ends the title as before, the keyboard window menu is
still refused, and the stand-in goes when the title's window does. Frames
are presented to the process's visible window, now the stand-in; input is
unaffected, since titles read it through GameInput, not window messages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 9145d9d3dabb0d5f8263b4203a82586710929d90)
2026-11-25 01:03:03 -06:00
imjustprism 5f1a45bdc2 flush a kept save blob that had to be copied
(cherry picked from commit eb7cc2d43711e806bbd8578d4ef75bde30326c20)
2026-11-25 01:03:03 -06:00
HailLucifer666 a5c98fe072 GPU: serialize pipeline library atomic writes with unique temp files
save() releases LAST and library locks before calling write_atomically(), which always wrote to the same fixed host-pipelines.tmp path. Concurrent worker saves and shutdown save(true) can truncate or unlink each other's temp file on Windows.

- Serialize write_atomically() with a mutex and unique per-call temp filename (.tmp-<pid>-<n>), cleaning up the temp file on rename failure.
- Add a 4-thread concurrent write_atomically stress test.

(cherry picked from commit be824d9d218320c71f2623ed4b14045210785db5)
2026-11-25 01:03:03 -06:00
AgneyaK 9c63a43431 run: stop with a clear message when the title's own DLLs are missing
A package copied without the DLLs that ship beside the executable leaves
every import from them unbound, and the title stops at its first call into
one: Grand Theft Auto VI 1.0.2.1 at +0x2237178 during System Init (#930,
#1553, #8), with nothing saying why.

After mapping the title DLLs, name the main image's static imports that
must come from the title's folder (neither the host nor our runtime serves
them) but were not mapped from it. Print them; when executing with the
default trap policy, stop before running title code. With
`--unimplemented zero` the title still runs (stubs were asked for).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e9cb14ad3ea2f7a3ec051d9f9691684d7e9037ae)
2026-11-25 01:03:03 -06:00
BastienRdz 903b568edc GPU: fences answer for ID3D12Fence1 as documented
fence.rs already implements ID3D12Fence1::GetCreationFlags at slot 11
(0x58), but FENCE_IIDS only listed ID3D12Fence and PAGEABLE_IIDS, so
CreateFence and QueryInterface rejected ID3D12Fence1 with E_NOINTERFACE.

Add ID3D12Fence1 (433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a) to FENCE_IIDS
and add a unit test covering creation, QueryInterface, and
GetCreationFlags.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit bbdc3ca7249948b7624ba65f4282615caef895b8)
2026-11-25 01:03:03 -06:00
Vyacheslav Venglovsky 8f08131364 Formats: test texture layouts against addrlib's own sizes and addresses
The layouts follow AMD's addrlib, but the tests only checked them
against themselves (every element on its own address) and a few
hand-worked offsets. Two tests now pin them to addrlib itself
(Mesa src/amd/addrlib at ed09d38, Navi 21 settings):

- layouts_match_addrlib: 21 descriptions over every mode Layout::offset
  addresses (linear, 256 B, 4 KiB and 64 KiB S and D; 1-16 byte
  elements, block compression, arrays, mip tails, 2D and 3D), each
  with addrlib's surface size, first tail mip and a hash of the
  address of every element.
- deep_volumes_keep_their_chain_in_each_slabs_tail: a 16x16x64 volume
  whose chain is all in the tail (addrlib's mipChainInTail), with
  explicit addresses: each 16-slice slab has its own tail block, and
  mip 1's 32 slices span two of them.

Over a wider sweep (about 20,000 descriptions, every mip count for
volumes up to 256 deep) main matches addrlib exactly in size, tail and
every address compared. A tail-entry rule that also requires a mip's depth to
fit one slab changes 5,456 of 14,780 volume layouts (5,087 grow, by
up to 5x) and moves their addresses; both tests fail with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit f078008b112343b6e68c8ca72b884073064320c1)
2026-11-25 01:03:03 -06:00
Tex 32676e3f79 Loader: guard clwb_loop shortcut against u64 overflow and wraparound
(cherry picked from commit 274f6988c9779b0612186c3448123e5e157d56e4)
2026-11-25 01:03:03 -06:00
Calvix2k 241a70924a HLE: guard dialog commands before initialization
(cherry picked from commit 9ccb83c00a9b0ee5121e4a9b2f6c0ee223630c84)
2026-11-25 01:03:02 -06:00
Tex 200bde46a6 Shaders: precompute MD5 round constants and avoid per-block Vec in md5_block
(cherry picked from commit 711d651ccab7673e5ab4365bd692294e954c845f)
2026-11-25 01:03:02 -06:00
Tex dc155d2fb9 Shaders: fold empty loop latches containing only dead phis
(cherry picked from commit be3202de393b71c9385f74b587256b01b48f7f63)
2026-11-25 01:03:02 -06:00
fluffyflattershy-afk 482ee84e2c HLE: allow an explicit maximum title window size
(cherry picked from commit a7636dd7b1a4a76eaa4f1cf211d2ff31faacc3f5)
2026-11-25 01:03:02 -06:00
Luiz Otavio Mello de Campos eb84fc3db7 Test scalar quadmask lowering on D3D12
Check both mask widths, the condition code and the zeroed upper destination.

(cherry picked from commit e3fe5bf94f848c2a6ca36900c2dfa70342083109)
2026-11-25 01:03:02 -06:00
BaggyALPHA 2d34e466b3 HLE clears the result of blocked address lookups
(cherry picked from commit 2b13ae41920296be79dc9642913a7807ecc98d57)
2026-11-25 01:03:02 -06:00
mgunes1311-lab b6ca1191b7 Shaders: do not parse VS inputs when reading mesh shader stage I/O
(cherry picked from commit 4e155a36ad728e1a21e7253ff4097af06582a45f)
2026-11-25 01:03:02 -06:00
fuzeofficial c339306eff Shaders: compress replaced phi chains in remove_trivial_phis
(cherry picked from commit 5c44562868df4c33cce60488132d83cf5ff02f30)
2026-11-25 01:03:02 -06:00
Omeya Sawant 1b744f84e6 docs: explain Windows shader-test validator prerequisite
(cherry picked from commit 32eb93495919655651e6b64be31e68b71af70422)
2026-11-25 01:03:02 -06:00
EatCodeSleep2 635360da20 Shaders: fold conditional branches to their fallthrough
(cherry picked from commit 1ed26e50d860f328cd42c640bc12486f65603995)
2026-11-25 01:03:02 -06:00
EatCodeSleep2 6bd18afffa HLE: complete XPackage progress callback unregistration
(cherry picked from commit 4f54c4775574e78ea7a869eae6605a401b107db3)
2026-11-25 01:03:02 -06:00
ashrafsdrop 4ae3490420 XNetworking: wire UDP port change callbacks and UTF-16 security queries
(cherry picked from commit 64a33ec757c1da0963a6821cd59995b8efabe946)
2026-11-25 01:03:01 -06:00
divyeshganta 20e295f2fc HLE: avoid misaligned f32 output slice in XApu
(cherry picked from commit 643fc6dfecffbd06de7313897b7d4bc4ffef6564)
2026-11-25 01:03:01 -06:00
DoubleD17 6d24aaa997 Deduplicate image paths in victory census
(cherry picked from commit 142ec8dd4563608b67ffabc8ba47175508f9a660)
2026-11-25 01:03:01 -06:00
BastienRdz 0d2ac11430 XAsync: canceling a call that already completed leaves it alone, as documented
Microsoft's XAsyncCancel reference says: "If the XAsyncCancel function
is invoked for an asynchronous call that has already completed, nothing
happens."

A call that completed successfully with a nonempty result stays in
CALLS until the title reads the result via XAsyncGetResult, so
XAsyncCancel still found it and invoked the provider with OP_CANCEL
before XAsyncComplete returned early on call.done.

Check call.done under its lock in XAsyncCancel and return immediately
when the call is already complete, dropping the lock before invoking
the provider.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 44ce06784b9ff8c7d9ab7ea4a9db02d72ee7804f)
2026-11-25 01:03:01 -06:00
Eduardo Bertozzi 54d9c1bfa8 README: how to install Rust on Windows (#1087)
Getting started names Rust (pinned in rust-toolchain.toml) without saying
how to get it. Add rustup through winget or rustup.rs, that the pinned
toolchain then comes on the first cargo command, and the MSVC C++ build
tools the Windows target needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 098a26aad5e3ef4655a9282f78cf713a2fc01a55)
2026-11-25 01:03:01 -06:00
Giuseppe Rainone 1c0015f062 HLE: constrain the title before suspending it
Closing the window never suspended Grand Theft Auto VI: its suspend
routine waits for a state that only its constrained-change routine
starts, and RegisterAppConstrainedChangeNotification bound to the host's
version, which never calls it. Every close ended in the one-second
deadline.

Register constrained-change routines here and run them (constrained)
before the suspend routines (quiesced), as the console does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit a7847a520197a45425bccf803a644e1968de67b2)
2026-11-25 01:03:01 -06:00
bvtterbroot 3e3c49165f GPU: log the TDR settings, and warn when a GPU hang would freeze the PC
With TdrLevel 0 Windows never resets a hung GPU: a slow or hung world
frame freezes the whole desktop, and the runtime never sees a device
removal it could report (#1054). With 1 the timeout is a blue screen.
Both are set by hand, often to keep slow frames from being reset, and
reports of "the PC froze" do not say so.

When the host device is made on a hardware adapter, read TdrLevel,
TdrDelay and TdrDdiDelay from HKLM\SYSTEM\CurrentControlSet\Control\
GraphicsDrivers, log them ("default" where a value is not set), and warn
for TdrLevel 0 or 1 with what to set instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 42961e8e577e5f195db0982e34bb59e800998c77)
2026-11-25 01:03:01 -06:00
给伊莉雅补魔 74c9545deb GPU: validate null args in create_deserializer to prevent d3d12 AV and add root.rs tests
(cherry picked from commit ef0c3e944916e2273457626be3d34f8dd5591eb4)
2026-11-25 01:03:01 -06:00
给伊莉雅补魔 c0cb57396d GPU: guard zero/overflowing stride in expand_rects and add primitive.rs unit tests
(cherry picked from commit e3c9dd0d53d92d7a1dc7b86d75147d3ed390c61a)
2026-11-25 01:03:01 -06:00
Luiz Neves d8b7d66993 Shaders: hardware test for the integer v_min3/v_max3/v_med3
(cherry picked from commit 8610ffb85baedbc7b8c4c9de1222b0911e00e589)
2026-11-25 01:03:01 -06:00
heromike405-arch ae0952d7f9 XMA: gather frame payloads one byte at a time
Read complete payload bytes directly inside an XMA2 packet. Keep the bit reader for packet headers, interleaved stream skips and the final partial byte. Add coverage for all eight alignments at packet boundaries and EOF. On Windows x86-64, 36,720 synthetic reads matched the previous implementation, including returned bytes and the next frame position. A release microbenchmark of read_frame measured 1009 to 168 ns for 128-byte frames and 7977 to 1062 ns for 1 KiB frames (median of nine runs).

(cherry picked from commit 03a6f22906b4372ec08d003e9103997659647b0f)
2026-11-25 01:03:01 -06:00
David Palacios 467bb36711 CLI: add AVX2 pre-flight CPU check before executing titles
(cherry picked from commit 534e1dd74c57448bef4c525e204acc123387d6f2)
2026-11-25 01:03:00 -06:00
Luiz Neves b2e23f834c HLE: test that XGSuggestSwizzleMode picks linear for a 1D texture
(cherry picked from commit 246ecea9631acfe1b694421c6c600e3981a1f752)
2026-11-25 01:03:00 -06:00
BastienRdz ea78bb9483 Loader: a clwb in the last bytes of a page is emulated instead of faulting
emulate_amd_only copies only the bytes left in the faulting page and
gated clwb_len on n >= 15 because clwb_len took a fixed [u8; 15]. A
4- to 10-byte clwb starting in the last 14 bytes of a page (or falling
back from a clwb_loop that straddles the page end) was therefore
skipped, leaving pre-Ice Lake Intel CPUs with an unhandled
STATUS_ILLEGAL_INSTRUCTION.

Change clwb_len to take &[u8], bounds-checking each byte read and
returning Some(len) only when len <= code.len(), and drop the n >= 15
guard in emulate_amd_only.

Fixes #924.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 60d2cf9cbcf5a2abc773d5de10c3c892e77d3340)
2026-11-25 01:03:00 -06:00
Enzo Souza Duarte 41dc5da4c9 Config: ignore an empty VICTORY_CONFIG
(cherry picked from commit fd44561ea1180aff5380285527fb8cac8195f4e8)
2026-11-25 01:03:00 -06:00
nino-exe bb0a2428fc policy: resolve a .. in the not-yet-existing part of a path
`resolve` canonicalizes the longest existing prefix and re-appends the rest, but it walks up with
`Path::file_name()`, which is None for a trailing `..`. A path such as `<tmp>/a/../b` (nothing exists yet) hit the
`_` arm and returned PolicyError::Io, so a cache_dir or data_dir with a `..` in a directory that does not exist yet
was rejected, and `normalize`'s `..` handling for the missing tail was never reached.

A trailing `..` is now kept in `rest` so `normalize` resolves it lexically.

Test: resolves_dot_dot_in_a_path_that_does_not_exist_yet (fails before, passes after). cargo test -p victory-core,
cargo fmt --check and cargo clippy --tests are clean.

(cherry picked from commit 52f0a099ede8aa4d5bde61a0c46963a77a4378ba)
2026-11-25 01:03:00 -06:00
quaternion 6ee01b61bd fix(hle): honor the requested executable on relaunch
runtime stores an absolute image path while relaunch_args searched raw CLI arguments for exact text, so a relative launch argument made XLaunchNewGame silently rerun the old title. Normalize the argument the same way runtime does before replacing it. Also split the title's quoted config args into proper arguments instead of split_whitespace. Add a regression covering a relative startup path, a different target and quoted/empty args.

(cherry picked from commit 71e88665c44f6f82370e2fb84e6d2358c1e7b180)
2026-11-25 01:03:00 -06:00
quaternion d23f0b83e1 fix(hle): read manifest fields past inline XML comments
elements() took field text up to the next '<', so a generator comment before the value made TitleId, StoreId or SizeMB empty. Skip comments while gathering the text. Add a regression with comments inside all three fields.

(cherry picked from commit ca362a42473bb0f8f9a83377091287a621e94527)
2026-11-25 01:03:00 -06:00
quaternion 7a4f0018b5 fix(loader): stage prepared images in per-writer files
write_if_changed used a shared <hash>.tmp file, so two concurrent cold launches of the same image could truncate each other's staging bytes or fail the rename after the other had published. Move publication into a portable module that stages under a unique pid/sequence name and removes it on failure. Two hermetic tests cover concurrent publishers and a failed rename.

(cherry picked from commit 1aac20aa8fd97237053c985b942225d54c0194a7)
2026-11-25 01:03:00 -06:00