Commit Graph

4696 Commits

Author SHA1 Message Date
84df39f34f Merge pull request #2453 from Flyander 2026-11-22 13:15:26 -05:00
a264ad778d Merge pull request #2447 from Codex 2026-11-22 13:15:22 -05:00
821cc1dc23 Merge pull request #2445 from Hadagalberto Junior 2026-11-22 13:15:22 -05:00
b715e6ac2e Merge pull request #2438 from MeNoSkills 2026-11-22 13:15:19 -05:00
b10e6ef5fa Merge pull request #2436 from Codex 2026-11-22 13:15:18 -05:00
0dff1b420b Merge pull request #2416 from Ewann 2026-11-22 13:15:09 -05:00
45e4a2e370 Merge pull request #2404 from S1m0ne1997 2026-11-22 13:15:04 -05:00
09cf8b65e3 rdna2spirv: s_memtime / s_memrealtime via OpReadClockKHR, enable VK_KHR_shader_clock 2026-11-22 19:14:59 +01:00
151c372ee1 Merge pull request #2395 from Matheus Gomes 2026-11-22 13:14:40 -05:00
78688eab40 Merge pull request #2389 from Julio Facal
# Conflicts:
#	docs/design.md
2026-11-22 13:14:35 -05:00
b01caaf086 Merge pull request #2386 from pietr 2026-11-22 13:14:30 -05:00
6579038528 Merge pull request #2383 from Sc4ros 2026-11-22 13:14:28 -05:00
e41720bac9 Merge pull request #2373 from Ewann 2026-11-22 13:14:21 -05:00
5864f1875c Merge pull request #2372 from Dominik 2026-11-22 13:14:20 -05:00
900473fcce Merge pull request #2343 from edupode 2026-11-22 13:14:02 -05:00
c5ab4bba97 Merge pull request #2327 from Dominik 2026-11-22 13:13:54 -05:00
d30267d4ed Merge pull request #2313 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 13:13:48 -05:00
c7894a6fb7 Merge pull request #2242 from Ewann 2026-11-22 13:13:28 -05:00
980807bc25 resource_tiling: the test's file header and the layout counts match the AMD rule (review of #2728)
The test file header still called the packed-tile count this layer's own
tight rule; it now says the split and the packed count follow AMD's PC
runtime, with AMD's values in the AmdCase table. resource_tiling.h names
the 47 layouts of #868 for the split and those 47 plus 32 deeper volumes
for the packed count.

AI-assisted (Claude Code).
2026-11-22 13:13:25 -05:00
99e5a1da3c Merge pull request #2203 from Dominik 2026-11-22 13:13:18 -05:00
4888fbb56d Merge pull request #2199 from edupode 2026-11-22 13:13:14 -05:00
919717d178 Merge pull request #2189 from towade 2026-11-22 13:13:13 -05:00
fbd598c2d0 Merge pull request #2187 from Vonsek 2026-11-22 13:13:12 -05:00
c457e0a7bd Merge pull request #2116 from swam122yam-glitch 2026-11-22 13:13:03 -05:00
7f29bae81e Merge pull request #2111 from Thatters 2026-11-22 13:13:03 -05:00
c68a35bcb4 Merge pull request #2109 from TheHoracio 2026-11-22 13:13:02 -05:00
45a5aec292 Merge pull request #2100 from Koro4e 2026-11-22 13:13:01 -05:00
4d64f9a68f Merge pull request #2069 from AlxcBTW 2026-11-22 13:12:59 -05:00
407a53923e Merge pull request #2048 from whoalin1
# Conflicts:
#	docs/testing.md
2026-11-22 13:12:54 -05:00
0a46434246 Merge pull request #1985 from Dominik 2026-11-22 13:12:46 -05:00
db317bd3ee Merge pull request #1947 from Jolymmiles 2026-11-22 13:12:44 -05:00
ec3d4384df Merge pull request #1818 from SHAURYASANYAL3 2026-11-22 13:12:35 -05:00
c8f8c00e34 Merge pull request #1798 from SHAURYASANYAL3 2026-11-22 13:12:34 -05:00
6cfe5862ed Merge pull request #860 from adonizm 2026-11-22 13:12:29 -05:00
51d954a2cd Merge pull request #436 from S1m0ne1997 2026-11-22 13:12:27 -05:00
60cc47cb79 Merge pull request #306 from IAmNotSiob 2026-11-22 13:12:26 -05:00
2ec3141844 Build the TLS host with the Windows BVH builder test 2026-11-22 19:12:18 +01:00
e8602fdfae runtime: address shader-cache session review feedback (D3D-34 follow-up)
Follow-up on merged 2d848a33 (#2167) addressing @Flyander's 7 review items:
1. Enforce version mismatch on live sessions (DXGI_ERROR_ALREADY_EXISTS) and clear+recreate on reopen after all sessions close.
2. Discard MODE_MEMORY stores on final release (in-memory sessions do not persist across full teardown).
3. Return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE on FindValue/StoreValue while ShaderCacheControl DISABLE is active.
4. Make ShaderCacheControl CLEAR remove inactive default-directory disk cache files left by prior runs.
5. Bound disk-file deserialization against actual file_size and max_file_bytes before allocating or reading.
6. Apply documented zero-limit defaults (1 KiB value, 128 entries, 128 MiB file) and return DXGI_ERROR_CACHE_FULL when limits are exceeded.
7. Use unique per-writer temp filenames (<pid>.<tid>.<seq>.tmp) for atomic disk flushes.

Verified on Windows 11 + NVIDIA GeForce RTX 3060 (621.24, Vulkan 1.4.357, LEONIDA_VK_VALIDATION=1): d3d12_shader_cache_test passed (0 validation errors).
2026-11-22 19:11:35 +01:00
310b2eb6d0 resource_tiling_test: drop four volume rows #868 already had (review of #2728)
8x8x64 R8, 16x16x16 RGBA8, 16x16x17 RGBA8 and 8x8x8 RGBA32F were in the
table twice with the same expectations. The deep-volume set is 32 new
layouts, 79 distinct in all; the header comment and docs/d3d12_vulkan.md
section 4.2 now say so.

AI-assisted (Claude Code).
2026-11-22 13:11:26 -05:00
c43bc3df9d d3d12: CheckFeatureSupport refuses undefined root signature versions
The layer clamped every HighestVersion above 1.1 to 1.1 and returned S_OK.
The host only does that for versions it defines: on an RTX 4070 Laptop
(621.24) and WARP, anything above 1.2 is E_INVALIDARG with the value left
unchanged. Keep the clamp for 1.2 and refuse the rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:10:23 -03:00
7762899b33 Runtime: hold a CPU fence signal until the queue signals before it have completed
ID3D12Fence::Signal from the CPU called vkSignalSemaphore at once, also while a queue Signal of a lower value
was still pending on the GPU. Vulkan requires a host signal to stay below every pending signal
(VUID-VkSemaphoreSignalInfo-value-03259), and D3D12 allows the order. The fence now records the highest value a
queue will signal, under the same lock as the claim, and a CPU signal above a value the GPU has not reached yet
(or made while an earlier one is held) is handed to the fence dispatcher, which applies it once the GPU passes
that value, in the order the signals were made. The callback holds no pointer to the fence; when the fence is
released (cancel) or the device is lost before the queue value is reached, the held signal is dropped, since
signalling then would break the same rule. Until a held signal is applied, GetCompletedValue reads the GPU's
progress.

d3d12_fence_timing_test: a queue Signal kept pending by a Wait on a gate fence, a CPU Signal above it (held, then
applied), and two CPU signals held behind one queue signal (applied in order). Fails on main's Fence at the first
check: the event for the CPU value fired while the queue signal was still pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:09:56 -05:00
8d43271bcd Merge upstream main into codex/d3d12-compute-trace
Trace at the Dispatch entry point while preserving the newly merged bundle replay path.
2026-11-22 19:09:24 +01:00
ad88c19e97 xdxr_build: radix scan writes offsets apart from the counts, correct on MoltenVK 1.4.2
The scan read each digit count and stored its prefix sum over it. MoltenVK 1.4.2's SPIRV-Cross
(6c09849f; MoltenVK main pins aa217aeb, also affected) moves a load through a pointer bitcast
from a uvec2 past a later store to the same address, so the MSL read back the sum it had just
written. The radix path (more than 1,024 elements) then lost and duplicated elements:
blas_three_sort_tiles and blas_refit_in_place failed xdxr_build_check in 10 runs out of 10.
SPIRV-Cross 38abe362 fixes it upstream.

The prefix sums now go to their own scratch array (XdxrLayout::scratch grows by 64 bytes per
tile), so no invocation stores to a word whose loaded value it still uses. xdxr_build.inc
regenerated with glslc (shaderc 2026.4) --target-env=vulkan1.2 -O -mfmt=c.

Tested on an Apple M3 Max, macOS 27.3: xdxr_build_check passes 10 runs out of 10 on Homebrew
MoltenVK 1.4.2 (0/10 before), MoltenVK 5189f8de with SPIRV-Cross 57e4efcc, KosmicKrisp and
llvmpipe. The full native ctest passes 36/36 on each driver, with the same two skips as before.
AI-assisted.
2026-11-22 22:09:22 +04:00
21f2585a48 Merge remote-tracking branch 'origin/main' into bindless-per-queue-retire
# Conflicts:
#	runtime/test/d3d12_descriptor_test.cpp
2026-11-22 19:08:58 +01:00
0327c9d27a Resolve host module GetProcAddress names through runtime shims
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 18:08:14 +00:00
e8a23c1afc Retire bindless table generations by timeline instead of waiting for the device (D3D-314)
A flush that grows the table or changes live keys now makes a new generation (table buffers, descriptor set, descriptors rewritten from a CPU shadow) that replay binds, and frees the old one once every submission up to its ticket has completed. No vkDeviceWaitIdle. Adds d3d12_bindless_churn_test and the LEONIDA_BINDLESS_IDLE_WAIT=1 comparison knob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:05:06 +01:00
c226964ea0 d3d12: WriteToSubresource/ReadFromSubresource answer as the host runtime does
d3d12_subresource_copy_test runs the same 117 steps on the Vulkan-backed device
and on the host runtime: textures in write-back and write-combine custom heaps,
a volume, an array, BC1 blocks, a buffer, an upload-heap buffer, a default-heap
texture and a multisampled one; whole and boxed copies, boxes outside, empty,
inverted or cutting a block, subresources past the last, pitches too small or
0, and copies before Map. It records every HRESULT and a hash of the whole
destination of every read, once per copy path (host image copy and staging).
On main 17 steps differed (RTX 3060, driver 610.88); now none do. The host's
rules:

- a box is refused only when its right, bottom or back edge lies past the
  mip's, or it cuts a compressed block; an empty or inverted box that passes
  those checks is S_OK and copies nothing (the layer refused it);
- the row and depth pitches are not checked: rows or slices that overlap are
  copied in order (the layer refused a pitch smaller than a row or slice).

Not compared, and reported as such: null data (the host faults; the layer
still answers E_INVALIDARG), which bytes win when a read's rows overlap (the
driver's copy order, tiled on NVIDIA), and a default-heap texture, which the
host refuses and the layer copies on purpose, as docs/d3d12_vulkan.md says.

d3d12_vulkan_device_test's cpu_copies expected the old refusals for an empty
box and overlapping slices, and now expects S_OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:04:31 +01:00
90c4ea6701 test: GPU fixtures for sub-dword MUBUF loads and GFX10_FORMAT_8_UINT (TEST-510)
The docs/design.md "Sub-dword MUBUF loads and GFX10_FORMAT_8_UINT" row was
CPU-checked only. Two single-thread compute fixtures in run_gpu_tests.py's
dump list now run the translated loads through Vulkan:

cs_buf_load_sub: buffer_load_ubyte/sbyte/ushort/sshort zero- and
sign-extended, the dword-crossing ushort at offset 3, and the RAW end check
by element size (a ubyte at 8 and a ushort at 7 of 8 bytes read 0; a
start-only check would read 0xeefe from the 0xee filler).

cs_buf_fmt8: tbuffer_load_format_x format:[BUF_FMT_8_UINT] at offsets 0..3,
one byte past the end, an INVALID V# format (0), and buffer_load_format_xyzw
with V# format 8_UINT and DST_SEL (X, 0, 1, 1), whose w is integer 1.

Both pass on an RTX 3070 Ti (driver 610.88); the expected words follow the
CPU test's byte table and rules. The row now says so; AMD hardware is still
unmeasured.
2026-11-22 12:02:47 -06:00
585143544e Reject out-of-image entry points before loader initialization
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 18:00:33 +00:00
6e9eb1282e fix(tests): reject NaN in sampler mip readback
An unordered NaN never exceeded the absolute error limit, so a corrupt GPU result could pass. Require each readback channel to be within the existing tolerance.
2026-11-22 18:59:59 +01:00