Repository navigation
Upstream: the 113 fixes merged since ffe310e that apply to the fork - #653
coderanonymus wants to merge 115 commits into
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Full test environment
First Windows + GPU test run of this PR: everything passes. Head Build: clean (
That includes the four Not done yet: a game run with this PR. My integration build ( Exact state tested
|
|
Offline check on the retail shader pack: this PR changes no emitted shader. Setup: RTX 5090, Windows 11.
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. |
- 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)
(cherry picked from commit e57e76a)
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)
(cherry picked from commit 93a24b7)
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)
(cherry picked from commit a7636dd)
Handle scalar and two-channel UNORM inputs and signed normalized inputs. (cherry picked from commit 6f36cdf)
(cherry picked from commit be3202d)
…5_block (cherry picked from commit 711d651)
…on mode (cherry picked from commit 2286e03)
(cherry picked from commit 9ccb83c)
(cherry picked from commit 274f698)
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)
(cherry picked from commit 3f6910a)
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)
(cherry picked from commit eb7cc2d)
…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)
(cherry picked from commit 6493dd9)
…h create_list (cherry picked from commit 8d3a025)
(cherry picked from commit 40f30be)
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>
257bc31 to
d264d2e
Compare
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.
…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
…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".
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_i4arm sits next to the fork'sv_cvt_f32_f64arm inlower.rs, and both are kept. Clippy passes with and without--all-featureson 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
(cherry picked from commit …)line.victoryapp 10, formats 8, README 6, loader 5, PE 3, core 2, docs/xtask/pipeline 1 each.descriptor/host.rs: the fork caps the dynamic-slot search at the ring's length. That cap cut off exactly then - 1slots that upstream's wraparound fix (c1c3281) adds, so the fix did nothing here and its new test (072fde0) would fail. The cap is lifted. Theenoughgate stays.host.rs: after a4974e4,VICTORY_GPU_TIMING=0means off, but the fork'slate_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 waytiming()does.Left out
ir.rsbuildsgfx10::Instructionliterals, which the new private field breaks.SHADER_HEAPSheld across mirror): it removesshader_slot, which the fork's late-texture path indescriptor.rsstill uses. It needs a hand port.console_insnhandles those instructions beforeemulate_amd_onlyruns, so upstream's emulation would never run. Its new asm test would fail on Intel CPUs: the fork's loop emulation leavesraxat 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:
host-pipelines.tmpoutside 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, forx86_64-pc-windows-msvc(cross-checked from Linux): clean.image::teststhat parse the test binary fail on Linux only, because that binary is ELF there. They fail the same way onmain.No game data used.
Included (113, upstream sha)
..in the not-yet-existing part of a path (nino-exe)Conflicting, not included (64)
🤖 Generated with Claude Code