Skip to content

Upstream: the 113 fixes merged since ffe310e that apply to the fork - #653

Open
coderanonymus wants to merge 115 commits into
fxceless:mainfrom
coderanonymus:upstream-clean-fixes
Open

coderanonymus wants to merge 115 commits into
fxceless:mainfrom
coderanonymus:upstream-clean-fixes

Conversation

@coderanonymus

@coderanonymus coderanonymus commented Nov 25, 2026 •

Copy link
Copy Markdown

Stacked on #642, which fixes the clippy failure on main. That fix is the bottom commit here, so CI can get past clippy to the tests.

Rebased on main (a26859f)

Rebased onto a26859f, the owner's newest commit. One conflict: upstream's v_cvt_off_f32_i4 arm sits next to the fork's v_cvt_f32_f64 arm in lower.rs, and both are kept. Clippy passes with and without --all-features on a clean build, Linux tests (255) pass, and so does the asset policy.

Why

Upstream merged about 150 community PRs on 2026-11-24/25, after ffe310e, the upstream commit this fork is based on. None of them are in the fork yet. Many fix things the fork also runs: XMA rings, XAsync, saves, the loader, PE parsing, sampler creation, descriptor search, shader lowering.

A full merge of upstream conflicts in 45 files, mostly where upstream rewrote parts of the fork's own work. This PR brings over the part that doesn't conflict: 113 upstream commits that apply cleanly and still work with the fork's code. That shrinks a later full sync.

What

  • 113 upstream commits, cherry-picked in order. Each keeps its author and has a (cherry picked from commit …) line.
    • By area: HLE 33, shaders 23, GPU 20, the victory app 10, formats 8, README 6, loader 5, PE 3, core 2, docs/xtask/pipeline 1 each.
  • One commit on top, "Picks from upstream: fit them to the fork".
    • descriptor/host.rs: the fork caps the dynamic-slot search at the ring's length. That cap cut off exactly the n - 1 slots that upstream's wraparound fix (c1c3281) adds, so the fix did nothing here and its new test (072fde0) would fail. The cap is lifted. The enough gate stays.
    • host.rs: after a4974e4, VICTORY_GPU_TIMING=0 means off, but the fork's late_stage() still treated any value as on. It disabled late waits and the relay while timing itself was off. It now reads the switch the same way timing() does.
    • Four comments from the picks named the game. They now say "the title", as in 4e17478.

Left out

  • 64 commits that conflict, listed below. Most are upstream's versions of this fork's own work (page tables, FidelityFX, view copies, the shader pack), plus fixes inside code the fork rewrote.
  • Dropped although they apply:
    • 146dfef (opcode name resolved at decode): the fork's ir.rs builds gfx10::Instruction literals, which the new private field breaks.
    • 645391b (normalized buffer ends): its test needs a helper from c430b1d, which conflicts.
    • 628b95d (SHADER_HEAPS held across mirror): it removes shader_slot, which the fork's late-texture path in descriptor.rs still uses. It needs a hand port.
    • 0de9efc and 514927d (clzero loops, rdpru, their tests): the fork's console_insn handles those instructions before emulate_amd_only runs, so upstream's emulation would never run. Its new asm test would fail on Intel CPUs: the fork's loop emulation leaves rax at the limit, not at the line after the last pass, and sets no flags.

Review

Ultracode-reviewed: four area reviewers went through the 81 picks that touch files the fork also changed, looking for semantic conflicts, and a skeptic checked each finding. Three findings were confirmed (the two adaptations above and the clzero drop). One low finding stays:

  • be824d9 (pipeline library atomic writes) protects only the early list on this fork. The fork's mapped library save still writes a fixed host-pipelines.tmp outside the new lock. This is not the mapped-file device loss, and it's no worse than before.

Some picks may duplicate open fork PRs. I matched by title only:

Verification

  • cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with --all-features, for x86_64-pc-windows-msvc (cross-checked from Linux): clean.
  • Tests on Linux:
    • victory-shader 186, formats 39, core 13, pipeline 7, game 3, xtask 6: all pass.
    • victory-pe: 32 pass. Its 4 image::tests that parse the test binary fail on Linux only, because that binary is ELF there. They fail the same way on main.
  • Not run: the Windows tests, the GPU tests, or the game. This PR's CI will be the first Windows test run.

No game data used.

Included (113, upstream sha)
  • ba42db6 xma: start the frame after a continuation at the next packet that has frames (tedin7)
  • d01b170 XAsync: end the call that finished, not whatever call the block holds now (Duff)
  • b1bdd89 Census: report directory traversal failures (Bloxive)
  • b9ff219 XTaskQueue: terminating a queue cancels its delayed callbacks too (Duff)
  • 01ae55a Files: a title run by its file name alone gets its own folder as G: (Duff)
  • 4eb0898 XMA: build the inverse transform's rotations once per subframe size (TG0000)
  • d4d1822 XMA: noise tests, and end a frame at its data instead of looping forever (AnoHunted)
  • 3c7d845 Kernel: a title image's file name that fits clears the last error (Maraco91)
  • 985d8d4 Audio: an XMA loop's skip is of its first frame, not of its last (Maraco91)
  • 11ca3ce Media: a share is refused however it is spelled (Maraco91)
  • e57e76a fix(pe): validate section raw data bounds (Diego)
  • acdcc41 Loader: suspend a thread before reading its TEB; skip bad dump times (Manuel Pérez)
  • 5cff000 XAsync: a new block where a result was left behind begins a call (Maraco91)
  • 1054fe8 Audio: an XMA read block past the ring's end wraps instead of filling forever (AnoHunted)
  • 92f2c60 GPU: every object answers for IUnknown (Maraco91)
  • e3bef08 XStore: a store id without an installed package is an invalid argument (marquezini)
  • c6959ac HLE: load a host DLL outside the module cache's lock (Duff)
  • 93a24b7 fix(formats): reject overlapping texture depth slices (Pedro Fortunato)
  • d549b63 HLE: a '>' in a quoted manifest attribute does not end its tag (Duff)
  • e6ebec9 Shader info: show stage I/O even when instruction decoding fails (FIocker)
  • 936e5e5 XGameUi: a text entry's limit is the console's (marquezini)
  • c000581 Kernel: GetModuleFileName of a title image into a null buffer (marquezini)
  • 7d04943 Shaders: a signed 64-bit operand sign-extends its 32-bit literal (Duff)
  • e6fe8ec GPU: fix CreateSamplerX mip-none base level, LOD range, bias clamp, and invalid enum values (nathanbzrr)
  • 2c22e2b XStore: wire offline *Result slots and fix OOB XStoreShowProductPageUIResult slot (nathanbzrr)
  • a3f89ed Census: deduplicate PE imports without hint (nathanbzrr)
  • 75fe6c0 HLE: require two hex digits in percent escapes (Enzo Souza Duarte)
  • b956320 GPU: handle depth/stencil copy footprints (broccolize)
  • 65062e1 xmem: report allocations the host refuses (LF2000 Builder)
  • 7a5d85e Audio: an XMA write block past the ring's end wraps before the first write (AnoHunted)
  • b796c8b GPU: clear DXGI outputs on out-of-range enumeration (broccolize)
  • 81b81df Shaders: reuse lane guards for unchanged EXEC within a block (Devin)
  • e950e81 xtask: count \x escapes and 0x hex arrays as encoded runs in the policy check (LF2000 Builder)
  • a4974e4 GPU: VICTORY_* switches set to 0 are off (KoLolX3)
  • 6325df7 Shaders: print only the operands an instruction has in SP3 text (LF2000 Builder)
  • 988fd9a translate: refuse a VICTORY_EMIT_DUMP directory inside the repo (LF2000 Builder)
  • 350f91c Formats: reject multisampled linear texture layouts (AlanQiang0418)
  • 43e2ca9 Show on-disk file size in victory inspect (Thomas Askharoun)
  • e34cb53 GPU: keep finite (min_lod, min_lod) in CreateSamplerX when mip filter is none (nathanbzrr)
  • efe102e Handle unsupported display deferrals in the HLE test (EatCodeSleep2)
  • 7216ab7 HLE: implement the RPC runtime's GUID calls (Nixitov)
  • a32eacd fix(pipeline): retry collisions when creating cache staging files (DocBlack89)
  • aaacc2d docs(architecture): list BCPack as implemented in victory-formats (给伊莉雅补魔)
  • 64b80c3 Formats: share immutable texture swizzle tables (TG0000)
  • 121412b loader(crash): verify unwind against known caller frames when RtlCaptureStackBackTrace returns empty (给伊莉雅补魔)
  • 3e98bd7 GPU: seek directly to private data on final release (TG0000)
  • 6d174ae List successfully emitted shaders in offline translation scans (Aws)
  • c1c3281 GPU: extend dynamic descriptor wraparound scan to prevent false exhaustion (pushkarreddyy)
  • 3d71ad1 Shaders: s_atc_probe's immediate is not a register (CaravelaLabs)
  • 072fde0 Exercise a free run straddling the cursor on the actual host heap (swarm)
  • 131944d PE: add synthetic unit tests for implib.rs and layout.rs (给伊莉雅补魔)
  • 0be58e6 GPU: add synthetic unit tests for query.rs and signature.rs (给伊莉雅补魔)
  • d0dd9fc fix(pe): keep every name for a shared export ordinal (quaternion)
  • 1aac20a fix(loader): stage prepared images in per-writer files (quaternion)
  • ca362a4 fix(hle): read manifest fields past inline XML comments (quaternion)
  • 71e8866 fix(hle): honor the requested executable on relaunch (quaternion)
  • eb8067f fix(hle): keep apostrophes intact when splitting relaunch args (quaternion)
  • 52f0a09 policy: resolve a .. in the not-yet-existing part of a path (nino-exe)
  • fd44561 Config: ignore an empty VICTORY_CONFIG (Enzo Souza Duarte)
  • 60d2cf9 Loader: a clwb in the last bytes of a page is emulated instead of faulting (BastienRdz)
  • 246ecea HLE: test that XGSuggestSwizzleMode picks linear for a 1D texture (Luiz Neves)
  • 45ed8e3 Shaders: hardware test for v_cvt_f16_u16 and v_cvt_f16_i16 (Luiz Neves)
  • 8d67fa5 Shaders: keep the v_cvt_f16_u16/i16 test to integers f16 holds exactly (Luiz Neves)
  • 534e1dd CLI: add AVX2 pre-flight CPU check before executing titles (David Palacios)
  • 03a6f22 XMA: gather frame payloads one byte at a time (heromike405-arch)
  • 259ba31 Shaders: negative-zero ordering test for the f16 min/max forms (Luiz Neves)
  • 8610ffb Shaders: hardware test for the integer v_min3/v_max3/v_med3 (Luiz Neves)
  • e3c9dd0 GPU: guard zero/overflowing stride in expand_rects and add primitive.rs unit tests (给伊莉雅补魔)
  • ef0c3e9 GPU: validate null args in create_deserializer to prevent d3d12 AV and add root.rs tests (给伊莉雅补魔)
  • 41b2472 Shaders: name the pick function type in the integer min3/max3/med3 test (Luiz Neves)
  • 42961e8 GPU: log the TDR settings, and warn when a GPU hang would freeze the PC (bvtterbroot)
  • a7847a5 HLE: constrain the title before suspending it (Giuseppe Rainone)
  • 098a26a README: how to install Rust on Windows (Record present intervals so hitching can be measured #1087) (Eduardo Bertozzi)
  • 44ce067 XAsync: canceling a call that already completed leaves it alone, as documented (BastienRdz)
  • 47c00d5 GPU diagnostics: create missing capture output directories (Blitz Studios)
  • 142ec8d Deduplicate image paths in victory census (DoubleD17)
  • 344704e Shaders: lower v_mul_hi_u32_u24 and v_mul_hi_i32_i24 (Rareuncommon)
  • 643fc6d HLE: avoid misaligned f32 output slice in XApu (divyeshganta)
  • 64a33ec XNetworking: wire UDP port change callbacks and UTF-16 security queries (ashrafsdrop)
  • 4f54c47 HLE: complete XPackage progress callback unregistration (EatCodeSleep2)
  • 1ed26e5 Shaders: fold conditional branches to their fallthrough (EatCodeSleep2)
  • 32eb934 docs: explain Windows shader-test validator prerequisite (Omeya Sawant)
  • 5c44562 Shaders: compress replaced phi chains in remove_trivial_phis (fuzeofficial)
  • 97c8783 GPU: keep A8_UNORM out of the R8 typeless family (AnoHunted)
  • 78c1267 Shaders: lower v_cvt_off_f32_i4 (AnoHunted)
  • e45bacd Shaders: preserve mip point filtering in anisotropic static samplers (mgunes1311-lab)
  • 4e155a3 Shaders: do not parse VS inputs when reading mesh shader stage I/O (mgunes1311-lab)
  • 2b13ae4 HLE clears the result of blocked address lookups (BaggyALPHA)
  • 23fc8a5 Shaders: gate anisotropic point-mip host filters (mgunes1311-lab)
  • 7dfa86f GPU: honor anisotropic point-mip device support (mgunes1311-lab)
  • c3a04e2 Shaders: lower scalar quadmask instructions (Luiz Otavio Mello de Campos)
  • e3fe5bf Test scalar quadmask lowering on D3D12 (Luiz Otavio Mello de Campos)
  • a7636dd HLE: allow an explicit maximum title window size (fluffyflattershy-afk)
  • 6f36cdf GPU: interpolate normalized rectangle vertex attributes (Luiz Otavio Mello de Campos)
  • be3202d Shaders: fold empty loop latches containing only dead phis (Tex)
  • 711d651 Shaders: precompute MD5 round constants and avoid per-block Vec in md5_block (Tex)
  • 2286e03 Shaders: key immediate sampler slots by descriptor words and comparison mode (给伊莉雅补魔)
  • 9ccb83c HLE: guard dialog commands before initialization (Calvix2k)
  • 274f698 Loader: guard clwb_loop shortcut against u64 overflow and wraparound (Tex)
  • f078008 Formats: test texture layouts against addrlib's own sizes and addresses (Vyacheslav Venglovsky)
  • bbdc3ca GPU: fences answer for ID3D12Fence1 as documented (BastienRdz)
  • 3f6910a CLI: propagate the title entry point exit status (Aws)
  • e9cb14a run: stop with a clear message when the title's own DLLs are missing (AgneyaK)
  • be824d9 GPU: serialize pipeline library atomic writes with unique temp files (HailLucifer666)
  • eb7cc2d flush a kept save blob that had to be copied (imjustprism)
  • 9145d9d HLE: show title windows through a stand-in that always reads its messages (Vax)
  • 6493dd9 Shader tests: require a device readback in every waterfall test (zhaibingye)
  • 8d3a025 gpu(list): log initial pipeline bound on reset/reset_x for parity with create_list (给伊莉雅补魔)
  • 40f30be Shaders: GFX10 FLAT offsets ignore bit 11 (davutsimsekk)
  • 532cb7c Diagnostics: VICTORY_POKE writes title bytes twice a second (Marvis)
  • 224e786 GPU tests: the frame pacing test tolerates a busy host (Marvis)
  • 70564ae README: status of 2026-11-24 (Marvis)
  • b8dbcba XGameSave: a stray or unreadable version folder never costs the save (moe-miau)
Conflicting, not included (64)
  • f5cb5ff Capture startup breakpoint diagnostics
  • a3acc87 Check the required startup archive before executing Series 1.0.2.1
  • e5b7159 Shaders: walk a lane-mask diagram once in vars and given
  • 810f442 GPU: a frame wait takes its tick before it sleeps
  • 64484b4 Input: apply VICTORY_KEYS to a connected host pad too
  • 7f00a62 Crash reports: name the host's CPU and Windows build
  • b58d198 GPU: copy into title memory without asking for its region first
  • 3f5eff5 input: with no device, previous and next readings walk every device in time order
  • 705a2f6 Inline uniform micro-tile runs in texture copies
  • 691236d GPU: align appended input-element offsets like D3D12
  • 12eba49 Shaders: fix whole-wave EXEC inline constant sign-extension and prefix lane validation
  • 6526965 GPU: find a list in the DRED breadcrumbs by its name, not only its pointer
  • 8a358e3 GPU: find the lists in the DRED breadcrumbs by position when the debug layer hides them
  • 52d528b GPU: match a breadcrumb node's name followed by the debug layer's note; drop the position fa
  • 882664e GPU: keep the frame wait's tick for the diagnostics log
  • c430b1d Shaders: tbuffer_load_format_d16 loads pack two 16-bit channels per VGPR
  • f821cb9 GPU: pipelines of different names load from the library at the same time
  • f47ebd8 feat(shader): lower buffer cache invalidations as no-ops
  • f177aae Shaders: cap BDD memo table and bail out early on overflow
  • 5d6889e Shaders: lower v_sad_u8, v_sad_hi_u8, v_sad_u16, v_sad_u32 and v_msad_u8
  • 67c4f53 victory-shader: resolve Structured::other and constant masks in v_cndmask_b32
  • 59035de GPU: grow per-list upload scratch on demand
  • 100de0e Shader tests: a skipped device says why it was skipped
  • e52777a GPU list: bind initial pipeline state in create_list and create_list_x
  • 1e923ad Shaders: set WAVE_OPS feature flag when lane_bit emits waveGetLaneIndex
  • 4ab20fc GPU: the indirect budget is charged in record order and no longer wraps
  • f096774 GPU: throttle failed swap-chain creation and resize
  • 4fc9d70 GPU: keep Staging::detile inside the staging buffer and harden committed()
  • c0228d9 victory-shader: mask mesh primitive vertex indices to 9 bits (drop edge flags)
  • d09f3aa DirectStorage: read a page list naming page 0 again before failing its request
  • 0b35b7f Shaders and GPU: FidelityFX on host and console paths, 64-bit image atomics, the BVH interse
  • a7fc47a Shaders: a phi edge is live only if a lane can take it to a read
  • 13091f6 Shaders: pixel and mesh I/O with reused registers, 16-bit packing and signature rows
  • 27c3dc9 Shaders and GPU: title memory at raw addresses through a page table
  • 8af0472 Shaders: lane masks spilled and combined in compute programs
  • 4051149 GPU: null views for title buffer views that are empty or run past their copy
  • 328eec1 Shader tests: instruction semantics and control flow against the console's float mode
  • 75677cb Shaders: buffer sizes read from descriptors, and size-only waterfall loops
  • 0f63757 GPU: root views of programs that use title memory go through the page table
  • 77053a0 Shaders: accuracy fixes for discards, f16 rounding, denormals, med3 and signed zeros
  • 4f57f46 Shaders: cube samples with gradients take their level from the gradients
  • c75fdba GPU: views the shaders pick from the heap, and one change journal for title memory
  • d71c388 GPU and shaders: bounded root views, and a guard against texture descriptors read as buffers
  • 683ad7a GPU and shaders: rectangle lists through a geometry shader, table constants read in place
  • 7389303 Game formats: effects, techniques and passes of the shader database; shader-info --effects
  • 286e33f Game formats: the shader pack; shader-info lists packs
  • c47b529 Shader warm-up (translate --cache), a cache keyed by the translator, pipeline queue fixes
  • 819f622 translate: progress counts finished shaders, not ones handed out
  • e0034c2 Shaders: register-relative moves reach only what their index can
  • 13bbd6f GPU: one host texture per texture memory, and writable twins for depth textures
  • 86a5ed6 GPU: views off their buffer's elements get their own copy; heap records copied as bytes are
  • 6d021fe GPU: world frame cost
  • bacb06a GPU: a heap slot holds its view's own copy
  • 9c58a1c Pipeline pre-build from the shader pack (translate --cache --pipelines); mesh pipelines load
  • 7000573 Diagnostics: title memory peeks, slot states, small buffers and 1D/3D read-back in listed fr
  • 13185f5 GPU: GetDeviceRemovedReason reports the host device's state instead of E_NOTIMPL
  • e29391f Shaders: honor op_sel, omod and clamp on v_interp_p2_f16
  • 0601955 Shaders: a helper lane's v_readfirstlane reads its own value
  • ed0dbfd GPU: copy title writes under ranges a submission's shaders write
  • 4e60ea3 victory-gpu: drop an indirect call before its clamp, not after
  • 42363ab Tests: hardware-only shader checks skip on a machine without a GPU
  • ccfb029 Tests: a machine with no GPU has no hardware adapter to check shaders on
  • cd94d35 GPU: shaders mark the pages they write through views; copy-backs compare only those
  • 940d32f GPU: a marked page's copy-back does not save the page for its own copy

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-25T04:06:32.431489Z
We couldn’t complete this review. Comment @codex review to try again.
257bc31 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@deepdev237

deepdev237 commented Nov 25, 2026 •

Copy link
Copy Markdown

🤖 AI-generated. This comment was written by Claude Opus 5.5 (Anthropic, model claude-opus-5-5), running as an autonomous agent in Claude Code. The AI did the work it reports: it merged the branches, built, ran the commands, tests and game runs, and read the logs. A person asked for this testing; this text was not reviewed by them before posting. Please verify anything you rely on.

Full test environment
  • OS: Windows 11 Pro, version 10.0.26300 (build 26300)
  • CPU: AMD Ryzen 9 5950X, 16 cores / 32 threads
  • RAM: 24 GB DDR4 at 2666 MT/s; page file 32 GiB on the system drive, Windows commit limit 55.92 GiB
  • GPU: AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32015.7029 (dated 2026-10-18); D3D12 reports host wave lanes min 32 / max 64; DXGI local video memory budget 15,419 MB; mesh shaders and shader model 6.6 available
  • Also installed: a virtual display adapter (Parsec Virtual Display Adapter 0.45). VIctory ran on the RX 9060 XT.
  • Toolchain: rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1 (797e8a9bc 2026-08-05), LLVM 22.1.8, host x86_64-pc-windows-msvc
  • Build: cargo build --profile diag -p victory --features diagnostics (diag = release + debug info)
  • Base: victory-fork main 310c6eb6c16822ab95076aad61fce19bba86bb98
  • Game files: Series X build 1.0.2.1. This copy has zero-filled holes in 11 archives (about 338 MiB in all: levels.rpf, audio.rpf, pack/story000/story000.rpf, navmeshes.rpf and six data/ttdb/*.ttpf), so failures that depend on those bytes are not emulator bugs.
  • Full logs (local paths shortened): https://gist.github.com/deepdev237/785e05b02d0dcece7aac1303f7fe4ba8

First Windows + GPU test run of this PR: everything passes.

Head 257bc31, merged alone onto main 310c6eb (merge commit, no other PRs). Command: cargo test --workspace --profile diag --no-fail-fast, run on real hardware, not WARP: AMD Radeon RX 9060 XT (RDNA4, driver 32.0.32015.7029), Ryzen 9 5950X, 24 GB RAM, Windows 11 Pro build 26300, rustc 1.98.1, x86_64-pc-windows-msvc.

Build: clean (Finished diag profile in 2m 02s with -j 4).

test binary passed failed ignored
victory (unit) 10 0 0
victory tests/census.rs 2 0 0
victory-core 13 0 0
victory-formats 39 0 5
victory-game 3 0 0
victory-gpu (includes the tests that need a real D3D12 device) 158 0 3
victory-hle 139 (+1 in its integration test) 0 0
victory-loader (unit + no_dll_planting, load_probe, title_dlls) 28 + 1 + 2 + 1 0 0
victory-pe 36 0 0
victory-pipeline 7 0 0
victory-shader (includes the hardware shader tests, 40 s) 236 0 3
xtask 6 0 0
total 682 0 11

That includes the four victory-pe image::tests that parse the test binary, which you could only see fail on Linux (ELF). On Windows they pass, and so does the new descriptor wraparound test from c1c3281/072fde0 with your lifted cap.

Not done yet: a game run with this PR. My integration build (310c6eb plus about 120 open PRs) conflicts with it in several places, so I have not run the title with it. I'll add the result here if I do.

Exact state tested
  • PR head: 257bc31e64aafd1a79a5d0527d36104075935288, merged with git merge --no-ff onto main 310c6eb6c16822ab95076aad61fce19bba86bb98 in a clean worktree (116 commits ahead of main after the merge).
  • Build: cargo test -j 4 --workspace --profile diag --no-run, then cargo test -j 4 --workspace --profile diag --no-fail-fast. 693 individual test results (682 passed + 11 ignored). The build printed no warnings.
  • victory-gpu's 158 here, against 186 on my integration branch, is because the integration carries about 120 other PRs with tests of their own.
  • Full build and test output: pr653-build.log and pr653-test.log in https://gist.github.com/deepdev237/785e05b02d0dcece7aac1303f7fe4ba8

@JRamos1993

Copy link
Copy Markdown

Offline check on the retail shader pack: this PR changes no emitted shader.

Setup: RTX 5090, Windows 11. victory translate --validate --list over the title's full shader pack (26,084 programs), for main 310c6eb and for this head 257bc31. I added a local DXIL hash on each validated line to compare the output byte for byte. Two runs of the same build give identical hashes, and the hash does catch real changes (2119b0e → 310c6eb changes the DXIL of 8,514 programs).

main 310c6eb this PR 257bc31
validated 25,382 25,382
programs whose DXIL differs 0
newly validated / lost 0 / 0

The batch tool's summary counters (IR instructions, structured and guarded instructions, descriptors, I/O) are identical too. So for this title, the 23 upstream shader commits here neither fix nor break anything in translation. Runtime-only paths (pipeline creation, samplers on the host, HLE) are not covered by this check.

AI use: Claude Code with Claude Opus 5.5 ran both builds over the pack and wrote this. Nothing from the title is in it.

LF2000 Builder and others added 22 commits November 25, 2026 01:53
- indirect.rs: the timing rig kept the written depth view it never reads
  after setup; drop the field.
- draw.rs: the scissor census sorts by a reversed key.
- resource.rs: placed_filler_twins is read only by the diagnostics
  build's copystat; allow it to be dead without the feature, as
  shadow and pipeline do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… frames

A frame that ends in a packet where no frame begins (the tail of a frame that crossed packets, then padding) left the next frame pointing into that padding, which ended the stream early. Now the next frame is found by following each packet's skip to the next packet with frames.

(cherry picked from commit ba42db6)
… now

Our own completions looked their call up again by block address: after a
provider's DoWork returned, after a cancel, after a failed begin, and when
queued DoWork ran. A provider usually ends its call itself (XAsyncComplete
from DoWork or Cancel), and once it has, the title may begin a new call on
the same block, from its completion routine or from a thread that polls
the status. The lookup then found that new call:

- the old call's DoWork result (S_OK, size 0) or cancel (E_ABORT) ended
  the new call before it had done anything, ran its cleanup and fired the
  completion routine a second time;
- DoWork still queued for a canceled call ran the new call's DoWork.

Each queued DoWork now carries the call that scheduled it and runs only
while that call is still the block's, and DoWork, cancel and begin
complete that call. A call that is already over ignores a second
complete, so nothing reaches the next call. XAsyncComplete itself still
goes by block, as providers name their call by its block.

(cherry picked from commit d01b170)
Fail when a requested scan root cannot be opened. Report traversal errors below a readable root alongside the other skipped inputs.

(cherry picked from commit b1bdd89)
A callback submitted with a delay waited on a thread of its own and was
delivered when the delay ran out, whether or not the queue had been
terminated meanwhile. XTaskQueueTerminate only canceled what was already
in the ports, so a pending delayed callback was not canceled: it ran
later as live work (canceled = false), after the termination callback,
by which time a title may have freed what the callback uses.

The queue now keeps its delayed callbacks in a list until their delay
runs out. Terminate cancels them along with the queued ones, before it
calls the termination callback, and a delay that runs out after that
finds nothing to deliver. A submit racing Terminate checks `terminated`
under the list's lock, so the callback is either canceled or refused.

(cherry picked from commit b9ff219)
`victory run GTA6.exe`, run from the game folder, gives an exe path with
an empty parent, and that empty folder was mounted as G:. An empty path
cannot be made absolute, so the root stayed empty and G:\x64\a.rpf
became \x64\a.rpf: the root of the current drive. The title then found
none of its files.

An empty root is now the current directory, which is what an empty
folder means everywhere else (`Path::new("").join("x")` is `x` in the
current directory). Passing a path with a folder in it is unaffected.

(cherry picked from commit 01ae55a)
imdct_half worked out every pre- and post-rotation with sin_cos on each
call (n of them per subframe) and ran its FFT on two fresh Vecs. The
rotations, the bit-reversed order and the butterfly rotations now come
from a table built once for 128, 256 and 512 samples; the work buffers
live on the stack. Every value is computed with the same expression (the
butterflies with the same running product), so the output is bit for
bit what it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 4eb0898)
Decoder::decode took the caller's bit count as the end of the frame. Past
the data the bit reader returns zeros, and a stereo tile header reading
only zeros gives the subframe to no channel, so it never moves on; with a
count beyond the data it never overreads either, and looped for good.
Clamp the end to the bits the data holds. A frame from read_frame always
holds its bits, so its decoding does not change.

Add deterministic noise tests (xorshift64, fixed seeds, as BCPack's):
buffers of noise packets, streams of noise frames with clean and damaged
headers, frames in mono and stereo at each sample rate, bit counts past the
data, and read_frame and packet at any offset. Every walk is bounded and
every decode must give one frame of samples. The bit-count test hangs
without the fix; the others pass on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d4d1822)
GetModuleFileNameA/W on the host clears the thread's last error when
the name fits, and code tells a truncated name from a whole one by it
(grow the buffer while the last error is ERROR_INSUFFICIENT_BUFFER; or
fail if it is, also when the name filled the buffer exactly). Our
answer for a title image set the error when the name was cut and left
it alone otherwise, so after one call with too small a buffer, or
after any earlier call on the thread that left 122, a whole name still
read as truncated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 3c7d845)
When a frame ended a loop, decode cut it at the loop's end subframe, set
the loop's skip (the subframes of the loop's first frame that lie before
the loop) and then took that skip out of the frame in hand: the loop's
last. So the head of the last frame was dropped instead, and the first
frame played from its start, with the audio before the loop in it. The
number of samples came out the same; the seam did not.

The pending skip is still applied to the frame in hand, and the loop's
skip is set after it, for the frame decoded next.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 985d8d4)
The source resolver's rule (local files only) knew a share as `\..`,
`//..` or `file://server/..`. The host knows more spellings: any two
leading separators (`/\server\share`), the object manager's prefix
(`\??\UNC\server\share`), and a `file:` URL with no host whose path
starts with two separators (`file:////server/share`,
`file:\server\share`, also percent-encoded). Those fell through as
relative paths or drive-less local files and went to the host's
resolver unchanged.

They are refused now, naming the server. Paths with one leading
separator, a drive after the slashes or the prefix, and the path of a
URL that names this machine pass as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 11ca3ce)
Stack dumps (VICTORY_STACKS, diagnostics builds) read another thread's
TEB right after NtQueryInformationThread and suspended it only later: a
thread exiting in between frees its TEB, and the read faults. The
thread is now suspended first and resumed on every way out.

The dump times went through Duration::from_secs_f64, which panics on
`inf` or `1e20`, killing the dump thread (the crash hook logs it as a
crash). They are parsed by `schedule` now, which leaves out NaN and
times no Duration holds. 1 new test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit acdcc41)
Calls are filed by their block's address, and a call that succeeded with
a result stays filed until XAsyncGetResult takes it. XAsyncBegin refused
any block whose address had a call filed. So when a title never took a
result and freed the block, the next block it was given at that address
could not begin a call: E_INVALIDARG, every time, with the old call's
provider never cleaned up.

A zeroed block is a new one: the block of a result left behind holds the
result's size, so it never reads zero. XAsyncBegin now ends a finished
call filed under the address of a zeroed block (its provider gets its
cleanup) and begins the new one. A call still in flight keeps its
address, and a block still holding a result is refused as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 5cff000)
… forever

The decoder fills an XMA voice's output ring until the write block
(word 0, bits 27-31) comes round to the title's read block (word 9,
bits 0-4). The write block wraps modulo the ring size (word 0, bits
22-26), and so does a read block moved on by command 18, but a read block
the title set up at or past the ring's end was compared as it was: no
write block ever equalled it. With a stream that loops forever the pass
never ended, holding that voice's lock, so the title's next command on
the voice (advance, disable) waited for good, and releasing the context
arrays did too.

Take the read block modulo the ring size as well, as the write side
already does. A test sets up read block 6 on a ring of four with an
endless loop and requires the pass to end within seconds, with blocks 0
and 1 filled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1054fe8)
No graphics object's interface list holds IUnknown, so QueryInterface
for it (and every call that hands out an object by interface id) said
E_NOINTERFACE and returned null. COM code asks for it to compare two
pointers for identity, to keep an object as a plain reference, or to
pass it on to an API that takes any object.

object::is, which all of those go through, now also matches IUnknown.
The DXGI device answers with the D3D12 device, which it already stands
for: one pointer whichever of the object's interfaces is asked.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 92f2c60)
XStoreQueryPackageIdentifier documents E_INVALIDARG for a store id that
has no installed package. We returned XPackage's 0x89245208 instead.

(cherry picked from commit e3bef08)
host::module held the module cache's lock while it called
LoadLibraryExA. Loading a DLL that is not loaded yet takes the OS
loader lock, and title code runs under that lock too (a title DLL's
thread attach, TLS callbacks run as threads start), where it can need
the cache: any first use of a host! function, or a late-bound title
DLL. One thread holding the cache and waiting for the loader lock,
another holding the loader lock and waiting for the cache: the process
hangs, and cannot even exit, as ExitProcess needs the loader lock too.

The cache is now looked up, then unlocked for the load, then locked
again to keep the handle; a thread that loaded the same DLL meanwhile
got the same module, which stays loaded.

(cherry picked from commit c6959ac)
The MicrosoftGame.config reader ended a tag at its first '>', but XML
allows '>' unescaped inside an attribute value. A value with one
(DefaultDisplayName="A > B") cut the tag short: its '/>' was never
seen, so the element stayed open and every element after it was read
as its child. Game/TitleId and the storage quota were then not found,
and the title ran as id 00000000 with no storage quota, its saves and
temporary files in that folder, without a warning.

A tag now ends at the first '>' outside quotes.

(cherry picked from commit d549b63)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit e6ebec9)
XGameUiShowTextEntryAsync documents a 1024-character maximum on console,
1024 for a maxTextLength of 0, and 1024 for the Password scope whatever
the title asks. 0 meant no limit here, larger limits were kept and the
scope was ignored.

(cherry picked from commit 936e5e5)
fluffyflattershy-afk and others added 22 commits November 25, 2026 01:53
Handle scalar and two-channel UNORM inputs and signed normalized inputs.

(cherry picked from commit 6f36cdf)
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 <noreply@anthropic.com>
(cherry picked from commit f078008)
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 <noreply@google.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit bbdc3ca)
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 (fxceless#930,
#1553, fxceless#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 <noreply@anthropic.com>
(cherry picked from commit e9cb14a)
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 be824d9)
…ages

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 <noreply@anthropic.com>
(cherry picked from commit 9145d9d)
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 <noreply@anthropic.com>
(cherry picked from commit 532cb7c)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 224e786)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 70564ae)
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 (fxceless#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 <noreply@anthropic.com>
(cherry picked from commit b8dbcba)
- descriptor/host.rs: the fork's cap on the dynamic-slot search was the
  ring's length, which cut off the n - 1 slots upstream's wraparound fix
  adds; the cap is lifted (the 'enough' gate stays), so a free run across
  the cursor is found, as upstream's new test expects.
- host.rs: late_stage() reads VICTORY_GPU_TIMING the way timing() now
  does, so VICTORY_GPU_TIMING=0 no longer turns off late waits and the
  relay while timing itself is off.
- The title is not named in the tree: four comments from the picks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HailLucifer666 added a commit to HailLucifer666/victory-fork that referenced this pull request Nov 25, 2026
Both remaining "port from the fork" phases turned out to be taken, and the
manifest could not say so, so the next session would have rebuilt them.

J's two halves are open PRs by other people: fxceless#895 by sagouindupm already
lowers pixel quad reads through quadReadLaneAt with the helper lanes
reached, and fxceless#917 is the constant-in-place-of-indirect-light switch this
phase describes. Building either would duplicate an open PR and conflict
with it in the same file.

K is gated on fxceless#653: 113 upstream fixes across 28 files that rewrite the
same files, with a conflict already open in it. Re-reading that diff for
cd94d35 once it merges decides K without writing anything.

The gate caught a stray vertical tab in the note text -- TOML forbids
control characters in strings, and the error pointed at the line.
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
As the PR's own fit-to-fork commit (d264d2e) does for them: four comments
of the picked upstream fixes named the game; they say "the title" now, as
in 4e17478.
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…ess#653: XMA audio hangs, XAsync, saves, window close, loader lock), input (fxceless#640 taps, fxceless#105 keys by place: ZQSD on AZERTY, fxceless#74 keyboard with XInput devices), saves and services, DirectStorage (fxceless#575 AutoSubmitDisabled), loader, tooling

# Conflicts:
#	crates/victory-hle/src/modules/dstorage.rs
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…ull requests and the host FidelityFX on our layer; our translator, title memory and copy-back kept

319 commits past ffe310e, merged onto wave4. Most of its runtime pull
requests were here already, picked one by one (fxceless#653 and fxceless#716,
prhle, offpr): where a change arrived both ways, the copy this branch had
is kept (net, audio, xg, runtime, lifecycle with its one stand-in window
(#1677), files, kernel, xasync, xgamesave, xmem, gameinput, the loader's
crash, clzero and publish code, the pipeline cache, #1658's staging clamp).
The rest is the resolution first made on wave2 (offm-on-wave2, ab1d525),
carried over:

- crates/victory-shader: ours (every conflict --ours). Kept from theirs
  only what landed whole: fxceless#661 SP3 text operands, fxceless#1021 s_atc_probe's
  immediate, #1636 FLAT offsets. Reverted where half landed: fxceless#1180, range.rs,
  fxceless#617's bench, #1337's sampler, ACCC, SOURCE_HASH, and new test files whose
  mod lines are in conflicted files. The rest is to be ported on its own.
- victory-gpu: ours plus the official units taken, each from its own
  diff: host.rs (fxceless#615 switch=0 is off, fxceless#1082 TDR log, #1626 swap-chain
  retries throttled), descriptor/host.rs (fxceless#974, its walk no longer cut at
  2^18 steps by ours), descriptor.rs (fxceless#52: a mirror holds the heaps' lock
  while it uses the heap, a read lock on this branch's RwLock, and so does
  our re-mirror of waiting slots), resource.rs (fxceless#52, fxceless#504 depth/stencil
  footprints, #1390 A8), pipeline/host.rs (fxceless#618), pipeline.rs (a stream
  subobject past its end not read), capture.rs (fxceless#615, fxceless#1146, a D24 depth
  plane dumped as depth), frame.rs (fxceless#174, with our late-wait shortcut inside
  the tick reservation), device.rs (fxceless#928, feature queries 7/8/23), list.rs
  (#1446, fxceless#52), external.rs (host FidelityFX, VICTORY_FIDELITYFX_DIR, off
  unless set), switch.rs, tdr.rs, and the small PRs (fxceless#553, #1562, fxceless#270,
  fxceless#153, #1453, #1204, fxceless#1173, #1206, fxceless#474).
- Not taken, ours kept: title memory at raw addresses (27c3dc9, 0f63757,
  6d021fe: their memory.rs and Upload), page marks (cd94d35, 940d32f: with
  our shaders every write through a view would be lost), bindless.rs and the
  change journal (c75fdba), root views and retirement at execute end
  (d71c388: unsafe with flights in the air), rectangle GS and table
  constants in place (683ad7a), twins and shared host textures (13bbd6f),
  heap copies (86a5ed6, bacb06a), the shader cache key, warm-up, pipeline
  queue and library (c47b529, 9c58a1c, fxceless#1000, #1660), #1510, #1635, #1246,
  fxceless#322, #1322, fxceless#669, fxceless#197 (turned down by prhle), #1726 (ours waits longer;
  its test added), the console upscaler's UAV clears. `translate --cache` is
  `--warm all` (with the adapter probe); the pipeline pre-build is not in.
- Also taken: the shader pack and the database's effects (shader-info), the
  startup archive check (fxceless#12, on this branch's KnownBuild with its patches),
  and the runtime PRs not here yet (FidelityFX's config and module).
- The title is not named in the merged-in comments (4e17478).

Details, the overlaps and what to watch: README, "The official
repository, merged".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.