Commit Graph

4696 Commits

Author SHA1 Message Date
86eb22f7e8 Merge branch 'main' of https://github.com/ubiquitarianism/leonida into rt-alloc-no-rebar
# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
#	runtime/test/d3d12_state_map_test.cpp
2026-11-25 12:58:11 +01:00
6aa5f0b0d4 Merge main (#1723 merged) into #622 (list value writes)
No conflicts. Brings #1723's final form: the README rows for 32
LEONIDA_* variables and indirect_clamp_test's ctest registration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:43:32 -05:00
f005d7ab22 Adapt #622 to #1723: the slot 71-74 rows say who writes and who waits
#622's rows had slots 73 and 74 as no-ops and the GPU-label path as the
only writer of 71 and 72. Under #1723 the list values record all four
for the lists they track (waits included), and LEONIDA_GPU_LABELS=1
writes 71/72 only for the others. The command-object table, the value
write paragraph, §5.5 of the console ABI notes and the README row now
say so, and name the arena and xmem fallbacks (src/value_write_sink.h).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:43:20 -05:00
924966e2fb Adapt #622 to #1723: its arena and xmem writes become the list values' fallback
#1723's list values own list slots 71 to 74 of the lists they track and
hand 71/72 to the GPU-label path only for lists they do not track. This
keeps that, and keeps what #622 adds that #1723 lacks: landing a value
in the GPU address arena and on an xmem page the title's view refuses.

- LEONIDA_GPU_LABELS stays opt-in (`1`), as on main and in #1723.
- src/value_write_sink.h: one place for the two targets a host store
  cannot reach, used by both writers. The device answers for the arena
  (an address below its size that is not the title's memory, the rule
  resolve_title_memory uses); xmem registers write_title_bytes for its
  pages. Replaces #622's label-only sink and xmem's title_write_fn.
- The pump's land(): the arena is asked before any host store, so an
  arena offset is never stored to as a host address; then
  kernel_writes::store as before; then xmem's mapping when that store
  faults. Counted as writes_arena and writes_title_pages.
- The arena refuses its reserved start (null region, zero page, quad
  indices) and a write past its end, stores an aligned value in one
  access, and is unregistered when its device goes.
- xmem's write_title_bytes stores an aligned value in one access.
- The label path keeps the same order for untracked lists.

Test, no game data: xbox_list_value_fallback. A tracked list's writes to
title memory land through the host store; to a default-heap buffer's
arena offset land in the arena (read back by a GPU copy); to the arena's
reserved start are dropped; to an xmem page the title made PAGE_NOACCESS
land through xmem's mapping. LEONIDA_GPU_LABELS=1 throughout, and no
write is handed to the label path. Without the arena step it fails at
line 168, without the xmem step at line 208 (llvmpipe and the iGPU).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:43:13 -05:00
4645a3f62a runtime: fix D16S8 fragment depth quantisation and pc_format fallback gating 2026-11-25 12:39:12 +01:00
9177972ae8 runtime: register indirect_clamp_test beside its add_executable
indirect_clamp_test came with #1723 and was registered through the foreach
over ${test}_test with the other self-checking Vulkan tests, which
tests/test_ctest_registration.py cannot see, so it reported the executable as
built but never run. It is now registered next to its own add_executable, with
the same SKIP_RETURN_CODE 77 and BUILD_TESTING guard, and left out of the
foreach. Built and run with ctest on Linux: passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:32:52 -05:00
709d545831 runtime/README: document the 32 LEONIDA_* variables #1723 added
The integration of the post-story-load runtime changes (#1723) reads 32
environment variables that no document named, so tests/test_docs_env_vars.py
failed. Each now has a row in the D3D12 switches table of runtime/README.md
with its default and what its values do, read from the code: the console heap
fix and retry budgets, the per-frame and asynchronous refresh trade-offs, the
title texture fill and view settings, the XMem and queue slot 31 switches,
the hang exit, the thread sampler, the submit-phase line and the Aftermath
extras. Diagnostic-only switches are marked so.

LEONIDA_QUEUE_PAGE_MAPPINGS is read by rt::xmem::queue_page_mappings_enabled(),
which nothing calls; its row says it has no effect at present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:32:43 -05:00
f3bfc039b2 Merge #1723 (post-story runtime) into #622 (list value writes)
Conflicts:
- runtime/README.md: #1723's LEONIDA_GPU_LABELS row (opt-in, only for
  lists the list values do not track). The rows #622 changed are
  brought in line with #1723 in the commits after this merge.
- runtime/shims/d3d12_vulkan_device.cpp: both sides. #622 tracks the
  arena for the label path; #1723 resets the arena's block tree under
  its lock and starts the arena after the null region.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:24:18 -05:00
d0b0b453f1 Merge main into integration/post-story-runtime (#1723), with #1558
runtime/test/xs_proxy_mock_test.cpp: main added check_depth_provider_refusal()
next to check_placed_resource_x() (#1558); this branch added the list-values
checks, which must run last because they start and stop the list-values
threads. Both kept, the list-values checks still last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:21:12 -05:00
59c54c1eb0 d3d12_xs: list slots 71/72 have one writer, the list values, when they track the list
Found by the comparison agent, not by a failing test. #1723's console
list slot path still handed slots 71 and 72 to main's GPU-label hook
(record_gpu_label, LEONIDA_GPU_LABELS) when its own list values track
the list (track_values, on by default with LEONIDA_LIST_VALUES). The
--first-run-ui profile sets LEONIDA_GPU_LABELS=1 (runtime/src/main.cpp).
With both on, two threads stored to one title address, one from a
Vulkan command buffer's completion and query, the other from the part's
fence and a D3D12 timestamp query. A late label could rewind a rising
counter or split a begin/end pair. The suite did not catch it:
xbox_gpu_label_completion submits its real list straight to the queue,
so only the label path landed there.

The list values are the right owner. They land slots 71 to 74 in
queue order behind the gates, and they also do the waits the labels
cannot do. Now:
- The label hook runs only for a list the list values do not track
  (LEONIDA_LIST_VALUES=0, bundles). Each handoff is counted in
  ListValueStats::labels_handed.
- The --first-run-ui profile no longer sets LEONIDA_GPU_LABELS.
  runtime/README.md and docs/first_run_ui.md say so.
- xbox_gpu_label_completion runs its label section with the list values
  off, as it always measured the label path alone, and checks that all
  five writes went there. A new section turns both on and records one
  write32 and one write64 on a tracked list, submitted through the queue
  proxy. Each lands exactly once: writes_landed == 2, labels_handed == 0,
  and the values are in memory. With the old condition this section
  fails at line 136 (labels_handed was 2), on llvmpipe and the iGPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:16:46 -05:00
1d19671ebd rdna2spirv: --explicit-lod-bias applies the S# LOD bias in the shader where MoltenVK drops the sampler's (SHADER-EXPLICIT-LOD-BIAS-MVK)
MoltenVK 1.4.2 drops VkSamplerCreateInfo::mipLodBias from both explicit and
derivative-LOD samples, so ps_ssharp's S# LOD_BIAS cases fail on every Mac.
With the flag the translator adds the S# bias (word 2 [13:0], signed 5.8) to
explicit LODs and to _b biases, as a Bias operand on implicit samples, and as
a 2^bias scale of Grad derivatives. tools/vk_subgroup_info.py reports
explicit_lod_bias for MoltenVK's driver ID, and run_gpu_tests.py, build.py
and make_game.py turn the flag on from it. ps_ssharp gains +-0.3 cases, which
fail when the bias counts twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 12:16:05 +01:00
Luc
88de45bf1d d3d12: refuse a pipeline whose shader needs VK_KHR_maintenance8 on a device without it
The translator records needs_maintenance8 for shaders that sample with a texel
offset outside a gather (the SPIR-V Offset image operand), but the runtime never
read it: on a device without VK_KHR_maintenance8 such a pipeline went to the
driver as invalid SPIR-V. ShaderLibrary::load() now reads the flag, and graphics
and compute pipeline creation refuse such a shader with E_NOTIMPL and a reason,
as they already do for mesh limits and workgroup memory.

Finding: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115210531

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:14:19 +00:00
6ee7ef89b9 Merge branch 'main' of https://github.com/ubiquitarianism/leonida into xapu-connect-layouts
main added its own runtime/shims/xapu.cpp: the boot stack's earlier xapu.dll stub, which gta6rt does not link and
xapu_test checks. This branch's xapu.dll command queue moves to runtime/shims/xapu_queue.cpp so both stay: gta6rt,
xapu_chad_test, the cl.exe fallback list in scripts/build_runtime.ps1 and the references in xapu_chad.cpp,
xapu_chad_test.cpp and docs/audio_hal_exe_calls.md name the new file; main's xapu.cpp and xapu_test are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnGkjYHUWx92TkwvwCnAMe
2026-11-25 12:09:55 +01:00
c7fdc26d2a runtime test: compile_teardown expects no session cache from llvmpipe
#1723's new d3d12_compile_teardown failed on llvmpipe at line 436: no
pipeline_cache.session.bin after teardown. It passes on the iGPU.

The runtime was right and the test assumed every driver keeps compiled
pipelines in a VkPipelineCache. Measured with a print in
save_session_pipeline_cache: after the warm-up build, llvmpipe's
vkGetPipelineCacheData returns VK_SUCCESS and 32 bytes, the header alone
(the save limit was 64 MiB). The runtime writes no file of a bare header
on purpose, as it is no cache.

The check now reads the driver ID (VkPhysicalDeviceDriverProperties).
On llvmpipe the file must be absent; on every other driver it must be
written at teardown, as before. The rest of the case (the background
build ran, the worker joined) is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:00:54 -05:00
29c356b0bc runtime test: cs_user_data's descriptor-word mode gets its own sentinel
d3d12_rebound_tables, d3d12_rebound_second_device and
d3d12_api_descriptor_copy went from pass (main) to fail at line 896 of
d3d12_title_va_test: 0/64 GPU words matched on both submissions,
although the mirrored CBV in the layer heap was right (checked by
printing the slot after the submission). They had been hidden behind
line 502 in the same executable.

main was right. Its rebound-table check selects the test shader's
indexed CBV mode with s5 = 0xFFFFFFFB. #1723 added a mode that returns
a descriptor's words instead, also on 0xFFFFFFFB, ahead of main's
branch, so the rebound tables read the words at s8 (unset, address 0)
instead of the CBV's data. #1723's mode now uses 0xFFFFFFFA, which
nothing else uses, and its one caller (the out[3] dispatch in
check_title_va) passes that. Both checks run as written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:00:46 -05:00
92394f1f83 title_gpu_views: a pair can be marked independent; such a twin is not imported
d3d12_xmem_placed failed at line 113 (to_cpu(dst) == dst) and line 244
(independently_mapped(gpu, size)). #1723 added View::independent_pages,
the to_cpu branch and independently_mapped for a GPU-only range that
queue slot 31 maps by itself, but nothing ever sets the flag: xmem
calls note_reservation without it, so every pair it makes is the legacy
kind, read at its CPU view. Nothing in the runtime read
independently_mapped either, although its comment says a slot-133
buffer there must be a shadow, not an import.

Neither side is simply right. The tests express #1723's design, but no
rule exists for which of the title's pairs are independent, and none
can be inferred: marking every GPU-only pair independent (tried) breaks
main's xmem test, whose pair (attributes 0x23/0x3, protect 0x2004 then
0x801, two constant sets docs/xmem_exe_calls.md lists among the
title's sites) must read at the CPU view, and
would move where DirectStorage, slot-70 views and slot 31's CPU mirror
read and write in the game. That rule is left to #1723's author.

So:
- title_gpu_views::set_independent_pages(gpu) marks a pair. Nothing in
  the runtime calls it yet, so the game's behaviour does not change.
- create_host_buffer declines an import over an independently mapped
  range before making anything, as independently_mapped's comment asks,
  and the shadow answers. On llvmpipe the import otherwise succeeded and
  the twin was never guarded (line 264, seen with every pair marked).
- d3d12_xmem_placed marks its two windows. It now also checks that xmem
  made them the legacy kind and that marking changes to_cpu and
  independently_mapped. Everything after that (slot 31 remapping only
  the GPU range, the CPU view untouched, the guarded twin, pins, host
  and kernel writes) is checked as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:00:45 -05:00
d7ef292e31 d3d12: a V# may name a layer buffer below the arena again, sign-extended
On the RDNA2 iGPU (RADV) d3d12_compute went from pass (main) to fail at
line 676, and #1723's d3d12_unmapped_vsharp failed at line 135 and
d3d12_graphics_indirect_heap_resources at line 478. In each, a view of
an upload buffer came out zero-size ("buffer SRV: address
0xffffffffffe20000 (16 bytes) has no GPU copy; zero records"). Measured
there: RADV puts upload buffers below the arena, so their VA (device
address minus heap_base) is negative, 0xffffffffffe30000 in
unmapped_vsharp. llvmpipe puts them above it, and all three pass there.

main was right. docs/design.md ("Heap-relative buffer device
addresses") makes the V# base a signed 48-bit offset: the translator
sign-extends it, and main wrote such an offset for the layer's own
buffers. d3d12_compute's shader reads it sign-extended, as the contract
says. #1723's vsharp_address accepted a negative offset only with
LEONIDA_IMPORT_BELOW_ARENA=1, the switch that decides whether title
memory may be imported below the arena, and wrote every other view of
such a buffer as zero-size.

encodable() now accepts a negative offset that fits in 48 signed bits
whatever the switch says. backed() still requires a buffer registered
in gpu_backings or the geometry copies, so the switch alone still
decides whether there is a title import there. An already-written V#
whose bit 47 is set is also read as negative when that is what names a
backing. Unbacked addresses still become zero-size, as #1723 wants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:00:45 -05:00
6f36d14002 d3d12: inline table V#s nothing backs become zero-size, as console heap slots
d3d12_title_va failed at line 502 and d3d12_unmapped_vsharp at line 191:
a V# the CPU writes into a bound table of a layer heap, naming an
address nothing backs (an unknown high address, a view past the end of a
real buffer), kept its base after the table scan, so a shader would add
heap_base to it and fault.

The tests were right. #1723 added fix_vsharp, which rebases a V# into
the title's memory and writes one with no GPU backing as zero-size, and
gave it an "inline table" path (VsharpPath::table), but only the console
heap copy calls it; scan_title_table still called rebase_title_vsharp,
which leaves an unbacked base as it is, and only the slot's first V#.
scan_title_table now runs fix_vsharp on both V#s of each slot (the
second is a UAV's counter), as fix_console_slot does.

With line 502 passing, the rest of d3d12_title_va runs again, #1539's
check_declined_imports and check_import_over_shadow (run by d3d12_geometry_views)
included. The same executable's d3d12_api_descriptor_copy and
d3d12_rebound_* registrations stopped at line 502 too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:00:30 -05:00
a607b779c4 d3d12: check heap eligibility when sizing the ReBAR arena
AI-assisted by Codex.
2026-11-25 10:53:03 +00:00
bcaa13dad3 Merge pull request #1558 from ubiquitarianism/claude/d16s8-uav-nvidia-fallback
Merging.

**Why merged**
- Fixes the NVIDIA startup stop that #939 introduced. Slot 133 asks for a D16S8 (format 118) depth texture with unordered access. On NVIDIA, `pc_format()` maps it to D24S8 and the depth provider refuses UAV on that, so the boot died early. With this PR the refusal is logged once and the texture is made without UAV, i.e. the pre-#939 stand-in.
- Independent real-boot confirmations past the stop, each against the same build without the PR stopping there:
  - RTX 4070 SUPER, Windows 11;
  - RTX 5060 Ti, Windows 10 (Snooozs);
  - RTX 3070 Ti, Wine 11.22 (djrolfes);
  - RTX 3080 Ti, Wine 11.17 (slauko: 603 s, no exception);
  - RTX 3090, Proton (azsekazvamdimitar).
  - On AMD (adrianmjim, RX 7900 XT) the native path is untouched and the related tests pass, including a GPU without D24S8 that falls back to D32S8.
- Re-tested here merged onto 3de22a190 (after #1547) on an RTX 4070 SUPER, and the merge onto the current main (57ba40bd6, which only adds #1493's translator change) is also clean:
  - fresh RelWithDebInfo build;
  - full ctest 410/411, where the only failure is `d3d12_depth_resolve`, the known NVIDIA MFAA sample-position case fixed by #1505;
  - the PR's 16 related tests pass, also with `LEONIDA_VK_VALIDATION=1`;
  - the consistency set is the same as main.

**Why it's good**
- It's a narrow fallback, used only when the provider refuses. Consoles and GPUs that accept the format keep the native path.
- It comes with tests for the refused and accepted cases.
- It unblocks every NVIDIA tester at the same spot.

**Known and separate:** the slot 133 stand-in leaks about 60 Vulkan objects at device teardown under validation. That leak predates this PR and is reported in #1608. Full D16S8 UAV semantics on NVIDIA remain a follow-up.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-25 05:38:42 -05:00
f41be1995c runtime: guard DescriptorTable 9-way collision, read_slots width, and change-tracking OOM 2026-11-25 11:37:33 +01:00
eedc7c8db9 d3d12_xs: queue slot 31 without a mapper keeps the unmodelled answer
xs_proxy_mock failed at line 4791: on a queue whose presentation is
managed outside (set_presentation_handler), raw(queue, 31, 0) must be
E_NOTIMPL and must not reach SuspendX. #1723's CopyPageMappingsBatchX
dispatch answered every slot-31 call itself, and with no hook and no
xmem (a proxy compiled alone) queue_copy_page_mappings returned S_OK
having mapped nothing.

The test was right. The file's own comment says that without xmem the
slot is refused as before, and check_queue_copy_page_mappings expects
the console-only answer every unmodelled queue slot gets in that case.
The new dispatch now runs only when something can remap (a hook set
with set_copy_page_mappings_hook, or xmem's copy_page_mappings_fn);
otherwise the call goes on to the presentation routes and the
unmodelled-slot answer as on main. With xmem linked, as in gta6rt,
nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:31:36 -05:00
682a557f87 runtime test: define the slot-31 recorder check_list_values_more uses
The list-values test of #1723 installs `record_page_mapping` as the
CopyPageMappingsBatchX hook and checks `g_page_mapping`, but neither was
defined, so xs_proxy_mock_test did not compile. The recorder counts the
calls and keeps the arguments plus a copy of the first batch's first
ranges, so section 6 can tell a deferred remap of the proxy's copy from
one made at the call with the caller's array. It is written from
`CopyPageMappingsHook` (shims/d3d12_xs_device.h) and the fields the test
reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:27:50 -05:00
df2e4093ef runtime: define NOMINMAX before windows.h in submit_phases.h and thread_sampler.h
Both headers now include <windows.h>, and the test targets that reach them
through vulkan_replay.h (replay_uav_clear_offset_test first) do not define
NOMINMAX, so windows.h's max/min macros broke the std::max/std::min calls in
vulkan_replay.h ("expected unqualified-id") and the runtime's test build
failed. Guard the include the way vulkan_gpu_labels.h already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:16:01 -05:00
1943a92f7b d3d12: lazy pipelines keep the dual-source remap, and a dual-source draw test (RT-DUAL-SOURCE-BLEND review)
A lazy graphics pipeline (the default) makes its stage words again in build()
through stage_words(), which replayed the B4G4R4A4 quantisation but not the
Location 0 / Index 1 remap. Both now go through rewrite_fragment(), the same at
creation and in a lazy build.

d3d12_translated_draw_test --dual-source draws ps_m15_dual (ps_m15 plus a
constant SV_Target1) with ONE + SRC1_COLOR / SRC1_ALPHA, lazy and at creation:
every covered pixel is exact. Without the lazy fix, NVIDIA still draws the
right colours but LEONIDA_VK_VALIDATION=1 reports 3 errors.

Found by kawaii-shakal's review of #1703.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:07:54 +01:00
96bbe55ce8 d3d12: keep a Resizable BAR arena in VRAM when the driver excludes it from a very large buffer (RT-ARENA-REBAR-FIT)
On an RTX 5070 Ti (NVIDIA 617.42) a 4,090 MiB arena-shaped buffer may use
the DEVICE_LOCAL | HOST_VISIBLE type and a 4,092 MiB one may not, so
LEONIDA_ARENA_MB=4096 (4,095 MiB, the workaround from #1537) placed the
whole arena in system memory: 4 GiB more host commit, and every
default-heap buffer read over PCIe.

With Resizable BAR, create_arena now tries 16 MiB smaller sizes, by at
most an eighth, and keeps the largest whose buffer may still use that type
(device_local_arena_bytes in arena_size.h). The cap is logged like the
other device caps. Without Resizable BAR nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:01:30 +05:00
ba626820ec Integrate post-story-load memory, queue and Vulkan runtime changes
Preserve physical window aliases across remaps, order console list values,
and replay bounded indirect graphics with captured draw state. Coordinate
pipeline lifetime, texture refresh and queue teardown. Add synthetic CPU
and GPU coverage for the integrated paths.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
2026-11-25 03:44:43 -06:00
c6817c3d55 d3d12: allow queue submissions during fallback clock calibration 2026-11-25 14:31:03 +05:00
3de22a1904 Merge pull request #1547 from TheGeogeo/perf/pipeline-compile-workers
d3d12: compile a submission's pipelines on worker threads (RT-PIPELINE-COMPILE-WORKERS)
2026-11-25 10:24:30 +01:00
7b251064ad dstorage: rebuild a BC6H/BC7 request with a few lost blocks instead of failing it (BCPACK-LOST-BLOCK-LIMIT)
A fitted BPTC request whose predictor chains reach a history entry the
local profile does not know was refused once more than max(2, blocks/1024)
blocks were affected, leaving the whole destination untouched. On the
1.0.2.1 package two BC7 requests fail this way at every boot, with one
unknown endpoint entry each (5 of 1,536 and 15 of 768 blocks).

bcpack::decode gets a separate limit for these lost blocks (lost_divisor,
1024 by default, as before) and an optional Report with the block and
lost counts. DirectStorage passes 32 (LEONIDA_DSTORAGE_LOST_DIVISOR) and
logs each approximated request. Inconsistent blocks keep the 1-in-1,024
limit; strict mode refuses any lost block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:20:30 +05:00
2c7440fed8 Merge main into title-window-overflow
The only conflict was runtime/test/d3d12_title_va_test.cpp: keep the
--window-cap branch (returns early) and main's declined-import and
import-over-shadow checks after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:11:58 -06:00
626d1281af Merge pull request #1710 from MoonEyes/runtime/state-blob-log-english
d3d12_xs: the state-blob field log line is in English (RT-STATE-BLOB-LOG-ENGLISH)
2026-11-25 10:10:17 +01:00
b88e2b596b xgameruntime: wire XPackage slots 28/29/35/36/40 and flat C exports
Builds on #984 (which landed IXPackageImpl4, slots 5-10, 22, and 39): wires the remaining IXPackageImpl 1-3 EnumeratePackages (slots 28/35) and RegisterPackageInstalled (slots 29/36/40) vtable entries to the offline implementation, adds the nine flat C XPackage* exports in SHIM_TABLE(xgameruntime) forwarding to the same handlers, and adds unit tests in xgameruntime_test.cpp.
2026-11-25 14:27:08 +05:30
a3e2088fd6 Merge main into d3d-sample-positions
Conflicts, all kept from both sides:
- GraphicsPipeline: main's rectangle_stage took bit 9, so custom_samples
  moves to bit 10; sample grids sit next to main's async_build.
- The pipeline variant appends VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT to
  main's dyn_list (8 entries at most) and keeps main's lazy shader modules.
- initialize() takes main's per-aspect zeroing and depth-UAV paths and still
  passes the active sample positions to every barrier.
- prepare_draw keeps main's skip/quad-index handling and the sample
  positions argument; emit_commands keeps active_samples, including main's
  clear-pattern round trip and the release (into UNDEFINED) barriers.
- Texture creation keeps main's 1D/3D UAV limits and the sample grid.
- Both new replay_texture_barrier_test cases are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 13:56:55 +05:00
87e4787c0a d3d12_xs: the state-blob field log line is in English (RT-STATE-BLOB-LOG-ENGLISH)
runtime/shims/d3d12_xs_device.cpp printed "[rt] d3d12_xs: state blob: campo
sin identificar en 0x%03x = 0x%08x", the only Spanish [rt] line; it came in
with #984. It now reads "unidentified field at", as aslan2142 proposed in
the coordination issue (#1608). The format arguments are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:56:22 +01:00
7884142013 check.py: fmt_all_test docstring counts the fixture as it is (DOC-FMT-ALL-DOCSTRING)
The docstring still described cs_fmt_all before b5b650186 grew it:
"28 loads ... 15 stores ... 316 words in all". The fixture has 32
typed loads (29 buffer_load_format_xyzw + 3 tbuffer_load_format_xyzw),
20 buffer_store_format_xyzw, and len(FMT_ALL_WORDS) is 336, as the
.asm header, the comment above FMT_ALL_WORDS and docs/design.md
already say. Only the three numbers change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:51:29 +01:00
abe3f20429 d3d12: the every-byte hash of a mapped title texture reads write-combined memory through a streaming copy (RT-TITLE-HASH-WC-STREAM)
refresh_title_textures hashes every byte of a mapped texture of up to 4 MiB each sixth pass, straight from the
title's pages. In a real boot those pages are write-combined, where ordinary loads are not cached: on the intro one
such hash took 36 ms on average and up to 78 ms, so every sixth pass cost one to two frames and the title presented
24 frames a second where it paces itself for 30. The bytes now come through copy_guarded's streaming copy, as the
fill of the same texture already does, and the copy is hashed: 0.4 to 1.1 ms.

The test places a mapped plane in ordinary and in write-combined pages and changes one byte the sampled hash does not
cover.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 09:46:06 +01:00
0000242d8d runtime: register dual_source_fragment_test away from the slot 57 tests (RT-DUAL-SOURCE-BLEND)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:44:26 +01:00
8b771908c3 Merge main into feat/gdk-lifecycle-window-hook (#769)
scripts/build_runtime.ps1 conflicted in the $files list of the build
without CMake: main added shims\silent_audio.cpp there (#1598) after this
branch had merged main, and this branch adds shims\lifecycle.cpp. Both
entries are kept, lifecycle.cpp where this branch had it. The branch's
other change in that file (user32.lib on the link line) merged cleanly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:41:48 -05:00
d763845349 d3d12: dual-source blending reads SV_Target1 at Location 0, Index 1 (RT-DUAL-SOURCE-BLEND)
A PSO whose blend state uses a SRC1 factor gets its fragment module's Location 1
colour output moved to Location 0 with Index 1, as Vulkan takes the second
source. Slot 57 native PSOs now map the SRC1 factors of state blob A.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:37:42 +01:00
1b9e4969a5 windows-boot: capture private minidumps and stacks on abnormal exit 2026-11-25 13:22:52 +05:00
8665eee910 Merge commit '3f81d46ac' into HEAD 2026-11-25 03:21:26 -05:00
ebe4512253 d3d12_xs: depth, stencil and raster state for slot 57 native pipelines from state blob A (RT-SLOT57-DEPTH-RASTER)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:19:01 +01:00
f5576377d1 d3d12_xs: a native PSO whose blend state the device refuses is built with blending off on its stand-in targets (RT-SLOT57-BLEND-STATE)
On devices without renderable B4G4R4A4, the Vulkan layer refuses blending on the
RGBA8 stand-in (E_NOTIMPL). Turn blending off on those targets, then on every
target, before leaving the pipeline to the PC description path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:13:09 +01:00
4e7b764dbc d3d12_xs: integer render targets keep blending off in slot 57 native PSOs (RT-SLOT57-BLEND-STATE)
A library pipeline enables MAX on an R8_UINT target; the colour block bypasses
blending there, and D3D12 refuses the PSO.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:02:38 +01:00
1940c2ac46 d3d12_vulkan: a tile heap prefers device-local memory instead of requiring it
ID3D12Heap tiles for reserved resources were allocated with DEVICE_LOCAL required, so once VRAM
was full (an 8 GB card without Resizable BAR, during the story load) the allocation failed for
every type and tiles() returned nothing. The memory types are the sparse resource's own
memoryTypeBits, so a system-memory type there is valid, and the heap now comes from it when VRAM
has no room.
2026-11-25 08:59:16 +01:00
092cc9e07e d3d12_vulkan: try a memory type once while its last six tries all failed
With VRAM full the NVIDIA driver answers VK_ERROR_OUT_OF_HOST_MEMORY for the device-local
heap too, so every texture that spilled to system memory first slept through five retries
under memory_mutex. After a type fails all six tries, allocate tries it once for the next
two seconds. The driver's spurious answer with memory free still gets its retries, since a
retry that succeeds never marks the type.
2026-11-25 08:57:49 +01:00
798077b7cb d3d12_vulkan: leave the BAR window to host-visible VRAM allocations and stop retrying it when full
Without Resizable BAR the DEVICE_LOCAL | HOST_VISIBLE type sits in a heap of about 256 MiB.
memory_type_order put it second for every texture and default-heap buffer that prefers VRAM,
so once VRAM filled up each such allocation failed there too, and the NVIDIA driver's
VK_ERROR_OUT_OF_HOST_MEMORY answer was retried six times with sleeps under memory_mutex
before falling back to system memory. Only allocations that ask for both DEVICE_LOCAL and
HOST_VISIBLE now try the window in its place; the others try it last, and an
out-of-host-memory answer from the window is believed the first time. Failures past the
first 16 are counted at powers of two.
2026-11-25 08:57:49 +01:00
0fcca5ef26 d3d12_xs: map console list slot 80 DispatchX to PC Dispatch slot 14 2026-11-25 12:44:12 +05:00
2f44380590 docs: state blob A's colour-target registers, measured over the library (RT-SLOT57-BLEND-STATE)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 08:41:48 +01:00