Commit Graph

4163 Commits

Author SHA1 Message Date
f3a4450592 vk_pipeline_check: reject malformed option values (TEST-250) 2026-11-22 16:43:50 +03:00
fa687fda48 d3d12_vulkan_device_test: sampler heap size and realtime priority gates 2026-11-22 14:43:26 +01:00
52c3a88947 GPU test: image atomics in a pixel shader (ps_imgatomic)
1,018 of the corpus's 1,038 image-atomic shaders are pixel shaders, but every GPU test of image atomics ran in a
compute shader (found by @aslan2142). ps_imgatomic does the corpus's forms in a pixel shader: image_atomic_umax,
umin and or on three 8x8 2D r32ui images (64 pixels contend for each texel) and umax on a 4x4x4 3D image, each
found through its own T# in the descriptor table and the set-0 r32ui storage arrays. Odd pixels are discarded
after their atomics, which must still count.

vk_bindless_test runs it when given ps_imgatomic.spv: it enables fragmentStoresAndAtomics (exit 77 without it),
clears the images (umin to all ones), draws, and checks all 256 texels against a model of the 4096 pixels and the
render target's discarded columns. run_gpu_tests.py and check.py run it next to ps_tex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:42:22 +00:00
1eeaa202f9 d3d12_vulkan_device_test: invalid-argument cases a Windows 10 host predates 2026-11-22 14:41:44 +01:00
3f26a95a10 fix(file_system): check is_regular_file for deletion markers so nested deletes do not hide parent directories 2026-11-22 10:41:32 -03:00
fa2712e2b0 xdxr_build: one-workgroup sort for small builds, 256-element radix tiles
The radix sort's fixed latency dominated small builds (2,000 triangles: 0.81
ms with the sort, 0.08 ms without, on an RTX 2050; the 10k regression
@exhawk measured on #1572). Up to 1,024 keys are now sorted in one
workgroup's shared memory (bitonic, ties by element index: the stable
order; 8 KiB, within the 16 KiB minimum with the radix arrays), and the
radix tiles are 256 elements (4 chunks instead of 32 per workgroup).

RTX 2050: 1,000 triangles 0.24 ms, 2,000 0.28 ms (0.83), 10,000 0.38 ms
(0.81), 100,000 2.3 ms (2.5); 1M 21.9 ms (20.3, the larger scan).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:41:25 +01:00
5c6ff05950 feat(runtime): implement ID3D12Device::CreateConstantBufferView (GFX10 V#)
Write a 16-byte GFX10 raw buffer V# descriptor (48-bit BufferLocation, stride 0,
num_records = SizeInBytes, GFX10_FORMAT_32_UINT, OobSelect::raw) into the
32-byte CBV_SRV_UAV descriptor slot, zeroing the trailing 16 bytes (or the full
slot for a null description, zero BufferLocation, or zero SizeInBytes).

Verified on Windows 11 with RTX 5080 and Radeon Graphics in d3d12_compute_test:
64/64 dwords matched for CBV A, 32 in-bounds + 32 OOB-zero matched at +128, and
negative controls flipped 64/64 dwords for CBV B and null CBV.

AI Assisted.
2026-11-22 14:41:17 +01:00
40107eb878 Merge pull request #1724 from Vonsek 2026-11-22 08:38:47 -05:00
985a0ee4dc Merge pull request #1719 from waltingford 2026-11-22 08:38:45 -05:00
4e0abc668c Merge pull request #1713 from totonii 2026-11-22 08:38:40 -05:00
acc50aafd0 Merge pull request #1710 from Dominik 2026-11-22 08:38:38 -05:00
089c124df3 Merge pull request #1704 from Jack UK 2026-11-22 08:38:35 -05:00
12952f7e92 Merge pull request #1702 from Sagah123 2026-11-22 08:38:34 -05:00
10cf6ffca6 Merge pull request #1699 from AimLogin
# Conflicts:
#	docs/testing.md
2026-11-22 08:38:33 -05:00
464cff7336 Merge pull request #1698 from Jan Trencansky 2026-11-22 08:38:32 -05:00
aa5ff92859 Merge pull request #1696 from SHAURYASANYAL3 2026-11-22 08:38:31 -05:00
6bce2fe30f Merge pull request #1691 from totonii 2026-11-22 08:38:29 -05:00
cd4ac9c785 Merge pull request #1689 from Codex 2026-11-22 08:38:27 -05:00
3f2dc6dd17 Merge pull request #1687 from Vonsek 2026-11-22 08:38:26 -05:00
1352cffcda Merge pull request #1684 from Emirhan Karaca 2026-11-22 08:38:23 -05:00
5f76cc2b27 Merge pull request #1680 from abilliontokens 2026-11-22 08:38:21 -05:00
73525b1b03 Merge pull request #1679 from AlxcBTW 2026-11-22 08:38:21 -05:00
e2af5b7df7 Merge pull request #1674 from Serrambi 2026-11-22 08:38:19 -05:00
a9c0d3bfb9 Merge pull request #1659 from Anira
# Conflicts:
#	docs/design.md
2026-11-22 08:38:17 -05:00
bdac6330ee Merge pull request #1591 from Vonsek 2026-11-22 08:38:07 -05:00
42512eec28 Merge pull request #1549 from tylerstraub 2026-11-22 08:38:03 -05:00
bb0ecfc089 Merge pull request #906 from AlxcBTW 2026-11-22 08:37:59 -05:00
aee81b80ef Merge pull request #759 from Douglas Sposito 2026-11-22 08:37:59 -05:00
b7201d7147 Merge pull request #616 from SirAmong
# Conflicts:
#	docs/design.md
2026-11-22 08:37:58 -05:00
89a080b20d test(runtime): index an unbounded SRV table in the M2 shader 2026-11-22 14:37:21 +01:00
8c0738cf44 fix(runtime): include graphics draws in the D3D12 trace
The first draw can currently be invisible in a boot trace. Record both public draw entry points even before the command list has a graphics pipeline.
2026-11-22 14:36:11 +01:00
83160a8114 d3d12: handle 4x MSAA and invalid MSAA in tiled allocation queries (D3D-191) 2026-11-22 14:36:05 +01:00
64d41a89a6 Translator: v_sin/v_cos reduce with x - RoundEven(x), contract row and GPU test (SHADER-88 follow-up to #1283)
#1283 reduced the angle in turns with Fract. For a negative argument Fract is
1 - |x|, which rounds in binary32: sin(-2**-26 turns) became +0 and the
absolute error was up to ~1.7e-7 at -0.1 turns. x - RoundEven(x) is exact in
binary32 for every finite x and keeps the angle in [-pi, pi]. The change is
inside turn_angle (shared by the f32 and f16 forms), with the variable names
of the line that test_mutations.py anchors on kept.

- tests/semantic/test_alu_sincos.py: f32/f16 against sin/cos(2*pi*x) in
  double, tiny arguments (fails on main), whole turns of either sign (+0, as
  measured on an RX 6800 by shelbykb2), +-0, inf/NaN, modifiers.
- runtime/test/shaders/cs_w32_sincos.asm: wave32 GPU regression guard
  (tolerance 1e-3, the driver Sin is only good to 2^-11), registered in
  check.py and run_gpu_tests.py.
- docs/design.md: contract row with the RX 6800 measurement and what is not
  matched (half/quarter turns, the small-x constant, inf/NaN words).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 08:34:03 -05:00
1f71839aa3 runtime: fallback and clamp swapchain extent when surface reports undefined extent (D3D-165) 2026-11-22 18:59:51 +05:30
f90a9ead2c fix(library_loader): make pseudo-handle state immortal across teardown and reject null proc names 2026-11-22 10:29:25 -03:00
a80614d7de queue_proxy_test: run the differential children side by side (TEST-242)
Each differential case starts two child processes (real object, proxy), and
each child pays its own device start-up: ~5 s on an AMD RDNA2 iGPU, 97 s per
ctest run. The children now run differential_jobs() at a time (half the
logical processors, 1..8; LEONIDA_QUEUE_PROXY_JOBS overrides, 1 = serial)
and are judged afterwards in case order, so the report is unchanged.

Starting children from several threads needs the pipe's write end to be
inheritable only for its own CreateProcessW: both ends are now created
uninheritable and the write end is made inheritable under a start lock, so
a sibling started meanwhile can't inherit it and hold the pipe open.

RX 9070 (WARP + hardware + Vulkan backends): 44 s -> 20 s, same output;
5 runs at 16 jobs clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:28:40 +00:00
354e129c20 Merge main into test/valu-int-misc (#1492)
Conflicts: runtime/test/shaders/check.py, scripts/run_gpu_tests.py, tests/semantic/regen_fixtures.py, tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 14:26:58 +01:00
c608a65679 GameInput: motion support via SDL sensors (#660 follow-up)
Expose SDL3's gyroscope and accelerometer through the GameInput shim:

- gameinput_abi.h: GameInputMotionAccuracy, GameInputMotionInfo and
  GameInputMotionState with the v0 layouts (Microsoft's public docs),
  size asserts included.
- The shim enables both sensors when a pad with them is opened, reads
  the latest sample each poll, and reports GameInputKindMotion plus a
  GameInputMotionInfo on such pads. GetMotionState returns the state as
  signed fractions of the motionInfo maxima (2 g accel, 2000 deg/s
  gyro, the shim's choice since SDL exposes no sensor range; VERIFY).
  All-zero accel means no sample yet, so readings before the device's
  first sample carry no motion. Magnetic field and orientation stay
  zero and Unknown: SDL has no compass and nothing synthesises a
  quaternion. Pads with sensors stream a reading every ~8 ms so motion
  is not stuck at the last button event; other pads keep the old
  change-driven behaviour.
- GetCurrentReading and GetNextReading with a device filter now reject
  kinds the device does not support (READING_NOT_FOUND), matching the
  v0 docs and the device-less path, so a motion query on a plain pad
  fails instead of returning a reading without motion.
- gameinput_test: a virtual pad with SDL sensors covers kind/motionInfo
  presence, no-motion-before-first-sample, normalisation, accuracy
  values, the +-1 clamp, the cadence, and the plain-pad rejection.
  gameinput_probe prints the live accel and gyro fractions.
- docs/gameinput.md: a Motion section, the API table, and VERIFY notes
  for the chosen maxima and the unprovided members.

Tested: gameinput_test 185/185 and ctest 90/90 (RelWithDebInfo) on
Windows 11 Pro 10.0.26200; SDL3 3.4.20 via -DLEONIDA_SDL3_FETCH=ON.
Follows: #660. AI-assisted (ZCode agent).
2026-11-22 14:26:06 +01:00
23a014bb06 dxgi: match frame statistics error notifications (D3D-211) 2026-11-22 08:25:54 -05:00
79cd04d231 Merge upstream/main and enforce SampleDesc.Count > 0 and per-format MSAA limits
Addresses review feedback on #1591:
- Reject SampleDesc.Count == 0 (and > D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT) with E_INVALIDARG instead of defaulting 0 to 1x.
- Intersect per-format sampleCounts via vkGetPhysicalDeviceImageFormatProperties for each configured color and depth/stencil attachment format, returning E_INVALIDARG when unsupported.
- Add negative PSO creation tests for SampleDesc {0,0}, {3,0}, {64,0}, {4,1}, {1,1}, and unsupported {32,0}.

AI Assisted.
2026-11-22 14:25:43 +01:00
a5a1eb231e Tests: prove Vulkan synchronization validation is active (TEST-198)
vk_sync_validation_selftest records two vkCmdCopyBuffer into the same
bytes on vk_test_device.h's device. With LEONIDA_VK_VALIDATION=1 the
write-after-write hazard must be reported, and the same copies with a
transfer -> transfer barrier must not be. Without validation, or without
a Vulkan device, it exits 77 (ctest skip).

Synchronization validation can be off although the tests ask for it,
for example with VK_KHRONOS_VALIDATION_VALIDATE_SYNC=false, and every
other GPU test then reports 0 validation errors without having been
checked. This test fails in that case, and with the Khronos layer
missing. docs/testing.md gets a row in its known problems.

No runtime code changes, no game files. AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:24:16 +01:00
1062df5154 Shader: accept abs on v_pack_b32_f16 (a sign clear of the packed half)
Follow-up to #1570, which took the `neg` half of SHADER-260 and left `abs`
refused. `abs` is the ISA's absolute value of the operand: a clear of the
sign bit, on the 16-bit half the operand contributes and applied before
`neg` (which #1570 emits as a bit 15 flip). The instruction already moved
each half unchanged, so the translator emitted nothing for `abs` and threw
`Unsupported("v_pack_b32_f16 abs modifier")` for any shader that used it.

Emit the clear instead: OpBitwiseAnd 0x7FFF on the selected half, before
the `neg` xor. No hardware run of this instruction with `abs` exists, so
the docs row says the rule is ISA-derived and unmeasured rather than
quoting a measurement.

Tests: exact-bit CPU cases in tests/semantic/test_pack_b32_f16_mods.py and
tests/test_values.py (both halves, op_sel, an sNaN payload, neg+abs order),
the interpreter-run GPU fixture ps_f16_pack_mods with its words derived
from the rule, and the row in docs/design.md.

SHADER-260, Depends on: #1570
2026-11-22 15:23:17 +02:00
477fc71af5 vk_test_device.h: guard swapchain maintenance1 features with macro check (#1688) 2026-11-22 14:21:08 +01:00
5a8c52e009 Merge main into test/coverage-gaps (#1299)
Conflicts: runtime/test/shaders/check.py, scripts/run_gpu_tests.py, tests/semantic/regen_fixtures.py, tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 14:19:45 +01:00
Ryx
c8ea00e4db Runtime: pause the active occlusion query around a resolve (D3D-189)
The Radeon 8060S on AMD's Windows driver times out (TDR) on the crossing
pattern of vk_overlapping_occlusion: a resolve recorded while an ordinary
occlusion query is active, so vkCmdCopyQueryPoolResults with WAIT_BIT and the
summing dispatch run while a query of the same pool is active (#1540, found
with --bisect). Validation reports nothing before the hang.

A resolve while a physical segment is active now ends that segment before the
resolve and begins the next one after it; the logical query's range spans one
more segment, so results are unchanged. A list that resolves inside a single
active query takes the segment path too when the device can sum.

The test adds a resolve inside one active query (default run and the new
"active" bisect phase), gives the crossing schedule the extra segment end, and
--bisect now detects a lost device by the queue timeline reading UINT64_MAX,
since vkQueueWaitIdle succeeds after the reset on that driver.
2026-11-22 14:19:43 +01:00
44288b3033 Merge remote-tracking branch 'origin/main' into w-pso4
# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
#	runtime/test/shaders/check.py
#	runtime/test/vk_test_device.h
#	scripts/run_gpu_tests.py
2026-11-22 14:19:31 +01:00
705a40bda9 Tests: a compute dispatch that samples through set 0 (d3d12_set0_compute_test)
Since #1489 the layer binds the device's bindless set at every dispatch as well as at every draw, but only the
draw has a test (d3d12_m2_textured_test): d3d12_compute_test takes the binding-free index entry on purpose, and
d3d12_descriptor_test samples through set 0 with a Vulkan pipeline of its own.

This test covers the compute bind point through D3D12 alone: a compute PSO whose index entry lists set-0
bindings, two SRVs, bytes no view was made for, and a wrapping and a clamping sampler. Four dispatches of
test/glsl/cs_set0_sample.comp (GLSL written to the translator's contract) load the T# and the S# from the
descriptor tables, find them in the hash table and sample: the two textures texel for texel, the fallback image
for the unknown bytes, and the right edge with the clamping sampler. A device without the bindless set refuses
the PSO. Registered with ctest like its neighbours (exit 77 is a skip).

With the vkCmdBindDescriptorSets call of the compute bind point removed from replay, this test fails
(VUID-vkCmdDispatch-None-08600, on llvmpipe).

Checked with a mingw-w64 build under Wine on llvmpipe, an RDNA2 integrated GPU and an RX 7900 XTX (RADV), with
the validation layer: exact, no validation errors. Not built with MSVC.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 08:19:04 -05:00
34a760fc73 fix(vulkan): check vkGetSemaphoreCounterValue VkResult in ScratchBuffers and Depth24Converter collect() 2026-11-22 10:18:43 -03:00
1955e1b958 Merge remote-tracking branch 'origin/main' into r436
# Conflicts:
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
#	tools/rdna2spirv.py
2026-11-22 14:16:49 +01:00
b481782d16 test(runtime): check native unbounded SRV root tables 2026-11-22 14:15:15 +01:00