Commit Graph
430 Commits
Author SHA1 Message Date
Vyacheslav Venglovsky 8780871ff7 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 e394a216f9 Loader: guard clwb_loop shortcut against u64 overflow and wraparound
(cherry picked from commit 274f6988c9779b0612186c3448123e5e157d56e4)
2026-11-25 01:03:03 -06:00
Calvix2k e9b4302e8f HLE: guard dialog commands before initialization
(cherry picked from commit 9ccb83c00a9b0ee5121e4a9b2f6c0ee223630c84)
2026-11-25 01:03:02 -06:00
Tex f780f33c84 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 718379621b Shaders: fold empty loop latches containing only dead phis
(cherry picked from commit be3202de393b71c9385f74b587256b01b48f7f63)
2026-11-25 01:03:02 -06:00
fluffyflattershy-afk 8af324dc02 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 47d1fd88ca 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 4f20cb5eef HLE clears the result of blocked address lookups
(cherry picked from commit 2b13ae41920296be79dc9642913a7807ecc98d57)
2026-11-25 01:03:02 -06:00
mgunes1311-lab 747805e697 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 8d30f0358f Shaders: compress replaced phi chains in remove_trivial_phis
(cherry picked from commit 5c44562868df4c33cce60488132d83cf5ff02f30)
2026-11-25 01:03:02 -06:00
Omeya Sawant 83a0869c4b docs: explain Windows shader-test validator prerequisite
(cherry picked from commit 32eb93495919655651e6b64be31e68b71af70422)
2026-11-25 01:03:02 -06:00
EatCodeSleep2 a850b066ed Shaders: fold conditional branches to their fallthrough
(cherry picked from commit 1ed26e50d860f328cd42c640bc12486f65603995)
2026-11-25 01:03:02 -06:00
EatCodeSleep2 ba0d0bceab HLE: complete XPackage progress callback unregistration
(cherry picked from commit 4f54c4775574e78ea7a869eae6605a401b107db3)
2026-11-25 01:03:02 -06:00
ashrafsdrop 5af6dfe3ff 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 568a85e5cf HLE: avoid misaligned f32 output slice in XApu
(cherry picked from commit 643fc6dfecffbd06de7313897b7d4bc4ffef6564)
2026-11-25 01:03:01 -06:00
DoubleD17 8777df612c Deduplicate image paths in victory census
(cherry picked from commit 142ec8dd4563608b67ffabc8ba47175508f9a660)
2026-11-25 01:03:01 -06:00
BastienRdz dea490a88b 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 1a2c0c0bc3 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 a2d8f0fb85 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 474f949c4d 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
给伊莉雅补魔 3a24b38bfb 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
给伊莉雅补魔 14e15c8188 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 df526e5cfd 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 5e4481fc8d 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 36212045ae 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 b9b890f289 HLE: test that XGSuggestSwizzleMode picks linear for a 1D texture
(cherry picked from commit 246ecea9631acfe1b694421c6c600e3981a1f752)
2026-11-25 01:03:00 -06:00
BastienRdz a6f0d8055b 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 338fb75668 Config: ignore an empty VICTORY_CONFIG
(cherry picked from commit fd44561ea1180aff5380285527fb8cac8195f4e8)
2026-11-25 01:03:00 -06:00
nino-exe 7fed69565a 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 12d53be52a 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 9257139db8 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 b0f38b4a0c 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
quaternion e7b97d9bf6 fix(pe): keep every name for a shared export ordinal
The PE-specific export table stores one name per address-table slot, so when two names alias one ordinal the earlier name is silently dropped from ImageInfo and from victory inspect --exports. Use the generic Object::exports iterator instead, which yields every named export and then ordinal-only entries, and map its target and flags back to our representation. Add a synthetic PE regression with two names for one ordinal plus a separate export.

(cherry picked from commit d0dd9fc5c01ce2e7e82047b4ab7e5b4821c82d7a)
2026-11-25 01:03:00 -06:00
给伊莉雅补魔 7da03c4a8e GPU: add synthetic unit tests for query.rs and signature.rs
(cherry picked from commit 0be58e62d24181a9eb60244a7e4d878a3627d401)
2026-11-25 01:03:00 -06:00
给伊莉雅补魔 54909476b7 PE: add synthetic unit tests for implib.rs and layout.rs
(cherry picked from commit 131944d02dc0b37469f85f907234c664eb8027af)
2026-11-25 01:03:00 -06:00
Aws 2a23c5be20 List successfully emitted shaders in offline translation scans
(cherry picked from commit 6d174aeeeb93669ab9f43ff01b24963933433af8)
2026-11-25 01:03:00 -06:00
TG0000 60518beb63 GPU: seek directly to private data on final release
Co-Authored-By: GPT 6.2 Sol <[email protected]>
(cherry picked from commit 3e98bd7e0ce79762162ac958e3ab67cc85de00c9)
2026-11-25 01:03:00 -06:00
给伊莉雅补魔 4e0591f628 loader(crash): verify unwind against known caller frames when RtlCaptureStackBackTrace returns empty
(cherry picked from commit 121412bec21b0790d04d56399f49e2d140652864)
2026-11-25 01:02:59 -06:00
TG0000 64c51bf223 Formats: share immutable texture swizzle tables
Co-Authored-By: GPT 6.2 Sol <[email protected]>
(cherry picked from commit 64b80c310941c8c105c9ac78fe4c29004f5e88a4)
2026-11-25 01:02:59 -06:00
给伊莉雅补魔 5cc6135363 docs(architecture): list BCPack as implemented in victory-formats
(cherry picked from commit aaacc2dcfe09afc10d0893b0259ef20afd326280)
2026-11-25 01:02:59 -06:00
DocBlack89 7a9a3c584b fix(pipeline): retry collisions when creating cache staging files
Preserve stale staging files left by interrupted writers and retry a bounded number of atomic create_new attempts. Propagate unrelated I/O errors immediately. Add deterministic CPU regressions. AI-assisted.

(cherry picked from commit a32eacdd5e0f2e55b5c0cddeb0d44d5fa93f9bb9)
2026-11-25 01:02:59 -06:00
Nixitov 52cb9f77ad HLE: implement the RPC runtime's GUID calls
(cherry picked from commit 7216ab7113115ea1accfabc6e3a00ee700c7c846)
2026-11-25 01:02:59 -06:00
EatCodeSleep2 654f33a204 Handle unsupported display deferrals in the HLE test
(cherry picked from commit efe102edac86f365a9951f3c92228413cbee8e46)
2026-11-25 01:02:59 -06:00
Thomas Askharoun c5692adf0a Show on-disk file size in victory inspect
(cherry picked from commit 43e2ca9de29f5833941970e82ed89872c9f86a81)
2026-11-25 01:02:59 -06:00
AlanQiang0418 76e1884968 Formats: reject multisampled linear texture layouts
(cherry picked from commit 350f91c23a9402b2a556a84c208a80030910ae3f)
2026-11-25 01:02:59 -06:00
LF2000 Builder 20602d4b13 translate: refuse a VICTORY_EMIT_DUMP directory inside the repo
translate writes emitted DXIL and validator reports to the
VICTORY_EMIT_DUMP directory. Both are derived from the game's shaders,
but the directory was never checked against the source tree. With
VICTORY_EMIT_DUMP=. run from the checkout, the .txt reports land in the
repo, and git and cargo xtask policy both let them through.

Check the directory once at the start of translate::run, as Config
already does for the cache and data directories.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 988fd9a64718ee9a235cff3b60192b6b86006c4d)
2026-11-25 01:02:59 -06:00
LF2000 Builder 81fa73c2aa Shaders: print only the operands an instruction has in SP3 text
The disassembly text showed operands that some instructions lack, and
dropped VOP3P negation that applies to one half only:

- s_memtime, s_memrealtime and s_get_waveid_in_workgroup printed the
  unused SMEM base and offset.
- A global or scratch access with no SGPR base printed `null`, not `off`.
- A MUBUF load with lds printed the unused vdata as a destination.
- VOP1 SDWA printed src1_sel, though VOP1 has no second source.
- VOP3P ops other than v_fma_mix with only neg_lo or only neg_hi set on
  a source printed as if the source were not negated. These now get
  LLVM's neg_lo:[..] and neg_hi:[..] suffixes; a source negated in both
  halves keeps `-src`.

Expected operands come from llvm-mc -mcpu=gfx1030 (gfx1010 for
s_get_waveid_in_workgroup). Only the text changes; translation reads
Fields and is unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 6325df752c5638365c3e5a2b2f827ba0f3f145cb)
2026-11-25 01:02:59 -06:00
KoLolX3 3c250125c5 GPU: VICTORY_* switches set to 0 are off
Six diagnostic switches (VICTORY_D3D12_DEBUG, _GBV, _DRED, _WARP,
VICTORY_GPU_TIMING and VICTORY_DUMP_TARGETS) were on whenever their
variable existed, so VICTORY_D3D12_WARP=0 still selected the software
adapter. They now go through one helper that reads a value other than 0
as on and an unset variable or 0 as off; every other value keeps the
meaning it had. The README says so above its switch table.

(cherry picked from commit a4974e4c21c16e2305942e37a868647d42eefe37)
2026-11-25 01:02:59 -06:00
LF2000 Builder 394cc9a5c3 xtask: count \x escapes and 0x hex arrays as encoded runs in the policy check
The run check split on every byte that is not alphanumeric or +/=, so
b"\x4d\x5a..." broke into 3-character pieces and an xxd -i style
[0x4d, 0x5a, ...] array into 4-character pieces. Either form of up to
about 100 KB of copied bytes passed the check and the pre-commit hook.

Also count the hex digits of \x escapes and 0x literals that have only
commas, whitespace or backslashes between them, and flag the file when
that passes the same 512 limit. The largest such run in the tree is 36
digits. Decimal arrays are still not caught.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e950e81756340b10c3ef87d9c1789ae482f1a262)
2026-11-25 01:02:58 -06:00
Devin f084578994 Shaders: reuse lane guards for unchanged EXEC within a block
An instruction guard depends on its EXEC and the reachability of its block. Keep the most recent result, including an elided guard, rather than repeating the same BDD queries for consecutive vector instructions. Scalar instructions still bypass guard selection.

Cover EXEC changes across and within a branch with a synthetic shader. Add a CPU-only guard_runs benchmark for unmasked, short, and long masked runs.

(cherry picked from commit 81b81df351437c50f4321286c725de51664c7b1b)
2026-11-25 01:02:58 -06:00