Reopened from #7201 (closed in the PR reset), rebased on current main.
Slot 86 (CreatePipelineState stream) -> PC slot 47, slot 101
(CreateStateObject) -> PC slot 62, slot 108 (GetResourceAllocationInfo2)
-> PC slot 68. Slot 108 accepts the console C-ABI order (return buffer
first) and the PC order, reads the title's 56-byte D3D12_RESOURCE_DESC
entries, expands each into a zeroed D3D12_RESOURCE_DESC1, normalizes
Xbox layout words and flag bits, and refuses a count with a null array.
Rebase: kept main's slot 133 (CreatePlacedResourceX) next to the new
slots, and slot 108 now masks flags with slot 133's PC set (0x5FF, which
keeps USE_TIGHT_ALIGNMENT and drops 0x200) instead of 0x1FF.
(cherry picked from commit 1b07215c84)
The (size, buffer, used) convention of the XSystem id getters: a short buffer learns the path length with its NUL
in *path_used, the buffer stays untouched, the HRESULT is unchanged.
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Restores old upstream PR 7450, ported onto main.
With --wave64-emulate, every read of another lane's exchange slot (ds_swizzle,
ds_bpermute, ds_permute, readlane, ...) now selects 0 when the source lane does
not exist in a partial last wave (Gen.x_lane_word), instead of relying on the
prologue's zeroed slot. RADV (Mesa 26.3.1) turned the store, barrier and load of
an exchange behind a branch into masked_swizzle_amd with fetch_inactive, so in a
40-thread group lanes 32-39 of a SWAP 8 swizzle read the missing lanes'
registers. Full waves emit the same module as before.
scripts/run_gpu_tests.py now runs the partial-wave fixtures emulated at subgroup
32, as check.py's partial_wave_test does. It left the subgroup size to the
driver, and RADV picks 64 for compute, where the new fixture passed even without
the fix.
GPU test cs_w64x_partial_swizzle (words measured on gfx1036 through
tools/hw_oracle), semantic test test_w64x_partial_swizzle with a hand-written
fixture, and a contract-table row in docs/design.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the validated console heap range when the title has no allocation hooks. Preserve partially committed buffer reservations, compare CBVs produced through the same ABI, and use the runtime's image robustness setting in the offline pipeline checker.
Seed eight words in the synthetic shader and check them in both GPU runners. Keep the desktop TFE load cases registered alongside the volume-view cases.
Combines old upstream PR 7354 into this change: the wave64 and wave32 VS
waves start at vertices 0, 64, 126, 190 ... and 0, 32, 64, 96, 126 ...,
and on an RX 9070 XT (GFX1201, RDNA4, RADV Mesa 26.2.6) every wave32 wave
lies inside one half of a wave64 wave, measured on GFX1201 by sperm in
old upstream PR 7354. Both "GFX12 not measured" clauses now cite that
measurement.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vs_w64_c_lane_id over 960 vertices on RADV Mesa 26.3.1 gives the same
packing on a gfx1036 iGPU (Raphael) and an RX 7900 XTX (NAVI31, RDNA3):
waves of 64, 62, 64, 62 ... at wave64 and 32, 32, 32, 30 ... with
gewave32, a period of 126 vertices both ways, and every vertex's wave32
lane equal to its wave64 lane & 31. So the 32-lane run is the cut into
halves, not "a repacking ... a stricter test". Say what was measured,
on which devices, and note the lane ^ 2 trap for new VS fixtures.
Found by sskver. w64_graphics.py: 29/29 ok on both GPUs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the desktop HRESULTs for Xbox-only formats. Check both console and desktop vtable callers in the mock, and exercise the full rectangle target for a derived PSO with a zero sample mask.
Keep completion batches with their owning Vulkan context. Test switching primitives, caller overrides, and the dynamic EXEC and uniform null-descriptor guards used for dimension-specific storage views.
Merging.
**Why merged:** Stacked on #540: the clipping invocations of a mesh segment now come from a mesh-pipeline query, so CInvocations/CPrimitives stay correct for mixed vertex + mesh work. sodove verified the exact head, including the disconnected-feature negative control that found (and now proves fixed) a gap in the test.
**Why it's good:** The embedded SPIR-V in statistics_sum_spirv.h was recompiled from the PR's .comp: all 431 words are identical and spirv-val passes. d3d12_mesh with validation: 0 errors, mixed C 12 vs vertex-only C 2, so the mesh share is 10, as expected.
Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** Fixes the mesh half of #506: the statistics pool active during vkCmdDrawMeshTasksEXT no longer enables the two clipping counters that VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076 forbids. Verified on an RTX 5070 Ti (sodove), RTX 4080 (quartz-heron-58) and RX 7900 XTX (bvtterbroot), all with validation on; the rebase to 916dbc619 is byte-identical (range-diff checked). Merged on its own first because #577 is stacked on it.
**Why it's good:** On the 4070 SUPER with LEONIDA_VK_VALIDATION=1: plain main fails d3d12_mesh with 3x VUID-...-07076; main + #540 + #577 passes d3d12_mesh, replay_query_edges and replay_query_predication with 0 validation errors, and the counters match sodove's numbers (mesh-only C 8/0, PS 1024).
Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** CI-only: a hung Windows runtime test now fails on its own (per-test ctest --timeout 300, TIMEOUT 180 on the loader test) instead of cancelling the whole job, and the job limit goes from 20 to 35 minutes. Each value is explained in a comment. Reviewed as good by Oliwettoo.
**Why it's good:** Workflow change with no new permissions, actions or downloads. The local tests it touches: 87 passed, 9 skipped. The runner-side effect can only be seen in CI, but there's nothing risky in it: the timeouts only turn hangs into failures.
Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).
AI-assisted (Claude Code, Claude Opus 5.5).
Merging.
**Why merged:** Indexes the DXBC identities the Xbox native graphics pipelines use, which the native-PSO path needs. The earlier hold (new tool not listed as a translator input) is fixed in 62a95883b: native_pso_hashes is now in translator_deps.cmake, make_game.py's translation sources and runtime.yml.
**Why it's good:** Security read of the three-dot diff: tools and tests only, no binaries, downloads or network calls. The PR's own tests: 129 passed. The consistency set, which caught the missing input registration last time, is clean now.
Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).
AI-assisted (Claude Code, Claude Opus 5.5).
Force the CRT TLS directory into tiny_ga_tls when /GA removes the last _tls_index reference. Reject the unassigned TLS index in the test so missing metadata fails the index check.
RegisterAppStateChangeNotification / UnregisterAppStateChangeNotification under
api-ms-win-core-psm-appnotify-l1-1-0/-l1-1-1 and kernelbase.dll, and CreateWindowExW/A under
user32.dll and ext-ms-win-rtcore-ntuser-window-l1-1-0/-l1-1-1, plus CreateWindowExA under
ext-ms-win-rtcore-ntuser-window-ansi-l1-1-0, the set the title's import table names. The title's
first top-level window is fitted to the work area and hooked: SC_CLOSE runs the suspend callbacks
(quiesced TRUE) and ends the run through the title's ExitProcess, with a 1 s deadline.
Split from #401 (a02134a9c), as the maintainer asked for one topic per pull request.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Speech is consistent now: XSpeechSynthesizerEnumerateInstalledVoices calls back once with a silent
voice (XSpeechSynthesizerVoiceInformation in the GDK reference's layout), and SetCustomVoice accepts
that voice id only. The enumeration takes (context, callback), the GDK reference's order; main read
them the other way round.
- XAppCaptureImpl is left to #537, which serves it in xgameruntime.cpp with its full layout.
- The lifecycle shim (app-state callbacks, CreateWindowEx hook) moves to its own pull request.
- docs/runtime_imports.md: the speech and launcher bullets match the code; the launcher's display power
request is called out as a side effect on the host.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An enhanced barrier's D3D12_BARRIER_SYNC_COPY mapped to VK_PIPELINE_STAGE_2_COPY_BIT only. Two D3D12
copy-scope commands are not Vulkan copies: WriteBufferImmediate is recorded as vkCmdUpdateBuffer and
ResolveQueryData's never-written queries as vkCmdFillBuffer, and synchronization2 runs both in the CLEAR
stage. A SYNC_COPY barrier after either therefore did not order it, and a copy after the barrier could read
the word before the write landed.
vulkan_sync now maps SYNC_COPY to COPY | CLEAR. vk_command_replay_test part K records WriteBufferImmediate,
a SYNC_COPY -> SYNC_COPY buffer barrier and a CopyBufferRegion of the written word; under
LEONIDA_VK_VALIDATION=1 it is a read-after-write hazard without this change. d3d12_state_map_test and
docs/d3d12_vulkan.md follow the new mapping.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the tagged pipeline variants and indexed quad expansion from #722 and #682 with the shared shader cache. Retain title-backed index uploads, cross-queue scratch sharing, amd64 console return conventions and the PC/console caller discriminator. The local shader build indexes native containers and includes the executable's embedded stages.
Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic.
The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
Select the geometry-stage variant when the input assembler requests an Xbox rectangle and cache it alongside the attachment-format variants. Keep a shared snapshot of the linked vertex program for that draw. Exercise alternating rectangle and triangle draws through the same PSO and compare the complete target after each switch.
Carry only runtime/src/rect_list_geometry.h, byte-for-byte from 6aa8eb11c. The stage generator and its original commits are by tedin7 (#207, carried forward in #682). This makes the draw-time change buildable against main while the explicit rectangle/quad work is in review.
sodove's negative control on this head showed the gap: with the layer reporting the feature but the
mesh-primitives pool never created, both counts stay at 0 and the enabled-feature assertion still held,
because it compared 0 >= 0. The count has to be positive to show the wiring is there. How many primitives
the mesh shader emits is the driver's, so the test asks for a positive count and not for a number.
The disabled case stays pinned at zero. AI-assisted.
Where the device has the meshShaderQueries feature of VK_EXT_mesh_shader, the number of
primitives the mesh shader emitted comes from a VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT
query run around each mesh segment, and it is added as the clipping invocations of that
segment. CPrimitives stays 0: Vulkan has no clipped-primitive counter, and D3D12's
CPrimitives is the clipper's output.
Claim: D3D-MESH-CLIPPING-COUNTER
Depends on: #540
Every AS resource's GPU VA must be the driver's vkGetAccelerationStructureDeviceAddressKHR value for the structure
behind it; the test checks that for the BLAS and both TLAS resources.
Envyre's review of old upstream PR 8414: the branch that takes the driver's address when it differs only ran on such
a driver. The test creates a second device whose get_instance_proc hands out a
vkGetAccelerationStructureDeviceAddressKHR that answers the real address plus 256 MiB (the device's existing
function-lookup hook, no change to the runtime), creates one AS resource on it and checks that its GPU VA is the
driver's address, that the arena address still names the structure, and that releasing the resource forgets both.
No builds run on that device.
The checks sit right after the TLAS lookups, before the CLONE/COMPACT section main has added since.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A default-heap acceleration-structure resource in the GPU address arena handed out buffer address + offset as its
GPU VA without asking the driver. An instance must name its BLAS by a value obtained from
vkGetAccelerationStructureDeviceAddressKHR (VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-12281), and for a GENERIC
structure the spec only promises consistent offsets between structures of one buffer, not equality with the buffer
address. Query it as the committed path does; if a driver ever returns a different address, use the driver's and
keep the arena address registered too.
GPU-assisted validation only knows addresses it has seen that call return, so it reported every arena BLAS as "an
invalid acceleration structure reference" and rewrote the instance to its dummy BLAS (the ray-query miss marso006
saw). It now reports the remaining layer limitation instead: a GENERIC structure built as bottom level is "not a
bottom level acceleration structure", which the spec allows.
Restored from old upstream PR 8414, which was closed unmerged when the original repository went private.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes the gaps from the security review on #357:
- sendto, WSASendTo, WSASendMsg (both exports) and WSAJoinLeaf on an
unbound socket made the host bind it to the wildcard address
(Microsoft's sendto remarks), so its port took datagrams from other
hosts. The shim now binds such a socket to 127.0.0.1, ::1 or
::ffff:127.0.0.1 first and fails with WSAEADDRNOTAVAIL if it stays
unbound.
- setsockopt (ws2_32 name and #21) refuses IP_ADD_MEMBERSHIP,
IP_ADD_SOURCE_MEMBERSHIP, IPV6_ADD_MEMBERSHIP, MCAST_JOIN_GROUP and
MCAST_JOIN_SOURCE_GROUP with WSAEADDRNOTAVAIL. wsock32's setsockopt is
its own export (dumpbin on Windows 10 22H2: not a forwarder) that remaps
the Winsock 1.1 IP_ numbers (Wine dlls/wsock32/socket.c has the same
table), so it gets its own wrapper that also refuses the 1.1 join (5)
and forwards everything else to the host wsock32.
- WSAJoinLeaf gets connect's loopback check, so a group is refused.
Tested: ws2_offline_test 71 checks, 0 failures, MSVC 14.44 / SDK
10.0.26100 on Windows 10, including a control check that the host sendto
alone binds to 0.0.0.0; docs tests 47 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#445 makes the same slot 73 change (map the console
ID3D12GraphicsCommandListX IID to ID3D12GraphicsCommandList on creation
and QueryInterface). Use its exact text in d3d12_xs_device.cpp so the two
pull requests merge cleanly in either order; this one keeps the
regression checks (ID3D12GraphicsCommandList9 and an unknown IID keep
E_NOINTERFACE with a null output) and the docs line.
Tested: xs_proxy_mock and d3d12_vulkan_device with MSVC 14.44 / SDK
10.0.26100, on this branch and on this branch merged with #445's head
386d6ac5d.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>