Commit Graph

5744 Commits

Author SHA1 Message Date
59c34bdc91 Merge pull request #1338 from liang-kai-shui 2026-11-22 05:37:48 -05:00
cb4e78b059 Merge pull request #1336 from Freem
# Conflicts:
#	docs/design.md
2026-11-22 05:37:47 -05:00
1aa8e266e5 Merge pull request #1335 from opit80 2026-11-22 05:37:46 -05:00
c4db02a1c8 Merge pull request #1334 from ezwinxdlmao
# Conflicts:
#	docs/design.md
2026-11-22 05:37:46 -05:00
6eb00bbf43 Merge pull request #1331 from undeadhuman37 2026-11-22 05:37:44 -05:00
f4b79eee0b Merge pull request #1330 from undeadhuman37 2026-11-22 05:37:43 -05:00
e3c9fbd2f2 Merge pull request #1329 from undeadhuman37 2026-11-22 05:37:43 -05:00
2837c2fdac Merge pull request #1328 from Ewann 2026-11-22 05:37:43 -05:00
a292b93a63 Merge pull request #1313 from SombraSoft 2026-11-22 05:37:40 -05:00
d01d1df494 Merge pull request #1306 from zneel 2026-11-22 05:37:40 -05:00
3d4bd43117 Merge pull request #1302 from Vonsek 2026-11-22 05:37:40 -05:00
53300de17f Merge pull request #1270 from AimLogin 2026-11-22 05:37:39 -05:00
6314d00c16 Merge pull request #1256 from abilliontokens 2026-11-22 05:37:39 -05:00
2f6881a065 Merge pull request #908 from AlxcBTW 2026-11-22 05:37:39 -05:00
aa87b94596 D3D-97: document independent Vulkan queue leases
Explain cross-queue Wait-before-Signal progress and the caller-owned legacy limitation. AI-assisted (Codex).
2026-11-22 13:37:16 +03:00
eef40049f1 valu_fuzz: review fixes (signaling-NaN-only uncertainty, unjudged-word count, --skip-op validation, Kernel resource test)
mem translator path ran on the Radeon 880M: 400 of 400 match. Docs: --show line back in the options list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:35:23 +01:00
b2c8fc1c48 Note the clang-cl 22.1.7/22.1.8 exception next to the LLVM 19+ requirement 2026-11-22 13:34:02 +03:00
8f5ee29f85 Merge remote-tracking branch 'origin/main' into w-m15 2026-11-22 11:33:54 +01:00
8b606c2c33 docs(design): deduplicate repeated contract table rows
Deduplicate seven older repeated row titles in docs/design.md:
- Integer clamp: exact duplicate removed
- Gather sampler LOD: stale pre-SHADER-152 RoundEven copy removed
- Other additions: two older copies removed, keeping complete d16 and Floor tie-up version
- v_mad_u64_u32, v_mad_i64_i32: older copy without EXEC masking removed
- LDS: stale ds_bpermute copy removed
- Known approximations: older short summary removed, keeping complete details
- Wave64 mask ballot: older copy lacking partial wave compare description removed

Finding by @kotorvr in #1218 (7077758389).
AI-assisted. No game files.
2026-11-22 16:03:39 +05:30
8f89893212 Merge current main into depth-stencil copy fix 2026-11-22 06:33:39 -04:00
43d578f3cf Translator: a constant lane mask gives lane L its bit L
Gen.mask_src turned an immediate lane-mask operand into bit 0 of the
constant for every lane, so s_and_saveexec_b32 s7, 0xff00 with all lanes
on left none on and an inline 5 left all 32 on. Lane L now takes bit L:
of the 64-bit value for the 64-bit forms (inline constants sign-extended,
literals with a zero high word, as src64_data) and of the 32-bit value at
L mod 32 for s_*_saveexec_b32 and s_andn2_wrexec_b32. 0 and -1 stay
constants. s_bcnt0/1_i32_b64 of a constant now counts the constant's bits
(scalar data, like s_ff1_i32_b64) instead of this lane's mask copy.
SGPR operands are unchanged.

GPU tests cs_w32_mask_imm.asm and cs_w64_mask_imm.asm, words derived in
their headers, failed on main on an RTX 5080 and an RDNA2 iGPU and pass
now; LaneMaskConstants runs both across every lane in the semantic suite.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:33:18 +01:00
27577750cf fix(translator): use typed texel fetches for explicit LOD gathers
The manually addressed footprint was always read from a float image. Integer views need typed fetches for all four taps, including when the destination packs them into 16-bit halves.
2026-11-22 11:33:18 +01:00
d5c0e16319 Tests: GPU test for the xy/xyz typed buffer loads and stores (TEST-185)
buffer_load_format_xy/xyz, tbuffer_load_format_xy/xyz and
buffer_store_format_xy/xyz were checked only on the CPU. The new
cs_fmt_xy_xyz.asm runs 12 loads and 9 stores on one thread, and
check.py and run_gpu_tests.py compare 128 dumped words.

Every expected word was measured by running the same body natively on a
Radeon 680M (gfx1035, RDNA2), through tools/hw_oracle's kernel wrapper
with s[0:3] set to the V# vk_compute_test passes. Wave32 and wave64 gave
the same words. What the hardware does:
- Loads write only their 2 or 3 VGPRs. A missing channel repeats one the
  format has (SHADER-86), and tbuffer loads take the instruction's format.
- Bounds: the whole element must end inside num_records, even when the
  loaded components do. Such a load reads 0, and such a store writes
  nothing.
- A store with fewer components than its format writes the whole
  element, with 0 for the rest. Into a one-channel format only x is
  written.

The translation already does all of this. The test catches a store that
fills the missing components with anything but 0, a bounds check on the
first dword only, and an xy/xyz load that writes four VGPRs: each of
these, made in a scratch copy of the translator, failed 6, 16 and 18
words.

check.py's dump comparison becomes dump_test, shared with
fmt_1010102_test, whose messages are unchanged. docs/design.md records
the measured rules in the typed-load, format-store and bounds rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:31:42 +02:00
a03e155134 Fix stencil corruption in depth-stencil CopyResource 2026-11-22 06:28:58 -04:00
e23e2da05a skin_streams: measure the vertex joint-index and skin-weight layouts (ASSET-12)
tools/skin_streams.py carves drawable resources out of an RPF9 archive without the
TOC, walks drawable -> LOD -> grmModel -> geometry -> FVF, classifies the skin
slots (16/17 weights, 20/21 indices) and validates the decoded bytes against each
model's bone count. docs/character_skeleton.md gets the measured layout table and
the corrected skin section. Synthetic tests in tests/test_skin_streams.py.
2026-11-22 02:26:56 -08:00
e6f8478e9b D3D-62: create the converter on every GPU; merge with the concurrent-queue test
The converter was made only where the GPU lacks D24_UNORM_S8_UINT (1c5463b4). 96-bit textures need it on every
GPU, so it is always created; it costs nothing until a copy uses it (lazy pipeline, lazy tracker lock).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 11:26:48 +01:00
983862e2a8 Runtime: 96-bit R32G32B32 textures on the Vulkan layer (D3D-62)
R32G32B32_FLOAT/UINT/SINT/TYPELESS textures were refused ("texture format not
supported yet"). They are now R32G32B32A32 images on every GPU: most have no
optimal-tiling RGB32 image, and one that has would not avoid the repack, since
D3D12 places subresources at multiples of 512 bytes and Vulkan wants a copy's
buffer offset to be a multiple of the texel size
(VUID-vkCmdCopyBufferToImage-dstImage-07975).

- Footprints keep D3D12's 12-byte texels (compared with WARP).
- CopyTextureRegion between a texture and a buffer is repacked by the D24
  compute pass (depth24_convert.comp modes 2 and 3, Depth24Job::rgb96): the
  same scratch, parts and lifetime, texels of three words in the footprint and
  four in the scratch, copied uninterpreted. depth24_convert.inc is
  regenerated with the documented glslc command; the same glslc reproduces the
  previous blob byte for byte from the previous source.
- WriteToSubresource/ReadFromSubresource take the staged copy, as D24-as-D32.
- A view's T# names GFX10_FORMAT_32_32_32_*, so alpha reads as one.
- Refused: unordered access and depth (as WARP), render targets (WARP has
  them; not done, and FORMAT_SUPPORT and GetResourceAllocationInfo agree),
  copies between a 96-bit and a four-channel texture, views of another
  format family.

Tested on an RX 9070 XT (AMD 26.11.2), Windows 11: d3d12_rgb96_test matches
WARP and the expected texels bit for bit for 4 formats as 2D arrays with mips
and as volumes; d3d12_descriptor_test samples FLOAT, UINT and TYPELESS views.
Clean under the validation layer with sync validation; depth24_convert_test
and ctest (62) pass.

AI-assisted (Claude Code).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 11:26:48 +01:00
e256a2547c Translator: --fma khr emits OpFmaKHR for fused multiply-adds
GLSL.std.450 Fma may be split into two roundings by a driver (Vulkan
environment: inherited from OpFMul followed by OpFAdd); RDNA2 v_fma_* round
once. --fma khr (default stays glsl) emits OpFmaKHR with capability FMAKHR and
SPV_KHR_fma and lists shaderFmaFloat32 in the index. Runtime device creation
and the vk_* test programs enable VK_KHR_shader_fma when present; cs_fma_fused
tests single rounding; the mini interpreter learns OpFmaKHR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:25:37 +01:00
8a52cbcdf1 Merge origin/main; lds_fuzz: exit 77 for backends without LDS, GFX11-only cmpstore swap, perturb scoping, docs wording
Merges #1265 (libdrm backend, gfx10_spelling) keeping both raw_kernel_text changes. The kernel
metadata's .max_flat_workgroup_size is now 1024 (was 256) so 256-thread groups launch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:25:34 +01:00
c491cf097c Tests: d3d12_sampler2 compares non-normalized cases only with a host that has them (TEST-191)
The test compared all 22 CreateSampler2 edge cases with the host's PC
runtime. A host that reports no NonNormalizedCoordinateSamplersSupported
leaves every non-normalized description unwritten, so the test failed
at the first one ("UINT border and non-normalized: ours written 1, host
runtime 0"). It printed that the host lacks the feature, then compared
anyway. Since 817a5e9 registered it with ctest, ctest fails on such
hosts.

Each edge case now records whether its description has
D3D12_SAMPLER_FLAG_NON_NORMALIZED_COORDINATES, read from the description
itself. Without the feature on the host, only the 3 cases without the
flag are compared live. The layer's answers to all 22 are still checked
against the recorded RTX 4090 / WARP answers first, as before. The
host's normalized-vs-not descriptor check runs only when the host has
the feature.

Measured on the host's default adapter here, a Radeon 680M (D3D12
driver 31.0.14084.6002): it reports no non-normalized samplers and
leaves all 19 non-normalized descriptions unwritten, which
docs/d3d12_vulkan.md now records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:25:13 +02:00
da576bd828 Docs: add Turkish (tr) community quickstart 2026-11-22 13:25:11 +03:00
dac548997e fix(shader): honor BGRA views in normalized buffer stores
The runtime describes two encodable packed UNORM formats in BGRA order through V# selectors. A store must place red in the third memory field even when only the red input is present.
2026-11-22 11:24:35 +01:00
f5c427716f fix(translator): saturate packed integer image reads
Native gfx1036 clamps out-of-range channels from signed and unsigned RGBA32 views before packing D16 results. Exercise both limits in the existing GPU readback fixture so wrapping at either boundary is observable.
2026-11-22 11:23:18 +01:00
51c402027c Docs: note e293917 pin and v1.2 model-count re-measure caveat 2026-11-22 07:22:52 -03:00
53ebea28f1 Merge origin/main (#1301 merged): read-method accessors, one translator row
#1301 landed on main: check_read_methods, fssm_header.read_methods,
ps_interp_census.py removed. Resolution: our corrected SHADER-181 mode row
references check_read_methods and the surviving census tool; kotorvr's
translator-side row kept verbatim; the two stale copies of the old
bits-are-the-mode row, the extra interpolants duplicates and the old
fssm_header paragraph dropped.
2026-11-22 02:22:27 -08:00
032dfb9183 Merge origin/main into hw-oracle-valu 2026-11-22 11:21:38 +01:00
43e4431cd8 docs/testing: run the GPU tests from a CI-built runtime
TEST-58/TEST-71 testers without VS2022 or CMake had no documented route
from the Runtime workflow's runtime-windows artifact to
scripts/run_gpu_tests.py. Add a short subsection: download the artifact
of the commit's run, unzip it, and pass the folder to --build;
build.py and check.py take the same folder as their second argument.
Repeats the same-commit rule the note above states.

Docs only, no game data, no CI change.
2026-11-22 18:20:23 +08:00
40984f1693 Merge remote-tracking branch 'upstream/main' into codex/mtbuf-packed-loads 2026-11-22 11:20:12 +01:00
6fc4588c3f Preserve trailing VGPR high half on odd-component d16 image loads 2026-11-22 11:19:59 +01:00
87320aec99 Document clang-cl crashes in Windows runtime test builds 2026-11-22 13:18:54 +03:00
304a3d8d58 docs: LDS oracle translator results and the RDNA2 backend note
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:16:01 +01:00
1ea8ac875d Merge remote-tracking branch 'origin/main' into presentx-core-v2-local
# Conflicts:
#	README.md
#	docs/d3d12_vulkan.md
#	runtime/CMakeLists.txt
#	runtime/shims/d3d12_com.h
#	runtime/shims/d3d12_vulkan_device.cpp
#	runtime/test/vk_test_device.h
2026-11-22 11:15:14 +01:00
c849e07f26 docs: valu_fuzz hardware oracle (f16 and mem), GFX10/GFX11 form table, results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:14:38 +01:00
7adce0dcbf fix(shader): use instruction identity selectors for MTBUF loads
Native RDNA2 ignores descriptor selectors for MTBUF and supplies zero for absent components. Preserve runtime descriptor swizzles for MUBUF and cover both paths with the same conflicting selectors.
2026-11-22 11:13:51 +01:00
eb8898d342 Merge origin/main: one PS interpolation modes row, read-method semantics
main hand-merged both PRs' rows (1246 twice, then 1256), leaving kotorvr's
bits-0-1-are-the-mode row beside ours and a duplicated Pixel-shader
interpolants row. Resolution keeps one interpolants row and one SHADER-181
row stating the measured truth: FSSM flags bits 0-1 are the read method
(55,791-record validation, 0 contradictions), the mode is PSV0's
(tools/ps_interp_modes.py), and the two disagree in 2,190 Constant-via-
p1/p2/f16 and 3,197 Linear-mov-only rows. The fssm_header section says the
same. #1301 (kotorvr) renames the accessors to read_methods and keeps the
translator side; kotorvr's code is untouched here.
2026-11-22 02:12:43 -08:00
6dcb298928 Merge remote-tracking branch 'origin/main' into hw-oracle-lds 2026-11-22 11:12:23 +01:00
d0ae89d817 Merge origin/main into m15-translated-draw-v2 (again)
main moved (c0ac5fd): vulkan_replay.h takes main's checked buffer copies (predicated copies, overlap and overflow
refusals). README's Xbox row is rebuilt from both sides (the previous merge commit had committed a zero-filled
README.md; this restores it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:11:09 +01:00
c9fd097b34 Translator: v_frexp_mant_f32, v_frexp_exp_i32_f32, v_ldexp_f32 (SHADER-89) 2026-11-22 10:10:43 +00:00
62593f47ca Runtime: Xbox-ABI proxies for the command queue and the fence (BUILD-231)
Device slots 8 (CreateCommandQueue), 75 (CreateCommandQueue1), 36
(CreateFence) and 32 (OpenSharedHandle of a fence) now return queue and
fence proxies. They forward the public chain in PC order (19 queue slots,
11 or 12 fence slots), refuse and log a slot past it up to the end of the
proxy's table, and name a read past the table through a guard region and
a vectored handler.

Heap, queue and fence proxies are unwrapped wherever a device or queue
method hands them to the real runtime: queue Signal/Wait, device slots
31/34/35/45/46/50. Arrays are copied without exceptions. QueryInterface
answers only the modelled interfaces, and logs one the real object has
but the proxy does not model. Outputs are cleared on failure as for
slots 14/62/76. --trace-d3d12 records proxy calls in the README grammar.
Every function a thunk hands its words to keeps them in the same
positions, because a title passes only as many as the method takes.

Tests: queue_proxy_test (host WARP, host hardware, Vulkan device;
differential per-process error cases, guard faults, identity, threads,
raw-slot client, child-runner self-test), xs_proxy_mock_test (older
devices, fences without Fence1, OpenSharedHandle branches, allocation
failures; three guard-setup fault modes), and device_proxy_test through
the D3D12XboxCreateDevice shim. No game files.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:08:53 +01:00
22d26c949d Merge origin/main into m15-translated-draw-v2
Conflicts (both sides kept): runtime/CMakeLists.txt (stub list), d3d12_com.h, d3d12_vulkan_device.cpp (arena buffers
with main's ray-tracing buffers and deferred destruction, calibrated timestamps, instance extensions, sampler
registration next to the window presenter), command_list.h, vulkan_backend.h, vulkan_replay.h, vk_test_device.h,
d3d12_state_map_test.cpp, docs and README. vulkan_present.h takes main's resource and tracker locks.

CI (linux-gpu-tests): ps_m15 and vs_m15 belong to d3d12_translated_draw_test. run_gpu_tests.py still assembles and
translates them but reports them as skipped (OTHER_HARNESS) instead of "no checker defined".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:08:08 +01:00