Repository navigation
Merge main into amd-dev - #3444
Conversation
Disable translated-shader caching whenever XCL_SAFE_BARRIER is set because the override changes direct-backend admission and generated barriers. Cover physical-wave boundaries, native wave32 mesh groups, and the explicit unsafe override. Checked with cargo check for the Windows GNU target across library, tests, and benches. Assisted-by: Codex (GPT-5.6-sol)
Adapt the default-on LDS ordering and read-run elision from PR xcl-dev#1252 to the current emitter while preserving coherent-memory, barrier, and wave-local remap state. Assisted-by: Codex (GPT-5.6-sol)
The direct per-instruction and per-lane lowerings do not yet order real LDS accesses between the two hardware halves. Refuse that unsafe combination so runtime routing uses the HLSL path's ordered meetings, while retaining native waves, geometry, and DS cross-lane operations. Assisted-by: Codex (GPT-5.6-sol)
Fused split-wave64 reduction tails emit their own guaranteed cross-half meeting, but did not record it in the LDS ordering state. Mark those exchanges as Met so a following LDS access does not pay for a redundant meeting. Assisted-by: Codex (GPT-5.6-sol)
Recognize the compiler's exact min, max, and/or whole-wave pattern only when its saved-EXEC mask provenance and instruction flow are proven. Rebuild it with wave operations over launched lanes, repair the accumulator, and route recognized direct-DXIL graphics stages through the HLSL path. The RTX partial-wave regression remains hardware-gated; GNU cross-target library, test, and bench compilation passes on Linux. Assisted-by: Codex (GPT-5.6-sol)
Adapt PR xcl-dev#2252 to propagate the requested graphics wave mode into direct DXIL. Wave64 VS/PS programs whose upper-lane reads need HLSL reconstruction now fail closed, while native and safe split programs remain direct. Assisted-by: Codex (GPT-5.6-sol)
A wave64 vertex or pixel shader can use v_writelane slots whose target lane was not launched in a partial hardware wave. Preserve proven slots in scalar shadows, select the native value when the physical upper lane exists, and include pixel helper lanes through the established quad recovery path. Direct DXIL falls back when it cannot represent the shadow. The structural coverage includes native and split forms, direct fallback, and an intervening VALU overwrite that requires physical-lane selection. Assisted-by: Codex (GPT-5.6-sol)
Pipeline pressure cannot safely evict and restore native generations while command-list state remembers only a reusable title address. Snapshot each registered pipeline before taking the bind-state lock and retain either its exact Pending identity or a pinned ready generation. Evicted generations remain deferred: this stage starts no restoration, worker, wait, receipt, or pressure policy. Replacement decisions are dropped outside the state lock, and split continuations carry the exact retained identity. Assisted-by: Codex (GPT-5.6-sol)
The required suite did not compile or execute custom benchmark targets, and translation timings did not cover the wave64 graphics analyses. Smoke every custom benchmark closure once and add equal-sized plain, native-spill, and split-spill translation workloads. The bench-only Cargo selector excludes library and binary test harnesses, avoiding duplicate optimized-profile unit and GPU tests. Assisted-by: Codex (GPT-5.6-sol)
Correctness-critical emission must not re-resolve a title address that may now name another pipeline, and it must never bind an unowned native pointer. Add a retained-identity consumer that exposes a raw pipeline only together with its exact immutable generation pin. Legacy one-shot pipelines remain an explicit transitional disposition, while deferred restoration and failures remain fail-closed. No live draw, dispatch, ExecuteIndirect, worker, or restoration policy changes in this stage. Assisted-by: Codex (GPT-5.6-sol)
A draw previously re-looked up its title pipeline address and then resolved it again inside ABI binding. Address reuse or generation replacement could redirect one recorded draw and leave its native object unpinned. Snapshot the retained decision once outside the bind lock, record an available immutable generation before use, and carry the selected raw pipeline through draw classification, tracing, ABI binding, and rectangle handling. Deferred recipe states fail closed; legacy one-shot behavior remains explicitly unchanged for a later generalized pinning stage. Assisted-by: Codex (GPT-5.6-sol)
Retained draw decisions previously fell back to the title-visible address for ordinary one-shot builds, allowing release and address reuse to redirect emission to another pipeline. Lazily retain one exact COM generation per used build, serialize its first pin with final release, and fail closed when no owned generation exists. Assisted-by: Codex (GPT-5.6-sol)
Pipeline generations recorded by draws must survive bundle execution, command-list submission, and GPU retirement independently of recipe rebuilding. Reset and split paths now carry only retained exact identities, and generation owners are dropped outside the list-state lock. The ordinary submission fast path remains marker-free when a recording has no exact generation pins. Assisted-by: Codex (GPT-5.6-sol)
Direct Dispatch now carries the retained SetPipelineState identity through deferred demand, build waiting, generation pinning, ABI setup, and the native SetPipelineState call. Reusable title or native addresses can no longer redirect a recorded dispatch to a replacement pipeline. This removes redundant registry resolution structurally; no runtime performance measurement was made in this Linux environment. Assisted-by: Codex (GPT-5.6-sol)
Generation retirement scanned every outstanding receipt by calling the driver while holding one global mutex, producing quadratic fence probes while the GPU lagged. Snapshot one exact queue-marker owner per fence, observe progress outside the mutex, and retire all batches below each captured monotonic cutoff. Receipt clones are now Arc-only, and completed or duplicate generations are destroyed after unlocking. The focused tests cover exact-owner deduplication, cutoff retirement, concurrent appends between phases, lock exclusion for probes and drops, poisoned duplicates, and COM-free receipt cloning. Assisted-by: Codex (GPT-5.6-sol)
A bind captured before its pipeline finishes remains an Initial decision and repeats completion and generation locks on every later emission. Add a non-default synthetic benchmark that compares that steady path with an already-retained Ready choice and with fresh registry classification. The fixture prewarms exact fake COM owners and excludes workers, DXC, driver compilation, and first-use allocation. A dispatch case also includes the initial-build gate. This records the baseline for a separate Initial-to-exact promotion change without altering default runtime behavior. Assisted-by: Codex (GPT-5.6-sol)
A bind captured while its pipeline was unfinished stayed Initial forever, so every later draw or dispatch repeated completion, generation, and candidate bookkeeping locks after the build had finished. Publish the first successfully resolved exact generation into a cell shared by every clone of that retained decision. Only exact available choices are cached; unavailable attempts remain retryable. Concurrent first consumers return one cell winner, including when a local failure races with another consumer's publication. The promoted owner survives release, address reuse, rebuild, and native Reset seeding. Assisted-by: Codex (GPT-5.6-sol)
Replace the linear generation-owner scan on every translated draw and dispatch with an allocation-identity index. Preserve the ordered owner vector for submission lifetime, rebuild the index across bundle and failed-close restoration, and clear it on every recording transfer. Assisted-by: Codex (GPT-5.6-sol)
Exercise the real generation-recording path at retained depths 1, 16, 64, and 256, then compare equal batches across distinct lists serially and in parallel. The feature-gated fixture uses exact fake-COM owners, stable synthetic list identities, and removes its state without touching a device. Assisted-by: Codex (GPT-5.6-sol)
Compare equal batches of retained pipeline-state snapshots across distinct command lists serially and in parallel. Each worker owns a separate exact-resolution carrier so the measurement isolates the global bind-state mutex rather than a shared reference-count cache line. Assisted-by: Codex (GPT-5.6-sol)
The adopted primary already forgets its state before final native Release. Avoid a second key-only forget after Release returns, when the runtime may already have created a new list at the same address. Assisted-by: Codex (GPT-5.6-sol)
Replace the process-wide bind-state mutex with a 64-shard registry of per-list state locks. Registry guards are released before list locking, and forget extracts state so UMA transfer and retained pipeline destruction remain outside both lock classes. Assisted-by: Codex (GPT-5.6-sol)
Keep four weak per-thread bind-entry references so repeated draw and dispatch state access bypasses registry shards. One-way live invalidation and a post-lock Acquire check reject stale entries after same-address list reuse without extending state or COM lifetimes. Assisted-by: Codex (GPT-5.6-sol)
ABI binding took separate state locks for the root snapshot, three arena reservations, dispatch limits, and allocator. Capture the root state, reservations, and allocator in one critical section, and pass dispatch limits explicitly so failures cannot leak them into a later dispatch. Compile-only checked for x86_64-pc-windows-gnu in debug and release; Windows execution was not available. Assisted-by: Codex (GPT-5.6-sol)
Existing timing covered translation, DXC, driver compilation, and title-thread waits but not time accepted jobs spent waiting for a worker. Record speculative/preload and demand-band residence separately, split promoted jobs at the accepted priority transition, and abandon timings for cancelled work. Timing aggregation stays outside the build-queue state lock so tracing does not add a nested serialization point to the measured path. Compile-only checked for x86_64-pc-windows-gnu in debug and release; Windows execution was not available. Assisted-by: Codex (GPT-5.6-sol)
Keyed compute submissions shared one process-wide registry lock and swept every in-flight key on each request. Route canonical keys across 64 shards, clean stale values only on exact-key contact, and remove terminal builds by exact weak identity. Counter retirement is serialized before terminal removal, while displaced keys and builds are dropped after unlocking. Compile-only checked for x86_64-pc-windows-gnu in debug and release; Windows execution was not available. Assisted-by: Codex (GPT-5.6-sol)
Repeated deferred dispatches re-ran wanted promotion and took the queued and demand locks after record-time demand was already established. Publish completed submit demand on the shared build after want and scheduling finish, so later calls use one acquire load while concurrent first callers remain idempotent. Cross-checked debug tests and release all-target builds for x86_64-pc-windows-gnu; Windows runtime tests were not run here. Assisted-by: Codex (GPT-5.6-sol)
Choosing between more GetWriteWatch calls and scanning gap bytes needs Windows measurements. Keep the existing 8 MiB production policy, add opt-in exact coverage and call timing, and provide a deterministic allocation-safe planner plus a manual threshold benchmark for a later measured activation. Cross-checked debug tests and release all-target builds for x86_64-pc-windows-gnu; the Windows benchmark, runtime tests, GPU tests, and smoke run were not run here. Assisted-by: Codex (GPT-5.6-sol)
Retained deferred dispatches repeatedly took the completion mutex even after an initial build had reached terminal state. Publish terminal initial-build state through an observational release flag while keeping exact waits, generation ownership, release, and eviction serialized by the existing mutex. Add serial and parallel CPU benchmarks for shared and distinct unpromoted completion probes, with the promoted path as a control. Cross-checked debug tests and release all-target builds for x86_64-pc-windows-gnu; Windows tests and benchmarks were not run here. Assisted-by: Codex (GPT-5.6-sol)
Dirty-page selection scans every active texture while holding the texture table, but existing activity reports hid both lock contention and scan cost. Preserve the exact resource-ordered selection and retention semantics while reporting lock wait, hold time, predicate work, matches, and retained uploads through the existing opt-in look sample. Cross-checked debug tests and release all-target builds for x86_64-pc-windows-gnu; Windows runtime tests, GPU tests, and smoke were not run here. Assisted-by: Codex (GPT-5.6-sol)
Brings amd-dev's 73 commits since 10582c4 onto the main-based merge (4fedcbc). Commits main already carries keep main's version. Each new amd-dev change is re-applied onto main's code where 4fedcbc chose main: direct wave32 reductions on graphics_reductions, quad-local lane reads beside main's own-lane fallback, remap compare and GPU-write keeping in main's texture selection, cached mapped ranges and look stats in main's sparse.rs, urgent PSO workers on main's Build queue, the RAM floor after main's compile gates. Left out: the XCL_ASYNC_SUBMIT submit thread series and the unlocked CPU read (built on amd-dev's submission path, alloc_pool and sparse landing), the shared deferred two-pass batch buffer and its smaller ExecuteIndirect regions (main's feedback sizes them), XCL_DXIL_NO_OPT cache keying (main bypasses the cache), and the 64 KiB / 2 huge-compile defaults (main's AMD medium-compute gate stays). Main's EXEC-select fold is not one of the newer forms.
|
Tested 4fedcbc as-is on Windows 11, RX 9070 XT, release build, on a retail title.
Thread stacks of the frozen process show a three-thread deadlock through the D3D12 runtime's lock:
vkd3d-proton doesn't have D3D12Core's lock, which would explain why this doesn't show on Linux. Two possible fixes: don't take the submit lease from a release hook that can run inside a runtime call (defer The PR head has moved to 5eb7f8f since; I have not tested that commit. |
… queue late_release::Held::drain signals each queue's fence under HELD, and native_queue_signal waits for the queue's submit lease. drain_known runs from a resource's last Release, which D3D12's runtime can make inside a call of its own (a list's Reset, alloc_pool::reset_list) while holding a runtime lock; the thread with the lease can be waiting for that lock (sparse::readback_after_execute_with resetting its allocator inside queue_submit::with). On Windows the three threads then waited for each other (title thread on HELD, the Reset thread on the lease, the queue thread on the runtime lock); reported by raylitebull on xcl-dev#3444 for main's code merged into amd-dev. vkd3d-proton has no such runtime lock. Sealing now takes the lease only when it is free (queue_submit::try_with, native_queue_try_signal); a queue whose turn is another thread's leaves the batch open, and the next drain (the late-release thread, every TICK) closes it.
|
Thanks for testing this on Windows and for the stacks – that pinned it down. The deadlock isn't from the merge: The cycle closes in Tested only on Linux (Wine + vkd3d-proton, RX 7800 XT), where the deadlock can't happen: builds, tests build. I can't run Windows here – could you try the new head when you have a moment? If it's easier to review on its own, I can open it as a separate PR against |
The stand-in lighting (XCL_RT_GATE=miss + XCL_AMBIENT) never applied on this merge: no "captured … sky dome" or "applied" line in any run, so every missed ray brought the sky's light indoors (overexposure, sparkles in hair and skin, white specks). Three causes: - Merge regression: main's ExecuteIndirect runs split programs through dispatch_chain::execute_indirect and returns before the ambient hook; amd-dev had no such branch. The chain path now calls the hook too. - Roles were looked up by the resolved PC pipeline, which lazy and background builds replace with other objects. Roles are now noted at the title's own CreatePipelineState, looked up by the bound pipeline and, failing that, by the console record (fnv64 of the CS). - The helper programs (SKY_REDUCE, AMBIENT_FILL, LIGHT_PLACE, …) were compiled with D3DCompile, which under Wine is vkd3d-shader and refuses them, so get_device made no device and every pass returned silently. They, and the depth UAV twins', present compositor's and mirror's helpers, now compile with DXC first (dxc::compile_sm6_first, x_5_x as x_6_0), D3DCompile as the fallback, and a refusal is logged. scatter's program stays on D3DCompile: built with DXC it scattered the title's writes to the wrong places. XCL_AMBIENT_DIAG=1 logs the path and role each lighting pass takes.
amd-dev zeroed pool tiles that an evicted or freed texture had used before mapping them into a new texture (XCL_ZERO_TARGET_PAGES, on by default). Taking main's vram.rs in the merge dropped that, so new render targets such as the screen-probe light history start out with another image's bytes, which shows up as block garbage in the lighting. Bring it back on main's page pool: TilePool marks tiles that come back from cooling, take_batch_recycled reports the marked ones it hands out, and bind_range zeroes them on the tile-mapping queue right before the UpdateTileMappings that gives them to the texture. One CopyBufferRegion per contiguous run, from a 1 MiB zeroed upload buffer into a buffer placed over the whole pool heap. Title queues already wait for the mapping fence in before_execute, so the zeros land before any work on the texture. A new heap's tiles are zeros already and are left alone. XCL_ZERO_TARGET_PAGES=0 turns it off; the zeroed tile count is logged at powers of two.
The title's final Release of a command allocator cleared RECORDINGS for it (alloc_release, real.rs) even when alloc_pool kept the allocator alive because a list still held a recording on it or the GPU had not passed its submits. The chains' scratch buffers, indirect command storage and pipelines then went through late_release, which only waits for work submitted before the release: a list submitted again (or a submit reserved but not yet on the queue) ran its chains on freed memory. Retail runs on Linux/RADV lost the device (0x887a0005) 2-4 min after world entry, each time after a gfxhub read fault (PERMISSION_FAULTS 0x3, client 10, thread vkd3d_queue) and a ring timeout. A local log of every buffer's GPU address range puts several of those fault addresses (0x8016d3c02000, 0x801736c00000.., 0x8016f76c1000, 0x80164e630000) in freed chain-scratch buffers of a run with the same address layout. A Quint model of the recordings' lifetime finds the same: a recording is freed at the final Release while a list can still submit it. RECORDINGS of a PC allocator now go at console_list::allocator_reset, which alloc_pool calls only for a backing it proved free (no list holds a recording on it, every submit passed): reset_pc_allocator, forget's free backings and sweep_release_owners. alloc_release clears them itself only when the pool does not keep the allocator. As a side effect, recordings on put-aside backings no longer wait for those backings' own Release.
Restores amd-dev's XCL_SPARSE_CPU_WAIT_MS (1000 ms by default, 0: off) from 6fa964d, which the main -> amd-dev merge (#3444) dropped with main's sparse.rs: a title submit whose wait for the sparse fence covers tile mappings, and every wait for the texture page queue's mappings, waits for the fence on the CPU before the title's lists go, and only past the limit has the title's queue wait for it on the GPU (logged). On amd-dev this was the RX 9070 device-removal fix: with every title queue holding its work behind the mapping queue's fence, the fence stopped short for 15 s and the device was removed. It also fixes the two debug-layer e2e tests, which fail the same way on plain main (1bd9cee) and pass on amd-dev (6bab0c5): with the GPU wait, the debug layer's synchronized command queue validation holds a queue's calls after a Wait for an unreached value on its own thread, and the test title's copies and fence Signal after a tile mapping did not run for more than 5 s ("GPU fence 1 not reached" in the sparse buffer heap, depth bias, raytracing and streamed texture sections), though the CPU wait finds the mapping done within 1 ms. With synchronized validation turned off (experiment) the GPU wait passed those sections too. Which waits cover mappings is tracked as on amd-dev: map_tiles, unmap_tiles and poison_all set mapping_queued, the next signal records mapped_value. Waits for uploads alone stay on the GPU. The CPU wait holds no queue's submit lease (title_textures::refresh runs before the lease is taken) and lets the upload gate go; it keeps the queue's wait gate, so another submit on that queue still sees the wait done first. amd-dev's wait_pending_mappings is not restored: main records the put-off dispatches before the submit's refresh, so no mapping of theirs comes between the refresh and the lists.
…them Restores amd-dev's XCL_ZERO_TARGET_PAGES (on by default, 0: off) from 6fa964d, which the main -> amd-dev merge (#3444) dropped with main's vram.rs. Our run environment still sets XCL_ZERO_TARGET_PAGES=1; the merged tree did not know the switch, so a pool tile given back by one texture went to the next with the old texture's bytes in it (#505, #1833: stale render-target, depth and UAV bytes in new targets). As on amd-dev: the tile pool keeps a bit per tile that came back (TilePool::dirty_bits), set when a tile cools back into the pool and taken when it is handed out; the recycled tiles of a bind are zeroed on the mapping queue through a buffer placed over the whole pool heap (no extra video memory), from a 1 MiB zeroed upload buffer, in a ring of 4 command lists, followed by an aliasing barrier and the mapping fence's signal. They are flushed at 256 tiles and in before_execute before the wait value is read, so every queue that waits for the page mappings (title queues, texture uploads) waits for the zero-fill too. Fitted to main: the list goes through native_queue_execute and the signal through native_queue_signal, as Pages::map's do (the PAGES lock, then the mapping queue's lease); a ring slot still on the GPU is waited for at most 5 s, then that batch is skipped (logged) instead of resetting an allocator in use; a reclaimed heap's zero alias goes with it in PoolHeaps::take_heap (made in own_work, it has no Release hook). Deferred unmap batches are not restored: main defers superseded texture unmaps behind every queue's completion mark itself (held_unmaps, c22c0ac).
Wires vram_small back in, as on amd-dev (6fa964d; XCL_VRAM_SMALL, on by default, 0: off). The main -> amd-dev merge (#3444) kept the module but not its calls in vram.rs, and dropped its tests, so every sampled texture under 64 KiB took a whole 64 KiB page of a reserved resource again: up to 16x the video memory of a mip tail, icon or LUT, plus a CreateReservedResource and UpdateTileMappings for each placement. As on amd-dev: place_pages puts a texture under 64 KiB that does not alias a live 64 KiB page (has_live_page: a sampled view over a render target stays on the target's pages) into a block of a 16 MiB heap; forget_for_recycle gives its block back before the pages are asked; page_bytes counts the small pools for the activity log. vram_small.rs is amd-dev's again, tests included; the GPU test now checks that the 4 KiB textures took no 64 KiB page, as main's page_bytes_for counts pages alone.
…fault Restores amd-dev's memory defaults, which the main -> amd-dev merge (#3444) left at main's: - XCL_TEXTURE_LEVEL_PAGES: on unless 0 (amd-dev 8942a5b; main: only with 1). A sampled texture's levels get pages when an upload first has texels for them: a retail title's 32,000 textures standing for 18 GB held 1.3 GB of pages with it. With it comes amd-dev's guard (6fa964d) that main did not have: a sampled view over a live 64 KiB page (a render target's, has_live_page) maps all of its levels at once, since its texels come from the GPU and no upload would ever map them (should_use_lazy_levels). - XCL_SMALL_TEXTURES: on unless set to something else than 1 (amd-dev 8942a5b; main: only with 1), still off in unit tests unless a test asks for it. - XCL_UPLOAD_KEEP_MB: back, 64 MB of idle texture upload buffers kept by default (amd-dev a68f609; main keeps 512 MB, with no switch). Upload heaps are commit and RAM while kept. README says so, in amd-dev's words.
This PR merges
mainintoamd-dev, so the two branches stop drifting apart, the same way #3203 did fornvidia-dev.amd-devbranched frommainat2c717a04(2026-11-27) and has not takenmainsince. That is about 650 commits, including thenvidia-devmerge (#3203) and the fixes that came after it.Please merge with a merge commit, not squash or rebase. That way git records that
mainis inamd-dev, and the next sync does not hit the same conflicts again.What is in it
4fedcbc8: a merge commit. Its parents areamd-dev10582c42(first parent) andmain24d21a41.5eb7f8fb: a second merge, of the currentamd-devhead36e16cf4(73 commits newer than10582c42), resolved by the same rules (below).git merge-tree --write-tree upstream/amd-dev HEADreturns this head's tree, so the PR merges intoamd-devwithout conflicts.3277acaf: a third merge, ofamd-dev6bab0c53(11 commits newer than36e16cf4: bake indices through the view heap's slots,XCL_FFX_RESET, black skipped Bink movies, BVH-builder binds, reflection fallback,XCL_TRACE_INDEXED,XCL_SKIP_CS, …). Four files conflicted:title_textures.rs:main'sTransitionrecord is kept besideamd-dev'sKept/kept();amd-dev's tupleTransitionandLIST_NOTESare not taken, sincemaintracks list transitions its own way.console_list.rs: both sides' locals are kept, andXCL_SKIP_CSgoes in front ofmain'spso_user_sgprs_exact.real.rs:indexed::note_madegoes in beforemain'sconsole_heap::write+vram::track_srv.main's lazy flag sits beside the BVH-builderimage_only.bind.rs:uncover_indexedtakesamd-dev'sindexed::resources.main'soriginalpipeline foris_kept.main'sskip_untranslated_dispatchis followed byleft_out::direct.indexed.rscallsmain'sread_committed_intowhereamd-devhascopy_readable; both read with zeros for unreadable pages.069c29fe:late_releaseseals a held resource's batch without waiting for a busy queue lease (queue_submit::try_with). Fixes the three-thread deadlock through the D3D12 runtime's lock that raylitebull found on Windows; the path ismain's (byte-identical files), not the merge's.Three fixes on top of the third merge, found in retail runs on Linux (RX 7800 XT, RADV):
859e8ad2ambient: find the stand-in's passes and build its helpers under Wine. The stand-in lighting never applied on this merge. There was nocaptured … sky domeorappliedline, so withXCL_RT_GATE=missevery missed ray brought sky light indoors: overexposure and sparkles. It had three causes:main's split-chain ExecuteIndirect path returned before the ambient hook. The hook now runs there too.CreatePipelineStateand looked up by the bound pipeline or the console record.D3DCompile, which is vkd3d-shader under Wine and refuses them. They now compile DXC first (dxc::compile_sm6_first), as do the depth-twin, present and mirror helpers.scatter's program stays onD3DCompile, because built with DXC it scattered writes to wrong places.XCL_AMBIENT_DIAG=1logs each lighting pass's path and role.2f3d1135zero recycled page-pool tiles before a new texture uses them. This is a merge regression.amd-devzeroed recycled pool tiles (XCL_ZERO_TARGET_PAGES, on by default); takingmain'svram.rsdropped that. New render targets such as the probe light history then started with another image's bytes, which showed as a mosaic of other shots in the lighting.main's page pool, zeroed on the tile-mapping queue before theUpdateTileMappings.XCL_ZERO_TARGET_PAGES=0turns it off.e3fae4edkeep dispatch chain scratch until the GPU is done with it. The title's finalReleaseof an allocator cleared its chain recordings even whenalloc_poolstill held the allocator because it was busy. A later submit then ran chains on freed scratch.mainhas the same code (alloc_release).How the conflicts were resolved:
A plain merge produced about 315 conflict hunks in 46 files. Most of them came from the same
nvidia-devline being integrated twice:amd-devmergednvidia-devd1be8103its own way.mainmergednvidia-devthrough Merge nvidia-dev into main (makes #2572 mergeable) #3203.Rules applied:
nvidia-dev:main's version is kept, because it is newer and has the follow-up fixes. Changes fromamd-dev's own 49 commits are re-applied on top of it.amd-dev's own features are kept and wired:ps_masks,rt_leave_out. These files are byte-identical toamd-dev.8942a5b9).XCL_RT_GATE, with the BVH builder off by default.f2f02bd0,fe5260b6,3bb095a0).1be2221e,512b0bbc).s_barrierin direct DXIL (965cc655).108cbafa,23d0f365).081da4b9).f33df5a7). This lives inmain's ownshaders/pipeline_library.rs, andXCL_PSO_LIBRARY=0/1overrides it.mainalready has them: 21 in total. 17 match by subject. The other four areb958a344(=3cde0cc3),60345c97,61559df6(mainhas2fc61b64) andda910ccd(mainhas its own pipeline library, AMD driver-cache default and sampler keys).Where
main's behaviour was kept overamd-dev's:Please check these if they matter to you:
alloc_pool:release_when_done,release_finishedandtake_excess_asideare dropped, becausemainhas its own probe-based allocator retirement.pending_gpu_marks()is rewritten formain's fence structure.sparse.rs: based onmain. Dropped:XCL_SPARSE_CPU_WAIT_MS, the RX 9070 device-removal fix),wait_pending_mappings,vram.rs: based onmain. Dropped: zero-fill of recycled tiles and deferred unmap batches.vram_small.rsis not wired in; onamd-devit was on by default.bind.rs, two-pass paths:main's record buffers and scale-args code. Dropped:XCL_TWO_PASS_SHARED, the 4-UAV scale-args root signature, and theUNKNOWN_RESfence tracking.console_heap.rs,title_textures.rs,dispatch_chain.rs, the present compositor, DXIL live lanes:main's versions.real.rs:main'sslot()lookups.82d5eea8(preparation progress per variant): not ported, because it conflicted everywhere withmain's reworked preparation UI.main's.XCL_TEXTURE_LEVEL_PAGESandXCL_SMALL_TEXTURESstay opt-in, and the upload buffers stay at 512 MB.Second merge (
36e16cf4), what needed more than a mechanical resolution:mainin some form;main's version is kept (duplicate tests dropped).main's code: the direct wave32 graphics reductions (8c79f57), quad-only PS reads besidemain's EXEC fallback (45ed56c), the page comparison after remap and GPU-written new textures inmain's texture selection (02ceae6, 0b985d7), the sparse range keeping (707123a, static renamedRANGES_KEPT), the look stats (2a630fd), urgent PSO workers onmain'sBuildqueue (4dea333), the RAM floor aftermain's compile gates (927524e), the--measure-*options (5ab4f64), the newer-forms selection (e35c384;main's EXEC-select fold stays on for every program).XCL_ASYNC_SUBMITsubmit thread (27f5f62, db556c2, b54c6d9, 9f9a9bc, 077047a; built onamd-dev's ExecuteCommandLists hook and alloc_pool, which the first merge replaced), the unlocked sparse CPU read (09536b8, eabf2de; needsamd-dev's sparse landing), the shared deferred two-pass batch buffer (c7388f3, 34e95e7, 0bad17b; needs the droppedXCL_TWO_PASS_SHAREDtracking), 5c5ee83 (mainalready keepsXCL_DXIL_NO_OPTruns out of the cache). From 36e16cf the newer-forms defaults andXCL_DIRECT_COMPACT_MINare taken, its huge-compile defaults (64 KiB, 2 at a time) are not: they would turn offmain's AMD medium-compute gate.Tests changed:
Removed, because they test code that was dropped above:
title_textures::a_sampled_shadowed_texture_is_active_againalloc_pool::excess_idle_aside_allocators_are_reclaimed_while_title_and_busy_ones_stayvram_smalltest moduleChanged:
early_depth: falseadded to the olderPsInterfaceliterals.main's robustness tests that expected multi-wave barriers to fall back to HLSL now expectamd-dev's direct safe barrier.Tested
cargo build --release -p xclandcargo build --release -p xcl --testssucceed on all three merge commits. These are cross builds tox86_64-pc-windows-gnuon Linux.On
3277acaf, the unit tests of the modules the third merge touched were run under Wine 11.21, withXCL_DXC_DIRpointing at DXC 1.9.2609:indexed(4),bvh_spare(4),ffx(3),title_textures(70 passed, 1 ignored),console_list(12),left_out(9).d3d12x::bindtests fail:gpu_two_pass_indirect_commands_keep_their_own_recordsandprepared_initial_pipeline_commits_only_after_create_or_reset_success. They fail the same way on the previous head069c29fe, because the Wine test prefix has no real D3D12 device; the merge did not cause them.Retail title on Linux: Wine 11.21 staging, vkd3d-proton 3.1 with a newer dxil-spirv, RX 7800 XT (RDNA3), RADV. Several runs with this tree plus a few local patches (mimalloc, a pixel-shader loop cap, user: hide title console window when DWM cloaking is unavailable (#175) #794, Recompiler: split wave64 spin loops poll with a compare-exchange, not an add of 0 (#847) #1244, xcl run: XCL_SHORT_MOVIES=1 ends a title's Bink videos after their first frame #681), using
XCL_RT_GATE=miss XCL_AMBIENT=skyand the default coherent window:0xc0000005read at0x400016000(xg::copy_frominto a GPU heap routed to the sparse windows) does not occur. It happened onamd-devwithoutmain's fixes in every run we made, including with D3D12.X: XMemVirtualAlloc GPU heaps go to the coherent window again #3369.game+0x23cf683writes to0x0, as in The retail title 1.0.2.1 (RTX 5070): reaches the end of the first-run setup, then deterministic 0xC0000005 write at 0x0 in game_scarlett_master.exe+0x23cf683 #846. The title waits on a bottom-of-pipe word while XCL has no pending fence, queue wait orWait64cell.On
e3fae4edthe release build and--testsbuild succeed, and the first new commit builds on its own. Unit tests under Wine:ambient18,alloc_pool28 (including the newa_final_release_retains_a_busy_allocator_and_not_a_free_one),depth_uav21.vram: 72 passed, 1 failed.d32s8_targets_take_their_own_size_of_video_memoryfails the same way on3277acaf.dispatch_chain: 25 passed, 2 failed, both in the test helperslot_of("adopted class"). One of them,failed_binding_keeps_indirect_commands_until_allocator_reset, fails the same way without the fix. The other is the new GPU testa_released_allocator_keeps_its_chains_until_the_gpu_is_done, which needs the same test setup fixed, so it proves nothing yet.In the title:
Regression run
No
xcl-smokeblocks yet:scripts/smoke.ps1has not been run on this head or onmain. These runs were on Linux/Wine outside the script (see Tested). Like #3203, the file list also trips the binary-file check: the GitHub files API returns no patch for these large merged files, so they are reported as binary.Not tested
amd-dev-specific stability fixes that were dropped in favour ofmain(above), on the GPUs they were made for.AI use
Claude Code (Claude Opus 5.5) did the conflict resolution, with sub-agents doing the commit-by-commit resolution, and wrote this description, at my request and under my review.
🤖 Generated with Claude Code