Repository navigation
Conversation
…ved for the Mac fork)
VIctory's code is GPL-3.0; its author allowed its use in XCL under GPL-2.0-only (2026-11-24): THIRD_PARTY.md and the decoder's header say so, with the project's URL. THIRD_PARTY.md also notes that the 128 rANS models of bcpack-tables.bin are, number for number, those of Microsoft's silicon-rans sample (MIT), compared against the tables generated from mdu_minirans.v in #208. Request::check is the enqueue check again (it had become a test-only wrapper of check_with_bc1). The README lists DirectStorage with BCPack and describes XCL_SAMPLE_BCPACK; scripts/test.ps1 lists it with the other sample variables. HANDOFF.md is left as it is (the PR's edit of it is not taken). (cherry picked from commit 8add9a327f60dfe34fcd3a7ea16368c0ec5a7a22)
…ainst the patent Without XCL_SAMPLE_BCPACK nothing showed that a stream decodes. The 14 fixtures of #208 (tests/data/bcpack, made by generate.py, an encoder written from the format notes and not from either decoder; all six modes, up to 64 KiB of output) now go through the lane stage of the ported decoder, which gives every fixture's symbols; bc1-1-8, whose states are cut shorter than an encoder can cut them, is refused. With 7 input bytes per schedule round instead of 8 the test fails. The 8-bit model 11 is checked against the base table printed in US 11,234,023, and every model sums to 65536. Fixtures and generator by Kalmarv (#208). (cherry picked from commit 10915eb96938d1bbdb111a60058a396f0942ee02)
A request that fails a check in EnqueueRequest (source type, file handle, destination page array, ...) went into the queue as Entry::Refused, which had no sequence number. CancelRequestsWithTag removed only pending Entry::Request entries, and the worker checked the cancel rules only for those, so a refused request was reported however the title cancelled it: its HRESULT in the next status entry, a FailureCount and first failure in the error record, and the error event. DirectStorage's documentation: "a cancelled request is not counted as a failure in either IDStorageStatusArray or DSTORAGE_ERROR_RECORD". Refused entries now get a sequence number from the same counter as requests (enqueue_refused / enqueue_numbered), CancelRequestsWithTag drops pending ones with a matching tag, and the worker skips submitted ones the cancel rules cover. A refused request with another tag, or enqueued after the cancel, still fails as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 66660bd9478c789959df1e0d3342f1081f778610)
RetrieveErrorRecord filled the first failure's HRESULT, options, destination, destination size and file name (or memory source), and left FileOffset @0x230, SourceSize @0x240 and CancellationTag @0x248 at 0. A title that logs or retries the failed request from its record saw offset 0, size 0 and tag 0. The layout follows DSTORAGE_ERROR_RECORD in ATG's Win32 implementation of the console API (Xbox-GDK-Samples, Samples/System/ SimpleDirectStorageCombo/DirectStorageWin32/dstorage_win32.h): after `WCHAR Filename[MAX_PATH];` (0x24..0x22C) come `UINT64 FileOffset;` (0x230), `void* Source;` (0x238), `UINT32 SourceSize;` (0x240), `UINT64 CancellationTag;` (0x248) and `CHAR Name[DSTORAGE_REQUEST_MAX_NAME];` (0x250, 64 bytes), 0x290 in all, which matches ERROR_RECORD_BYTES and the offsets XCL already writes. Its MarkRequestError (DirectStorageWin32WrapperQueue.cpp) copies them from the request: m_errorRecord.FirstFailure.FileOffset = m_entries[index].request.FileOffset; m_errorRecord.FirstFailure.SourceSize = m_entries[index].request.SourceSize; m_errorRecord.FirstFailure.CancellationTag = m_entries[index].request.CancellationTag; The file offset is written for file requests only: FileOffset shares a union with Source, so for a memory request those bytes are unused or the source page offset. Name stays 0: Request does not keep the name pointer. The new test reads 16 bytes past the end of an 8-byte file with tag 0xABCD and fails without the fix (FileOffset: left 0, right 256). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 2e17d3dedd954f4cd487296c1919e62708f77b39)
CreateStatusArray made every slot E_PENDING, so IsComplete(i) was false
for a slot nothing was ever enqueued into. A title that waits for
IsComplete before it reuses a ring slot, including the slot's first use,
waits forever.
ATG's Win32 implementation of the console API (Xbox-GDK-Samples,
Samples/System/SimpleDirectStorageCombo/DirectStorageWin32/
DirectStorageWin32WrapperStatusArray.cpp) starts every slot complete:
m_completeFlags.resize(capacity, true);
m_resultCodes.resize(capacity, HRESULT_FROM_WIN32(S_OK));
and its EnqueueStatus marks the slot not complete (`MarkState(index,
false, S_OK)`). dstorage_win32.h says a status entry "can be enqueued
again" once IsComplete() for it returns true.
Slots now start at S_OK. Enqueueing a status still stores E_PENDING
(QueueInner::enqueue), so a slot behaves as before once it is enqueued;
no code or test read a slot that was never enqueued. EnqueueStatus on a
closed queue leaves the slot as it was, which is now complete instead of
pending forever.
The new test creates an array of 4 and checks that slot 3 is complete
with S_OK; it fails without the fix (`status_is_complete(s, 3)`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5bd7cd8e73129e3cc22e17802a185940bfaf549f)
…-after-free in poll_unwatched)
…f title buffers/textures, watchdog/cpu_writes probes, lock-free thread dump
…; page/resource tracing - CopyMemoryToMemoryX out of a GPU view of the title's memory (its page pool) is copied by the CPU from where the CPU has the pages again (cpu_copy, as upstream), unless the GPU wrote a texture there; XCL_GPU_VIEW_READBACK=1 reads back the PC texture instead. - XCL_VIEW_MIRRORS=1 (off by default): SRV/CBV buffer views outside unified memory read through a mirror refreshed page by page before each submit. Too slow under Wine/Rosetta (the title's heaps are not write-watched on a Mac: 290 MB compared per submit), kept for experiments. - XCL_TRACE_PAGES=a,b,... (addresses above 4 GiB or physical page numbers): mappings, moves, unmappings, allocations and frees of those 64 KiB pages, DirectStorage writes reaching them, queue #31 GPU-view mappings, views / descriptors / copies / uploads / Map of resources over them, with the title's call stacks. Every hook returns at once when tracing is off. - Diagnostics: a CopyMemoryToMemoryX out of a GPU view logs the physical page, where the CPU has it, its bytes and the DirectStorage request that last wrote it; the watchdog probe logs the DirectStorage queues (pending, in flight, run). GTA VI 1.0.2.1: the 16 KiB read at the first loading screen is a 128x4 R16G16B16A16 texture the game looks up by name hash and reads back asynchronously into a float4 table; nothing writes its page before the read (a fresh pool page) and the read does not block - not the hang. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diagnostics for a stuck title (all off unless XCL_WATCH_WAITS=1): - The title's waits (handles, condition variables, WaitOnAddress, sleeps, completion ports, contended SRW / critical-section locks) are wrapped at import resolution and GetProcAddress; xcl.exe's own WaitOnAddress / WaitForSingleObject / WaitForMultipleObjects / Sleep imports go through wrappers of their own (Rust's locks, condition variables, channels, parking). - Each thread notes in a lock-free slot what it waits in, since when, and the call stack; a watcher thread logs threads held 10 s or more, and every 30 s a snapshot of every thread (in a wait, polling one, or RUNNING since its last wait), title fences behind what their queues were told, the CPU-copy worker, the pipeline builds, the DirectStorage queues, MWAITX loops by address, and GPU queue waits whose fence has not reached the value. - XCL's own blocking points are marked (GPU fence waits, WaitFrameEventX, pipeline builds and waits, sparse-window waits, the DXIL cache mutex), and 30 entry points of D3D12.X say which one a thread is inside (`waitwatch::api`, no stack: cheap). - XCL_SERIALIZE_TILES=1 (off): XCL's tile mappings and its submissions to D3DMetal one at a time – tried against GTA VI's loading stop; it did not keep it from stopping. GTA VI 1.0.2.1 on CrossOver 26 / D3DMetal 3: about 5 s after the first loading screen starts the render and streaming threads stop together, each inside a wait of the Win32 lock family (NtWaitForAlertByThreadId) that neither the title's nor XCL's imports make (D3DMetal's or Wine's own); every fence the queues were told to signal has completed, no XCL lock is contended, and the present thread waits for work that never comes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…b / rep stosb Rosetta cannot resume a 256-bit store that faults past its first half: it stores the two halves apart, and when the second faults after the first has landed it prints "rosetta error: unexpectedly need to EmulateForward on a synchronous exception" and never delivers that exception. Its exception server stays with it, so every later exception of the process waits for ever – XCL's emulated instructions, Wine's write-watch faults, the title's own. vcruntime140.dll's memmove (= memcpy) and memset copy with unaligned 32-byte VMOVDQU; one of them crossing into a write-watched page of unified memory was enough. GTA VI 1.0.2.1 froze 5-10 s into its first loading screen at vcruntime140.dll+0x1597 in every run (render and streaming threads, then the watchdog, all stopped at their next exception). When vcruntime140.dll is mapped on a Rosetta host (before any of its code runs), the entry points of memmove, memcpy and memset jump to XCL's rep movsb / rep stosb versions, which stop at the byte that faults and go on from it. XCL_RUNTIME_COPIES=0 leaves them. With this the title goes on past that screen to its first-run pages (navigation, legal notices, terms). Tests: memmove forward/backward over overlaps and lengths, memset, return values; the patched entry points reach working copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…MWAITX in place on request - `clzero; add rax, 0x40; cmp rax, r64; jb -12` (12 bytes) gets a helper that runs the whole loop – the same stores, RAX and the flags of the last compare – and returns past it; the call replaces the CLZERO in one aligned store. GTA VI clears five ranges per call this way, five traps per call and hundreds a second before. - The race that kept CLZERO thunks off (a thread stepped onto the instruction after a CLZERO while another writes the call there) cannot happen for a whole loop: its emulation steps past the loop, an end not past its start included; only the huge/wrapping fallback steps into the body, and it then stops loop redirection for good (checked under the patch lock). - XCL_PATCH_MWAITX=1: MONITORX becomes a 3-byte NOP and MWAITX PAUSE; NOP after their first use, in one locked 16-byte compare-exchange (GTA VI's MONITORX straddles an 8-byte boundary). Off by default: the trap is what makes the title's wait loop wait. Tests: the loop helper run on the host (RDX and R10 ends, lengths, end <= start, registers kept, return past the loop); the in-place replacement across an 8-byte boundary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… probe, the last exceptions Diagnostics (all off unless XCL_WATCH_WAITS=1): - The waits of every loaded module's imports are wrapped too (K32EnumProcessModules, every 5 s), nested waits counted once; a thread in EnterCriticalSection names the owner. - A thread running since its last wait has its syscall frame read (TEB + 0x378 in CrossOver 26's ntdll.so): the syscall or Unix call it is in, its registers, a critical section one of them holds, and the return addresses on its stack – without suspending it. - A fault probe thread takes a zero-fill fault, a section fault, a handled access violation, a VirtualQuery and a VirtualAlloc every 100 ms; a stage that does not come back is logged with the time the process stopped taking that kind of fault. - A vectored handler keeps the last 256 exceptions (thread, code, address, fault address, stack, the title's code bytes), logged when the probe stops coming back. - XCL_EXCEPTION_TEST_AT=<s>: ud2, int3, hlt, a non-canonical load, an unmasked SIMD divide and an integer divide by zero, each raised and handled in turn. These found the GTA VI loading freeze: exception delivery stopping process-wide, then the runtime's 32-byte store Rosetta cannot resume (see the vcruntime140 commit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rosetta 2 cannot deliver a fault in a 256-bit unaligned store whose second half faults after the first has landed (a write-watched page re-armed by every submit, next to one already written), nor in VCVTPS2PH m64/m128: it prints "unexpectedly need to EmulateForward on a synchronous exception" and every later exception of the process waits for ever. GTA VI froze within seconds of its first loading screen. widestore plans each image at load: every such store becomes the same instruction at VEX.L=0 plus VEXTRACTF128 m128 (VCVTPS2PH through a saved scratch register), in a helper with unwind data. Five-byte stores call it in place; four-byte ones go through int3 padding, or a run: a call before the store whose helper does the straight run up to and past it (moved instructions, RSP-based operands +8, RIP-relative ones re-aimed, mov r64,rsp as lea, conditional jumps inside, a loop whose head only its back branch reaches run whole), merges with a neighbour where every branch is known, and a trap (int3, a VEH, a stub) for the rest – also under every anchored store, for a branch into a run nothing could see. GTA VI: 87,699 stores, 47 left to traps (from 1,764), none hot in the runs so far; the menu comes up in 58 s (241 s before). XCL_WIDE_STORES=0 leaves them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… black) PresentX takes several planes and the console's display composes them; XCL showed plane 0's first resource alone. GTA VI as a Series S presents its 3D image at 1920x1080 in plane 0 and its interface at 3840x2160 in plane 1 – plane 0 was transparent black at the menus, so every frame XCL showed was black. Two planes or more are now composed into the back buffer by one full-screen draw: each plane's source rect scaled to its place on the screen (linear filter), each over the ones before it with premultiplied alpha, over black, written opaque – at the size of the largest plane. The plane layout (0x48 bytes: token, resource count, resources, source rects, destination, color space, flags) is logged when the plane count changes; XCL_PRESENT_PLANE=n shows plane n alone for diagnosis. One plane keeps the plain copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… panics on the Mac) GTA VI's world load kernel-panicked macOS three times out of three (26.4 and 26.7.3) inside Metal command-buffer submission (IOGPUFamily / AGX, IOGPUCommandQueueSubmitCommandBuffers; once an MTE tag-check fault). D3DMetal records command buffers with unretained references, so an object destroyed, or a sparse tile unmapped, while committed work still names it is walked by the driver at submit. An audit confirmed several such paths in XCL; this closes them with one mechanism. late_release.rs is now a ledger of marks: - every queue made through the adopted device gets a clock at creation (XCL's fence on it); a submission reserves its value before it enters the driver and signals it after (`submit`), so a mark taken while a submission is in progress (D3DMetal releases objects from inside ExecuteCommandLists) waits for that very submission. ExecuteCommandLists chunks and KickoffX go through it; the sparse queue is an external clock whose next value is published before each of its calls; - a mark is the value reserved on every clock; held entries go once it has passed, plus a grace on the Mac (100 ms, XCL_LATE_RELEASE_GRACE_MS: Metal retires command buffers after the fence value is written), at most 64 per 4 ms tick, in order, on the ledger's thread, outside every lock; - XCL_LATE_RELEASE_SERIAL=1 (an experiment, off): final releases never overlap a submission. real.rs: one hooked_release for every kind. Resources always; on the Mac also heaps, descriptor heaps, pipelines, allocators, lists, command signatures, query heaps and root signatures (XCL_LATE_RELEASE_ALL=0/1). The last-reference test (AddRef, compare, Release) runs under a per-object stripe lock – two last-but-one releases at once both missed it and the object ended inside the hook – and holds only when AddRef and Release both give COM counts. What XCL keeps by an object's address goes when it really ends (release_held), and only on its true last reference. When XCL lets go of a reference of its own and one is left (an upload into a texture the title released), the held entry is touched: it waits for that work too. The hook runs on D3DMetal's own threads as well – a Metal completion handler on a dispatch queue releases what it kept for a command buffer. Those have no TEB: the first version read an environment variable there (a OnceLock), the fault's handler never came back and the queue never signalled its fence (a unit test hung). So the switches are settled once on a thread of Wine's (late_release::init, from adopt), the stripe is a spin lock, and a held reference goes into a fixed ring with its mark inline: atomics only. sparse.rs: a decommitted tile stays parked and mapped until every queue is past the work submitted before the decommit (its mark); take_tile never forces one out (a retired or new pool instead). Pools whose tiles all came free stay 30 s (the newest two whatever their age) and are then handed to the ledger, not dropped under the state lock. list_x.rs / cpu_writes.rs: a CopyMemoryToMemoryX read-back keeps its source until the copy ran. The CPU writes after the GPU get one worker per queue and never write before their fence: a stale event wake or the 10 s timeout wrote early, and the title then freed what the GPU still used. A job goes to its worker under the lock that gives it its value (two threads could send them the other way round, and with no timeout left that was a deadlock). Tests (Wine on D3DMetal): marks and submits, grace/cap/order, touches, the ring, the stripe race, a release from inside a stalled real submission, every held kind counts COM references on D3DMetal, a held reference is the last only when no other is left, parked tiles wait for their mark, retired pools are handed over. The whole suite (but the GPU recompiler group, which hangs on D3DMetal) has the same 7 failures as before. An independent review (4 lenses, adversarial verification) confirmed 4 findings, all fixed here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reservation of 64 KiB pages made with no commit, and a block of physical pages, over XCL_SPARSE_64K_MAX_MB are plain memory, outside the sparse windows (unset: as before). GTA VI on Series S reserves its physical-page pool so (3.9 GB in one reservation; its pages' homes one block). In the windows every page of it got a 64 KiB tile of video memory the GPU never reads there – its streamed textures are kept in step from the CPU view – about 4 GB of Metal private memory at startup (~3 GB more in the world load than Series X), a tile mapping and a clear for each page at startup, and a decommit, park and unmap for each page that moved while it loaded. On Series X the same pool lies outside the windows already, and its menu renders. GTA's other sparse reservations total about 1.2 GB, so 2048 catches the pool alone. Test: a reservation over the limit is plain memory, one under it in a sparse window; a block over it has plain homes; its pages mapped into the pool, moved, sent home and mapped again keep their bytes, with no tile under it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a world load)
GTA VI's world load (runs 58, 59) grew Metal private memory from 4.5 to 14 GB
in 16 s and the memory guard stopped it. The cause: a held object was
re-marked ("touched") whenever XCL let go of a reference of its own and one
was left. XCL looks at the textures it keeps in step every frame (a clone,
then its Release) for as long as they are registered, and a texture the title
had let go of stays registered until its real end – so it was touched again
before its grace was up, every time, and never let go. The game streamed
~750 new textures a second into that.
Touching is now off (XCL_LATE_RELEASE_TOUCH=1 turns it on for experiments);
the case it covered – XCL's last work on a released object – is covered by
D3DM_RETAIN_REFERENCES=1 on the Mac (Metal keeps what a command buffer uses
until it completes) and by upload_batch waiting for its uploads.
The activity log's memory line counts the deferred releases (held so far,
let go, waiting), so a ledger that stops letting go shows at once.
Test: a held object XCL keeps looking at (clone and Release every 10 ms while
it is registered) still goes, once, soon after its grace. The arena test
waits for the ledger's other test work like the ledger's own tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…world load on the Mac) GTA VI's world load on the Mac was stopped by the memory guard three times in a row (runs 58-60). The title streams its textures into a 16 GiB GPU view of its memory, of which it maps a 3.9 GiB pool page by page (queue #31), and it places tens of thousands of sampled textures there: 32 768 by 70 s after the load started, 90 % of the new pages read with nothing mapped (run 60). On D3DMetal every sampled title texture was a committed texture of its whole size (reserved textures on shared tiles do not show each other's contents there, `vram::on_pages`): Metal memory grew by 6 GiB in 15 s. lazy_tex.rs (new; XCL_TEX_LAZY=1 textures not wholly present when made, 2 every eligible one, 0 – the default – the committed path as before): a sampled 2D texture (arrays and cubes, single-sample, no other use, BC formats – XCL_TEX_LAZY_FORMATS –, 128 KiB and up – XCL_TEX_LAZY_MIN_KB) placed in a GPU view is a reserved resource (64KB_UNDEFINED_SWIZZLE) with no tile mapped. Its tiles are in groups from GetResourceTiling: each standard mip of each slice, each slice's packed mips (checked to cover every tile and subresource once, else one group; XCL_TEX_LAZY_GRAIN=texture). Before an upload, a group gets tiles when it has them, when the title's GPU work writes the texture (copies, resolves: all of it, before that submit's lists run), or when at least half of its bytes in the console's layout lie in 64 KiB pages with memory – textures lie side by side 1-2 KiB apart, so a page mapped for one texture's mip tail holds the end of the one before it, and "any page" backed that one's level 0 for a sliver (by mip within a group: a whole texture by XCL_TEX_LAZY_GRAIN=texture is backed when its small mips are streamed in). An upload with nothing to back is left out; the tiles are mapped before the detile, which then reads only what is copied. Tiles come from pool heaps of 1023 tiles (four to one of D3DMetal's 256 MiB blocks, NOT_ZEROED, never freed), mapped with UpdateTileMappings on XCL's upload queue (one call a pool heap, inside late_release::submit) ahead of the copy on the same queue, which copies only subresources that have tiles (texture::upload_batch_masked); the CPU waits for it before the title's submit. Only what has no copy yet is copied when the texture's memory is as at its last upload, or the title's GPU work wrote it (what its tiles have holds that work's texels). A released texture's tiles wait for a mark taken then and serve the next ones. A texture short of tiles (no more to be had) is tried again only when its pool can serve it – free tiles for a group it lacks, counted out as the upload will take them (smallest groups first), oldest first and uploaded first; one probe when a heap may be made, CreateHeap not asked again for 1 s after it failed –, not at every submit. No tile of a live texture is ever unmapped. A shape whose tiles would take more than XCL_TEX_LAZY_MAX_OVERHEAD (1.25) times its committed size plus a tile a slice stays committed; XCL_TEX_LAZY_MAX_MB caps the pool. Title MakeResident/Evict (device #34/#35) leave lazy textures out: a reserved texture is a resource of its own in Metal's residency set. Also: - title_textures: PENDING counted shadowed textures whose source changed and never took them back (the fast path of refresh never ran again); now only active ones. - the census (XCL_ACTIVITY, every 2 s): title textures made by path and by method (#44, #133, views by address), with console and PC sizes (the PC's committed size, asked once per description); kept now (active / shadowed / lazy / same-range aliases / GPU-written / pending); how much memory GPU-view textures had when made; how placements overlapped; the lazy textures' tiles and pool; D3DMetal's video memory unwrapped (it reports it modulo 4 GiB) and the upload staging buffers. - texture::copyable_desc: GetCopyableFootprints of a reserved texture with the default layout. - texture::upload_batch_masked_run tells whether the copies were submitted when it fails; a Signal failure keeps the list and its upload buffer alive (they were freed under the GPU). - tests: TEST_LOCK / VRAM_TEST_LOCK poison-tolerant; title_bytes test right on a Mac; runner::skip_config for a configuration's skip (the placed-texture test said nothing where it tests nothing); the PENDING fix tested through recheck_source. Tests on D3DMetal under Wine (M5 Pro, macOS 26.7.3), each GPU gate alone first: - gates: reserved BC1/2/3/4/5/6H/7 and RGBA8 textures (2D 256² – 2048², non-power-of-two, all-packed, arrays, cubes; typeless with typed views; cube-as-cube-array views) map from two heaps, upload and read back exactly; groups mapped one by one hold their texels and the others read as zero; tiles of a released texture serve the next; copies both ways with committed textures; 1024 unbacked 1024² BC7 textures +2 MiB, 4 µs each; mapping a 22-tile texture 0.07 ms. - end to end through CreatePlacedResourceX on an adopted device, a GPU view and queue #31 mappings: no memory – no tiles, zeros; the tail's page – the tail's group alone; all of it; released and reused; 200 streamed in one or two heaps; a GPU copy and a resolve into one; what must stay committed does; 2048 textures streamed side by side, a quarter with their tail's pages: 48 MiB of tiles where committed textures take 1600 MiB, the same heaps again on a second pass; a full pool that cannot grow (6 tiles free, then 20 given back, then the rest): the groups that fit, nothing uploaded again while nothing can be had, the older texture served first, a GPU copy's texels kept. - the whole suite: 707 passed, the 6 known failures (title_bytes… passes now); the real / sparse / title_textures / lazy_tex modules in one thread: all pass; the lazy tests again with the game's environment (D3DM_RETAIN_REFERENCES=1, XCL_LAZY_PAGES=0) and with XCL_TEXTURE_SKIP_UNCHANGED=1: pass. An independent review in four rounds (five lenses, then the fixes, then the shortage redesign, then a last check; each finding checked by a skeptic) confirmed 23, 12, 4 and 2 findings – none a kernel-panic risk – all fixed here, among them: a full pool re-uploaded every short texture at every submit (and tiles coming back woke all of them); the unchanged-content skip ran before the lazy check; a texture released between the two bookkeepings was uploaded unmasked into tiles parked for others; a GPU write's texels were copied over after a shortage; a failed upload left tiles with other textures' texels, or lost a change; the default path walked every new texture's pages and asked the PC's size for the census alone (now only with XCL_ACTIVITY, or lazy textures); the lock order of the tile mappings; a Signal failure freed an upload list under the GPU (pre-existing); "the title's GPU work writes it" is now what was recorded for this submit (Entry::writes_now), not ever; video memory unwrapped every 250 ms, only on a Mac. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p budget, a watch that names the work and ends the title (GTA VI's first world frame) GTA VI 1.0.2.1's world load on the Mac (run 61, with 0020) reached its first world frame and the GPU stayed 100 % busy in compute for minutes: no Metal error, nothing in XCL's log, a title fence one value short, until the process was killed (macOS freed the GPU 10 s later). No ray-tracing program had run (the empty BVH descriptors were never read): the frame's new programs were vfx_triangleClip's heap defragmentation – CS_DefragHeap_ComputeRelocations (df231d75ee930b98) ends by writing (count, 1, 1) dispatch arguments, and CS_RelocateVfxStartIndexLocation (36204a134ee59578) indexes its records by group id and copies a size read from GPU memory. On a Mac much title GPU memory is outside unified memory (its heaps are plain memory there): what translated programs write at those addresses is dropped, and a PC ExecuteIndirect reads the title's PC buffer, whatever it held. XCL passed those arguments to D3DMetal unchecked – the likely cause, not observed: XCL recorded nothing per dispatch. XCL capped each lane's loops (65 536 iterations); nothing capped a dispatch. - indirect.rs `Sanitize` (a Mac; XCL_INDIRECT_SANITIZE=0: as before): a translated compute ExecuteIndirect with a plain dispatch signature (not in a bundle) runs XCL's pass first – one thread a command copies its group counts into a buffer of XCL's (64 KiB chunks per recording, reused after the allocator's reset or release), 0 x 0 x 0 for more than XCL_INDIRECT_MAX_GROUPS groups (2^22, some 30 full-screen 4K passes of 8 x 8 tiles) or Y / Z above 65 535 – and the dispatch reads them there with a 12-byte signature. The pass reads the title's arguments where translated programs write them (a UMA window as a UAV), as an upload buffer, or from the title's own PC buffer (INDIRECT_ARGUMENT, read in INDIRECT_ARGUMENT | NON_PIXEL_SHADER_RESOURCE and back). Everything that can fail is made before anything is recorded; a failure logs and passes the arguments as before. The pass's pipeline and signature are made once and never replaced (lists may have recorded them). The root-changing repacker drops such dispatch commands too. - The dispatch-wide budget (emit.rs `Em::trip`, `PRELUDE_TRIP`, `TRIP_AT_START`, mod.rs `LOOP_GUARD_TRIP`): in compute programs with loops, the lanes of a wave that find their budget spent add 1 to the dispatch's `res` word 0, and a wave that starts once XCL_BUDGET_TRIP_WAVES (64) such adds were made skips its loops (its budget starts at 0). A wave decides as a whole (one atomic read at the start); split wave64 halves that decide apart time their exchanges out once (bounded). Not where a group barrier waits for every wave (XCL_WAVE64_SPIN=0, XCL_SAFE_BARRIER=0). bind.rs `res_block`: a compute dispatch's block is [0, a serial, the threshold] – the windows upload a chunk only when its bytes changed, so a count the GPU left at an address must not carry over; a recording submitted again gets [0, a new serial] in its blocks on the CPU before the upload (`before_submit`, in ExecuteCommandLists and KickoffX). One block serves all commands of an ExecuteIndirect and a bundle's dispatch in all its runs. Graphics HLSL is unchanged (its DXIL cache entries stay valid); compute programs compile once more. The threshold is read at run time: XCL_BUDGET_TRIP_WAVES keeps the translation caches unless it is 0. - stall.rs (new; XCL_GPU_STALL_WATCH=0: off): each translated dispatch is noted for its list (console program, groups; for ExecuteIndirect where its arguments are and whether they were checked; the newest 512 a list), and ExecuteCommandLists / KickoffX hand what a list noted to its queue's history (the last 16 submissions of the title's work, with the fence values signalled after each). A thread looks at the title's fences every second. A fence's clock runs while it is short of what a queue was told to signal and does not move – one complete or moved starts again, a gap between looks (the process stopped, the Mac asleep) counts as one look –, and nothing is judged while a queue waits for a value nobody was told to signal. After 10 s the queues' submissions in flight are logged (`[stall]`), every 30 s while it lasts; XCL_GPU_STALL_EXIT=<s> ends the title after s seconds (`real::end_title`; exit code 0x574111ED). fence_x holds a reference to every fence it was told of (its value is asked from another thread), and a CPU Signal below the value a fence had (a rewind) lowers what queues were told of. XCL_SKIP_CS=<hash>,… drops a console program's dispatches (a lever for test runs). - `[indirect]`: the first ExecuteIndirect of each console program (128) and draw pipeline (32) with its arguments in each kind of place – unified memory window k, an upload buffer, or outside unified memory – whether it was checked, or why it was skipped. The compute PSO line names its console program (the translation cache's hash) and threads. XCL_ACTIVITY: translated compute ExecuteIndirect so far (checked), dispatches skipped, views given an empty descriptor, acceleration structures outside unified memory. - launcher: XCL_GPU_STALL_EXIT=30. Tests on D3DMetal under Wine (M5 Pro, macOS 26.7.3): - the check on the GPU from the three sources (upload SRV, the title's own buffer in INDIRECT_ARGUMENT, a window-like UAV), six commands with a 16-byte stride – (2,1,1), (4194305,1,1), (2048,2049,1), (1,65536,1), (3,1,0), (65535,1,1): exactly 2 + 65 535 groups ran from each; the repacker's test with the cap; `groups_ok` at the limits without overflow. - the trip on the GPU with the translator's own pieces around a loop that never ends: 16384 groups of 64 threads – 563 ran their loop, 15821 skipped it, 0.05 s; without the trip (threshold 0) all 1024 groups ran theirs; translation: the trip in compute loops only (native and split wave64), none in loop-free programs, compiled by DXC; kernels keep the plain guard; GTA's five programs of run 61's last frame translate and compile with it. - the watch: a moving fence never stalls; reported at 10 s then every 30 s; the exit at its second (also before the 10 s report); a fence idle for 40 s and then signalled is not a stall; a 40 s gap between looks is not counted, and a hang under a sampler's 5 s stops still ends the title; a queue held by an unsignalled wait is not a stall, and the clock starts again when it is let go; a stall that ends is forgotten; fences: a forward CPU Signal keeps what queues were told, a rewind lowers it; the ledger across submissions, lists run again, 16 submissions a queue, the newest 512 records a list; a recording run again gets fresh dispatch blocks. - the whole suite: 724 passed, the 6 known failures. Two independent reviews (four lenses, each finding checked by a skeptic; then the fixes) confirmed and fixed, among others: a fence idle for long was judged stuck for all that time the moment it was signalled again (a false exit at GTA's boot); time the process or the Mac was stopped counted as no progress; lifetime maxima made a rewound fence short for good, and the first fix of it also lowered them on forward CPU signals (DirectStorage); the check's cached pipeline could be replaced and freed while a recorded list still used it; trip counts carried over to a recording's next run; XCL's own upload queues listed as unfinished; the ledger kept a list's oldest records; bundles got barriers; a test's stand-in fence asked from another thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… title's Submit; the title's minidump kept off XCL's DWARF; a crash's memory in the log (GTA VI's intro crash)
GTA VI 1.0.2.1's world load on the Mac with the VFX defrag trio skipped (run 63) reached the
intro (frame 1254) and ended 184 ms later in an access violation at game+0x50e2130: a per-entity
table at [[rsi+0x10] + 8 * index] held a garbage tagged pointer (0xb5bfbf25060006e1). GTA fills
its streaming page table for a batch in its own submit path right before Submit
(game+0x1400e88f0 -> 0x140f2c470) and leaves an entry as it was when it frees the page. XCL
copied a request's page array at EnqueueRequest, and a half-full queue submitted by itself: an
entry still 0 refused the request (703 in run 62, 59 in run 63, 51 of those never logged), and an
entry naming a page the title had freed and taken again sent the data there, over whatever lived
in it, without a trace. The game's crash handler then died in Wine's dbghelp (0xc0000094 at
dbghelp.dll+0x157b1) and the process ended with that code.
- dstorage.rs (XCL_DSTORAGE_LATE_PAGES=0: as before): a request's physical page array that lives
in the title's memory (not on the enqueuing thread's stack) is read when the request runs
(`pages_now`); its snapshot at EnqueueRequest is used only when it cannot be read. A half-full
queue still submits by itself but sends only the entries before the first such request; that
request and everything after it (statuses, signals, in order) wait for the title's Submit –
unless the queue is full (one slot left: the title cannot Submit while it waits for room), when
all go. Held batches are counted once each. A cancel sends what a held batch kept back and
nothing holds back any more – the entries before the first request still waiting for the
Submit, all of them (the hold ends) when none is left. An auto-submit that finds the queue no
longer half full (a Submit took the entries meanwhile) sends nothing. Query (DSTORAGE_QUEUE_INFO) counts a held batch's entries as sent and says the
queue submits by itself when it is full – which it does –: a title that waits for room without
a Submit is not left waiting on them. (GTA VI never calls Query.) An entry still 0 at the request's turn is looked at again 8 times 1 ms apart (the title
may be filling it); after 4 requests in a row whose looks found nothing, none looks for a
second. Counted and shown in the `[waits]` DirectStorage line: entries filled, moved to another
page and cleared since EnqueueRequest, zeros filled while waiting / left, holds, full-queue
sends. Every failed request is logged with its options, destination and source – memory, or a
file and its offset, or the file object of a request refused at EnqueueRequest – (past 4096,
every 1024th); a page-array write failure names the page not written and the file offset (64 of
them). The last request that wrote each 64 KiB page is kept by default (XCL_DSTORAGE_PAGE_LOG=0:
not), for a crash's report: the pages' addresses are found before its lock is taken (they take
kernelx's), and a crash's report waits for it 100 ms at most in all.
- dbghelp.rs (new; a Mac host): the title's dbghelp.dll is the system's, but for
MiniDumpWriteDump: Wine's, with dbghelp kept to public symbols for the call
(SYMOPT_PUBLICS_ONLY, restored after) so that it does not read XCL's DWARF – its DWARF
expression evaluator divides by zero there –, and without the kinds of dump that copy the
process's memory wholesale (full, private read-write, private write-copy memory: tens of GB for
a title here). XCL_TITLE_MINIDUMP=0: no dump (ERROR_NOT_SUPPORTED); =full: the kind asked for.
hle `HleModule::real_dll`: GetModuleHandle("dbghelp.dll") answers as the system does (NULL
while it is not loaded) and LoadLibrary gives the system's module or fails – never XCL's
pseudo handle, which knows only MiniDumpWriteDump.
- eh.rs: after the report of an unhandled exception, the memory around each register that points
at readable memory (16 qwords; near the start or the end of what is readable, as many from the
register's on as are) and one step further (what the first 8 qwords there point at, labelled
from the register, a misaligned one too), each with the DirectStorage request that last wrote
its 64 KiB page. Copied with ReadProcessMemory: memory another thread unmaps meanwhile fails the
copy, not the filter (a fault there is a nested exception and the title's own filter never
runs) – the vtable look of the register report too.
- kernelx.rs (a test): a move to an address the test had just freed could find it reserved by
another thread first (a test thread suspended in between while another test dumped the
process); the destination is now in the low 64 KiB, which is never reservable.
Tests on Wine (M5 Pro, macOS 26.7.3):
- DirectStorage: a page table entry changed after EnqueueRequest – the data lands in the page the
table names at the request's turn and the page it named before keeps what it held; a half-full
queue (16 slots, 10 requests whose entries name another page at EnqueueRequest) writes nothing
anywhere before the Submit and everything into the pages the title names when it submits, the
old page untouched; a full queue (4 slots, 3 requests) runs them without a Submit; an entry 0 at
its turn – filled by the first look, left 0 after the looks, the looks rest after 4 such
requests and come back a second later; Query while a batch is held (16 slots, 11 entries: all
slots, 4 to the full queue's send; 3 pending and no hold: 13 slots, 5 to its own submit) and
the full queue sending it without a Submit, Query as for an empty queue after; a cancel of half
of a held batch keeps the hold, of the rest ends it and sends the status kept back without a
Submit. The tests' queues and pages are closed and freed when dropped, an assertion that fails
too (the queue's worker is waited for before the buffers it reads go). Mutations: with XCL_DSTORAGE_LATE_PAGES=0 all three of the
first fail (the snapshot; the self-submit writes into the old page); with late reads but no
hold the half-full queue writes into the old page; without the full-queue rule the third
fails; Query as before reports (5, 1), one that ignores the pending entries (16, 5), a hold left
set by the full queue's send (16, 15); a cancel that leaves the hold set or sends nothing fails
its test.
- dbghelp: LoadLibrary gives the system's dbghelp, GetProcAddress on it XCL's MiniDumpWriteDump
and the system's SymInitialize, GetModuleHandle the same module – and NULL for a name of a
real DLL routed to XCL that is not loaded (with the pseudo handle before, the test fails); the
kinds of dump kept and
left out (windows-sys' constants); a minidump of the test process (an executable with DWARF)
asked with MiniDumpWithFullMemory is written without it, dbghelp's options as before, and none
under XCL_TITLE_MINIDUMP=0. Without
SYMOPT_PUBLICS_ONLY the test process dies at dbghelp.dll+0x157b1, as GTA's did. A probe under
Wine reproduced the run-63 crash with XCL 0021's xcl.exe (SymFromAddr and MiniDumpWriteDump),
and none with the executable stripped or with SYMOPT_PUBLICS_ONLY.
- the crash's memory: the lines for a register and one step further (a misaligned register's
labels), the last qwords of a region whose next page is reserved only, unreadable addresses
and registers that point at nothing skipped.
- the whole suite: 735 passed, the 6 known failures (twice after the last fixes).
Four adversarial reviews (lenses on DirectStorage ordering, the crash path and the tests; then
on the title's flow, Windows and Wine semantics and concurrency; then twice on the last changes;
each finding checked by a skeptic) confirmed and fixed, among others: the minidump type bit for
private write-copy memory (0x10000, not 0x20000); the crash report reading memory with a
check-then-read race inside the exception filter; a misaligned register's labels; GetModuleHandle
of dbghelp giving XCL's pseudo handle; note_written waiting on kernelx's locks under its own;
Query reporting an auto-submit a held batch would not get; the hold flag left set by a cancel,
then a cancel that ended a hold without sending what it kept back, then one that sent from a
stale look at the hold (it looks again under the queue's lock, as the auto-submit does); the
failure log naming memory for a file; tests that could not fail or left a queue's worker reading
freed buffers when they failed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stand-in never sent to the PC; indirect draws checked on the GPU; DirectStorage writes kept by page for a crash; diagnostics of the memory the GPU cannot see (GTA VI's first world frame) GTA VI 1.0.2.1's world load on the Mac with 0022 (run 64) got past run 63's crash point's DirectStorage problem (0 failed requests, 4,077 page-table entries sent to the pages the title named) and recorded its first world frame at 214.7 s, but never presented it: the binds of that frame built their pipelines on the title's threads with no limit – about 415 new compute programs, one of about 29 MB of DXIL still compiling after 434 s – and the title's job threads and main thread waited in their idle waits behind them to the end of the run. - pso_async.rs, real.rs, pso.rs (pipeline scheduling): a compute program of 256 KB of DXIL or more that no earlier run built goes to a lane of its own (XCL_PSO_BIG_THREADS, 2 threads below normal priority) and its binds do not wait for it (XCL_PSO_WAIT_BIG_MS, default 0: late at once); the smaller ones keep the workers and XCL_PSO_WAIT_MS. What a run built is kept in built-pipelines-<translated cache identity>.txt beside used-pipelines.txt (XCL_PSO_BUILT_LEDGER=0: none) and XCL_PSO_BUILT_SEED=<file> counts a list as built; a known big program is built on the workers and waited for like a small one – until three of them take 2 s or more (the driver's cache is not what the ledger says), then the ledger is not trusted and what is still queued on the workers goes to the big lane. A program over XCL_PSO_MAX_DXIL_KB (4096) is refused when it is made, by its translated cache's header, with no driver call, and so is every program XCL_NO_BUILD_CS lists; their stand-ins stay and their work is skipped. Builds still running are named every XCL_PSO_STILL_BUILDING_S, a build that fails is named (the first 16, then at powers of two; a refused one never), and a panicking build is a failed one instead of a dead worker. - bind.rs, list_x.rs (bind gate): a stand-in whose pipeline is not built – late, failed, refused or on the big lane – is never sent to the PC with XCL's root signature: its Dispatch, DispatchX, DispatchMesh, ExecuteIndirect and draws are skipped and counted, the first 32 programs named (XCL_STANDIN_SKIP=0, XCL_STANDIN_SKIP_DRAWS=0: as 0022). The depth-bias variant of a pipeline (D3DMetal has no dynamic depth bias) is not set while it builds – the base pipeline draws without its bias – nor when its build ends between the two looks; the first use of that fallback is logged. - indirect.rs, bind.rs, device_x.rs (indirect draws): a translated draw's ExecuteIndirect with a plain DRAW or DRAW_INDEXED signature has its arguments checked on the GPU first – a command over XCL_INDIRECT_MAX_DRAW_COUNT (2^23 - 1) vertices or indices an instance, over XCL_INDIRECT_MAX_DRAW_WORK (2^26) in all, or reading past the bound index buffer, draws nothing – where the arguments are outside unified memory or unknown, and everywhere once any stand-in's work was skipped (a skipped producer leaves stale records behind) or with XCL_INDIRECT_SANITIZE_DRAWS=all (=own: the first scope only; =0: none). Root-changing (repacked) signatures, ones with vertex or index buffer views, and bundles go as they are. The check's pipelines are made ahead on xcl-indirect-warm; every ExecuteIndirect is counted by kind, place and fate (XCL_INDIRECT_CENSUS); XCL_INDIRECT_OWN=skip drops the ones whose arguments only PC copies fill. - dstorage.rs, kernelx.rs, eh.rs, gpu_views.rs, waitwatch.rs (DirectStorage): the last request that wrote each physical page is kept by page (XCL_DSTORAGE_PAGE_LOG=address: by address, as 0022; =0: none), so a crash's memory lines name the request and the page that is mapped there now – or that no page is, and that the memory may still hold what that page left; the old pages of moved entries are classified (XCL_DSTORAGE_OLD_PAGES); every hold for the title's Submit says how it ended, one held longer than XCL_DSTORAGE_HOLD_WARN_MS (2000) is named by xcl-dstorage-holds; the queue workers are xcl-dstorage-q<id>; the [waits] line keeps 0022's text through "full queues sent N; " and adds each queue's most pending, its holds and a Submit histogram. The crash report takes only try-locks under one 100-ms budget in all. 0022's request handling is unchanged. - outside.rs (new), real.rs, console_heap.rs, device_x.rs, kernelx.rs, stall.rs, mod.rs, host.rs (diagnostics, with XCL_ACTIVITY; XCL_OUTSIDE_CENSUS=0: none): every 30 s, the memory translated programs cannot see – views given an empty descriptor by kind and by 64 KiB page, buffer V#s the title wrote into its heaps, views made by address, placed buffers and the GPU-visible plain allocations that hold them (base, size, flags, protection) –; the stall ledger counts ExecuteIndirect by kind and place for recorded and submitted lists (XCL_INDIRECT_SUBMITTED) and the [stall] line names a submission's draws; the memory line ends with the host's figures. - skip_roots.rs (new), bind.rs, list_x.rs, kernelx.rs (for the next patch): at the first 2 skips of each program XCL_SKIP_CS lists (16 in all; XCL_SKIP_CS_ROOTS=0: none), its root arguments – constants, root descriptors and the first 8 slots of each descriptor table – with each view's V#, its memory's place (a unified-memory window, a placed buffer, the plain allocation, other memory, none), who wrote the descriptor (XCL's view or the title's bytes) and the first 16 bytes the CPU holds there; DispatchX flags other than 0 (once a value) and the title's SetThreadPriority calls (once a thread and an IDLE/LOWEST value) are logged. - kernelx.rs: FreeTitlePhysicalPages takes the lazy mark of a page it frees with it (lazy pages are off on a Mac: no change for the title there; the paging tests no longer see each other's marks). Tests on Wine (M5 Pro, macOS 26.7.3): 835 passed (735 at 0022, 100 new), the 6 known failures, 25 ignored, the same in two runs; the translator's sources are unchanged (source id 6b6d07bbd7308cc4: no translation is made again). Among the new tests: the big lane, the ledger, its seed and its distrust; a refused program never reaching the driver (D3DMetal); a stand-in's work skipped on every entry point; the draw check against its CPU rule on a 64-bit grid and on D3DMetal (window, upload and own sources) – the first triangle-drawing tests here; D3DMetal runs min(count, max) commands and gives a new committed buffer zeros; DirectStorage holds, the page record and the crash lines; the census; the root-view lines. Every test was mutation-checked: of 382 mutations of the Rust code, 5 are equivalent, one showed a defect (fixed here), and every other one fails its test. An adversarial review in five parts (pipelines, indirect, DirectStorage, diagnostics, what crosses them), each finding checked by a second reader, and two more over the fixes found no defect that could crash, hang or panic a run; what they found is fixed here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ls; pipeline waits with a limit bounded per frame; graphics builds and a frame's waits named (GTA VI's first world frame) GTA VI 1.0.2.1's world load with 0023 (run 65) reached its first world frame at about 160 s and presented nothing: one thread bound about 45 pipelines no build had finished, one after another, each wait bounded by XCL_PSO_WAIT_MS=1500 – about 27.5 s of waits in one frame – while three graphics pipelines sharing one new 608 KB pixel shader held the three workers for 14.6 s. After 30 one-second checks of the render thread's heartbeat the title's own stall watchdog called its armed report hook, whose deliberate store to address 0 (game+0x23cf683, 0x4d8bd421) ended it at 190.3 s: XCL_WATCHDOG_BYPASS resumed such a store only with a `ret` right after it, which this binary's hooks do not have (they end `add rsp, imm8; ret`), and its test used bytes the binary does not hold. - eh.rs, log.rs (the watchdog): one rule for the title's report hooks – the store `mov dword [0], imm32`, then `ret` or `add rsp, imm8; ret`, its return address right after the watchdog's `call rax` and on the watchdog's own store, in the hook's image – resumes at the hook's epilogue, which returns into that store; the watchdog's store in its first loop is resumed at its heartbeat check as before, and the one in its second loop (+0x2215da9) is resumed there too. Any other store to address 0 still ends the title. The hook's code is named (the first 4, then at powers of two), and the three lines wait a few ms for a busy log instead of being dropped (log::try_write_soon: at most 200 tries over about 5 ms, no blocking wait). A test raises the real faults through the handler under Wine: the leaf hook and the hook with a 0x48 frame, each called through the shapes of the watchdog's two call sites, come back with the registers each resume promises. - pso_async.rs, present.rs (a frame's waits): a thread's waits with a limit for pipelines at its binds and draws are bounded per frame too (XCL_PSO_WAIT_FRAME_MS, default 2000; 0: none): each gets what the frame has left of it, and once it is spent the binds go on at once without a pipeline not yet built (its build goes on) until the title's next Present; the first bind of a frame that went on without one is logged with what the frame waited and for which pipelines, and a pipeline the frame's budget made late says so in its line. With XCL_PSO_WAIT_MS unset or 0 a bind waits for its build as at 0023. - real.rs, host.rs, waitwatch.rs (diagnostics): every graphics, VS+GS or mesh pipeline's build is named with its translation and driver times; the "no Present" line ends with the threads that waited for pipelines since the last Present (the 4 longest); the waits watch's state of a call that merged several ends with their number and this one's age. Tests: 851 pass, the 6 known failures (835 at 0023), 25 ignored. Mutations at each step of the patch (52, 102, 12): in the end each is caught by the test meant for it, but one equivalent. Two rounds of adversarial review, each finding checked by a verifier; every confirmed finding is fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eline builds queued in tiers; upload staging and XCL's part of the coherent window capped; the world's frames dumped (GTA VI's world load on the Mac)
GTA VI 1.0.2.1's world load with 0023.1 (run 66) went past its first world frame (about 149 s) and
the title's stall watchdog, and presents went on until the strict memory guard ended it at 199.7 s
for swap (+4488 MB). D3DMetal's memory grew from 1.9 to 8.8 GB, because MADE keeps a PC texture for
every view address the title names, and keeps it for good. The Mac had also started with 11.6 GB of
other apps' memory. 0023.2 measures what that memory holds before GP2 changes it. It caps two
buffers that only grew and orders the pipeline builds.
- view_census.rs (new), console_heap.rs, real.rs, device_x.rs, title_textures.rs, lazy_tex.rs,
vram.rs, host.rs (GP1, diagnostics only):
- A lock-free shadow of the shared descriptor heap's places (16 bytes each, one VirtualAlloc of
32 MiB at most) follows every PC view XCL writes, copies or clears, after the D3D12 call.
- MADE keeps how each of its textures was made.
- Every 10 s, on a thread of its own (xcl-view-census, under XCL_ACTIVITY), the census prints the
lines "view census: …": the places in use, and the textures MADE holds that no PC descriptor
names any more (what GP2 may let go), by kind and size. XCL_VIEW_CENSUS=0 turns it off.
- The title's threads only do relaxed atomic stores. The census never dereferences a map value,
makes no D3D12 call, and uses uma::made(), so it never creates the unified-memory window.
- pso_async.rs, real.rs, gpu/recomp/pso.rs (PP2): the workers' queue in two tiers.
- First the pipelines the built-pipelines ledger knows or whose translation is cached, then the
cold ones.
- Only one worker at a time waits for commit on a big compute pipeline of the first tier. The
turn passes on once that build is past its wait.
- XCL_PSO_TIERS=0 gives one FIFO, as before.
- The VS/PS precompile fills only the flat DXIL cache, so a precompiled graphics pipeline counts
as cold, though it needs no DXC (the design's erratum).
- pso_async.rs, host.rs (PP3, MP4, PP6):
- A "pipeline queue (2 s): …" line: the queue by tier and kind, DXC compiles, big-lane commit
waits and the programs skipped. Also a clause in the "[waits]" line, and "pipelines at the
end:".
- The first use of each pipeline built in this run, at bind time ("[pso] first use of …", 1024
at most).
- The built-pipelines file gets each key once.
- gpu/texture.rs, title_textures.rs (GP3): upload staging kept at 128 MiB (XCL_UPLOAD_STAGING_MB;
0: as before).
- Batches go in runs of at most the cap, cut by PC staging bytes, through the kept buffer, which
no longer grows past the cap. A texture bigger than the cap gets a staging buffer of its own
for its upload only. In run 66 the kept buffer had grown to 256 MiB at 92 s, raising D3DMetal's
memory by 256 MB.
- A texture whose own upload fails before its submit gets one later turn (Entry.later), never one
that would overwrite what the GPU wrote.
- gpu/uma.rs, host.rs, real.rs (GP4): XCL's own part of the coherent window is 256 MiB on a Mac
(XCL_COHERENT_OWN_MB; 512 elsewhere, as before).
- A "coherent window: …" line gives its use and its high-water.
- A committed texture the window has no headroom for is now named by a bounded warning. It gets
a PC texture of its own, which the title's CPU writes do not reach.
- XCL_TRACE_MEM's no-room trace gives its count, at 1-16 and then at powers of two.
- present.rs, bind.rs, device_x.rs (DUMPS): XCL_FRAME_DUMP_WORLD=<every>[,<max>] (off; 20 at most
by default) dumps every n-th Present from the world's mark, the first dispatch XCL_SKIP_CS skips.
A dump whose copy outlasts its 2-s wait is written at a later present.
Tests: 915 pass, the same 6 failures as before (851 passed at 0023.1), 25 ignored.
Mutations at each step: 181 mutants on the first implementation, 41 on the review's fixes and 15 on
the last fixes. The records under runs/analyses/0023.2-impl list each survivor, each closed test gap
and each equivalent mutant.
Reviews: two rounds of adversarial review (four parts, then the fixes), each finding checked by a
verifier, then a check of the last fixes. Every confirmed finding is fixed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides changed the same code in 13 files. Each conflict was resolved by hand, keeping both sides wherever they fit together: - BCPack: the same port on both sides. BC7 dictionary entry 0 stays as scripts/gen_bcpack_victory_tables.py writes it from bcpack-tables.bin ([1, 0, ...]): every BC7 record has the same 116-byte layout, and the u16 after the widths is skipped in all of them. The entry-0 test pins that value. - Upload staging: the cap (XCL_UPLOAD_STAGING_MB) stays. The kept buffer is let go before a bigger one is made, and a size past u64 is an error (9db0989). Title-texture batches also stop at 256 textures. - ExecuteIndirect: fresh_indirect_arguments wraps the paths upstream wraps: the two-pass mesh path, the PC-pipeline path, the repacked path, and the direct call, which here is also both fallbacks of the GPU-checked path. Each call gets a transition of XCL's own buffer to INDIRECT_ARGUMENT and back, so that it reads the arguments written before it (measured upstream on NVIDIA; on the repacked path the repacker's transition of its output does that already). The GPU-checked path is not wrapped: it runs on XCL's checked copy, which is moved to INDIRECT_ARGUMENT after the check, the same ordering. The stall trace (XCL_TRACE_GPU_STALL) is kept everywhere. - PresentX: two planes or more are still composed by default. XCL_PRESENT_PLANE=n shows plane n alone and falls back to plane 0 as upstream's selection does; every plane's token is flipped; the plane shown alone is read through upstream's guarded GetDesc (a follow-up commit guards the composed planes too). - Descriptor resync: upstream's signature and tag map. Slots are read in place and a copied slot comes from the shared heap, as before: the resync runs at every submit over hundreds of pages in GTA VI's world, so it takes no per-page ReadProcessMemory and no linear search for a mirror. - Releases: the deferred-release ledger stays the only Release hook. It runs on driver threads that may touch atomics only, so the release gate's mutex is not taken there; clone_resource's adopted-object check and the deferred remaps stay. - Bottom-of-pipe writes: the per-queue workers and the ordered CPU copies stay. The submission's lists in the stall trace come from 9db0989, and so does its removed-device rule: the writes of a submission whose fence reads all ones are not done (a follow-up commit also stops the title there, as the fences' rule below leads to). - DirectStorage: AutoSubmitDisabled is honoured. A full queue still sends everything instead of blocking the producer (3247579's wait for room is not taken). - Fences: the cell follows GetCompletedValue, a removed device's all-ones included, so the title's wait ends and reaches stop_if_device_removed. The 10 ms poll and WakeByAddressAll stay. - Stall watchdog: the report hooks are recognised by their bytes; upstream's test change is covered by the negative tests of the resume. Tests (lib, Wine + D3DMetal): 942 passed, 6 failed, 25 ignored. The 6 also fail on our series alone and on upstream main, which fails 2 more that pass here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comment described a Mac-only remap of slots 73 and 74 that upstream removed itself (692d902). Both sides now map the slots the same way, so the lines are upstream's again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e after it backbuffer_like_guards_against_invalid_pointers_and_vtables put its "truncated" 64-byte vtable on the stack. The bytes past an array there can be read, so the 88-byte check passed and slot 10 was whatever the stack held. In a build where that was a pointer into the stack, the guard called GetDesc through it, the test died on an execute fault and the test run hung. The vtable is now the last 64 bytes of a committed page with only reserved memory after it, and the test also checks the reason check_resource_desc_slot gives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream's check_resource_desc_slot (d44cf12) guarded only the plane shown alone. With XCL_PRESENT_PLANE unset and two planes or more, the default on GTA VI, compose_planes and the planes' log line (describe_plane) still called GetDesc on each plane's resource unchecked. Both now go through get_resource_desc. A plane whose object, vtable or GetDesc entry cannot be read is left out of the composition, and the log line gives the reason instead of the size. Test: planes whose resource has a null vtable, an unmapped vtable or a null GetDesc entry are not composed and are named with their reason. Nothing is called through them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row gave `0` as the default and said to set `1` to try the second plane. With the merge, unset composes two planes or more, `n` shows plane `n` alone, and plane 0 is shown when the title presents fewer planes or plane `n` has no presentable resource. So `0` turns composition off: a user who copied the documented default lost the composed planes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge took two rules for a removed device. Their fence_x skip of UINT64_MAX was removed, so a removed device's all-ones ends the title's wait on a fence cell and its next call reaches stop_if_device_removed. In the cpu_writes worker, 9db0989's rule was kept: with the fence at all ones, no write of the job is done. That included Immediate markers and CPU copies, which do not depend on the GPU. A title waiting on such a bottom-of-pipe marker would wait for ever instead of being stopped with the report. The worker now calls real::stop_if_device_removed when its fence reads all ones, as the title's next submit or present would. It writes the report and ends the process when the device is gone. While the device still answers, the job's writes are left out as upstream does, and its done fence is still signalled. Test: a job whose fence reads all ones while the device answers. Its write is not done, its done fence is signalled, and the queue's next job is done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge removed upstream's skip of UINT64_MAX in refresh (3f3cca2), so that a removed device's all-ones reaches the fence cell. The title's wait on the cell then ends, and its next call reaches stop_if_device_removed. It also removed upstream's test of the skip, which swapped a local AtomicU64 and never called fence_x. Nothing pinned the new rule. The test signals u64::MAX on a fence with a cell from the CPU and checks that the cell reads u64::MAX after the refresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ount The merge took 9db0989's order: the kept upload buffer is let go, and taken off STAGING_BYTES, before a bigger one is made. With the cap, gpu_large_mixed_upload_keeps_tight_staging_and_exact_pixels checked only runs on a kept buffer of 128 MiB, so no test grew one. In GTA VI the buffer grows 4 -> 8 -> 32 -> 128 MiB. The test now first uploads the 4 MiB BC7 texture alone, which keeps a buffer of 4 MiB. It then uploads the 128 MiB RGBA texture alone, which grows the buffer to 128 MiB. Both read back byte for byte. A per-thread mirror of what the kept buffers add to and take from STAGING_BYTES (cfg(test) only) shows the count at 128 MiB after the growth, with a peak of 128 MiB and never 132, and back to where it started once the uploader is dropped. STAGING_BYTES itself is the process's, and the other tests change it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…itDisabled Upstream's 5bff7bd honours a queue's AutoSubmitDisabled option: such a queue no longer submits by itself at half full, only at the title's Submit or when full. GTA VI makes its queues that way, so the change alters how its streaming batches reach the disk and the page tables. No run of the game has seen it yet, and a build that cannot turn it off cannot compare it with the old behaviour in one A/B pair of runs. XCL_UPLOAD_STAGING_MB=0 is kept for the same reason. XCL_DSTORAGE_AUTO_SUBMIT_DISABLED=0 ignores the option: the queue then submits by itself at half full, like any other, as before 5bff7bd. Unset, or any other value, keeps upstream's behaviour. The first CreateQueue1 line says when the option is ignored. One risk remains with the option honoured: a batch that fills a queue (4,159 entries for GTA VI's) takes the full-queue escape, which runs requests into the title's pages before its Submit. The log says so as "a full queue (qN, ...) runs requests into the title's pages". Test: the switch's values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream's 5bff7bd translates a console MS container that sits in a stream's AS slot, with no MS subobject, as the mesh shader it is. Our series refused those pipelines: translated before the mesh chunk budget was fixed, the title rendered nothing from then on. GTA VI makes 38 such pipelines in every run, and none of our runs has drawn with them. A build that cannot refuse them again cannot compare the two in one A/B pair of runs. XCL_MS_IN_AS_SLOT=0 refuses them as before: E_INVALIDARG, with the translation-error line ending "refused (XCL_MS_IN_AS_SLOT=0)". This happens in translated_mesh_stream before any translation. Unset, or any other value, keeps upstream's translation. Test: the switch's values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the PR you asked for: our fork's work on GTA VI 1.0.2.1 under CrossOver and D3DMetal, with main (8862fc3) merged in. In our runs on a MacBook Pro (M5 Pro, 24 GB, Series S profile), the game used to freeze at its first loading screen, kernel-panic macOS during the world load, hang the GPU at the first world frame, and crash at the intro and right after the first world frame. With this series it runs about 150 s inside the world (run 67), until our memory guard stopped it for swap. It did not crash. The world's 3D scene is still black, and memory still grows (see Still not working).
It is large: 35 commits (the fork's 25, the merge and 9 follow-ups), +34,896 / −1,500 lines in 83 files, about 15,700 of the added lines in test modules. Each commit's message gives the cause, what was measured and the tests. Five commits are cherry-picks from ivall/xcl and keep their authors. main is merged in rather than rebased onto, because both sides changed the same code in 13 files; the merge commit lists the resolutions, and so does How main was merged below. If you would rather review it in parts, we can split it into stacked PRs by theme.
What is in it
GTA VI's stall watchdog (
eh.rs,log.rs,pso_async.rs). The crash at game+0x23cf683 that your Runs 10, 11 and 13 also report is the title's own watchdog: when the render thread's heartbeat stops, it calls an armed report hook whose store to address 0 ends the game. main resumes that hook only when aretfollows the store. In GTA VI 1.0.2.1 the hooks endadd rsp, imm8; ret, so it never matched, and our run 65 ended there at 190.3 s. WithXCL_WATCHDOG_BYPASS=1on a Mac, one rule now covers every report hook: the store, thenretoradd rsp, imm8; ret, reached from the watchdog'scall rax, in the hook's image. Such a hook is resumed at its epilogue, and the watchdog's own stores, in both of its loops, at its heartbeat check. Any other store to address 0 still ends the title. A test raises the real faults through the handler under Wine. In run 65 the watchdog fired because one thread waited about 27.5 s for pipelines in a single frame, so a thread's pipeline waits with a limit (XCL_PSO_WAIT_MS) are now also capped per frame (XCL_PSO_WAIT_FRAME_MS, 2000 ms). Resuming the watchdog does not help when the GPU itself hangs: see the next item.GPU hangs at the first world frame (
indirect.rs,gpu/recomp/emit.rs,gpu/recomp/mod.rs,bind.rs,stall.rs). Our runs 61 and 62 hung the GPU there in the VFX heap defragmentation. df231d75ee930b98 writes the dispatch arguments that 36204a134ee59578 (RelocateVfx) is run with through ExecuteIndirect, and on the Mac those arguments are outside unified memory, so the dispatch read whatever the PC buffer held. Your Runs 11 to 13 name 36204a134ee59578 in the stalled list too. This adds:[stall]) and can end the title (XCL_GPU_STALL_EXIT);With these, run 62 still hung, but the watch named the work and ended the title. Since run 63 our test runs skip that trio with
XCL_SKIP_CS=71f4ac8ad5eba33c,df231d75ee930b98,36204a134ee59578. That is a lever for testing, not a fix: giving those heaps memory the GPU can see is not done.GPU objects and tile mappings wait for the GPU before they go (
late_release.rs,real.rs,sparse.rs,list_x.rs,cpu_writes.rs). Three world loads out of three kernel-panicked macOS inside Metal's command-buffer submission (IOGPUFamily / AGX). D3DMetal records command buffers with unretained references, so an object destroyed, or a tile unmapped, while committed work still names it is walked by the driver at submit. Now:With this and
D3DM_RETAIN_REFERENCES=1, none of our ten world loads since (runs 58 to 67) panicked. Also, on the Mac a late-released resource is forgotten before its final Release (a use-after-free inpoll_unwatched), and XCL's own Release of a held object no longer re-marks it (that piled up 8 GB in a world load).Memory in the world load (
lazy_tex.rs,title_textures.rs,kernelx.rs,gpu/texture.rs,gpu/uma.rs). Our memory guard stopped runs 58 to 60. GTA VI streams tens of thousands of sampled textures into a GPU view of its memory, and on D3DMetal each became a committed texture of its full size: Metal memory grew 6 GiB in 15 s.XCL_TEX_LAZY=1, off by default) make such BC textures reserved resources that get tiles only where the title's memory has pages. In run 61, 11,389 of them (11.9 GB on the console) took 888 MB of tiles.XCL_SPARSE_64K_MAX_MB(off by default; 2048 for GTA VI) keeps a title's large 64 KiB-page reservation (3.9 GB on Series S) in plain memory instead of the sparse windows.XCL_UPLOAD_STAGING_MB), and XCL's part of the coherent window at 256 MiB on a Mac (XCL_COHERENT_OWN_MB). Together they took 384 MB off D3DMetal's memory in run 67, against run 66.Pipelines (
pso_async.rs,real.rs,bind.rs,list_x.rs,gpu/recomp/pso.rs). Run 64 recorded its first world frame and never presented it. About 415 new compute pipelines were built on the title's own threads with no limit, and one of them, 29 MB of DXIL, was still compiling after 434 s. Now:With D3DMetal's cache warm, run 67 built 672 pipelines in 3.3 s at its first world frame.
DirectStorage (
dstorage.rs,dbghelp.rs,eh.rs,kernelx.rs). Run 63 reached the intro and crashed 184 ms later on a garbage pointer in a per-entity table. GTA VI fills its streaming page table for a batch in its own submit path, right before Submit. XCL copied the page array at EnqueueRequest and let a half-full queue submit by itself, so stale entries refused requests or sent data into pages the title had freed and taken again.Rosetta (
loader.rs,widestore.rs,isa.rs,eh.rs). Rosetta cannot resume a 256-bit store whose second half faults after the first half has landed. It prints "unexpectedly need to EmulateForward on a synchronous exception", and every later exception of the process waits for ever. GTA VI froze 5 to 10 s into its first loading screen, because vcruntime140's memmove and memset copy with such stores.XCL_RUNTIME_COPIES).XCL_WIDE_STORES). GTA VI has 87,699 of them, and 47 are left to traps. The menu now comes up in 58 s instead of 241 s.XCL_PATCH_MWAITX=1, off by default).Display planes (
present.rs,compose.rs). As a Series S, GTA VI presents its 3D image at 1920×1080 in plane 0 and its interface at 3840×2160 in plane 1. Plane 0 is transparent black at the menus, so plane 0 alone shows black menus. Two planes or more are now composed into the back buffer by one draw: each source rect is scaled to its place, with premultiplied alpha, over black. After the merge,XCL_PRESENT_PLANE=nshows plane n alone, and every plane goes through main's guarded GetDesc.Ordered CPU copies and readbacks (
cpu_writes.rs,list_x.rs). GTA VI stopped submitting at its first loading screen: a CopyMemoryToMemoryX done by the CPU was written after the title had already seen its own fence complete.XCL_CPU_COPY_ORDERED).XCL_GPU_READBACK_COPY).Diagnostics, most of them only with
XCL_ACTIVITYor a switch of their own (waitwatch.rs,view_census.rs,outside.rs,skip_roots.rs,kernelx.rs,host.rs,present.rs):XCL_WATCH_WAITS=1: where every thread waits, without stopping it, plus a fault probe. It found the Rosetta freeze.XCL_ACTIVITY: the census of the views XCL writes and the textures no view names any more, and the census of the memory translated programs cannot see.XCL_SKIP_CSskips.XCL_TRACE_PAGES, and the[indirect]and pipeline-queue lines.XCL_FRAME_DUMP_WORLD).Ports from ivall/xcl.
scripts/gen_bcpack_victory_tables.pyis the script THIRD_PARTY.md already names.python -I scripts/gen_bcpack_victory_tables.py <bcpack-tables.bin> <out.rs>, run on VIctory's bcpack-tables.bin, reproducestables.rsbyte for byte.tests/data/bcpack, made by itsgenerate.py, by Kalmarv);README: the
XCL_PRESENT_PLANErow as the merged code reads it, and rows for the two new opt-outs. Three docs are not changed, though they no longer describe this branch:poll_unwatchedline mentions a release guard this branch does not have;How main was merged
Both sides changed the same code in 13 files. Where both sides fit together, both are kept. Where they could not both stay:
tables.rs,tests.rs(both sides ported the same decoder)[2, 1, 0, …](a4b80ec) is the generator's[1, 0, …]. Your entry-0 test is kept and asserts that row.gpu/texture.rsstaging_capacity(16-MiB steps) andlarge_staging_uses_sixteen_mib_growth_stepsare removed.gpu_large_mixed_upload_keeps_tight_staging_and_exact_pixelsexpects the capped buffer and gained a growth case.d3d12x/title_textures.rsclone_resourcecheck, deferred remaps,BATCH_ITEMSandbatch_fitsRELEASING,ResourceRelease,with_resource_reference) anduploads_do_not_acquire_references_during_resource_releaseare removed.BATCH_BYTES(32 MiB) is replaced by the staging cap (128 MiB).real.rs. Batches follow the cap.d3d12x/real.rshooked_releaseand the deferred-release ledgerResourceRelease::begin(692d902, f7bcad5) is not taken.d3d12x/console_heap.rsunregister_with_resync, tag map and resync signaturecpu_mirror_srvandglobal_srv_resolves_only_to_a_live_cpu_mirrorare removed.d3d12x/cpu_writes.rsstalled_queue_keeps_writes_pending_without_blocking_other_queuesis ported to our workers.d3d12x/fence_x.rs(merged without a conflict)refresh(3f3cca2) and its test are removed.stop_if_device_removed. The removed test only swapped a local AtomicU64; a new test checks the cell.hle/dstorage.rsroom,pending_for_enqueue,full_manual_queue_waits_for_submit_cancel_or_close) is not taken. A full queue sends everything.d3d12x/present.rsparse_plane, plane-0 fallback, guarded GetDesc and configuration log; our compositionrequested_plane_indextakes any plane number. Unset, two planes or more are composed instead of plane 0 alone. The log line counts composed planes.backbuffer_like_guards_against_invalid_pointers_and_vtablesnow puts its truncated vtable at the end of a committed page.d3d12x/bind.rsfresh_indirect_argumentson the paths you wrapeh.rstitle_watchdog_resumes_fatal_crash_at_world_loadwent with that test, which our watchdog change replaced.title_watchdog_keeps_stores_to_address_0_it_does_not_know_fatalcovers the case.d3d12x/sparse.rs,vram.rsAfter the merge, nine more commits:
check_resource_desc_slot.stop_if_device_removedwhen its fence reads all ones. Under main's rule alone the writes were left undone, so a title waiting on such a marker would wait for ever.XCL_DSTORAGE_AUTO_SUBMIT_DISABLED=0andXCL_MS_IN_AS_SLOT=0. Both default to main's behaviour.present.rstest above, the README row, and our stale comment on slots 73/74 dropped.New switches
Of the new switches, the README lists only the two opt-outs. The others are described in the code and in the commit messages.
All 65, with their defaults
On by default:
XCL_PSO_WAIT_FRAME_MS0: no capXCL_PSO_WAIT_MS) a thread may spend in one frameXCL_PSO_TIERS0: one FIFOXCL_PSO_BIG_THREADS0: no big laneXCL_PSO_BIG_LOW0XCL_PSO_WAIT_BIG_MSXCL_PSO_MAX_DXIL_KB0: no limitXCL_PSO_BUILT_LEDGER0XCL_PSO_STILL_BUILDING_S0XCL_STANDIN_SKIP,XCL_STANDIN_SKIP_DRAWS0XCL_INDIRECT_SANITIZE0XCL_INDIRECT_MAX_GROUPSXCL_INDIRECT_SANITIZE_DRAWSall,own,0XCL_INDIRECT_MAX_DRAW_COUNT,XCL_INDIRECT_MAX_DRAW_WORKXCL_INDIRECT_DRAW_INDICES0XCL_BUDGET_TRIP_WAVES0: off (changes the translation)XCL_GPU_STALL_WATCH0[stall]linesXCL_LATE_RELEASE_ALL0: resources only;1: every kind everywhereXCL_LATE_RELEASE_GRACE_MSXCL_UPLOAD_STAGING_MB0: no cap (the old growth)XCL_COHERENT_OWN_MBXCL_CPU_COPY_ORDERED0XCL_GPU_READBACK_COPY0XCL_DSTORAGE_LATE_PAGES0XCL_DSTORAGE_AUTO_SUBMIT_DISABLED0XCL_DSTORAGE_PAGE_LOGaddress,0XCL_DSTORAGE_OLD_PAGES0XCL_DSTORAGE_HOLD_WARN_MSXCL_MS_IN_AS_SLOT0: refuseXCL_RUNTIME_COPIES0XCL_WIDE_STORES0XCL_TITLE_MINIDUMP0: no dump;full: the kind asked forXCL_VIEW_CENSUS,XCL_OUTSIDE_CENSUSXCL_ACTIVITY0XCL_INDIRECT_CENSUS,XCL_INDIRECT_SUBMITTED0XCL_SKIP_CS_ROOTSXCL_SKIP_CS0Off by default:
XCL_TEX_LAZY=1or2, withXCL_TEX_LAZY_FORMATS(bc),XCL_TEX_LAZY_GRAIN(mip, ortexture),XCL_TEX_LAZY_MIN_KB(128),XCL_TEX_LAZY_MAX_OVERHEAD(1.25),XCL_TEX_LAZY_MAX_MB(0: no cap)1XCL_SPARSE_64K_MAX_MB=<MB>XCL_GPU_STALL_EXIT=<s>XCL_SKIP_CS=<hash>,…XCL_NO_BUILD_CS=<hash>,…XCL_PSO_BUILT_SEED=<file>XCL_INDIRECT_OWN=skipXCL_PATCH_MWAITX=1XCL_FRAME_DUMP_WORLD=<every>[,<max>]XCL_WATCH_WAITS=1,XCL_EXCEPTION_TEST_AT=<s>XCL_TRACE_PAGES=<pages>XCL_WATCHDOG_PROBE=<file>XCL_GPU_VIEW_READBACK=1,XCL_VIEW_MIRRORS=1,XCL_SERIALIZE_TILES=1,XCL_LATE_RELEASE_SERIAL=1,XCL_LATE_RELEASE_TOUCH=1XCL_PLAN_IMAGE,XCL_PLAN_DEBUG,XCL_PLAN_SITES,XCL_PLAN_TRAPSChanged meaning:
XCL_PRESENT_PLANE(unset composes the planes;nshows plane n alone, so0turns composition off),XCL_WATCHDOG_BYPASS=1(resumes every report hook; still Mac-only and off by default) andXCL_PSO_WAIT_MS(now also bounded per frame).Tested
x86_64-pc-windows-gnullvmwith Rust 1.97.1 and LLVM-MinGW, release, as the Mac cross-build CI does.cargo build --release --locked --target x86_64-pc-windows-gnullvm -p xclandcargo test --no-run --release --locked --target x86_64-pc-windows-gnullvmbuild without errors. The 39 checks ofscripts/verify_mac_build.sh, run as the same grep commands, pass.Unit tests: the lib's test binary (
cargo test --release --locked --target x86_64-pc-windows-gnullvm -p xcl --lib --no-run), run in the CrossOver bottle withWINEDEBUG=-all XCL_LAZY_PAGES=1, a freshXCL_DXIL_CACHEfolder and--test-threads=6 --skip gpu::recomp::tests::gpu_ --skip gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes. The first skipped group runs separately (below); the second test fails or hangs under Wine here.device_x::tests::console_depth_buffers_and_their_views_are_the_pcs,list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu,present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content,real::console_format_query_tests::console_formats_are_asked_as_the_pcs,real::console_format_query_tests::gpu_console_depth_formats_are_supportedandxaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime.bcpack::tests::fixtures_decode_to_their_lanes(main has the test but nottests/data/bcpack) andtitle_textures::tests::title_bytes_are_used_in_place_when_all_are_readable.list_x::tests::timestamps_outside_unified_memory_land_after_the_queue: D3DMetal's timestamp queries read 0. Skipped on main too.dstorage::tests::under_page_log_address_writes_are_kept_by_address_alone: needsXCL_DSTORAGE_PAGE_LOG=address.title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels: there are no shared texture pages on this host.GPU translator tests (
gpu::recomp::tests::gpu_, 87 of them), run on one thread. A test that hung for 90 s was skipped and the group was run again.gpu_graphics_vs_ps_draw,gpu_ps_p0_reads_flat_integer_selectorsand the threegpu_rect_list_*tests.gpu_wave64_ps_spill_slots,gpu_wave64_ps_whole_wave_reductionsandgpu_wave64_vs_spill_slots_and_identity.gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware.gpu_bvh_intersect_ray,gpu_bvh64_intersect_ray_across_memory_windows_and_grazing,gpu_built_bvh_nodes_match_the_cpu_node_test,gpu_mesh_mode_reads_memory_windowsandgpu_mesh_mode_two_passes.GTA VI 1.0.2.1 (our own Series dump), Series S profile, on the same Mac. These runs used our fork's builds from before the merge, not this branch's head. Each row adds the fixes named:
D3DM_RETAIN_REFERENCES=1XCL_SKIP_CSof that trioXCL_RUN_SECONDSended it at 900 sRun 67's environment, besides the Series S profile in the title's xcl.toml:
It also set logging switches (
XCL_ACTIVITY=1,XCL_WATCH_WAITS=1, frame dumps, traces),XCL_RUN_SECONDS=1200and input throughXCL_REMOTE_INPUT.Regression run
scripts/smoke.ps1was not run, so there are noxcl-smokeblocks for main and for this head, and the PR check will say so. The game runs above are longer runs of our fork's builds on one title. They are not smoke runs of main and of this head.Still not working
XCL_SKIP_CS; without that, the first world frame hangs the GPU.Not tested
Windows. This branch was not built with MSVC or run there, and
scripts/test.ps1/cargo test --workspacewere not run. Several changes are not limited to a Mac host and change Windows behaviour too:The merge with main and the nine commits after it ran the unit suites only, with no title. For GTA VI these changes have not run yet:
XCL_DSTORAGE_AUTO_SUBMIT_DISABLED=0andXCL_MS_IN_AS_SLOT=0restore the series' behaviour for the first two.The translator's sources differ from main's, so a first run makes the translated shader cache again. For GTA VI that took about an hour on this Mac.
BCPack: BC7 entry 0 follows the table's record layout and the generator. It is not checked against a decoded retail stream:
bcpack_paritydoes nothing withoutXCL_SAMPLE_BCPACK, and we have no samples.The workspace's integration tests were built, not run.
Other titles, the Series X profile, a physical controller, AMD and NVIDIA GPUs, and other Macs or macOS and CrossOver versions.
AI use
🤖 Generated with Claude Code