4696 Commits

Author SHA1 Message Date
4058dc8970 tests: include gfx1013 encodings in cs_w64x_partial_swizzle disasm fixture 2026-12-01 16:54:10 -06:00
c4ca576150 Merge pull request #2910 from c0pperlane/doc-d3d12-vulkan-stale-status
docs/d3d12_vulkan.md: drop stale "not implemented" status for buffer SRVs, streams, mesh PSOs and WriteBufferImmediate (DOC-D3D12-VULKAN-STALE-STATUS)
2026-12-01 22:45:03 +01:00
4a305d0666 d3d12/vulkan: bind/map staging before binding VRAM buffer & document LEONIDA_EXTERNAL_WINDOWS_MB 2026-12-01 17:04:33 +02:00
8ebe7cc2e8 d3d12/vulkan + make_game: ReBAR DMA readback, budgeted staged slabs, test fixes & CLI wiring 2026-12-01 16:40:36 +02:00
9d41505a44 d3d12/vulkan: staged VRAM arena, DMA readback batching, parallel shadows, stream-pool fix
On top of PR #2566 (8db8335d2), combines verified runtime performance and
correctness improvements for non-ReBAR Vulkan GPUs (tested on Linux / Wine /
RTX 3090 24 GB, BAR1 = 246 MiB, driver 590.48.01):

- Stage 4 GiB GPU address arena + overflow TitleBufferWindows slabs in
  DEVICE_LOCAL VRAM with HOST_VISIBLE staging mirrors (arena_staging.h,
  arena_staging_test.cpp).
- Fix startup glibc realloc() race by caching max_compute_shared_memory_size,
  sharing mutex-guarded VkPipelineLayouts, and eagerly loading pipeline_cache()
  during single-threaded Device construction.
- Stage 9a-1: batch retired arena + external window host readbacks into a
  single copy_buffers_sync() submission on the dedicated DMA copy queue
  (wb: 27.6 ms -> 2.35 ms/frame).
- Stage 9a-2: parallelize ShadowPages::refresh across 4 persistent threads
  via ShadowRefreshPool (shadows: 26.9 ms -> 10.2 ms/frame).
- Fix resolve_pool_memory() zeroing out root descriptors probed with
  kRootViewBytes (64 KiB) near the end of committed stream-pool blocks
  (stream pool unbacked: 131,072 -> 16-33, root view unbacked: 0).

AI-assisted. Verified with 151/151 portable Linux CTest passing and Windows
MSVC build + retail boots on RTX 3090 (590.48.01).
2026-12-01 16:37:00 +02:00
3fbc120df4 Merge pull request #1397 from whoalin1/mask-regs-data-read
rdna2spirv: a VALU data read of a lane-mask operand yields the wave's mask word
2026-12-01 12:53:35 +01:00
a726736ec2 Merge pull request #1774 from Tauwni/fix/explicit-lod-bias-moltenvk
rdna2spirv: --explicit-lod-bias applies the S# LOD bias where MoltenVK drops the sampler's; ps_ssharp passes on Macs (SHADER-EXPLICIT-LOD-BIAS-MVK)
2026-12-01 12:45:24 +01:00
beefb8927a Merge pull request #1880 from thiefyzheng/fix/texel-copy-fixedwidth
xg_xs copy_elements: dispatch fixed element widths 1/2/4/8/16 to a compile-time-sized copy loop (RT-TEXEL-COPY-FIXEDWIDTH)
2026-12-01 12:11:20 +01:00
47fa73a566 runtime: make a missing return an error, not a warning (#2748)
* runtime: make a missing return on some paths an error

MSVC has two codes for a function that reaches its closing brace: C4716 whenthere is no return at all, already an error by default, and C4715 when somepaths return and others do not, which is a warning at the default warning level(measured: cl /EHsc alone reports it, /W4 is not needed). A change in this treedropped a return out; from a function with early returns, so it was C4715, andthe build stayed green. A full Release build of this commit reports none, sothe flag costs nothing today.

* runtime: keep /we4715 out of the assembler command

merzleckeier measured it on Windows Server 2025: add_compile_options
(/we4715) puts the switch on ml64's command line too, and MASM answers
'warning A4018: invalid command-line option : /we4715' - the same reason the
/utf-8 line above this one carries a COMPILE_LANGUAGE filter. Reproduced here:
unfiltered, one A4018 line from abi_probe.asm; filtered, none, and the C++
half still reports error C4715 when a return is removed.

---------

Co-authored-by: fiestorra <fiestorra@users.noreply.github.com>
2026-12-01 11:49:12 +01:00
4902100668 d3d12_queue_wait_timeout: the same 60 s budget as d3d12_queue_wait (#761)
The control runs create_vulkan_device_standalone before it waits its 20 ms, so its TIMEOUT covers the whole device bring-up, exactly like the positive test above it (TIMEOUT 60). Under a parallel ctest that bring-up can pass 10 s, and CTest then kills the process: WILL_FAIL inverts an exit code but not a ***Timeout, so the negative control failed for a reason it does not control.

OLD-2970 / TEST-586

Co-authored-by: whoalin1 <207920491+whoalin1@users.noreply.github.com>
Co-authored-by: Gemini 4 Neon <noreply@google.com>
2026-12-01 11:48:32 +01:00
1cd6eaf7c6 copy_elements: dispatch fixed element widths 1/2/4/8/16 to a compile-time-sized memcpy loop
copy_elements ran a runtime-sized std::memcpy per texel/block (the call is not
inlined), which dominates TitleImageUpload::write on runtime texture refresh.
The per-row element loop is now copy_tiled_row<Into, Width>, chosen by one
switch on format.bytes per row: 1/2/4/8/16 get a constant-size memcpy, every
other size takes the unchanged runtime-size loop. Addresses (row/column tables,
pitches, linear fast path) are untouched, so the bytes written are identical,
including for unaligned pointers and pitches and in both directions.

texel_copy_test compares copy_elements with the original loop over the whole
destination buffer: tiled and linear, mips and tails, arrays, volumes, widths
1/2/4/8/16 plus non-specialized 3/6/12, misaligned buffers and padded pitches.
2026-11-30 23:34:45 +00:00
b3cc377020 translator: s_mov copies of EXEC keep the narrowing's tag through SGPR round-trips
Review follow-up on the mask-word gather gate (#1397): `s_mov_b32 s4,
exec_lo` under an unknown EXEC narrowing recorded nothing for s4, so the
later `s_mov_b32 exec_lo, s4` restore minted a fresh ("n", id) tag in
_exec_src_ex. mask_exec_sigs coverage then failed and the read kept this
lane's 0 / ~0 bit, while the equivalent literal `s_mov_b32 exec_lo, -1`
resolved to a constant half-state and gathered — register and literal
restores of the same runtime value disagreed.

_mov_sgpr_vals now returns an ("al", halves) alias for an EXEC source
whose half-state is an unknown narrowing, the same scheme saveexec uses:
exec_lo gives (state, None), exec_hi (None, state), exec gives each half
in its own register for b64 moves. _exec_src_ex already resolves those
aliases, so the restore reproduces the original tag and the gather stays
exact; untracked SGPR sources still mint a fresh narrowing and stay
conservative.

Tests: two semantic cases (wave32 and wave64) assert the register
round-trip gathers OpGroupNonUniformBitwiseOr identically to the literal
-1 restore; cs_exec_copy.asm (+ fixture, check.py/run_gpu_tests.py dump
entries) stores the mask word, exec_lo's own word and the literal-restore
word side by side on real hardware — PASS on RTX 4070 and Radeon
(64-wide), wave64 exec filters 9/9 on AMD.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-30 22:22:44 +00:00
d99ba5c095 Merge main: drop the macos job as main does, keep this PR's runtime.yml path filters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 20:24:47 +01:00
99167bcaf3 Merge pull request #2737 from OreoFR/carry/pr-2062
reprend #2062: d3d12: say when the driver's pipeline cache stops keeping new pipelines (RT-PIPELINE-CACHE-GROWTH-STALL)
2026-11-30 18:38:24 +01:00
f0143cd5ff Merge pull request #2732 from OreoFR/carry/pr-2173
reprend #2173: d3d12_xs: say so when LEONIDA_D3D12=vulkan is asked of a runtime built without the Vulkan device (RT-VULKAN-REQUESTED-NOT-BUILT)
2026-11-30 18:37:45 +01:00
db9f497bb0 Merge pull request #2725 from OreoFR/carry/pr-279
reprend #279: d3d12: min/max samplers honour filterMinmaxImageComponentMapping (D3D…
2026-11-30 18:37:03 +01:00
ad25611b53 Merge pull request #2729 from OreoFR/carry/pr-220
reprend #220: d3d12: validate CreateShaderResourceView descriptors (reopens #5275)
2026-11-30 18:16:12 +01:00
e319e63250 Merge pull request #2758 from OreoFR/test/vk-gpu-profile-paravirtual-no-stamps
vk_gpu_profile_test: skip the per-pipeline checks, and say so, when a paravirtual GPU resolves no timestamp
2026-11-30 18:15:49 +01:00
efe695aa91 Merge pull request #2738 from OreoFR/carry/pr-2031
reprend #2031: runtime: harden submit_phases period parsing and skip Scope overhead when disabled
2026-11-30 18:15:34 +01:00
cee1cb1d31 Merge pull request #2735 from OreoFR/carry/pr-2016
reprend #2016: runtime: guard null and invalid sizes in value_write_sink and add unit tests (RT-VALUE-WRITE-SINK-GUARDS-AND-TESTS)
2026-11-30 18:15:17 +01:00
149e3835f3 Merge pull request #2716 from OreoFR/carry/pr-1050
reprend #1050: runtime: replay the console list's inline records as their vtable calls (BL-3)
2026-11-30 18:15:03 +01:00
7663c34fcf Merge pull request #2739 from OreoFR/carry/pr-2029
reprend #2029: runtime: guard overflow/div-by-zero and remove duplicate passes in d3d12_xs_alloc_size
2026-11-30 17:50:48 +01:00
c08ececaf1 Merge remote-tracking branch 'origin/main' into fix-2738 2026-11-30 17:29:58 +01:00
08e42a5160 Merge pull request #2691 from fiestorra/fix/paravirtual-exp2-skip
runner: skip the exact exp2 case on Apple's Paravirtual device (re-opened #2641, closed by an accidental push)
2026-11-30 17:28:44 +01:00
80355d34a8 Merge pull request #2733 from OreoFR/carry/pr-2085
reprend #2085: d3d12: one guarded copy per run of adjacent written geometry tiles (RT-GEOMETRY-READBACK-RUN-MERGE)
2026-11-30 17:25:12 +01:00
35e75b7a9d Merge pull request #2731 from OreoFR/carry/pr-2174
reprend #2174: rdna2spirv: seed the POPS collision word so the wait loop ends (SHADER-POPS-COLLISION-SEED)
2026-11-30 17:24:02 +01:00
f8c32396c1 vk_gpu_profile_test: say so and skip the per-pipeline checks when a paravirtual GPU resolves no timestamp
The macOS runner's Apple Paravirtual device sometimes resolves none of the 7
timestamps (runtime run 46433144059: entries.size() == 3 failed at line 300,
before the existing guard for constant timestamps), while other runs on the
same image pass. Only on a paravirtual device and only with 0 timestamps, the
per-pipeline and interval checks are skipped and the output says so; any other
device is checked in full.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:00:23 +01:00
c13dc82a51 submit_phases: keep timing scopes for the frame and floor lines
timing_wanted() looked only at the periodic line and the dev overlay, so with
LEONIDA_SUBMIT_PHASES_SECONDS=0 the frame and floor lines (on every
LEONIDA_SUBMIT_FRAME_SECONDS, 10 s by default) were printed with zero phase
times (found by merzleckeier on #2738). They read the phase times too, so they
now count as a consumer. The new test turns the periodic line off before the
first read and checks that scopes stay timed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:34:27 +01:00
2afbcef3c0 runner: skip the exact exp2 case on Apple's Paravirtual device
That device's OpExp2 lands two ulps low on 2^-125, so the bit-exact fixture cannot
hold there; real Apple hardware returns the exact pattern (M5 Max, MoltenVK 1.4.2,
passes the same case), which is why this skips by device instead of widening the
check for everyone.

The skip reads the device line the harness already prints beside the subgroup line
that wide_pixel_skip reads, so it needs no new plumbing.

Written with an AI assistant.
2026-11-30 15:39:20 +01:00
e3af360709 d3d12: keep the return of build_compute_pipeline, and align the new lines
The slow-pipeline line replaced the fprintf but also removed the function's
return out; - the body then fell off the end of a non-void function. MSVC at /W4
reports neither C4715 nor C4716 for this shape and the build stays green, so the
caller would have read an uninitialised ComputeBuild; the test suite does not
distinguish the two, which is why the earlier build-based check missed it.
Restored, and the new statements dedented to the block they belong to.
2026-11-30 15:35:28 +01:00
7acf84d38f d3d12: say where a slow pipeline came from, and whether its journal was written
The slow-pipeline line reported 	ook N s to build for a timer that starts before the journal file is read
and before the shared cache is asked, so it named a compile for what could be a cache lookup. Chasing a compile
cost from it is chasing the wrong number: a run with 16 such lines had compiled exactly one pipeline.

The line now names the source (a compile, the shared cache, or the pipeline's own journal file) and carries the
hit the journal reported, whether its cache was seeded from a file, and whether the file was written afterwards.
That is what turned three contradictory readings of the same log into one, on an RTX 4090 with a warm journal:
23 slow lines, all hit 0, seeded 0, written 1 - first-sight pipelines, each compiled once and journaled.
2026-11-30 15:26:46 +01:00
ff55c339e8 Merge origin/main (f9f3ec4c6) into the carry of #2029
Current main after #2566. New conflict on top of the earlier carry merge:
runtime/shims/d3d12_xs_alloc_size.h, align_up_saturating: main (#2027)
returns value when to == 0, the PR when to <= 1; for to == 1 the rounding
formula gives value as well, so both agree; the PR's guard and comment kept.

Co-authored-by: Ilyass Roussi <76879547+IlyassRS3@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:31:48 +01:00
30857b8b72 Merge origin/main (f9f3ec4c6) into the carry of #2016
Current main after #2566. New conflict on top of the earlier carry merge:
runtime/CMakeLists.txt: main added the title_frames, title_mirror_hooks and
title_heap tests at the place of the PR's value_write_sink test; all kept,
the PR's test after main's.

Co-authored-by: abnalstlll-byte <284980532+abnalstlll-byte@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:31:35 +01:00
696e728777 Merge origin/main (f9f3ec4c6) into the carry of #2085
Current main after #2566. New conflict on top of the earlier carry merge:
runtime/test/geometry_views_test.cpp, header list: main added case 17 (the
command-list-epoch guard); the PR's two cases, numbered 17-18 in the earlier
carry merge, become 18-19 (header and the comments at the cases).

Co-authored-by: BubsMcgee <203599835+BubsMcgee@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:31:07 +01:00
f474c74b04 Merge origin/main (f9f3ec4c6) into the carry of #2174
Current main after #2566. New conflict on top of the earlier carry merge:
tools/rdna2spirv.py, _translate (straight-line and CFG paths): main passes
extra=meta_extra to _shader_meta.collect and reads the literal samplers
after it; the PR's g.note_pops_word(insns) runs right after that block,
before fit_shared_memory / needs_barrier_rounds as before.

Co-authored-by: QemmHD <290605352+QemmHD@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:30:43 +01:00
1d4dc90ea0 Merge origin/main (f9f3ec4c6) into the carry of #220
Current main after #2566. New conflict on top of the earlier carry merge:
runtime/shims/d3d12_vulkan_device.cpp: main added a three-argument
bind_title_image overload where the PR adds valid_shader_4_component_mapping;
both functions kept.

Co-authored-by: justr4mzi <243612488+justr4mzi@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:29:51 +01:00
b291426966 Merge origin/main (f9f3ec4c6) into the carry of #2031
Current main after #2566; no new conflicts on top of the earlier carry merge.

Co-authored-by: Ilyass Roussi <76879547+IlyassRS3@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:29:22 +01:00
bede3ad0d3 Merge origin/main (f9f3ec4c6) into the carry of #2062
Current main after #2566; no new conflicts on top of the earlier carry merge.

Co-authored-by: Galaxy <23423870+thegalaxydev@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:29:20 +01:00
0590fe2777 Merge origin/main (f9f3ec4c6) into the carry of #2173
Current main after #2566; no new conflicts on top of the earlier carry merge.

Co-authored-by: quartz-heron-58 <245169279+quartz-heron-58@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:29:05 +01:00
d92dc7a4aa Merge origin/main (f9f3ec4c6) into the carry of #279
Current main after #2566; no new conflicts on top of the earlier carry merge.

Co-authored-by: Zilumz1 <221744236+Zilumz1@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:19:24 +01:00
f216975939 Merge origin/main (f9f3ec4c6) into the carry of #1050
Current main after #2566; no new conflicts on top of the earlier carry merge.

Co-authored-by: Gavin Bloom <g4v1nbl00mt4mu29@tamu.edu>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:19:16 +01:00
ab09fd1f86 Merge main: keep --no-ftz32 and --integer-dot-fallback next to --explicit-lod-bias
tools/rdna2spirv.py: main's float-only typed implicit sample (OpImageSampleImplicitLod)
is used only without --explicit-lod-bias; with the flag the Grad path still
scales the derivatives by the S# bias.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 11:46:44 +01:00
07905380dc ps_ssharp: probe the bias at +-0.26, not +-0.3
NVIDIA (RTX 3090, driver 610.88) moves NEAREST mip selection to level 1 at
about +0.289, inside Vulkan's 0.25..0.5 range, so a single +0.3 already read
level 1 there (found by zmasi). +-0.26 stays under that on every driver, and
the bias counted twice (+-0.52) still crosses 0.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 10:55:18 +01:00
b8508a974b Merge branch 'main' of https://github.com/ProjectLeonida/mandy into fix/rendering-correctness
# Conflicts:
#	tests/semantic/test_interp_computed_ij_fallback.py
2026-11-30 04:36:05 -05:00
efc1929908 runtime: eliminate Windows 11 full-space commit_pages_locked broadcast storm, ShadowPages/TitleTextureCells guard conflict, and streaming budget bursts 2026-11-30 04:34:17 -05:00
1aefed0dac runtime: fix present_mutex AB-BA deadlock, cross-queue relay cycle, and held-queue stalls 2026-11-29 21:05:26 -05:00
18936010df chore: remove dead Tier 1 files, wire 5 unwired C++ tests, and fix play.ps1 path 2026-11-29 20:00:40 -05:00
32b9f4a3e0 Merge pull request #2649 from DadaCap/fix/sample-locations-msaa-only
runtime: programmable sample positions only for multisampled targets, so 1x depth images stay plain (RT-SAMPLE-LOCATIONS-MSAA-ONLY)
2026-11-29 23:03:09 +01:00
22e1349d78 test(submit_frame): yield until steady_clock advances in WorkerScope check 2026-11-29 16:50:39 -05:00
d1539971a9 runtime: programmable sample positions only for multisampled targets (RT-SAMPLE-LOCATIONS-MSAA-ONLY)
#778 filled the sample-locations grids from 1 sample upwards, so every 1x depth-stencil image was created
sample-locations compatible and carried sample locations through its transitions. D3D12 only has programmable
sample positions for multisampled targets; since #778 the world phase loses the device on an RTX 5080. Keep 1 sample
out (SamplePositions::programmable_count): 1x depth images are plain again, MSAA keeps the feature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gt9hwPPpwX5RYWwXCnj43U
2026-11-29 22:43:46 +01:00