A bake's uploads waited for the lock the runtime holds while it remaps, and a staging buffer a draw kept waited at every later
refresh (29 to 239 ms a frame, all threads, run n04): gone, a read through the kernel gets every page. A staging buffer made for
one upload asks neither the write watch nor the guards (VICTORY_TEXTURE_ONCE=0: as before). blake3 makes way for a 128-bit digest
(0.035 against 0.2 ms a megabyte). While textures are kept for minutes the sweep looks at 8,192 a time (VICTORY_TEXTURE_SWEEP=whole).
The pass before a bake is made again only for something new.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
After victory-fork f85101b6, whose window checker found 90 records of 2^24 vertices in one list; ours
also run mesh records over 65,535 groups (all ones) empty instead of as 65,535 groups.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Runs n03 and n04 lost the device in the main pass. The pixel program
3711fdad456538a1, bound in both stopped lists, reads entry 35 of its big table
as raw bytes per lane, and that slot is a structured view of 8 byte elements
that begins at 8 mod 16 (capture play-1125-0127, all 766 draws): no raw view
begins there, so it stayed structured, and a raw load through it has no end on
AMD. So not only picked buffers: tables' buffers too, in title slots and in
the dynamic slots, which have twins now as well (a constant buffer of a fresh
table has a raw one of its bytes).
Measured with it: constant buffer loads, uniform and per lane, end with a
constant buffer's view. Loads by title address end with the raw view of the
copy, or read the null view for a page without one. VICTORY_RAW_VIEWS=0: as
before. Every shader is translated again (5 min).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mapping and unmapping a view wait for what every protection change of a
view takes too (about 100,000 a second, the guards'): 0.2-4 ms a page, all
on the one thread the title loads with. Scatter maps and the GPU's
page-mapping copies go in groups of up to 64 pages, noted before and after
on the caller's thread, the system calls on up to eight
(VICTORY_MAP_THREADS=1: one after the other, as before).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured on the RX 7900 XTX (indirect::tests::descriptors_written_under_readers):
a thread that makes texture views in a slot of a shader-visible heap lets the
card see a descriptor that is neither the old one nor the new one in 4 % of its
reads (35 of 822 million: the driver clears it and fills it step by step).
Copied from a CPU-only heap: none in 8,582 million reads, and three times as
fast (51 ns against 149). Title threads and our passes rewrite slots while
submissions run whose shaders pick them; three device losses of 2026-11-25
(play-1125-0203, n02, n03) were reads of memory no view names.
Every slot of the host heaps (views, raw twins, null views, constant buffers,
samplers) is now made in a slot of the thread's own in a heap the card does
not see and copied in. VICTORY_VIEW_COPY=0: made in place, as before.
A raw twin whose view begins between two multiples of 16 (35 a frame, left as
the title's unbounded view) is made from the 16 bytes below and its descriptor
moved on, if it is the one AMD's raw buffer descriptors are; null otherwise.
indirect::tests::textures_read_in_another_dimension (a measurement): a view
read in another dimension or level than its own gives zeros or its own texels:
not a cause.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
What the copy does not write was whatever the block of the pool held: the atlas of baked decorations (a 2048x2048 BC3 texture of
which a bake writes 256x256 at most) drew other textures' bytes over the waitress's face. VICTORY_COPY_OVER_TITLE=0: as before.
With a measurement of what a cold texture costs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run crash-1 held 5.2 GB of staging blocks (n02: 0.9): at most 8 empty ones
stay (512 MB of the PC's memory). With the frame line: raw twins made per
frame, and those that had to be views as the title's are.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
All of the title's loading goes through one thread of its own, which maps
the pages of a batch and then submits it. Each page took up to four system
calls (unmap, split, map, commit), each waiting for the address-space lock:
200-400 us a page in the world. No split of a placeholder that is the
view's own, no commit of section pages that are committed
(VICTORY_MAP_LEAN=0: as before); the thread, below normal priority as the
title sets it, is lifted above it where it maps (VICTORY_STREAM_PRIORITY=0:
not). VICTORY_DSTORAGE_LOG=<file>: every request, status entry and the cost
of the mapping calls; VICTORY_STACKS names each thread's affinity.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Placed textures are read, kept on the card and uploaded from the first level their views show (VICTORY_HELD_LEVELS=0: whole;
after victory-amd 4436f8f1's spans). An upload of the bytes a host copy holds is left out (VICTORY_TEXTURE_SAME=0). A slot
shows its new view once that view's upload has run. A decoration bake takes slots due a few frames later too and waits for
memory being remapped (VICTORY_BAKE_EXACT=0). Host copies go only past 88 % of the budget, the longest idle first
(VICTORY_TEXTURE_KEEP=1: the rule before). A slot rewritten with other filler words keeps its view.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A buffer a shader picks from the view heap by an index it computes is read as
raw bytes, whatever view the title has there, and the index and the offset
come from data. On AMD a raw load through a typed, structured or constant
buffer view has no end (measured), a texture's descriptor read as a buffer's
is a wild address, and an index past the title's slots (clamped to 2^21)
reaches the dynamic slots of other lists. Both device losses of 2026-11-25
stopped in the meshlet culling (0452fc2d2e2fc4c3), which does such reads.
View heaps now hold 2^22 views: past 2^21 a raw view of the same bytes for
every buffer view of a title slot (a constant buffer's view for a constant
buffer; a null raw view for everything else and every slot past the title's),
and picked raw and constant buffers are read there. Texture and typed picks
and tables stay as they were. A view that does not begin on 16 bytes cannot be
raw; its twin is the view as it is. Idea of a guard by kind: VIctory d71c3889.
VICTORY_RAW_VIEWS=0: as before. Every shader is translated again (8 min).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both losses were reads in memory given back seconds before. Empty texture
blocks (up to 4 GiB) stay below 85 % of the card's budget, windows of title
memory and staging buffers stay for five minutes with 12 GiB of the PC's
memory free, and up to 1 GiB of scratch chunks stays. Nothing read past a view
or through a wrong slot finds the hole then. VICTORY_KEEP_FREED=0: as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both device losses of 2026-11-25 (play-1125-0203, n02) stopped at the same
place, found by the run of three indirect executions between barriers in the
captures: compute 0452fc2d2e2fc4c3 (meshlet culling), behind fc5e66f8f873d3bb.
- With device-removed data on (DRED=light too) each list keeps, per indirect
execution, the pipeline and the first 16 dwords of user data; the report
says them for the stopped commands, and what the heap slots they name hold.
- A dynamic slot that shows a constant buffer in a list's scratch chunk holds
that chunk (n02: the fault was in the memory of three freed chunks).
VICTORY_SLOT_HOLDS=0: not held, as before.
- A slot's resource is let go after its descriptor is written over, not
before; the same resource again is not retired.
- indirect::tests::raw_loads_past_views (ignored, a measurement): on the RX
7900 XTX raw loads through typed, structured and constant buffer views have
no end: they read whatever lies after the view.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- VICTORY_HEAP_SYNC=all mirrors every copied record at once, as before.
- VICTORY_DYNAMIC_SLOTS sets the table slots past the title's.
- Room kept for card copies of buffers is 1 GiB at most (was 5 GiB on 24 GB).
- VICTORY_TEXTURE_KEEP=0 lets idle textures go after 5 s, as before.
- VICTORY_TEXTURE_AWAY_MS: a texture whose memory went is shown 3 s longer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lamps' shadow maps write depth plus a slope bias, and the main pass takes
the normal's derivatives, from the quad's other lanes; a wave read of a helper
lane is undefined (0 on AMD): holes in shadows, dashed triangle edges.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A removed device is reported by whoever finds it first, and the list it
stopped in by its name. The window stand-in of VIctory 9145d9d is left out
until it has been tried.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
16-bit interpolations write the half op_sel picks, with omod and clamp; the
device says whether it was removed; detiling ends with its staging buffer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The write block (context word 0, bits 27-31) was used as it is for the first
block of a pass, so one at or past the ring size (bits 22-26) was written
past the ring's end, possibly into another APU allocation, before it wrapped
with (write + 1) % size. Take it modulo the ring first, as the read block is
taken, and as advance_read does.
(cherry picked from commit 7a5d85e6a2867081ed54515ce7f33bae3fcb643d)
Windows command lines quote only with double quotes. split_args treated an apostrophe as a quote too, so -name=O'Brien swallowed the following argument. Only toggle on ", and add the apostrophe case to the relaunch test (review note on #455).
(cherry picked from commit eb8067f2eae84cb64081af357cd03a48944a42b2)
The fork's emulation of a clzero loop zeroed from the start to the end and
left rax at the end: the instruction zeroes whole lines and the test comes
after it (VIctory's own test of it failed here). The title's descriptor
heaps are held shared while their slots are written (VIctory 628b95d held
them alone, for every thread that writes descriptors).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Recovery took any name `v<digits>` as a version, so a leftover `v01`
next to a committed `v1` parsed as version 1, and the cleanup rebuilt
the name as `v1` and deleted the committed save (#870). A correctly
named but unreadable newer entry (an empty `v2`, a file, a broken
manifest) did the same: `v1` was pruned as older, the read failed, and
the next update committed a fresh `v1` holding only the changed blobs,
which the following read pruned again.
Now only `v<N>` exactly as `commit` writes it is a version. `current`
takes the newest version whose manifest reads, removes only versions
below it, and leaves unreadable newer entries alone. An update goes
above the highest version name present, so a stray entry neither hides
the save nor blocks writes. With no readable version at all, reads and
updates still fail and nothing is removed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b8dbcba260d1012dca8f06ee572e5244bffba1ac)
`Instruction::name()` binary-searches the opcode table, and the pipeline
asks about every instruction eight times per translation: `ir::build`,
`structure`, `resource` (which has the most call sites), `io` and
`lower`. The answer cannot change - the encoding and opcode are decoded
from the words and never rewritten - so resolve it once when the
instruction is built and read the field after that.
Measured with the synthetic bench from #1002 (no game data), sixteen
interleaved rounds per arm, best of each, nanoseconds per instruction, at
256/1k/4k/16k instructions:
resource 17 -> 9, 15 -> 7, 24 -> 16, 23 -> 15 (0.47-0.67)
lower 511 -> 479, 428 -> 411, 440 -> 401, 477 -> 428 (0.90-0.96)
io 27 -> 23, 26 -> 21, 26 -> 22, 30 -> 22 (0.73-0.85)
whole 926 -> 881, 920 -> 874, 958 -> 921, 1019 -> 939 (0.92-0.96)
`decode` pays the one search it used to be spared (112 -> 115 at 16k,
inside the run-to-run spread); every stage after it reads a field. The
emitted DXIL is byte-identical at all four sizes.
cargo test --workspace --locked: 342 passed, 0 failed, 7 ignored.
Both clippy configurations clean; cargo xtask policy ok.
(cherry picked from commit 146dfef67a3ecd2c4fd8f9cff8de149c65dfe6f0)
A title that ends itself when its main loop has not ticked for a while
runs on through slower frames.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 532cb7cdfee02e6139a683f79ee4c9b4a92828a4)
A title makes its window on one of its own threads and reads its messages
only when that thread reaches its PeekMessage loop. In slow frames and
loads that is seconds apart, so the system shows the busy cursor over the
window and a click turns it into a "Not responding" ghost.
A top-level title window is now made message-only (it can never be shown),
and a stand-in window with the title's text, style, icon and fitted size is
made on a thread of ours that does nothing but pump its messages. The
title's ShowWindow shows the stand-in, its window text follows, closing the
stand-in suspends and ends the title as before, the keyboard window menu is
still refused, and the stand-in goes when the title's window does. Frames
are presented to the process's visible window, now the stand-in; input is
unaffected, since titles read it through GameInput, not window messages.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 9145d9d3dabb0d5f8263b4203a82586710929d90)
save() releases LAST and library locks before calling write_atomically(), which always wrote to the same fixed host-pipelines.tmp path. Concurrent worker saves and shutdown save(true) can truncate or unlink each other's temp file on Windows.
- Serialize write_atomically() with a mutex and unique per-call temp filename (.tmp-<pid>-<n>), cleaning up the temp file on rename failure.
- Add a 4-thread concurrent write_atomically stress test.
(cherry picked from commit be824d9d218320c71f2623ed4b14045210785db5)
A package copied without the DLLs that ship beside the executable leaves
every import from them unbound, and the title stops at its first call into
one: Grand Theft Auto VI 1.0.2.1 at +0x2237178 during System Init (#930,
#1553, #8), with nothing saying why.
After mapping the title DLLs, name the main image's static imports that
must come from the title's folder (neither the host nor our runtime serves
them) but were not mapped from it. Print them; when executing with the
default trap policy, stop before running title code. With
`--unimplemented zero` the title still runs (stubs were asked for).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e9cb14ad3ea2f7a3ec051d9f9691684d7e9037ae)
fence.rs already implements ID3D12Fence1::GetCreationFlags at slot 11
(0x58), but FENCE_IIDS only listed ID3D12Fence and PAGEABLE_IIDS, so
CreateFence and QueryInterface rejected ID3D12Fence1 with E_NOINTERFACE.
Add ID3D12Fence1 (433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a) to FENCE_IIDS
and add a unit test covering creation, QueryInterface, and
GetCreationFlags.
Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit bbdc3ca7249948b7624ba65f4282615caef895b8)
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)