The retail executable imports D3D12SerializeVersionedRootSignature, and Wine's own d3d12.dll
does not answer that export for the runtime's shim. The result is hard to place: the D3D12 trace
stops at about 1,658 calls, the startup trace ends in an access violation inside the executable,
and nothing in the log but one [rt] line names the cause. Two of us read that as a boot-chain stop
before finding it.
Document the prefix requirement, the three DLLs and the override that make Wine use them, and the
measured difference: 1.4 million calls with no exception against 1,658 calls and a fault.
In Gen.desc_probe (%desc_lookup_fn), replace the counter-clobbering exit
(OpStore %dl_k 8; OpBranch %dl_next) with a structured early break
(OpBranch %dl_end) and mark OpLoopMerge %dl_end %dl_cont DontUnroll.
On Intel UHD Graphics 630 (CFL GT2) with Mesa ANV 26.1.6, keeping %dl_idx
on a single-exit loop-header phi caused the backend to hoist the post-loop
binding-table-index add (add bti, idx, 2) into B0 before the probe loop
ran (confirmed in INTEL_DEBUG=wm across SIMD8, SIMD16 and SIMD32), making
ps_table_fetch read slot 0 (magenta 0x3f800000) for both fetch-sint and
fetch-uint. Breaking straight to %dl_end gives %dl_end a distinct exit phi
so the add stays after the loop, while DontUnroll preserves one compact
rolled loop.
Tested (synthetic fixtures only, no game files):
- Intel UHD 630 (Mesa ANV 26.1.6, uncached): ps_table_fetch PASS (4096/4096),
run_gpu_tests.py default 185/241 passed (0 failed, up from 184/241 with 1 fail),
3-fallback run 220/241 (only known ms_wave_info_s3 fails).
- NVIDIA GTX 1050 Ti (555.58.02, VK_LOADER_LAYERS_DISABLE=~implicit~):
run_gpu_tests.py default 180/241 passed, 61 skipped, 0 failed.
- Mesa llvmpipe (26.1.6): ps_table_fetch PASS (4096/4096).
- CPU: tests/test_desc_cache.py (spirv-as, spirv_asm.py, spirv-val) OK;
scripts/run_semantic_tests.py tests/semantic: 444/447 files pass (5,956 tests,
same 3 pre-existing failures as main dde82f27).
AI-assisted.
XUserDeviceImpl slots 4/5 (XUserRegisterForDeviceAssociationChanged and its
unregister) and 7/8 (XUserRegisterForDefaultAudioEndpointUtf16Changed and its
unregister) handed out a token and dropped the registration; unregister
returned true for anything.
Each registration is now kept (kind, a duplicate of its queue, context,
callback) under a token unique across both kinds and never 0, and the
matching unregister removes it at once, with or without wait. Unregister
returns true for every token, as XUserUnregisterForChangeEvent does; a token
already removed, never issued or of the other kind changes nothing. Offline
the association and the default audio endpoint never change, so no event is
raised and no callback is queued or called. The state is namespace-scope
with a constinit SRW lock, no function-local statics.
xgameruntime_offline_test checks null arguments, token uniqueness, that
registrations are kept and removed per kind, harmless repeat and foreign
unregisters, and that no callback runs. docs/runtime_imports.md says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 20-thread group is one wave32 with lanes 20-31 never launched. A launched
lane whose source lane is missing gets 0, and a send to a missing lane is
lost. cs_w32_permute and cs_w64x_permute run full waves only. The expected
words are measured with a raw 20-thread hw_oracle kernel on gfx1036.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`CommandList::clear_depth_stencil` (`runtime/src/command_list.h`) refused a `ClearDepthStencilView` whose depth was
outside [0, 1] or NaN, and one whose `D3D12_CLEAR_FLAGS` were 0, so `Close` answered `E_INVALIDARG` and the whole
`ExecuteCommandLists` submission was dropped. Windows' D3D12 closes those lists: on WARP a `D32_FLOAT` target keeps
1.5, -0.5 and NaN exactly as given, and a clear that names no plane clears nothing. `d3d12_clear_test` now reads those
back on WARP and on the layer, and `d3d12_close_parity_test` measures the four `Close` verdicts.
A title that clears depth with a computed value (or wraps the clear in a flag mask that can be 0) lost that frame's
depth clear and, with it, the whole submission's work. The call is now recorded with the depth as given (a D16 target
still quantizes at replay) or, with no plane named, recorded as nothing.
d3d12_clear_test adds three read-back comparisons (1.5/-0.5, NaN, flags 0), command_list_test asserts the accepted
calls and the stored values, and the four close-parity rows move from the known-difference table to `match`.
The queue proxy's PresentX slot is past the PC chain, so nothing recorded
a present: a --trace-d3d12 run of a frame loop could not say how many
frames were presented, or whether one was refused. XboxPresentation::PresentX
now writes one line per call through d3d12_trace::result (ok or failed).
xbox_present_test captures the trace around a blank present and a refused
three-plane call and checks for exactly those two lines.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
The host runtime sizes and creates R8G8B8A8_UNORM_SRGB and B8G8R8A8_UNORM_SRGB textures with
ALLOW_UNORDERED_ACCESS (RTX 4090 617.42 and WARP). The layer created their image in the sRGB format with
STORAGE usage, which most GPUs lack, so it refused them: a retail title sizes a 2048x2048, 12-mip
R8G8B8A8_UNORM_SRGB render target with unordered access through device slot 25, got UINT64_MAX and
stopped on its 32-bit size check.
Such a texture is now a mutable image of the UNORM format of the same order (Format::uint_backed, from
#7604), where the GPU can make that image with both formats listed. Its storage view is UNORM, as every
D3D12 typed UAV of these textures is; RTVs and SRVs are sRGB, so clears and draws encode and sampling
decodes. Multisampled ones are still refused.
d3d12_srgb_uav_test compares with WARP: the retail shape's size alignment and creation, a clear
through the sRGB RTV and one through a UNORM UAV, byte for byte, for RGBA8 and BGRA8. Without the
change it fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A buffer_load_format_* whose format comes from the V# no longer searches a binary tree over the
format codes. One table word per code gives the conversion kind, the channel count and the
four channel widths; one shared function per output component reads that word and picks the
conversion with OpSelect, so the decode has no branch and the module carries one copy of it.
The exact UNORM/SNORM quotient comes from a shared %fmt_norm_bits that reads the width's 64-bit
repeat constant from a table. The fixed-format (MTBUF) path is unchanged.
In a module with one dynamic-format load the decode goes from 3,498 instructions and 306 branch
ops to 565 instructions and no branch, and the module from 250,869 to 56,763 bytes. Every one of
the 128 codes gives the same words as before (tests/semantic/test_format_decode_table.py).
AI-assisted (Claude/MiniMax Code).
image_sample_l/image_sample_lz selected the typed view only for dim:SQ_RSRC_IMG_2D, so a UINT or SINT 2D-array, 3D, cube or 1D image was sampled through the float view and the VGPRs held a converted float instead of the integer texel. The hardware applies the T# FORMAT rule to every dimension, and image_load already reads the uint/sint alias of the dimension's sampled binding there.
The typed path is the existing image_read_typed dispatch, now with the dimension it declares the aliases for (a cube uses its 6-layer 2D-array view) and the typed sampled-image type of that dimension; a float format still samples the float view. tests/semantic/test_sample_typed_dims.py covers the alias and binding each dimension emits, that the float view survives, and spirv-val.
French translation of CONTRIBUTING.md at 1ab957b3, with the same
"English is authoritative" note as the French quickstart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bit 24 of V# word 3 (GFX10 RESOURCE_LEVEL) is WRITE_COMPRESS_ENABLE on GFX12, so
the informational --gfx10-word3 run is refused there. On gfx1200 a vector load
after a store of the same thread needs no wait (--hw-sync none without the
scalar ops: 1,000 of 1,000); the scalar loads need the store wait and s_dcache_inv.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 12 Microsoft-signed DLLs in the DLL table report an Authenticode hash
mismatch as shipped because the Xbox packaging fills the load-config
CodeIntegrity field after signing. Add one sentence next to the table that
says so, credited to jasontheminions's finding in #8504.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gfx12 kernels are the GFX10/GFX11 text respelled (gfx12_lines): a MUBUF
soffset is null instead of the literal 0, which is what made every
buffer_load/store_b* "operands are not valid for this GPU or mode";
s_waitcnt_vscnt, s_waitcnt vmcnt/lgkmcnt and buffer_gl0/gl1_inv become
s_wait_storecnt, s_wait_loadcnt, s_wait_kmcnt and global_inv. The V#s keep
their layout (Mesa gfx12-rsrc.json: word 1 and word 3's fields as on GFX11);
word3() now refuses a family it has no layout for.
RX 9060 XT (gfx1200), AMD 26.11.2: seeds 2-4 x 2,000 programs x wave32 and
wave64, 12,000 of 12,000 match; the negative control catches all 8
perturbations. GFX10, GFX11 and translator text are byte-identical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slot 55 is the console's CreateDerivedPipelineState(pBasePSO, n, pRecords,
riid, ppv): n = 1..4 records of 0x14c bytes (a u32 tag, payload at +4) that
patch the base PSO's state before a new PSO is created.
- Slot 86 keeps a deep copy of the stream it creates on the returned PSO
(ID3D12Object private data, released with the PSO): shader bytecode,
stream-output and input-layout arrays and strings, cached blobs, and
AddRef'd root signatures.
- Slot 55 patches a copy of the base stream and creates the PSO through the
slot 86 path, so a derived PSO can itself be a base.
- Tags: 0 = DEPTH_STENCIL (or the DEPTH_STENCIL1 prefix), 1 = RASTERIZER,
2 = BLEND, 3 = sample mask (TomBox layout; the 1.0.2.1 title does not write
it), 5 = StencilReadMask and StencilWriteMask bytes overlaid on the base's
DEPTH_STENCIL, applied in record order. Other tags are refused.
- A base not created through slots 86/55, a base without the matching
subobject, malformed records, and n outside 1..4 are refused with E_FAIL or
E_INVALIDARG and a null output, each logged once.
- Slot 55 shadows PC CreateReservedResource1 (PC slot 55) on the proxy, as
slot 78 shadows PC CreateReservedResource2 in #7125; the vulkan device test
calls the PC method on the real device behind the proxy.
Tests: pso_stream_test (synthetic streams: console subobject offsets, deep
copy, patching, tag 5 overlay and record order, refusals) and
device_proxy_test over WARP (refusals, graphics base via slot 86, n = 3 and
n = 4 derivations, a derivation from a derived PSO).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwHrL5Lxc1rum25b6tnpo8
(cherry picked from commit d80c40845d7eca9163f937de943b65482b7f0657)
The proxy also serves host callers: d3d12_vulkan_device_test drives the Vulkan device through it,
and its ID3D12Device5::CreateMetaCommand call (PC slot 61) landed in proxy_create_sampler_x
(found by nullmarsh on #7115: the test stopped at line 5763 instead of main's known line 6574).
Slot 61 now checks the caller's return address with a classifier the runtime installs
(set_console_caller, the name #7490 uses): D3D12XboxCreateDevice installs
rt::shims::mapped_image_base, so only a caller in an image the guest loader mapped gets
CreateSamplerX. Any other caller, and every caller when no classifier is installed, is forwarded
to the PC slot 61.
xs_proxy_mock_test checks all three cases: no classifier (PC slot 61), a guest caller (PC
CreateSampler with the same words; a null description skipped) and a host caller under an
installed classifier (PC slot 61). d3d12_vulkan_device_test again stops at line 6574, as on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 8f756ebe048af042638ce51a61490f35f4f44ee3)
Slot 81 goes through route_xbox_device_slot like the other Xbox routes, so
an override onto 70 or 74 still wins. Kept ladder-frame's slots 86/101/108
and the 74 env-slot mode next to #8869's slot 81 tests and its
LEONIDA_XS_FRAME_EVENTS_SLOT override. The handled-slots comment in the
header is rewritten as one list that matches device_slot_overridden.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/x64_recomp.py is the start of the static recompiler the arm64 port
needs: an x86-64 decoder (prefixes/REX, ModRM+SIB, RIP-relative, hi8
regs, immediate forms, groups 1-5/8/15/1A/11) and an arm64 assembler
with label fixups. tools/recomp_census.py counts how much of a PE's
.pdata-declared code the decoder covers. docs/mobile.md records the
route (AOT lift of .text to arm64, macOS first, MoltenVK or SPIRV-Cross
for graphics) and what still blocks iOS.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
tools/leonida_mods.py manages the port's mods folder: create, install,
list, check, enable, disable, pack, remove and a gta6rt launcher, with a
Tkinter window behind Mods.bat on Windows. Packages are plain ZIPs with
mod.json at the top level; the installer refuses paths that climb out of
the package and never touches game data. mods/ ships four archetype-swap
examples, three of them installed disabled.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Any non-empty value other than "0" lifts the frame-event cap: a
WaitFrameEventX hands its token out at once (no vblank grid, no latency
throttle) and PresentX presents unsynced, so the frame rate is whatever
the title renders. Registration and suspension keep their errors, an
uncapped frame's statistics report its present time, and the flag
survives suspend/resume. frame_pacer_test covers the grid's removal and
restoration.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
A literal source is one ISA dword (bits 63:32 of the constant) only when its
printed spelling fits one dword. LLVM pads nothing, so such a literal prints in
at most 8 hex digits; a 16-digit spelling is the whole binary64 value. The
magnitude check from the previous commit read 0x0000000012345678 as the high
word 0x12345678 instead of the low one, and tools/f64_diff.py's CPU reference
made the same mistake, so a generated program could agree with the translator on
the wrong operand.
tools/shader_ir.py records the literal's hex-digit count next to f64_literal
(and now marks v_ldexp_f64's sources too); tools/rdna2spirv.py decides with it at
all three literal readers, and tools/f64_diff.py's read_source mirrors the rule.
Tests: tests/semantic/test_f64_literal_whole.py gains the padded-width case
(0x0000000012345678 -> low word 0x12345678, high word 0) next to the 8-digit
control, and tests/test_f64_diff.py checks the reference reads both spellings the
same way.
Taken from the follow-up patch of @matheuskshn (930e78a2, tested by them on an RTX 4070 Ti: replay_quad_list_test fails the two non-indexed cases on a6b31d51 and passes with it). Re-run here: replay_quad_list_test and d3d12_rect_list_test exit 0 on the pod (Wine, RTX 4090).
llvm-mc 21's gfx1013 decoder prints a v_fma_mix* literal whose low 16 bits
are the f16 value of one of 90 inline constants as that constant, and
re-encodes the instruction in 8 bytes: the SRC field changes from 0xff to
the inline code and the literal word is gone (0x3f800000, 1.0 as an f32
source, prints as 0). The printed-encoding check refused it as a dropped
field. mix_inline_literal accepts exactly that difference, the source takes
the stored 32-bit literal with the stored neg/abs bits, the instruction
takes its 12 stored bytes and the later offsets move up by 4, on both the
clean and the re-anchoring listing paths.
Swept with llvm-mc 21.1.8 over all 65,536 low halves; llvm-mc 23 prints
lit(V) instead. CPU-checked by FmaMixInlineLiteralTest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"f64_source_words" and the rounding-op reader applied the one-literal-dword rule (bits
63:32, bits 31:0 zero) to every literal the parser flags "f64_literal". LLVM prints the
two-dword literal of an f64 instruction as one 16-digit "0x" value in the gfx1013 listings
the translator reads, so "v_rsq_f64 v[8:9], 0x07b1b5527cbdbe7e" became the rsq of
0x7cbdbe7e_00000000 ("22740052 21877845" instead of "bf95374e 5c0e6ad8"), and
"v_trunc/ceil/rndne/floor_f64" refused such a literal as "Unsupported: <op> literal".
The one-dword rule now applies only to a literal that fits a 32-bit word; a wider one is
split into its two words, as "v_ldexp_f64"'s reader already did.
"python -I tools/f64_diff.py --sweep --programs 0" (its CPU reference) on main and then
this branch: 7 match, 1 mismatch of 12 -> 43 match, 0 mismatch of 47 (35 operand forms
that were refused now translate). "tests/semantic/test_f64_literal_whole.py" against
main"'s" "tools/" (LEONIDA_TOOLS_DIR): 4 failures, 4 errors; with the change: OK.
Windows 11, Python 3.12.10, translator oracle only (no GPU, no game files).
The xmem shims record what they hand the title (XMemAlloc, XMemAllocDefault,
XMemVirtualAlloc, the title's VirtualAlloc); an address outside those ranges
is left as it was and counted. The submit-time scan reads only the
CBV/SRV/UAV slots the bound table's root signature declares, and its cost
is accumulated per ExecuteCommandLists. Section 3.3 describes the three
places addresses are replaced and the two kinds of copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>