Commit Graph

3384 Commits

Author SHA1 Message Date
8564bb48bb Merge pull request #688 from aslan2142/game-rmdir-create-race
OLD-9215: restore old upstream PR 9215 - file_system: RemoveDirectory and a create inside the folder are ordered as on the host
2026-11-26 00:00:45 +01:00
d4681041ec Merge pull request #710 from aslan2142/gpuav-as-type
OLD-8414: restore old upstream PR 8414 - d3d12: arena AS resources take their address from vkGetAccelerationStructureDeviceAddressKHR
2026-11-25 23:59:57 +01:00
340e8a415c Merge pull request #638 from aslan2142/skip-int3-wine
OLD-7824: restore old upstream PR 7824 - startup_trace: LEONIDA_SKIP_INT3 works on title threads and with Wine's breakpoint address
2026-11-25 23:59:09 +01:00
696d70da19 Merge pull request #677 from aslan2142/root-sig-flag-mask
OLD-7234: restore old upstream PR 7234 - d3d12_xs: pin that the root-signature flag mask keeps every public flag (old upstream PR 7140)
2026-11-25 23:58:18 +01:00
809d1869af Merge pull request #657 from aslan2142/root-constants-zero
OLD-8904: restore old upstream PR 8904 - root_signature: accept root constants of 0 values, as the host does (D3D-942)
2026-11-25 23:57:31 +01:00
d34c426ef9 Merge pull request #684 from aslan2142/t-drive-overlay
OLD-8161: restore old upstream PR 8161 - file_system: T: is a folder of each process's own in the overlay
2026-11-25 23:56:38 +01:00
722fee9af6 Merge main into delay-import-thread-order-notes (#643)
#634 rewrote the same runtime/README.md paragraph on the loader. Its text
stays, and its relocation sentence takes this PR's wording: DIR64 and
HIGHLOW relocations, the other types rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:54:12 -05:00
21d3662ad8 Merge pull request #634 from aslan2142/loader-rebase-without-reloc-dir
OLD-8847: restore old upstream PR 8847 - pe_loader: move an image with no relocation directory; refuse only on IMAGE_FILE_RELOCS_STRIPPED
2026-11-25 23:53:26 +01:00
844519ab59 Merge main into stream-output (#1630)
Brings in main after #1891, so main's tip is the single merge base;
no conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:35:35 -05:00
1bf5eeafd7 Merge pull request #1891 from BubsMcgee/tf-device-foundation
d3d12_vulkan_device: detect and enable VK_EXT_transform_feedback + vk_pipeline_check parity (D3D-TRANSFORM-FEEDBACK-DEVICE)
2026-11-25 23:32:25 +01:00
17b5992b83 Merge pull request #804 from aslan2142/test1700-rdna3-repacking
OLD-7505: restore old upstream PR 7505 - w64_graphics, design: the wave32 VS run is the halves of the wave64 waves, not a repacking (TEST-1700)
2026-11-25 23:31:14 +01:00
392dda8f06 Merge pull request #833 from aslan2142/wave64-partial-wave-zero
OLD-7450: restore old upstream PR 7450 - wave64 emulate: a cross-lane read of a missing lane in a partial wave gives 0
2026-11-25 23:19:00 +01:00
dd6d3fd8a5 Merge main into stream-output (#1630)
Brings #1630 up to date with main; no conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:04:49 -05:00
6af9c80a99 d3d12: refuse an active SO stream across heaps too (D3D-302)
VUID-vkCmdBeginQueryIndexedEXT-queryPool-04753 forbids two active
transform-feedback queries with the same index anywhere in the command
buffer, whatever their pools. prepare() tracked the active ones by heap
and stream, so two heaps beginning stream 0 together still issued two
active indexed queries. It now keeps one bit per stream for the list.

replay_query_predication case 18 adds a second heap: overlapping queries
on one stream in two heaps are refused, and queries that take turns on
that stream are fine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:04:39 -05:00
d3b8251bc3 Merge pull request #1860 from lixonik/fix/title-3d-view-array-range
D3D-3D-VIEW-ARRAY-RANGE: use the single array layer for Vulkan 3D views
2026-11-25 23:02:37 +01:00
48245b436d root_signature_test: 64 constants spill whole for compute, refused as a spill for pixel
This branch's check expected pack_stage(Compute) to refuse 64 constants
as an unmodelled spill. main's pack_stage now spills trailing compute
parameters behind s[0:1], so compute takes them (cost 64, one spilled
parameter of 64 dwords). The "refused only as a spill, not for cost"
check moves to a pixel shader, where a spill is still refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:51:33 -05:00
1d0bf24dc7 startup_trace: take the int3 candidate ExceptionAddress names; drop the unused <set>
int3_from tried the byte at Rip first and only then checked
ExceptionAddress against it. With Rip one past the 0xCC and
ExceptionAddress on it (a mixed form), a second 0xCC at Rip (int3
padding) was taken first and then refused by the address check, so that
int3 was not skipped. Each candidate (Rip, then Rip - 1) now has to agree
with ExceptionAddress before it is taken. Main did not skip it either,
so this closes a gap rather than a regression. int3_skip_test gets a
"padding" case for it.

The std::set the old dedupe used is gone, so its include goes too; the
candidate loop needs <initializer_list>. Both raised in review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:43:47 -05:00
83c1bf2791 Merge commit 'refs/fix2/main' into fix2-638 2026-11-25 16:42:43 -05:00
ac3aef567b root_sig_public_flags_test: expect the heap-indexed fallback where the host refuses those flags
Since #1353 the shims' serializers (versioned and legacy) serialize a
description the host refuses for CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED or
SAMPLER_HEAP_DIRECTLY_INDEXED (Windows 10's in-box d3d12.dll): they call
the host again without the two bits and put them back into RTS0. The
three host-parity checks failed on Windows 10 for that, as reported in
review.

Where the host refuses such flags but takes the description without
them, the shim now has to return S_OK with that blob byte for byte,
except the RTS0 flags dword, which must hold all the flags, and a valid
container hash. Byte-for-byte parity stays wherever the host accepts,
and the shim still has to refuse whatever else the host refuses. The doc
bullet says the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:42:34 -05:00
712714bef2 Merge main into perf/big-compute-budget (#1889)
Brings #1889 up to date with main after #1742 (the pipeline compile unlock),
resolving the five conflicts as described in the guide on the PR:
https://github.com/ubiquitarianism/leonida/pull/1889#issuecomment-7175252290

- vulkan_replay.h: PipelineCompiles::build takes both the large-compile
  budget and main's `prior` compiles; build_pipelines passes the budget,
  and main's check_compiled_pipelines / finish_compiled_pipelines stay.
- vulkan_backend.h: execute_now takes the large-compile demand and passes
  the budget to the pass-0 compile, and pass 1 passes the budget too.
  set_large_compiles locks pipeline_mutex_, since #1742 moved the
  pipeline state under that lock.
- replay_pipeline_compiles_test.cpp: both test blocks kept, and the
  prior_compiles_reuse call passes an empty budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:41:36 -05:00
00c65b940d Merge commit 'refs/fix2/main' into fix2-677 2026-11-25 16:40:58 -05:00
509a543de7 Merge main into root-constants-zero
main's pack_stage now spills trailing compute parameters into the array
behind s[0:1] and refuses an unknown parameter type. Keep both; drop only
the zero-value constant refusal, as this branch does. A zero-value
constant takes no SGPRs and no spill dwords, and a new case checks the
spill offsets around one. The old "32-SGPR budget refuses before the
cost limit" comment no longer holds with spilling and goes; main's
over-cost case replaces it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:40:13 -05:00
afea66650c Merge main into delay-import-thread-order-notes
runtime/shims/startup_trace.h: main added the tls_index0 example event
and the exception's region/regs fields to the header comment; keep them,
add this branch's delay_import_unimplemented example and renumber seq.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:38:51 -05:00
c116c3fa28 Merge main into t-drive-overlay
docs/boot.md: main added LEONIDA_WRITE_DIR / LEONIDA_SAVE_DIR to the
--overlay bullet and a new "Under Wine on Linux" section; keep both and
the T: paragraph of this branch after main's sentences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:38:20 -05:00
0bae6f545a Merge main into wave64-partial-wave-zero
scripts/run_gpu_tests.py: main added cs_w32_wrxchg2_ext and
cs_w32_wrxchg2st64 to the same name list; keep main's list and add
cs_w64x_partial_swizzle to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:37:28 -05:00
d96b3a8644 Merge pull request #857 from ohshitwaddup/tests/gpu-wrxchg2-b32
tests: GPU fixtures for the ds_wrxchg2_rtn_b32 pair cases and ds_wrxchg2st64_rtn_b32 (TEST-WRXCHG2-B32-EXT)
2026-11-25 22:28:36 +01:00
f9642954fc Merge pull request #1742 from IlyassRS3/fix/pipeline-compile-unlock-resources
runtime: unlock resource_mutex while compiling unbuilt pipelines
2026-11-25 22:25:13 +01:00
e79079f39d Merge pull request #1987 from abnalstlll-byte/feat/rt-unbound-tsharp-reasons
d3d12, test: track unbound T# refusal counts by reason and verify binding rules (RT-UNBOUND-TSHARP-REASONS)
2026-11-25 22:12:59 +01:00
9cd0c3f427 Merge pull request #1759 from abnalstlll-byte/feat/rt-xdxr-bvh-rehydrate-batched2x
xbox_bvh_builder: implement RehydrateRaytracingAccelerationStructureBatched2X (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
2026-11-25 22:10:34 +01:00
a05c178708 d3d12, test: fix unbound_tsharp_tracker scope and verify binding rules (RT-UNBOUND-TSHARP-REASONS)
- Move UnboundTsharpTracker and unbound_tsharp_tracker() to namespace scope
  so the free functions in rt::d3d12 that call it compile correctly.
- Add non-const Device::state() overload for test_bind_title_image().
- Remove nonexistent rt::d3d12_xs::resource_proxy_real_resource() call;
  resource_image_address() now casts the ID3D12Resource pointer directly.
- Fix cube layer check in bind_title_image to verify texture layer count.
- Add D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET to test MSAA texture desc.
- All 35 checks in d3d12_unbound_tsharp_rules_test pass cleanly.

AI-assisted (Claude Code)
2026-11-26 00:01:32 +03:00
5e188a02f9 d3d12, test: track unbound T# refusal counts by reason and verify binding rules (RT-UNBOUND-TSHARP-REASONS)
In runtime/shims/d3d12_vulkan_device.cpp, extend note_refused_tsharp to record
both overall distinct slots and per-reason distinct slots and total refusal
counts across console descriptor heaps, matching the title texture diagnostic
breakdown in refresh_console_heaps.

Expose inspection helpers in runtime/shims/d3d12_com.h and add synthetic tests
in runtime/test/d3d12_unbound_tsharp_rules_test.cpp covering:
- 1D rule: dimension and layer count compatibility ("T# type or samples do not fit the texture")
- Array rule: layer bounds ("T# names layers the texture lacks")
- Cube rule: minimum layer requirements ("cube T# on fewer than six layers")
- MSAA rule: sample count matching ("T# type or samples do not fit the texture")
- Tracking: distinct slot and total refusal counts by reason

AI-assisted (Claude Code)
2026-11-26 00:01:32 +03:00
0bf7ef8066 runtime: a large compile that fits may pass one that does not, within a bound (RT-BIG-COMPUTE-BUDGET) 2026-11-25 21:59:36 +01:00
16b5b540c0 Merge main into test1700-rdna3-repacking
Conflict in docs/design.md: main added the "Per-lane descriptor selection"
row right above the SHADER-10 row this PR rewords. Both are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:40:04 -05:00
5da72d19f0 Merge pull request #1922 from kawaii-shakal/title-bar-hud
d3d12_xs: LEONIDA_TITLE_HUD shows frame rate, memory and pipeline compiles in the window's title bar (RT-TITLE-HUD)
2026-11-25 20:39:34 +01:00
ef205eec98 xbox_bvh_builder: review fixes for batched rehydration (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
Maintainer fixes on top of the author's rehydration, carried over from the
reviewed branch onto the rewritten head:

- Scratch: each element of a batch gets a region of its own in one buffer
  per call, at D3D12's acceleration-structure alignment, and the command list
  holds that buffer until its next Reset (rt::d3d12::hold_until_reset). Before,
  every element and every list shared one builder-wide buffer with no barrier
  between the builds, and growing it released a buffer that builds already
  recorded could still use.
- Fresh builds: a rehydrate always builds from geometry. PERFORM_UPDATE is
  cleared together with SourceAccelerationStructureData, so the layer never
  refits from the dehydrated stream's bytes.
- The leaf frame compressionParams gives is described as not applied yet,
  which is what the code does.
- The test reads back rehydrated builds made without scratch
  (ScratchAccelerationStructureData = 0), the shape the title uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:37:34 -05:00
721a3b85ae Merge main into wave64-partial-wave-zero
Conflict in scripts/run_gpu_tests.py: the dump-test name list gained
cs_w64x_cmp_sdst on main and cs_w64x_partial_swizzle here; both are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:37:20 -05:00
65235f36ad test: update rehydration test comment to specify geometry rebuild (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
AI-assisted (Claude Code, Claude Opus 5.5)
2026-11-25 22:30:44 +03:00
b352aa9be9 xbox_bvh_builder: supply scratch buffer and address review feedback (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
- Fix log_once call signature at line 268 (passes flag, text without format args).
- Do not copy source_data into SourceAccelerationStructureData to avoid unwanted refit
  on update paths (d3d12_vulkan_device.cpp:2639).
- Allocate and supply scratch buffer via builder_ensure_scratch when the title passes
  ScratchAccelerationStructureData = 0 (docs/xdxr.md §6), avoiding command list poisoning.
- Retain the leaf-frame note (compressionParams, docs/bvh.md §4a) in comments and docs.
- Remove stale deserialize references in test comments and update test coverage.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-25 22:30:44 +03:00
cb1cb86e92 xbox_bvh_builder: rebuild from geometry and refuse source-only rehydration (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
Addresses review feedback on #1759 from @aslan2142 and @Tyrannys:
- RehydrateRaytracingAccelerationStructureBatched2X now rebuilds structures
  exclusively from geometry (docs/bvh.md §4a).
- Offline console dehydrated streams cannot be directly deserialized by
  PC D3D12/Vulkan drivers (docs/bvh.md §4/§4a). When source_data is present
  without geometry descs, the shim logs once and refuses with E_NOTIMPL.
- Documented in docs/xdxr.md that the 4th parameter (const UINT64* source_data)
  is a hypothesis denoting offline console stream pointers.
- Empty structures (NumDescs == 0 without source) are logged once and skipped.
- Updated runtime/test/xbox_bvh_builder_test.cpp and tests/test_xbox_bvh_builder_rehydrate.py
  to verify refusal of source-only streams (E_NOTIMPL) and handling of empty structures.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-25 22:30:44 +03:00
07e89b1935 xbox_bvh_builder: implement RehydrateRaytracingAccelerationStructureBatched2X (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
Implements XboxBvhBuilder::RehydrateRaytracingAccelerationStructureBatched2X
in runtime/shims/xbox_bvh_builder.cpp. The shim now rebuilds or deserializes
each acceleration structure on the command list via ID3D12GraphicsCommandList4
rather than stubbing out with E_NOTIMPL, resolving the interactive boot stop
reported by timbot103 past story-load texture streaming.

Validates count == 0 (S_OK), null list / descs (E_INVALIDARG), and adds unit
coverage in tests/test_xbox_bvh_builder_rehydrate.py and runtime/test/xbox_bvh_builder_test.cpp.

AI-assisted (Claude Code)
2026-11-25 22:30:44 +03:00
e18b59a5b7 Merge pull request #1612 from Tyrannys/first-run-pad-focus
runtime: the first-run UI keyboard pad reads keys only with focus (RT-FIRST-RUN-PAD-FOCUS)
2026-11-25 20:30:08 +01:00
cee965560c Merge pull request #1814 from timbot103/d3d-clear-uav-3d-slice
D3D-CLEAR-UAV-3D-SLICE: clear selected 3D UAV slices and rectangles
2026-11-25 20:29:08 +01:00
75a41f5dc2 Merge pull request #1896 from IlyassRS3/fix/rt-indirect-topologies-and-stats
runtime: support dynamic topologies in indirect draws and report per-reason skip counts (RT-INDIRECT-TOPOLOGIES-AND-STATS)
2026-11-25 20:28:13 +01:00
b904919ab4 Merge pull request #1832 from IlyassRS3/fix/rt-indirect-clamp-sharing-and-safety
runtime: share indirect clamp buffers across queue families and fix safety bugs
2026-11-25 20:27:08 +01:00
369bb1c753 d3d12: gate SO_STATISTICS pools and refuse per-stream overlap (D3D-302)
The three review points on #1630:

- prepare() refuses two overlapping SO_STATISTICS queries on one stream: two
  active indexed queries in one pool break
  VUID-vkCmdBeginQueryIndexedEXT-queryPool-04753. Queries on different streams
  are fine.
- The transform-feedback pool now also needs the transformFeedbackQueries
  property, and a stream at or above maxTransformFeedbackStreams runs nothing
  and resolves zero instead of issuing an invalid indexed begin.
- replay_query_predication case 18 fails without both: the overlapping-stream
  list is invalid_query and a stream past the pool's stream count fills zeros.

Tested: d3d12_vulkan_device, d3d12_state_map and replay_query_predication pass
plain and with LEONIDA_VK_VALIDATION=1 (RTX 3080 Ti, driver 616.64). AI-assisted.
2026-11-25 14:24:41 -05:00
205bda4a4a Merge pull request #1941 from abnalstlll-byte/feat/rt-texture-tiles-host-adapter
test: respect LEONIDA_HOST_ADAPTER and layer LUID in d3d12_texture_tiles (RT-TEXTURE-TILES-HOST-ADAPTER)
2026-11-25 20:20:30 +01:00
e380a69a60 Merge pull request #1950 from kurrutako/rt/session-cache-at-exit
d3d12: write the session pipeline cache when the run ends with the device alive (RT-SESSION-CACHE-AT-EXIT)
2026-11-25 20:15:15 +01:00
c37374180b Merge pull request #1887 from IlyassRS3/rt-console-heap-vsharp-bitset
d3d12: track live console-heap V# slots in a host-RAM bitset (RT-CONSOLE-HEAP-VSHARP-BITSET)
2026-11-25 20:06:41 +01:00
3233b9857f d3d12: track live console-heap V# slots in a host-RAM bitset
When released_backings or title_va_aliases().invalidations() advances,
refresh_console_heap() previously scanned all 32-byte slots of heap.copy
linearly to find live buffer V#s (!(w[3] >> 30) && (w[2] || w[6])). When
heap.copy sits in arena.mapped (uncached write-combined GPU memory), each
buffer release triggered ~180k uncached PCIe reads across a 5.5 MiB heap.

Add a portable host-RAM bitset (leonida::ConsoleHeapVsharpSlots in
runtime/src/console_heap_vsharp_slots.h) updated at every resource-heap
write to heap.copy (fix_console_slot, deferred fix_over zeroing,
for_each_zeroed, and add_console_heap reset), and iterate only live V#
slots during invalidation passes (0 reads from heap.copy; 64 slots skipped
per word via std::countr_zero).

Item: RT-CONSOLE-HEAP-VSHARP-BITSET
2026-11-25 17:20:50 +01:00
9e7720c9e7 Merge pull request #1893 from OreoFR/rt-depth-format-copy-staged
replay: copies between depth formats that differ go through transfer scratch (RT-DEPTH-FORMAT-COPY-STAGED)
2026-11-25 17:19:44 +01:00