Fourteen commits the #984 merge gained after 8a242efeb: its own failing tests (xmem_test under Wine, check_tls_index0, vk_bindless_grow, xs_present_lazy_test), the console-heap probe and the poke experiment behind their switches, Python tool fixes, and the title watchdog default. No conflicts.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
No test covered the chain the merge builds for slot 57: #939's NativeGraphicsFactory first, the base's PC description path (CreateGraphicsPipelineState with the bare programs) when the factory answers E_NOTIMPL. The new case checks, on the mock device: no factory reaches the PC path; a factory answering E_NOTIMPL is asked once and the PC path then runs; a factory that succeeds is the answer and the PC path is not asked; E_INVALIDARG, E_OUTOFMEMORY and E_FAIL are returned as they are; an unreadable description is refused before the factory; removing the factory restores the PC path.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The merge keeps one first-use mechanism, the base's lazy pipelines; #939's DeviceInfo::first_use_backend_pipelines is gone from d3d12_com.h and vk_test_device.h, and these two tests still copied it. prepare_on_bind and cold_graphics_compile stay.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The merged PlacedAtVaHandler keeps #939's seventh argument (the title's clear value, which the Vulkan device's create_placed_xbox_resource uses); the base's two test lambdas had six.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The base is 8a242efeb, the merge of main and #984. 68 files conflicted; they were resolved in seven groups by
one rule: the same change in two forms keeps the base's form, everything only #939 has is kept, and where the
two solve one problem in two ways the base's is the frame and #939's plugs into it.
A, the Xbox proxy (d3d12_xs_device.cpp/.h, d3d12_xs.cpp, d3d12_xs_pso_stream.cpp/.h, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, device_proxy_test.cpp, queue_proxy_test.cpp): the base's files with #939's additions
ported in. Device slot 57 asks #939's NativeGraphicsFactory first and falls back to the base's
proxy_create_graphics_pipeline_from_native_code on E_NOTIMPL. Kept from #939: the providers (texture lease,
raw texture view, resource by address, constant view, descriptor mapping, depth-stencil UAV, texture pages),
the title-backed descriptor mirror, slot 13's feature answers, GPU labels on list slots 71/72. Dropped: #939's
duplicates of the boot ladder routes, its fallback window, its slot 133 stand-in.
A2 (xs_proxy_mock_test.cpp): the base's test with #939's slot 70 raw-buffer case; presentation cases follow
#939's rule that a device which ever had a handler has no queue fallback.
B1, the Vulkan device (d3d12_vulkan_device.cpp, d3d12_com.cpp/.h, shader_library.h, queue_families.h,
pipeline_cache_file.h, startup_trace.h): one lazy-pipeline mechanism, the base's; #939's pending_base_compile
and first_use_backend_pipelines dropped, prepare_on_bind and cold_graphics_compile kept. create_texture keeps
the base's signature; #939's deferred backing is folded into the base's placed-memory binder. #939's quad
lists as triangle indices.
B2, the D3D12 tests (d3d12_existing_heap, a8_dimensions, pipeline_cache_seed, title_va, rect_list,
shader_library, loader_tls_index0, draw, compute, xmem_placed, shader_library_corpus): the base's tests where
both carry the same case, #939's cases added (rebound tables, linear texture map, large vertex batch,
executable shaders, default A8 views).
C, the backend (vulkan_replay.h, vulkan_backend.h, vulkan_bindless.h, vulkan_scratch.h, vulkan_present.h,
rect_list_geometry.h, vk_test_device.h, vk_pipeline_check.cpp, vk_store_test.cpp, bindless_sizing_test.cpp,
replay_texture_barrier_test.cpp): the base's prepare_draw and lazy compute, its #1055 release rule and its
rectangle generator; #939's rectangle variants, GPU quad index expansion, 1D/3D and depth-stencil UAVs, the
label fence on the base's submit.
D, memory, services, presentation (xmem.cpp/.h, xg_xs.cpp, xg_xs_test.cpp, title_va_alias.h and its test,
main.cpp, frame_pacer.h, xbox_present.cpp/.h; xgameruntime_offline.cpp for one comment): the base's xmem with
#939's label hooks, file-backed sections and pin_mapped_data; both texture computers in xg_xs.cpp, the base's
answering first; --first-run-ui kept without host speech in its profile.
E, build, tools, docs (runtime/CMakeLists.txt, make_game.py, tools/rdna2spirv.py, tools/shader_disasm.py,
scripts, tests, docs; docs/README.md and tests/test_exe_shaders_stage.py beyond the conflicts): the base's
v_dot4 decode, #281's disassembler form and tests/semantic/test_fspx_dot4_op_sel_disasm.py dropped; the
base's executable-shader step with #939's cache fix; 366 registered tests.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The second half of run_tiny_tls_ga (new in #984) points TMP and TEMP at a missing folder so that the home clone cannot be written and the loader must refuse the image. Under an emulator the override never reaches the loader: Wine gives the process the temporary folder of its prefix whatever the caller's environment says, so the reservation succeeds, --run returns 0 and the script failed with '--run without the reservation returned 0' (on #984's head too).
When the script runs the loader through an emulator it first asks --dry-run, which maps the image and names index 0 in a note when the reservation fails, without running any of its code. If that note is missing the override is not in effect: the script prints 'SKIP the failed-reservation half: TMP and TEMP set for <runner> do not reach the loader's GetTempPathW' and stops there, after the first half (the image gets index 0 and reads its TLS from slot 0) has passed. A native run is unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Three checks of the physical-page views fail under Wine, two of them on main as well (xmem is a known Wine failure there) and one that #984 adds; with #984 registering the test twice more (xmem_write_watch, xmem_no_write_watch) that made three red tests. Measured under Wine 11: a page of a reserved section view that has been written and reads back is still reported by VirtualQuery as MEM_RESERVE with protection 0 (type MEM_MAPPED, allocation protection PAGE_READWRITE), where Windows reports MEM_COMMIT and PAGE_READWRITE.
- 'unmapping one of them afterwards keeps the others' memory' (#984) asked whether the neighbours were still mapped through reserved_only(), which is the reported state. It asks for the view itself now (in_view: the region's type is MEM_MAPPED), which is what the check is about, and also that the unmapped page is no longer in one. Same on both hosts.
- The two checks of the reported state and protection of a written view page print SKIP with the reason when the host is Wine and gives exactly that answer; the first then still checks that the page is a read-write view holding what was written. On Windows both run as before.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Applies the fix oscarlosu-lab proposed on #968:
https://github.com/ubiquitarianism/leonida/pull/968#issuecomment-7142206199
What was wrong: queue slot 31 (CopyPageMappingsBatchX) targets the title's
GPU-only reservation, but the D3D12 layer reads that memory at its paired CPU
view (title_gpu_views::to_cpu). copy_page_mappings mapped the pages only at the
GPU-only address, so the paired CPU view stayed reserved and the layer's reads of
that memory (the slot-70 views waiting for readable memory) never became
possible.
The change, in copy_page_mappings:
- when the destination is in a paired GPU-only range and its CPU range is a
physical-page window, every page mapped or unmapped at the destination is
mapped or unmapped at the CPU address as well, with that window's protection;
- a source page not mapped at a GPU-only address is looked up at its CPU
address.
Cost: a second view per copied page, so such a page is mapped at three
addresses (pool, GPU-only, CPU) and counts as aliased: the shadow tracker copies
it at every submission. Risk: the pairing is a heuristic (the CPU reservation of
the same size made just before the GPU-only one); if it is ever wrong, the
mirror replaces the title's own mappings in that CPU range.
The comment reports 9 alias checks but does not give them, so the test is new:
xmem_test's test_copy_page_mappings_cpu_view reserves a CPU + GPU-only pair and
checks that after a batch copy onto the GPU-only range the CPU range is
committed and shows the same bytes (and a write there is one memory with the
pool), that a GPU-only source mapped only at its CPU range is found there, and
that a null source unmaps both ranges.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merges the local m984-on-main (1d89b20c5f), main with #984
merged, into #968's head f2268abea.
Conflicts and their resolutions:
- runtime/shims/xmem.h: both sides appended to the end of rt::xmem. Kept
geometry_aliases and transfer_physical from #984 and appended #968's
CopyPageMappingsFn typedef and the inline copy_page_mappings_fn after them.
- runtime/shims/xmem.cpp: copy_page_mappings and the self-registering
g_copy_page_mappings_set stay right after XMemMapPhysicalPagesScatter,
followed by #984's shadows_write_watch. One-line port: #984's g_mapped stores
the page number itself (HostUnorderedMap<uintptr_t, uint64_t>), so
`it->second.page` becomes `it->second`.
- runtime/shims/d3d12_xs_device.cpp:
- includes: #968's "xmem.h" beside "d3d12_trace.h", then #984's includes;
- constants: #984's block kept, kQueueCopyPageMappingsBatchX = 31 added after
kQueueExecuteCommandListsX and its static_assert;
- the slot-31 section (ConsolePageRange/Batch, copy_console_page_range,
queue_copy_page_mappings) goes after #984's queue_execute_command_lists and
before the "PresentX is at queue slot 30" comment;
- child_slot: #984's queue block kept; the slot-31 dispatch (beyond the PC
table and with xmem's hook set) goes just before the qroutes lookup, ahead
of the presentation routes and the console-only S_OK tail. Newer-layout
PresentX is 32, so 31 does not clash.
- runtime/test/xs_proxy_mock_test.cpp:
- includes: "../shims/xmem.h" beside #984's d3d12_xs_frame_events.h;
- #984's descriptor-heap and later checks kept, check_queue_copy_page_mappings
after them. Without xmem the merged proxy answers slot 31 with the
console-only S_OK, so that check's `== E_NOTIMPL` becomes `== S_OK` (and its
summary line says so);
- main: `|| check_queue_copy_page_mappings()` appended after
check_presentation_wiring().
runtime/test/xmem_test.cpp merged without conflict: test_copy_page_mappings runs
after test_physical_pages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From rung-414-on-main (24a19ae8f), where it found the reference cycle fixed two commits ago, adapted to this tree: PresentX is called at queue slot 30 (a queue is in the older layout until a fence reaches slot 16 or 17), and the runtime's window is destroyed by the thread that owns it, so the last check waits for it to go (up to two seconds) instead of looking once.
It compiles the proxy with LEONIDA_VULKAN_DEVICE, as gta6rt does, and checks: the frame events before the first present are the device's own; nothing is built before the first PresentX and one window after it; WaitFrameEventX stays the device's and counts from the same token source the presenter checks (an unissued token is E_INVALIDARG, an issued one is accepted); a second PresentX builds no second window; and the window goes with the device proxy.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
#984's new test refuses device-local allocations to force the table into host memory, and says itself that the host fallback is not checked on a device with no host memory type outside device-local memory. But it injected the fault there too: llvmpipe has one memory type for everything, so every allocation was refused, the table could not grow and the check right after the frame failed (on #984's head, on Linux and under Wine; the test is in the portable subset, so a Linux CI run with lavapipe would be red). The fault is only injected where a separate host type exists; elsewhere the table grows normally in that step, and the all-memory-refused cases further down still run.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
On a host without CLWB every execution of the instruction raised #UD and the vectored handler emulated it. The
retail title's GPU upload worker flushes whole buffers with CLWB in a 64-byte loop (exe+0x532f1b0 on 1.0.2.1), so a
buffer cost one exception per cache line; under Wine that kept the worker busy for minutes and the main thread
polling its event in session 0xd, so the boot never left the first-run pages.
The handler now rewrites the instruction at its first #UD: 66 0F AE /6 becomes 66 0F AE /7 (CLFLUSHOPT), the same
operand and length, which also writes the line back; a host without CLFLUSHOPT gets 66 0F 1F /0, a NOP of the same
length. LEONIDA_CLWB_PATCH=0 keeps the old per-execution emulation.
Tested: cpu_emulation_test under Wine 11.21 on an i9-9900KF (no CLWB, has CLFLUSHOPT): both sites rewritten, SIB and
displacement kept, the code runs again. Retail boot on the same machine with #984 + #968 (RTX 2070 SUPER, Fedora 44):
the worker that sat in the CLWB loop at 420, 540 and 660 s now moves on, and the title gets past the first-run pages
into the story load.
AI-assisted: yes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RBZntAmGCDe3LdLjbzZzuc
Brings the branch up to main at b4b7756e8: #396 (console list slot 139 is Reset) and #403 (queue slot 18 is the frequency getter for a guest caller). The first merge already resolved the proxy to these two forms, so nothing changes in the code:
- runtime/shims/d3d12_xs_device.cpp: one conflict, main's copy of the base list proxy, which #396 edited and the first merge had dropped for #984's list proxy (the Reset rule of #396 is in #984's list_slot). Ours.
- runtime/shims/d3d12_xs_device.h: merged clean, unchanged.
- runtime/test/xs_proxy_mock_test.cpp: git added main's console_to_pc_list_slot(139) check next to the copy the first merge had put two lines lower; one stays, in main's place.
Every line the two pull requests added to these three files is in the result.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The merged queue proxy recognises PresentX at slot 30 on a queue in the older layout and at slot 32 on a queue detected as the newer one (a fence at slot 16 or 17, or SignalX at 25), which is #984's measured behaviour, with main's LEONIDA_XS_PRESENT_X_SLOT pinning one slot and an attached handler answering first. Only one of the two is PresentX at a time: in the newer layout slot 30 is another method.
docs/d3d12_vulkan.md still had main's row (the queue slots stay refused, gta6rt creates no presentation) and runtime/README.md still said PresentX has an unknown slot. Both describe the merged code now. check_presentation_wiring gains the newer-layout case: before the fence 30 reaches the presenter and 32 does not, after it 32 does and 30 does not.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The case that loads fspx/, fspx_gfx/ and bvh/ indexes calls itself synthetic and runs against index files it writes itself, but two of its keys were the SHA-256 digests of two programs of the game's pipeline library (the ones docs/fspx.md cites as programs 842 and 843), with those numbers in the file names. A hash is not content, but a synthetic test has no reason to carry real ones, and nothing in the case depends on the values. They are 3333... and 4444... now, next to the 1111... and 2222... the case already used, with file names _00001 and _00002.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
d3d12_a8_dimensions_test makes its device without the A8 render-target
path, so it covers 1D and 3D A8_UNORM textures only in the fallback.
d3d12_a8_copy_test now also checks them on a device that has the path:
a 128x1 1D and an 8x8x4 3D A8_UNORM texture are created as R8_UNORM
images (no VK_FORMAT_A8_UNORM_KHR image is made for them), so they are
never one side of a mixed-backing copy, and a 1D A8_UNORM render target is
refused rather than made in either backing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From rung-428-on-main (554f0e4ec). The bug that commit fixed, VK_KHR_maintenance5 enabled inside maintenance8's #ifdef, is not in #984's copy of the A8 support: the enable already sits under its own guard here, so only the comment on it comes over. What the commit adds besides still applies:
tests/test_vulkan_extension_guards.py reads the runtime sources and fails on any device extension enabled inside another extension's #ifdef. d3d12_a8_copy_test also forces the fallback (a8_render_target false) on any device: A8_UNORM render targets are refused at creation, in GetResourceAllocationInfo and in the format support, no A8 image is created, and plain A8_UNORM textures still copy.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An A8_UNORM render target is a VK_FORMAT_A8_UNORM_KHR image and any other
A8_UNORM texture an R8_UNORM image. CopyResource and CopyTextureRegion
between the two issued vkCmdCopyImage on that pair, which Vulkan does not
count as size-compatible: VUID-vkCmdCopyImage-srcImage-01548, although the
bytes came out right on the drivers tried. moffington reported it in the
review of #428 and Dezmonius confirmed it on native Windows with the
validation layer.
Such a copy now takes the replay's existing image -> transfer scratch ->
image route, the one depth <-> colour copies use, with one byte per texel
on both sides. Same-backing copies still copy image to image. This is the
approach of Dezmonius's proof of concept, which they described on the pull
request but did not publish; written here from that description.
d3d12_a8_copy_test copies A8 render target -> A8 texture and back, whole
(CopyResource) and a 3x3 box from a nonzero source offset to a nonzero
destination offset (CopyTextureRegion), and checks every texel read back:
the source bytes inside the box, the destination's own outside it. It wraps
vkCreateImage and vkCmdCopyImage behind the instance-proc pointer it hands
the layer and fails on any vkCmdCopyImage between VK_FORMAT_A8_UNORM_KHR and
another format, so it fails without this change even where the validation
layer is not installed; with LEONIDA_VK_VALIDATION=1 the layer's errors fail
it too. A8 -> A8 and R8 -> R8 copies are the controls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#984's new slot 25 case first checks that the PC device refuses a depth-stencil texture with unordered access. Microsoft's runtime (WARP) does; Wine's vkd3d sizes the texture without validating the flag pair, so under Wine device_proxy and device_proxy_trace failed at that line (on #984's head as well as on the merge; both pass on main, which has no such case). The control now runs only where the host is Microsoft's, the way the other host comparisons do it (host_wine.h). The checks of the proxy itself are unchanged and run everywhere.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
RDNA2 ignores the VOP3 output modifier of the f64 VALU arithmetic and rounding
ops while f64 denormals are kept, which is the MODE this translator models. I
measured it with tools/hw_oracle raw kernels on a gfx1036 iGPU (the Radeon
iGPU of a Ryzen 7 7800X3D, Windows driver 31.0.24002.92, code object v5),
wave32 and wave64 identical, over the four combinations of MODE.IEEE and
denorm_mode_16_64. mul:2 / mul:4 / div:2 changed nothing for v_add_f64,
v_rcp_f64, v_rsq_f64, v_sqrt_f64, v_trunc_f64, v_ceil_f64, v_floor_f64 and
v_rndne_f64 while f64 denormals were kept, applied only with MODE.IEEE off and
the denormals flushed, and clamp applied in every one of those runs. The two
f64 call sites that still forwarded a full modifier list now hand
clamp_mods_f64 only the clamp they act on, and the rows that described the
scaling for those ops are corrected to what the hardware does.
This is SHADER-721, the binary64 counterpart of the f16 omod row (#4542,
"an f16 destination ignores omod"). The row for v_add_f64 records the sweep and
how it was confirmed and keeps the LLVM VOP3 citation main already had; the
rcp/rsq/sqrt and rounding rows keep the measurements others contributed (the
v_sqrt_f64 ulp errors, @timelery's sweep of the four rounding ops) and only
change the sentence about the omod. One contradiction is removed on the way:
main's rounding row said the translator applies the modifiers "as those rows
do" while the code applied them to ops whose own row says they are ignored.
Ops with their own rows are left exactly as they are - v_cvt_f64_i32/u32,
v_cvt_f32_f64, v_frexp_mant_f64, v_div_fixup_f64 and v_ldexp_f64 keep what
their rows measure. The same rule probably reaches the first three as well, and
tests/semantic/test_alu_ldexp_f64.py already knows it for ldexp; I raised that
in #5256 as a finding instead of folding unmeasured ops into this change.
Counted over the whole corpus, not a sample: 216 v_add_f64 in 5 of the 26,503
listings, none carrying an omod or a clamp, and no f64 mnemonic in the corpus
carries one, so no game shader changes behaviour here. The two translated
fixtures that do carry a modifier move to the unmodified result, which is what
the sweep predicts: cs_f64_add now reads 0x0 0x3ff40000.
Expectations follow the rule in tests/semantic/test_valu_add_f64.py,
tests/semantic/test_f64_round.py, tests/test_f64_output_modifiers.py,
tests/test_f64_transcendentals.py and the two fixtures with their runners.
tools/f64_diff.py keeps its f64-omod case as a known divergence and
tests/test_f64_diff.py now expects it to mismatch the ISA reference rather than
match it: the reference applies the omod the ISA text describes, the translator
no longer emits it, and that case is the one MODE in which the hardware does
apply it. ps_f64_mods, cs_f64_add and ps_f64_round pass on an NVIDIA RTX 4090
(driver 32.0.16.2124) and on the gfx1036 iGPU above, 3/3 on both; cs_f64_add
reads the same words on Intel UHD 630 / Mesa ANV at this head (@gertify).
The merge kept main's form of device slot 81 (GetFrameStatisticsX: an attached presentation answers first) and with it main's answer when nothing is attached, S_FALSE with a zero count. No retail run has been through that answer: it is a reading of the public samples. #984, the tree that was measured to boot through the story load, answers the same call with S_OK and a zero count, and E_POINTER for a null count or for a count above zero with no array (its GetFrameEventsX handler). Nothing attaches a presentation in gta6rt, so this is the answer the title gets.
main's structure stays (the configurable route, the logged name, the handler first); only the answer without a handler is #984's. Both forms write the count through the third argument, so the two do not disagree about the layout. The mock tests (env-slots-invalid, check_presentation_wiring), the header comment and the row in docs/d3d12_vulkan.md say the same.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
main's failed-resize case (a3090aab2) builds a VulkanSwapchain with eight arguments; #984 gave the constructor a ninth, DeviceFaultDiagnostics*, with no default. Pass nullptr, as #984's own case in this file does.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merges main at 1154976d4 into the integration branch at 273b3bdf9 (merge base ece4ba5b3). 42 files conflicted;
this commit is the resolution only. Build and test repairs follow in their own commits.
Rule of resolution: where both sides added different things, both stay; where both made the same change in two
forms, main's reviewed form stays and whatever #984's form did in addition is carried into it; where the two
changed the same code for different purposes, both purposes are kept.
Xbox proxy code (runtime/shims/d3d12_xs_device.cpp, d3d12_xs_device.h, d3d12_xs.cpp, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, registry.cpp):
- d3d12_xs_device.cpp is #984's file with main's differing pieces ported in: env_slot and the configurable device
routes, XboxQueueSlotRoutes, PresentationHandler / set_presentation_handler, the console caller rule for device
slots 61 and 74 (#383, #385), route_xbox_device_slot, slot 81 as GetFrameStatisticsX, create_host_device, the
console-form rule for slots 25 and 56, the console list IID of #359, and the forms of queue slot 18 (#403) and
list slot 139 (#396).
- Kept from #984: the list proxy with handle translation, queue slots 16/17 as Signal/Wait, the fence's
completed-value mirror, the shared FrameTokenSource, PresentX through queue_present_x when no handler is
attached (slot 30, or 32 on a queue detected as the newer layout), slots 27/53/55/57/70/71/133, the wider
pc_resource_desc, S_OK for queue slots past the PC table.
- Dropped: #984's GetFrameEventsX and LEONIDA_XS_FRAME_EVENTS_SLOT, its second-word rule for slot 61, its
undetected-layout rule for queue slot 18, its list IID mapping to GraphicsCommandList6; main's copy of the base
list proxy, its null-view slot 70 and its refusing slot 133.
Proxy tests (runtime/test/xs_proxy_mock_test.cpp, device_proxy_test.cpp, queue_proxy_test.cpp):
- Checks of both sides, each run once; main's forms of the render-target size and layout checks with #984's extra
cases added; main's --env-slots-74 and #984's --env-slots-70.
- Adapted to the merged code: the queue tail answers S_OK, slot 73 answers an unknown IID with the list proxy,
the queue slot 18 case installs a console caller. Dropped: #984's slot 81 GetFrameEventsX cases.
D3D12/Vulkan layer (runtime/shims/d3d12_com.cpp, d3d12_vulkan_device.cpp, runtime/src/command_list.h,
frame_pacer.h, shader_library.h, vulkan_backend.h, vulkan_replay.h, runtime/test/command_list_test.cpp,
d3d12_close_parity_test.cpp, d3d12_execute_indirect_validation_test.cpp, replay_texture_barrier_test.cpp,
vk_pipeline_check.cpp, vk_test_device.h):
- Resource::create_texture: #984's title images (deferred placed, pending streamed, title pool) and main's
ordinary textures (#1413 shared blocks, #1364 staging fallback) are exclusive branches chosen by the texture's
origin, so both pools run on disjoint sets of textures.
- frame_pacer.h is main's pacer (#402) with #984's FrameTokenSource as the token counter.
- main's forms kept for ExecuteIndirect (#1066, #377), the barrier into LAYOUT_UNDEFINED (#1055), the B4G4R4A4
stand-in, per-face stencil masks, the unaligned tile staging (#528) and the device-lost flag (#980).
- shader_library.h: main's block inflate; #984's `bulk` parameter now defaults to true so main's callers keep it.
- Dropped: #984's B8G8R8A8 stand-in for B4G4R4A4 targets, its refusal of separate stencil masks, its zero-count
refusal in ExecuteIndirect, its wider UNDEFINED -> UNDEFINED release and the test case for it.
Other shims (runtime/shims/dstorage.cpp, file_system.cpp, gameinput.cpp, xgameruntime_offline.cpp,
runtime/test/xgameruntime_offline_test.cpp, xmem_test.cpp):
- ReadFile and DirectStorage reads: #984's pinned kernel_writes read, then main's touch_pages retry on
ERROR_NOACCESS. main's rt::fs::read_file is folded into #984's read_file.
- gameinput: main's strict LEONIDA_INPUT_SCRIPT parser with #984's rsup/rsdown entries.
- Speech synthesis: main's one silent voice and handle checks; #984's accept-anything form dropped.
Build, tools, docs (runtime/CMakeLists.txt, runtime/cmake/translator_deps.cmake, scripts/build_runtime.ps1,
make_game.py, tools/rdna2spirv.py, shader_disasm.py, shader_ir.py, shader_library.py,
runtime/test/shaders/cs_imgload_tfe.asm, cs_imgload_d16_tfe.asm, docs/README.md, boot.md, d3d12_vulkan.md,
runtime/README.md):
- Unions of the test, target and source lists; spirv_loop_guard.py added to translator_deps.cmake.
- rdna2spirv.py: main's DPP compare rule (#957), SMEM vcc base (#647) and widen_wave64_masks (#1021); #984's
restore_skipped_instructions and restore_dot4_inline_sel. #984's duplicate widen_wave64_valu_masks dropped.
- shader_disasm.py and shader_ir.py: main's structure with #984's one-line-per-dword llvm-mc input and wave flags.
- shader_library.py: main's structure with #984's --compute-hashes and per-state compute variants.
One file that did not conflict is changed here: tools/rdna2_decode.py. Git kept both sides' decoders for a VOPC
compare with a DPP operand, and #984's narrower one shadowed main's; it is main's file again.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merging.
**Why merged:** TEST-PIPELINE-LIBRARY-HOST-ADAPTER, test-only: prints which host D3D12 adapter was actually used, so host-comparison results can be tied to a GPU. This was the first independent Windows build; KernelSmoker's review was static.
**Why it's good:** d3d12_pipeline_library and _host pass both plain and under validation, and print "host D3D12 adapter: NVIDIA GeForce RTX 4070 SUPER".
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** D3D-COPY-TIMESTAMP-CAPS: timestamp bits are tracked per queue family, and transfer-only families count as 0 bits because they can't reset or resolve queries. This was the first native Windows run of the fixed head; madhyn's Wine run was on an older head, and KernelSmoker ran vk_queue on Linux. Behaviour change: OPTIONS3.CopyQueueTimestampQueriesSupported can now be TRUE, and a copy queue that gets a transfer-only family returns E_FAIL from GetTimestampFrequency and GetClockCalibration instead of borrowing the graphics family's bits.
**Why it's good:** d3d12_vulkan_device, d3d12_query_rules, vk_queue, vk_queue_query_sync and vk_queue_constructor_oom: 5/5 both plain and under validation on the 4070 SUPER.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** RT-INFLATE-MATCH-COPY: the inflater copies repeated matches in blocks (doubling memcpy that only reads finished output; distance at least 1 and bounds-checked) and reduces Adler-32 every 5552 bytes (the standard NMAX). sodove measured it 8-14x faster, and whoalin1's host tests pass.
**Why it's good:** shader_library, startup_trace, dstorage and d3d12_pipeline_library* pass both plain and under validation; shader_library_corpus is skipped, the same as on main.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** RT-STREAM-TRANSFER-BARRIER: a transfer-write → transfer-read/write barrier goes before every vkCmdCopyBuffer, so back-to-back streamed copies are ordered. moffington measured SyncVal at 10 errors on the base and 0 on the head. Plaaasma (4070 Ti), iFeyz (RX 9070 XT) and whoalin1 (gfx1035) passed it. LEONIDA_ORDER_BUFFER_COPIES=0 turns it off (documented in docs/d3d12_vulkan.md).
**Why it's good:** replay_*, vk_bc_zero_init, vk_queue* and d3d12_close_parity: 16/16 both plain and under validation. A negative control on the cumulative build checked that the test really catches a missing barrier: with the barrier on, `--expect-unordered` fails; with the env var at 0, the ordered check fails and `--expect-unordered` passes. It also passes on top of #1055's vulkan_replay.h change. It adds one barrier per buffer copy, a small sync-policy cost with an opt-out.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** VK-ZERO-INIT-FILL-ALIGN: zero_compressed_image aligns the fill to max(4, fmt.bytes) and rounds the usable size down, so vkCmdFillBuffer's offset and size are 4-aligned. That also makes the copy offset 4-aligned on transfer queues, which closes the VUID-07737 gap noted on #434. kawaii-shakal (ASan mock) and Sangonapou (RTX 3080 Ti) checked it.
**Why it's good:** vk_bc_zero_init, vk_queue and the replay_* tests: 12/12 both plain and under validation.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** RT-DEVICE-LOST-LOG: when the device is lost, the layer prints one stderr line per device. An atomic exchange keeps the context path and the dispatcher path from both printing. KernelSmoker approved it (llvmpipe and RTX 3090).
**Why it's good:** vk_fence_dispatcher_sync, vk_queue and vk_queue_query_sync pass both plain and under validation.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Merged on top of the merge made for #396 (main 507029d1e plus RT-QUEUE35,
RT-ALLOC9 and RT-LIST139). No conflicts.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merged on top of the merge made for #395 (main 507029d1e plus RT-QUEUE35
and RT-ALLOC9). No conflicts.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merged on top of the merge made for #391 (main 507029d1e plus RT-QUEUE35).
One conflict, in docs/d3d12_vulkan.md: both sides added a row at the same
place of the Xbox-only table. Both are kept: this branch's
"Command-allocator slot 9" row, then main's "Device slot 81, queue
PresentX/SuspendX/ResumeX" row. The code and the tests merged without
conflicts.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two files conflicted; in each, both sides had added something at the same
place and both are kept.
runtime/shims/d3d12_xs_device.cpp: this branch's
queue_execute_command_lists() next to main's XboxQueueSlotRoutes and
xbox_queue_slot_routes() (the PresentX, SuspendX and ResumeX routes).
runtime/test/xs_proxy_mock_test.cpp: main() runs check_xbox_queue_slots()
and then check_presentation_wiring().
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Conflict in docs/design.md: this branch rewords the "Wave64 graphics: partition invariance
(SHADER-10)" row; main left that row as it was and added the SHADER-W64-WQM-UVOTE row after it.
Kept this branch's SHADER-10 row and main's new row below it. runtime/test/shaders/w64_graphics.py
merged without conflicts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in docs/boot.md, the --overlay switch: main now says the overlay defaults to
<game-dir>\overlay and the package is never written; this branch adds the per-process T: folder
inside the overlay. Kept main's sentence and appended the T: text after it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every committed and placed texture made its own vkAllocateMemory and
released it with its own vkFreeMemory, about 100 us and 200 us on an
RTX 3080. Small device-local textures now take ranges of 64 MiB blocks
(runtime/src/image_memory.h). Render targets, depth buffers, CPU-visible
textures and textures over an eighth of a block keep their own
allocation. A range goes back to its block through the deferred
deletion queue, and a texture in a reused range is zeroed before a
shader reads it.
Tests: image_memory (CPU) and d3d12_texture_memory (GPU).
Three files conflicted; in each, both sides had added something and both
are kept.
runtime/shims/d3d12_xs_device.cpp: this branch still had the Xbox device
slot routes inline, followed by its fixed handlers for slots 86, 101 and
108; main has since moved the same six routes into
route_xbox_device_slot() (#385). The generic path now calls the helper and
then the three fixed handlers, so a configured route still wins over
them, as this branch's second commit intends. device_slot_overridden()
has main's list plus 86, 101 and 108.
runtime/shims/d3d12_xs_device.h: the comment lists both sides' slots.
runtime/test/xs_proxy_mock_test.cpp: the mock device keeps main's case 13
(CheckFeatureSupport) and this branch's case 68
(GetResourceAllocationInfo2); check_xbox_slots keeps main's slot 41 and 61
cases, one combined list of handled slots, and this branch's slot 86, 101
and 108 cases.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merging.
**Why merged:** GPU-PIN-EXIT-STATUS: in check.py and run_gpu_tests, a helper that exits non-zero is always a failure, never a subgroup-pin SKIP, so a crashing helper can't hide as a skip. KernelSmoker approved it after an RTX 3090 GPU run, and the author compared it against #125.
**Why it's good:** run_gpu_tests, shader_checks and run_gpu_tests_paths: 177 passed.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 0f98d193c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Takes the updated head of #1034's branch, which holds main 6558d5318 (#1012, GPU-CMP-F64, is merged there). Git merged
it without conflicts (git merge-tree, exit 0), and the tree is the one a direct merge of main gives. GitHub had
reported a conflict since #1012 merged, with the branch and main on two merge bases (68d1331e5 and 50407827c). Merging
#1034's head instead of main leaves this branch with one merge base with main when #1034 merges.
The merged tree was tested before the push: every standalone test file under tests/ passes except
tests/test_ci_registration.py, which fails on main 6558d5318 alone (#1365 fixes it).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Takes the updated head of #1034's branch, which holds main 6558d5318 (#1012, GPU-CMP-F64, is merged there). Git merged
it without conflicts (git merge-tree, exit 0), and the tree is the one a direct merge of main gives. GitHub had
reported a conflict since #1012 merged, with the branch and main on two merge bases (68d1331e5 and 50407827c). Merging
#1034's head instead of main leaves this branch with one merge base with main when #1034 merges.
The merged tree was tested before the push: every standalone test file under tests/ passes except
tests/test_ci_registration.py, which fails on main 6558d5318 alone (#1365 fixes it).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>