Commit Graph

149 Commits

Author SHA1 Message Date
c34cec72ee Merge pull request #2593 from Bloh09/fix/ci-main-red-tests 2026-11-29 13:44:04 +01:00
01c555a3c1 Merge pull request #687 from kotekompotek/work/d3d12-xs-list-slot80-dispatch
d3d12_xs: map console list slot 80 DispatchX to PC Dispatch slot 14
2026-11-29 09:10:46 +01:00
02c3ef96d1 Merge pull request #1390 from Diegobecker07/old-9990-slot-caller
d3d12_xs: the first call of a forwarded device slot names its caller (OLD-9990, RT-526)
2026-11-29 09:10:05 +01:00
a5314101cc runtime: xs_proxy_mock times the list-value gate with steady_clock (CI-XS-PROXY-TICK-CLOCK) 2026-11-28 17:31:05 -08:00
f64162d0a3 Merge pull request #2516 from Tyrannys/claude/xs-console-placement-layout
Size read-only console textures in the title's swizzle mode (RT-XS-CONSOLE-PLACEMENT-TITLE-LAYOUT)
2026-11-29 02:04:39 +01:00
193a692863 Merge pull request #2498 from Tyrannys/rt-xs-descriptor-mirror-gaps
d3d12_xs: CreateSamplerX writes through; mapped descriptor ranges are left to the submission-time pull (RT-XS-DESCRIPTOR-MIRROR-GAPS)
2026-11-29 02:04:23 +01:00
59feb165bd d3d12_xs: leave a mapped descriptor range to the queue's pull at submission
From timbot103's review of #2498.

A mapped real range is the Vulkan device's live arena: shaders of lists
already submitted read it, and the queue rewrites the slots it pulls there
in place (title buffer addresses rebased) when it submits. local_mirror_table
copied the title's raw slots into it while a list was being recorded
(SetGraphicsRootDescriptorTable / SetComputeRootDescriptorTable), which could
overwrite a translated slot an earlier submission was still reading. The
first commit of this PR made that happen on Wine as well; on Windows, where
VirtualQuery reports the arena as accessible, main already did it.

local_mirror_table now leaves a mapped range alone. The queue pulls the
title's slots of every bound table itself at submission
(pull_title_descriptors through title_va_aliases), which needs no
VirtualQuery of the arena, so Wine loses nothing.

xs_proxy_mock_test, check_descriptor_mirror case 2: with a translated value
in the real slot, binding a table over it (graphics and compute) leaves the
slot as it was, and the submission-time pull then takes the title's slot.
The previous commit fails the first of these checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 20:11:24 -06:00
c05dc2ff52 Size read-only console textures in the title's swizzle mode
Slots 25 and 108 size a list from the PC form of its descriptions
(pc_resource_desc), which drops the title's layout word (0x100 | swizzle
mode). console_texture_layout read the layout from that PC form, so a
texture only the CPU fills was sized in XG's default mode instead of the
one the title named: a 64x64 BC7 texture in SW_64KB_S came out 4 KiB
instead of 64 KiB, a 32x32 RGBA8 linear texture 4 KiB instead of 8 KiB.

Pass the title's layout word to console_texture_layout in
console_placement and apply_console_placement, as the unordered-access
rule already does.

Found by kevincommits (#1608).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:09:12 -06:00
a23273b5c0 d3d12_xs: CreateSamplerX writes through, and mapped heaps take bound tables
Two gaps in mirroring title-backed descriptor heaps on the Xbox console path:

- Xbox device slot 61 (CreateSamplerX) created the sampler in the real heap only. Every other
  descriptor creator and copier also stores the result at the title's address (local_write_through),
  so a title that copies samplers out of its own heap memory read zeros. Slot 61 now writes through
  as slot 22 does.
- local_mirror_table, run when a descriptor table is bound (list slots 35/36), checked the real range
  with VirtualQuery even when it is a mapped range. Wine can report a live vkMapMemory span as
  MEM_FREE, so on Wine the table was never mirrored. It now skips the check for a mapped range, as
  local_write_through does.

From kevincommits' finding in #1608 (item 2). xs_proxy_mock_test gains check_descriptor_mirror, with
the mock's real heap pointed at memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 13:38:27 -06:00
53ed711b85 xs proxy mock: check queue and fence ownership during forwarding 2026-11-27 12:53:48 -06:00
0f7868ffad Merge #1957 from IlyassRS3: work-aware timeout clock for console command-list value waits
Head 9520db518.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:16:31 -05:00
b3e541b224 d3d12_xs: drop the null-RTV marks of a descriptor heap when it is released
The null-view marks (#1504, by ubiquitarianism) are kept by the real CPU
handle. They were moved by descriptor copies and cleared by a view made
with a resource, but never dropped when the heap went away, so an RTV heap
made later at the same address inherited stale marks and its clears were
skipped. The heap proxy now records an RTV heap's real CPU range and
heap_release drops the marks in it. The barrier conversion keeps no state
across calls, so it needs nothing here.

xs_proxy_mock_test: an RTV heap's marked view is skipped while the heap
lives and cleared after it is released; a mark outside it stays; a second
heap at the same address starts unmarked and marks again. docs/d3d12_vulkan.md
says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:03:00 -05:00
8d686309b0 Merge main into integration/boot-combined (RT-BOOT-COMBINED)
Conflict in runtime/shims/d3d12_xs_device.cpp, proxy_copy_descriptors_simple:
keep this branch's copy_null_rtv_marks call and main's fsdraw::enabled()
gate for the descriptor-copy diagnostic.

tools/rdna2spirv.py merged without a textual conflict, but #1662 on main
calls restore_dot4_inline_sel in the exact re-anchoring path, which this
branch had deleted. The merge puts main's function back so that call
resolves; the next commits reconcile it with the dot4 op_sel rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:49:53 -05:00
7551c8aa8c Merge branch 'fix/rt-null-barrier-clear-v2' into local/boot-combined
# Conflicts:
#	runtime/shims/d3d12_xs_device.cpp
2026-11-25 16:06:44 -05:00
9f98dcc617 Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY)
Fall back to a dedicated buffer allocation when the shared arena fills.
Update console descriptors and resource backing, preserve pipeline cache
entries, and replay mesh records using bounded indirect arguments. Keep
scripted input available until read and cover the runtime and translator
paths with synthetic tests.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
2026-11-25 14:30:51 -06:00
9520db5187 runtime: cap all list-value wait pauses, scale demoted caps, and test Pump 2026-11-25 18:52:28 +01:00
94ba78348e d3d12_xs: slot caller via a formatter hook, cleared on reset (review of #9990)
- The proxy no longer calls rt::shims::module_offset itself: gta6rt sets it
  with set_device_slot_caller_formatter; with none set the address is shown
  in hex, so xs_proxy_mock_test links d3d12_xs_device.cpp alone as before.
- reset_device_proxy_stats() clears the stored caller with the first-call
  flag; xs_proxy_mock_test checks call -> caller -> reset -> empty -> call.
- The accessor comment says which slots it covers and that it is a
  diagnostic observation (flag set before the caller is stored).

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:33:54 -03: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
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
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
0fcca5ef26 d3d12_xs: map console list slot 80 DispatchX to PC Dispatch slot 14 2026-11-25 12:44:12 +05:00
970837c753 d3d12_xs: null-resource texture barriers and null-view RTV clears on the console list
List slot 146 (Barrier -> GCL7 80): a texture barrier with no resource, which
the console takes as a global barrier, is forwarded as a D3D12_GLOBAL_BARRIER
with the same sync and access; a mixed texture group is split into runs in
order, in storage that lives for the call. Calls with nothing to convert keep
the title's pointer. A group array that cannot be read safely (null with a
nonzero count, an unknown group type, absurd counts) is refused whole and
logged once per reason.

List slot 52 (ClearRenderTargetView -> PC 48): the device proxy marks the real
handle when CreateRenderTargetView gets no resource (moved by RTV descriptor
copies, cleared by a view made with a resource), and the clear of a marked view
is skipped, as on the console. Other views keep today's path.

Before this, both calls put the PC list in its error state, so Close failed and
ExecuteCommandLists dropped the submission. xs_proxy_mock_test models that
error state in its mock list and covers both paths; the two old slot-146 cases
that passed garbage words now pass valid ones.

The null-resource barrier and null-view clear behaviour were first reported by luizwidmer/palmetto.
2026-11-25 00:51:27 -05:00
3cf0a41bc5 d3d12_xs: make a D16S8 depth texture without UAV when the depth provider refuses it
Since #939, slots 76 and 133 hand a depth-stencil texture with unordered access
to the depth provider. On a GPU with D24S8 attachments (every NVIDIA card) the
Vulkan layer's pc_format() makes D16_UNORM_S8_UINT (format 118) as
D24_UNORM_S8_UINT, and Resource::enable_depth_stencil_uav accepts only
R16_TYPELESS, 118 and R32G8X24_TYPELESS, so it answers E_INVALIDARG. Slot 133
passed that on for a 1280x720 format 118 texture with ALLOW_DEPTH_STENCIL |
ALLOW_UNORDERED_ACCESS (all-ones layout), and the boot stopped on an int3.

When the provider refuses (E_INVALIDARG or E_NOTIMPL from the provider call
itself), slot 76 now makes the committed texture without unordered access and
slot 133 goes on to its stand-in (the title-placed texture, else the committed
one), as both did before the provider. The first refusal per slot is logged.
Any other failure is passed on as before: the provider out of memory, the
backing's own CreateCommittedResource, a refused placement or description.
The refused backing is released and no placement range is registered.

On a real boot (Windows 11, RTX 4070 SUPER, driver 621.24), on 0bc810504 with
an earlier form of this change that fell back on any failure of the depth path
(the only one that occurred was the provider's): the fallback fires once
(slot 133, format 118, hr=0x80070057), no int3, 6,187 PresentX ok and 0
failed, 69/69 captures non-black, and the boot reaches the first-run pages.
Without it, 3 of 3 boots stopped on the int3 after 182-362 PresentX.

Tests:
- xs_proxy_mock: a mock provider refusing a format 118 texture (E_INVALIDARG,
  E_NOTIMPL) through slots 76 and 133 gets S_OK and the stand-in, with the
  refused backing released; E_OUTOFMEMORY from the provider, a failing backing
  and a refused placement are passed on with no stand-in.
- xbox_d16s8_refused_uav (Vulkan, LEONIDA_CONSOLE_D16S8=d24): slots 76 and 133
  return a depth-stencil texture without unordered access.
Both fail without the change (slot 76 and slot 133 each checked on its own).

Follow-up: teach enable_depth_stencil_uav the D24S8-made form of format 118,
so these textures keep their UAVs on NVIDIA too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-24 23:34:00 -05:00
6ed716a99a Merge main into RT-QUEUE-SIGNAL (#430)
Everything below this rung (#414, #416, #427) and the rung's own routing are in
main already, through #984 and #939, in main's form; what is left of #430 is
its test of queue slot 17, ported onto main's layout detection.

Conflicts, all resolved to main's form:
- runtime/shims/d3d12_xs_device.cpp: main's queue slot 16/17 rule (a fence
  there is the newer layout's Signal/Wait, for any caller) replaces the
  rung's caller-gated rule; main's PresentX routing (slot 30, or 32 once the
  newer layout is detected, LEONIDA_XS_PRESENT_X_SLOT) and lazily built
  presenter replace the fixed slot 32 of #414; main's list proxy already
  translates the CPU handles of console list slots 50 to 54 (#416) and
  drops unordered access from a depth-stencil texture at slot 76 (#427).
- runtime/shims/d3d12_xs_device.h, runtime/shims/xbox_present.cpp,
  runtime/shims/xbox_present.h, runtime/src/frame_pacer.h: main's shared
  FrameTokenSource (Logan's piece of #414, as #984 carried it).
- runtime/shims/d3d12_xs_desc_clean.h, runtime/test/device_proxy_test.cpp:
  main's without_depth_stencil_uav and its slot 25/76 test (#427).
- runtime/test/xs_proxy_mock_test.cpp: main's file, which already has
  check_list_cpu_handles (#416's cases and more); the rung's slot 16/17 case
  is ported to main's form at the end of check_xbox_queue_slots: slot 16 and
  17 with a fence reach PC Signal and Wait with the real fence, not the PC
  getters, and the fence proxy's vtable pointer is unchanged. The rung's
  host-caller and no-fence expectations are dropped: under main's rule a
  fence at 16 proves the newer layout, after which those calls answer S_OK.
Auto-merged, then set to main's content:
- runtime/test/queue_proxy_test.cpp: #414's call of queue slot 32 as an
  overridden slot; on main slot 32 is routed only on the newer layout and the
  sweep of the console tail already calls it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:35:34 -05:00
d9674fca8c Device slot 133's stand-in can read its fourth word as a barrier layout: LEONIDA_SLOT133_LAYOUT_WORD=1
The committed stand-in of slot 133 reads the word as a resource state, which is what the story-load boots had wherever the stand-in answered, and stays the default. The placed-at-VA handler of the same slot reads it as a D3D12_BARRIER_LAYOUT, and #939 measured the title passing 6 (SHADER_RESOURCE) for 1x1 targets, which as a state is INDEX_BUFFER | RENDER_TARGET. #939's reading is now behind the switch: CreateCommittedResource3 with the layout as given on a device with ID3D12Device10, else the legacy state of the layout. xs_proxy_mock_slot133_layout runs #939's cases in a process of its own.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:27:40 -05:00
7ea226e65b Merge main (0aecc5efa: #984 and #968) into the #939 merge
main now holds the #984 merge (18a22c1ae) and #968, queue slot 31 as CopyPageMappingsBatchX. Two conflicts: the include list of d3d12_xs_device.cpp (both includes kept) and the call order in xmem_test.cpp (the two page-mapping tests of #968 run after test_physical_pages, after the early return of #939's file-pools mode). The slot 31 dispatch of #968 stays ahead of the presentation routes, so #939's rule for queue slots 30 to 32 on a device that had a presentation handler does not reach it where xmem is linked.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:09:27 -05:00
b8447eec01 xs_proxy_mock_test: device slot 57 asks the native factory first and falls back on E_NOTIMPL
No test covered the chain the merge builds for slot 57: #939's NativeGraphicsFactory first, the base's PC description path (CreateGraphicsPipelineState with the bare programs) when the factory answers E_NOTIMPL. The new case checks, on the mock device: no factory reaches the PC path; a factory answering E_NOTIMPL is asked once and the PC path then runs; a factory that succeeds is the answer and the PC path is not asked; E_INVALIDARG, E_OUTOFMEMORY and E_FAIL are returned as they are; an unreadable description is refused before the factory; removing the factory restores the PC path.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:32:47 -05:00
116c6ca478 xs_proxy_mock_test: the placed-at-VA handlers take the clear value
The merged PlacedAtVaHandler keeps #939's seventh argument (the title's clear value, which the Vulkan device's create_placed_xbox_resource uses); the base's two test lambdas had six.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:28:22 -05:00
154e4ec034 Merge the #984 result (main + RT-PROTON-STORY-LOAD) into #939
The base is 8a242efeb, the merge of main and #984. 68 files conflicted; they were resolved in seven groups by
one rule: the same change in two forms keeps the base's form, everything only #939 has is kept, and where the
two solve one problem in two ways the base's is the frame and #939's plugs into it.

A, the Xbox proxy (d3d12_xs_device.cpp/.h, d3d12_xs.cpp, d3d12_xs_pso_stream.cpp/.h, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, device_proxy_test.cpp, queue_proxy_test.cpp): the base's files with #939's additions
ported in. Device slot 57 asks #939's NativeGraphicsFactory first and falls back to the base's
proxy_create_graphics_pipeline_from_native_code on E_NOTIMPL. Kept from #939: the providers (texture lease,
raw texture view, resource by address, constant view, descriptor mapping, depth-stencil UAV, texture pages),
the title-backed descriptor mirror, slot 13's feature answers, GPU labels on list slots 71/72. Dropped: #939's
duplicates of the boot ladder routes, its fallback window, its slot 133 stand-in.

A2 (xs_proxy_mock_test.cpp): the base's test with #939's slot 70 raw-buffer case; presentation cases follow
#939's rule that a device which ever had a handler has no queue fallback.

B1, the Vulkan device (d3d12_vulkan_device.cpp, d3d12_com.cpp/.h, shader_library.h, queue_families.h,
pipeline_cache_file.h, startup_trace.h): one lazy-pipeline mechanism, the base's; #939's pending_base_compile
and first_use_backend_pipelines dropped, prepare_on_bind and cold_graphics_compile kept. create_texture keeps
the base's signature; #939's deferred backing is folded into the base's placed-memory binder. #939's quad
lists as triangle indices.

B2, the D3D12 tests (d3d12_existing_heap, a8_dimensions, pipeline_cache_seed, title_va, rect_list,
shader_library, loader_tls_index0, draw, compute, xmem_placed, shader_library_corpus): the base's tests where
both carry the same case, #939's cases added (rebound tables, linear texture map, large vertex batch,
executable shaders, default A8 views).

C, the backend (vulkan_replay.h, vulkan_backend.h, vulkan_bindless.h, vulkan_scratch.h, vulkan_present.h,
rect_list_geometry.h, vk_test_device.h, vk_pipeline_check.cpp, vk_store_test.cpp, bindless_sizing_test.cpp,
replay_texture_barrier_test.cpp): the base's prepare_draw and lazy compute, its #1055 release rule and its
rectangle generator; #939's rectangle variants, GPU quad index expansion, 1D/3D and depth-stencil UAVs, the
label fence on the base's submit.

D, memory, services, presentation (xmem.cpp/.h, xg_xs.cpp, xg_xs_test.cpp, title_va_alias.h and its test,
main.cpp, frame_pacer.h, xbox_present.cpp/.h; xgameruntime_offline.cpp for one comment): the base's xmem with
#939's label hooks, file-backed sections and pin_mapped_data; both texture computers in xg_xs.cpp, the base's
answering first; --first-run-ui kept without host speech in its profile.

E, build, tools, docs (runtime/CMakeLists.txt, make_game.py, tools/rdna2spirv.py, tools/shader_disasm.py,
scripts, tests, docs; docs/README.md and tests/test_exe_shaders_stage.py beyond the conflicts): the base's
v_dot4 decode, #281's disassembler form and tests/semantic/test_fspx_dot4_op_sel_disasm.py dropped; the
base's executable-shader step with #939's cache fix; 366 registered tests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:26:00 -05:00
6fdeadfe50 Merge main with #984 into RT-QUEUE31 (#968)
Merges the local m984-on-main (1d89b20c5f), main with #984
merged, into #968's head f2268abea.

Conflicts and their resolutions:

- runtime/shims/xmem.h: both sides appended to the end of rt::xmem. Kept
  geometry_aliases and transfer_physical from #984 and appended #968's
  CopyPageMappingsFn typedef and the inline copy_page_mappings_fn after them.
- runtime/shims/xmem.cpp: copy_page_mappings and the self-registering
  g_copy_page_mappings_set stay right after XMemMapPhysicalPagesScatter,
  followed by #984's shadows_write_watch. One-line port: #984's g_mapped stores
  the page number itself (HostUnorderedMap<uintptr_t, uint64_t>), so
  `it->second.page` becomes `it->second`.
- runtime/shims/d3d12_xs_device.cpp:
  - includes: #968's "xmem.h" beside "d3d12_trace.h", then #984's includes;
  - constants: #984's block kept, kQueueCopyPageMappingsBatchX = 31 added after
    kQueueExecuteCommandListsX and its static_assert;
  - the slot-31 section (ConsolePageRange/Batch, copy_console_page_range,
    queue_copy_page_mappings) goes after #984's queue_execute_command_lists and
    before the "PresentX is at queue slot 30" comment;
  - child_slot: #984's queue block kept; the slot-31 dispatch (beyond the PC
    table and with xmem's hook set) goes just before the qroutes lookup, ahead
    of the presentation routes and the console-only S_OK tail. Newer-layout
    PresentX is 32, so 31 does not clash.
- runtime/test/xs_proxy_mock_test.cpp:
  - includes: "../shims/xmem.h" beside #984's d3d12_xs_frame_events.h;
  - #984's descriptor-heap and later checks kept, check_queue_copy_page_mappings
    after them. Without xmem the merged proxy answers slot 31 with the
    console-only S_OK, so that check's `== E_NOTIMPL` becomes `== S_OK` (and its
    summary line says so);
  - main: `|| check_queue_copy_page_mappings()` appended after
    check_presentation_wiring().

runtime/test/xmem_test.cpp merged without conflict: test_copy_page_mappings runs
after test_physical_pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:09:14 -05:00
8a242efebf Merge main into RT-PROTON-STORY-LOAD (#984): #396 and #403
Brings the branch up to main at b4b7756e8: #396 (console list slot 139 is Reset) and #403 (queue slot 18 is the frequency getter for a guest caller). The first merge already resolved the proxy to these two forms, so nothing changes in the code:

- runtime/shims/d3d12_xs_device.cpp: one conflict, main's copy of the base list proxy, which #396 edited and the first merge had dropped for #984's list proxy (the Reset rule of #396 is in #984's list_slot). Ours.
- runtime/shims/d3d12_xs_device.h: merged clean, unchanged.
- runtime/test/xs_proxy_mock_test.cpp: git added main's console_to_pc_list_slot(139) check next to the copy the first merge had put two lines lower; one stays, in main's place.

Every line the two pull requests added to these three files is in the result.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 19:57:34 -05:00
7e3bfb4e33 PresentX: docs and a test state the one-slot-per-layout rule of the merge
The merged queue proxy recognises PresentX at slot 30 on a queue in the older layout and at slot 32 on a queue detected as the newer one (a fence at slot 16 or 17, or SignalX at 25), which is #984's measured behaviour, with main's LEONIDA_XS_PRESENT_X_SLOT pinning one slot and an attached handler answering first. Only one of the two is PresentX at a time: in the newer layout slot 30 is another method.

docs/d3d12_vulkan.md still had main's row (the queue slots stay refused, gta6rt creates no presentation) and runtime/README.md still said PresentX has an unknown slot. Both describe the merged code now. check_presentation_wiring gains the newer-layout case: before the fence 30 reaches the presenter and 32 does not, after it 32 does and 30 does not.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 19:56:42 -05:00
48ba269139 d3d12_xs: device slot 81 with no presenter answers as the measured boot did
The merge kept main's form of device slot 81 (GetFrameStatisticsX: an attached presentation answers first) and with it main's answer when nothing is attached, S_FALSE with a zero count. No retail run has been through that answer: it is a reading of the public samples. #984, the tree that was measured to boot through the story load, answers the same call with S_OK and a zero count, and E_POINTER for a null count or for a count above zero with no array (its GetFrameEventsX handler). Nothing attaches a presentation in gta6rt, so this is the answer the title gets.

main's structure stays (the configurable route, the logged name, the handler first); only the answer without a handler is #984's. Both forms write the count through the third argument, so the two do not disagree about the layout. The mock tests (env-slots-invalid, check_presentation_wiring), the header comment and the row in docs/d3d12_vulkan.md say the same.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 19:42:09 -05:00
39879ce0fd Merge main into RT-PROTON-STORY-LOAD (#984)
Merges main at 1154976d4 into the integration branch at 273b3bdf9 (merge base ece4ba5b3). 42 files conflicted;
this commit is the resolution only. Build and test repairs follow in their own commits.

Rule of resolution: where both sides added different things, both stay; where both made the same change in two
forms, main's reviewed form stays and whatever #984's form did in addition is carried into it; where the two
changed the same code for different purposes, both purposes are kept.

Xbox proxy code (runtime/shims/d3d12_xs_device.cpp, d3d12_xs_device.h, d3d12_xs.cpp, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, registry.cpp):
- d3d12_xs_device.cpp is #984's file with main's differing pieces ported in: env_slot and the configurable device
  routes, XboxQueueSlotRoutes, PresentationHandler / set_presentation_handler, the console caller rule for device
  slots 61 and 74 (#383, #385), route_xbox_device_slot, slot 81 as GetFrameStatisticsX, create_host_device, the
  console-form rule for slots 25 and 56, the console list IID of #359, and the forms of queue slot 18 (#403) and
  list slot 139 (#396).
- Kept from #984: the list proxy with handle translation, queue slots 16/17 as Signal/Wait, the fence's
  completed-value mirror, the shared FrameTokenSource, PresentX through queue_present_x when no handler is
  attached (slot 30, or 32 on a queue detected as the newer layout), slots 27/53/55/57/70/71/133, the wider
  pc_resource_desc, S_OK for queue slots past the PC table.
- Dropped: #984's GetFrameEventsX and LEONIDA_XS_FRAME_EVENTS_SLOT, its second-word rule for slot 61, its
  undetected-layout rule for queue slot 18, its list IID mapping to GraphicsCommandList6; main's copy of the base
  list proxy, its null-view slot 70 and its refusing slot 133.

Proxy tests (runtime/test/xs_proxy_mock_test.cpp, device_proxy_test.cpp, queue_proxy_test.cpp):
- Checks of both sides, each run once; main's forms of the render-target size and layout checks with #984's extra
  cases added; main's --env-slots-74 and #984's --env-slots-70.
- Adapted to the merged code: the queue tail answers S_OK, slot 73 answers an unknown IID with the list proxy,
  the queue slot 18 case installs a console caller. Dropped: #984's slot 81 GetFrameEventsX cases.

D3D12/Vulkan layer (runtime/shims/d3d12_com.cpp, d3d12_vulkan_device.cpp, runtime/src/command_list.h,
frame_pacer.h, shader_library.h, vulkan_backend.h, vulkan_replay.h, runtime/test/command_list_test.cpp,
d3d12_close_parity_test.cpp, d3d12_execute_indirect_validation_test.cpp, replay_texture_barrier_test.cpp,
vk_pipeline_check.cpp, vk_test_device.h):
- Resource::create_texture: #984's title images (deferred placed, pending streamed, title pool) and main's
  ordinary textures (#1413 shared blocks, #1364 staging fallback) are exclusive branches chosen by the texture's
  origin, so both pools run on disjoint sets of textures.
- frame_pacer.h is main's pacer (#402) with #984's FrameTokenSource as the token counter.
- main's forms kept for ExecuteIndirect (#1066, #377), the barrier into LAYOUT_UNDEFINED (#1055), the B4G4R4A4
  stand-in, per-face stencil masks, the unaligned tile staging (#528) and the device-lost flag (#980).
- shader_library.h: main's block inflate; #984's `bulk` parameter now defaults to true so main's callers keep it.
- Dropped: #984's B8G8R8A8 stand-in for B4G4R4A4 targets, its refusal of separate stencil masks, its zero-count
  refusal in ExecuteIndirect, its wider UNDEFINED -> UNDEFINED release and the test case for it.

Other shims (runtime/shims/dstorage.cpp, file_system.cpp, gameinput.cpp, xgameruntime_offline.cpp,
runtime/test/xgameruntime_offline_test.cpp, xmem_test.cpp):
- ReadFile and DirectStorage reads: #984's pinned kernel_writes read, then main's touch_pages retry on
  ERROR_NOACCESS. main's rt::fs::read_file is folded into #984's read_file.
- gameinput: main's strict LEONIDA_INPUT_SCRIPT parser with #984's rsup/rsdown entries.
- Speech synthesis: main's one silent voice and handle checks; #984's accept-anything form dropped.

Build, tools, docs (runtime/CMakeLists.txt, runtime/cmake/translator_deps.cmake, scripts/build_runtime.ps1,
make_game.py, tools/rdna2spirv.py, shader_disasm.py, shader_ir.py, shader_library.py,
runtime/test/shaders/cs_imgload_tfe.asm, cs_imgload_d16_tfe.asm, docs/README.md, boot.md, d3d12_vulkan.md,
runtime/README.md):
- Unions of the test, target and source lists; spirv_loop_guard.py added to translator_deps.cmake.
- rdna2spirv.py: main's DPP compare rule (#957), SMEM vcc base (#647) and widen_wave64_masks (#1021); #984's
  restore_skipped_instructions and restore_dot4_inline_sel. #984's duplicate widen_wave64_valu_masks dropped.
- shader_disasm.py and shader_ir.py: main's structure with #984's one-line-per-dword llvm-mc input and wave flags.
- shader_library.py: main's structure with #984's --compute-hashes and per-state compute variants.

One file that did not conflict is changed here: tools/rdna2_decode.py. Git kept both sides' decoders for a VOPC
compare with a DPP operand, and #984's narrower one shadowed main's; it is main's file again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 19:38:04 -05:00
fb2afdccc2 Merge main into RT-QUEUE18 (#403)
Merged on top of the merge made for #396 (main 507029d1e plus RT-QUEUE35,
RT-ALLOC9 and RT-LIST139). No conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 18:48:12 -05:00
864337351b Merge main into RT-LIST139 (#396)
Merged on top of the merge made for #395 (main 507029d1e plus RT-QUEUE35
and RT-ALLOC9). No conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 18:48:08 -05:00
b06d096ad0 Merge main into RT-ALLOC9 (#395)
Merged on top of the merge made for #391 (main 507029d1e plus RT-QUEUE35).

One conflict, in docs/d3d12_vulkan.md: both sides added a row at the same
place of the Xbox-only table. Both are kept: this branch's
"Command-allocator slot 9" row, then main's "Device slot 81, queue
PresentX/SuspendX/ResumeX" row. The code and the tests merged without
conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 18:47:24 -05:00
94c9e43154 Merge main into RT-QUEUE35 (#391)
Two files conflicted; in each, both sides had added something at the same
place and both are kept.

runtime/shims/d3d12_xs_device.cpp: this branch's
queue_execute_command_lists() next to main's XboxQueueSlotRoutes and
xbox_queue_slot_routes() (the PresentX, SuspendX and ResumeX routes).

runtime/test/xs_proxy_mock_test.cpp: main() runs check_xbox_queue_slots()
and then check_presentation_wiring().

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 18:41:34 -05:00
7234bcd7a5 Merge main into RT-SLOT108-REBASE (#727)
Three files conflicted; in each, both sides had added something and both
are kept.

runtime/shims/d3d12_xs_device.cpp: this branch still had the Xbox device
slot routes inline, followed by its fixed handlers for slots 86, 101 and
108; main has since moved the same six routes into
route_xbox_device_slot() (#385). The generic path now calls the helper and
then the three fixed handlers, so a configured route still wins over
them, as this branch's second commit intends. device_slot_overridden()
has main's list plus 86, 101 and 108.

runtime/shims/d3d12_xs_device.h: the comment lists both sides' slots.

runtime/test/xs_proxy_mock_test.cpp: the mock device keeps main's case 13
(CheckFeatureSupport) and this branch's case 68
(GetResourceAllocationInfo2); check_xbox_slots keeps main's slot 41 and 61
cases, one combined list of handled slots, and this branch's slot 86, 101
and 108 cases.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 18:23:04 -05:00
d7e2944757 Merge main into RT-SLOT74 (#385)
Three files conflicted; in each, both sides had added something and both
are kept.

runtime/shims/d3d12_xs_device.cpp: this branch moved the Xbox device slot
routes into route_xbox_device_slot(), which slot 74's handler asks first,
while main added a sixth route to the inline chain: GetFrameStatisticsX
(routes.frame_statistics, slot 81), answered by the presentation handler
or with S_FALSE and a zero count. The helper is kept and that route is
moved into it unchanged, between wait_event and queue_x as on main.

runtime/test/xs_proxy_mock_test.cpp: run_env_slots keeps this branch's
on_slot74 parameter next to main's EnvPresenter struct, and main() runs
check_slot74() and then check_presentation_wiring().

docs/d3d12_vulkan.md: both table rows, in slot order (74, then 81).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 18:10:14 -05:00
150b753449 Merge main into RT-SLOT61 (#383)
One conflict, in docs/d3d12_vulkan.md: both sides added a row to the same
table. Both are kept, in slot order: this branch's "Device slot 61" row,
then main's "Device slot 81, queue PresentX/SuspendX/ResumeX" row.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 17:55:46 -05:00
438859b525 Merge main into RT-SLOT41 (#377)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 17:15:39 -05:00
94f2773c1f Merge main into RT-XMEM-LEASE (#375)
One conflict, runtime/test/xs_proxy_mock_test.cpp, neighbours added on both
sides, both kept: the mock's `held` (this branch, slot 5 private data for the
committed-resource leases) next to main's `max_level` (FEATURE_LEVELS answer),
and this branch's five checks in main()'s list before main's
check_presentation_wiring().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:51:38 -05:00
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.

Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.

Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.

Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.

No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:42:12 -06:00
f2268abead d3d12_xs: queue slot 31 is CopyPageMappingsBatchX, mapped through xmem (RT-QUEUE31)
The retail title calls its command queue's slot 31 (game_scarlett_master.exe+0xf2cc7f) with a batch count, 24-byte
batches {destination, range count, ranges}, the base and page count of its physical-page pool, and 0. Each 12-byte
range {kind, start, count} maps pool pages at the destination: 0 a run, 1 one page repeated, 2 unmapped, 3 unchanged.
main refused the slot with E_NOTIMPL; the title does not test the result and goes on to read the destinations.

Each range now reaches rt::xmem::copy_page_mappings_fn, which maps the physical page behind every source page at its
destination page (a second view of the same section, so both addresses are one memory) and unmaps where the source has
nothing or the kind is 2. The hook is set by xmem.cpp; tests that compile the proxy alone keep the old refusal.

Tests: xmem_test (a run, one page repeated, an unmapped source page, a null source, an overlapping range, bad
addresses) and xs_proxy_mock_test (the four kinds, a range past the pool, an unknown kind, xmem refusing, no xmem).

AI-assisted.
2026-11-24 15:58:40 +00:00
245c959ea0 d3d12_xs: ask the host D3D12CreateDevice for feature level 11_0 (BL-2)
The host path of D3D12XboxCreateDevice asked the PC D3D12CreateDevice for
minimum feature level 12_0, which a comment called the least restrictive
floor. It is the other way round: the minimum refuses every adapter below
it, so a host that tops out at 11_x failed with E_INVALIDARG
(docs/boot_leads.md BL-2). rt::d3d12_xs::create_host_device asks for
kHostDeviceFloor = 11_0, the lowest level D3D12 creates a device at; the
device keeps its highest level, which FEATURE_LEVELS reports and the log
prints (max_feature_level).

xs_proxy_mock_test drives it with mock hosts that top out at 11_0, 11_1,
12_0, 12_1 and 12_2. Each one is created at 11_0, the device proxy's slot
13 reports the host's own top level, and the failure paths (no host
function, failing host, S_OK with no device) clear the output. With 12_0
as the floor the 11_x hosts fail. The Vulkan-backed device takes no feature
level and stays at 12_1 (no ray tracing tier, no sampler feedback).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:10:05 +05:00
00fc275459 Keep the Xbox list contract and explicitly managed presentation routing distinct
The known Xbox list interface can wrap a base desktop list and checks each forwarded slot. Detaching a managed presenter no longer falls back to a second window. Reset the integrated list counters with the rest of the device diagnostics.
2026-11-24 23:03:55 +08:00
2d9987f3cd Merge the upstream offline services, frame events and queue ABI into the Windows UI integration
Retain the first-run origin-token poll and shared tokens alongside standard origin, vblank and flip events. Route attached presenter callbacks before the fallback window and dispatch local speech through the Windows provider with the upstream offline fallback.

The offline pipeline checker now enables the runtime mesh query feature for cache-producing runs. A controlled GPU comparison with the same compute shader changed from a miss to an application cache hit.
2026-11-24 22:51:02 +08:00
e9a13181f4 d3d12_xs: route device slots 86, 101, and 108 to PC Device2/Device5/Device8
Reopened from #7201 (closed in the PR reset), rebased on current main.

Slot 86 (CreatePipelineState stream) -> PC slot 47, slot 101
(CreateStateObject) -> PC slot 62, slot 108 (GetResourceAllocationInfo2)
-> PC slot 68. Slot 108 accepts the console C-ABI order (return buffer
first) and the PC order, reads the title's 56-byte D3D12_RESOURCE_DESC
entries, expands each into a zeroed D3D12_RESOURCE_DESC1, normalizes
Xbox layout words and flag bits, and refuses a count with a null array.

Rebase: kept main's slot 133 (CreatePlacedResourceX) next to the new
slots, and slot 108 now masks flags with slot 133's PC set (0x5FF, which
keeps USE_TIGHT_ALIGNMENT and drops 0x200) instead of 0x1FF.

(cherry picked from commit 1b07215c84)
2026-11-24 18:43:05 +04:00
e59cc2e655 Distinguish desktop and Xbox feature queries while retaining the D16/S8 paths
Keep the desktop HRESULTs for Xbox-only formats. Check both console and desktop vtable callers in the mock, and exercise the full rectangle target for a derived PSO with a zero sample mask.
2026-11-24 21:46:19 +08:00