Commit Graph

4696 Commits

Author SHA1 Message Date
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
525441cb30 Merge pull request #1677 from Flyander 2026-11-22 08:38:20 -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
3ed19122f1 Merge pull request #1654 from Codex 2026-11-22 08:38:15 -05:00
4296f3d22a Merge pull request #1624 from Flyander 2026-11-22 08:38:10 -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
73311ed04d d3d12: retire queue tickets only after successful idle 2026-11-22 16:22:18 +03:00
477fc71af5 vk_test_device.h: guard swapchain maintenance1 features with macro check (#1688) 2026-11-22 14:21:08 +01:00
32a6f0340d D3D-162: reject footprint conversions before preparation 2026-11-22 14:21:03 +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
e633201e49 D3D-97: fail queue wait test safely on timeout
End a timed-out cross-queue test before the fence dispatcher can touch a closed event or queue teardown can wait forever. Add a deliberately unsignaled fence control so CTest covers the failure path. AI-assisted (Codex).
2026-11-22 16:15:06 +03:00
07b5dabec3 Runtime: serialize QueryReplay plan/commit with remove_query_pool and keep pending waits on failed submit 2026-11-22 16:14:35 +03:00
cfcc1de491 GPU runners: ps_ij_computed SKIPs, not FAILs, without PerVertexKHR inputs
Follow-up to #1545 (SHADER-177). Under --bary-fallback and --f16-interp-fallback the translator refuses a
computed I/J pair, so ps_ij_computed has no .spv, and both runners reported "missing .spv" instead of SKIP:
9018411c's bary skip in run_gpu_tests sits inside the PIXEL_VERTEX branch (ps_ij_computed is not in it) and
after the missing-.spv check, check.py's skip came after its .spv check too, and neither knew the f16
fallback, which run_gpu_tests turns on by default where PerVertexKHR doesn't compile (MoltenVK). Both runners
now skip it first, under either fallback; a missing .spv without a fallback is still a failure.
tests/test_run_gpu_tests.py covers both runners.

Co-authored-by: crastinator <qvaras@proton.me>
2026-11-22 05:11:19 -08:00
e7c92dde62 Runtime: the translated-shader test steps build under the Visual Studio generator
The M1.5/M2/M3 custom commands passed "PATH=<spirv-tools>;$ENV{PATH}" through cmake -E env.
The Visual Studio generator splits it at the semicolons, and a PATH entry ending in a
backslash escapes the next quote on the generated command line, so the step stops with
"no such file or directory" and MSB8066; Ninja happened to keep it whole. The commands now
set only LEONIDA_SPIRV_TOOLS, and runtime/test/shaders/build.py puts that folder in front of
PATH itself. Reported by @whattheflop in #907.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:10:27 +01:00
0ecfd1369c CTest: skip indirect-zero test without Vulkan 2026-11-22 14:09:43 +01:00
1b1d090e3c Merge pull request #1667 from romainveurrier 2026-11-22 08:08:38 -05:00
806ca614e3 Merge pull request #1665 from Vonsek 2026-11-22 08:08:36 -05:00
54575594ab Merge pull request #1661 from omardev29 2026-11-22 08:08:35 -05:00
f5d31f02ae Merge pull request #1660 from Vonsek 2026-11-22 08:08:34 -05:00
ab8f759e44 Merge pull request #1658 from totonii 2026-11-22 08:08:33 -05:00
2c075b19ef Merge pull request #1654 from Codex 2026-11-22 08:08:29 -05:00
0c7dd3bd66 Merge pull request #1650 from Vonsek 2026-11-22 08:08:28 -05:00
1676a01a80 Merge pull request #1641 from Vonsek 2026-11-22 08:08:22 -05:00
bf3fb1efa6 Merge pull request #1631 from bobcatchris 2026-11-22 08:08:16 -05:00
53961b7a95 Merge pull request #1624 from Flyander 2026-11-22 08:08:14 -05:00