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>
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>
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>
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>
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>
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>
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.
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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.
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.
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)
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.
The slot 73 fallback retried every IID the PC device refused, so asking for
a public list revision the backend lacks (ID3D12GraphicsCommandList9 on a
revision-8 device) returned S_OK and a base list instead of E_NOINTERFACE
(review on #359). Only the console ID3D12GraphicsCommandListX IID
{c3827890-4024-474c-98cf-645b51dc4874} (#445) is now created as
ID3D12GraphicsCommandList, in one call, and the list proxy answers
QueryInterface for it. Every other IID reaches the device unchanged.
Tested: xs_proxy_mock (List9 and an unknown IID keep E_NOINTERFACE with a
null output; the console IID is created once and is queryable) and
d3d12_vulkan_device with MSVC 14.44 / SDK 10.0.26100; docs tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Queue slots 16 and 17 are GetTimestampFrequency(UINT64*) and GetClockCalibration(UINT64*, UINT64*) on the PC:
both write through their first argument. The retail title calls slot 16 with one of its fences and a value, the
shape of Signal(fence, value). On the console queue Signal and Wait sit two later than on the PC, at 16 and 17,
as the frequency getter does at 18. Forwarded by number, the call wrote the frequency over the first word of
the fence proxy, its vtable pointer; the title's next call on that fence went through a null pointer.
The title's call (set_console_caller) whose first argument is a fence proxy now goes to the PC Signal or Wait
with the real fence. A host caller keeps the PC getters, and so does a title call whose first argument is no
object of this proxy, which cannot be a Signal.
Same family as the slot 18 change: the console queue order of old PR 2490 (Nolan Cotter), as one rule for
main's queue proxy. xs_proxy_mock_test: both slots with a fence reach the mock queue's slots 14 and 15 with the
real fence, the fence proxy's first word is unchanged, and the non-fence and host calls reach slot 16.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Queue slot 18 is ID3D12CommandQueue::GetDesc on the PC: a struct return that writes a 16-byte description through
the hidden pointer. The retail title calls slot 18 with one pointer to 8 bytes, the shape of
GetTimestampFrequency(UINT64*), which the console queue has there (two methods are inserted at 14/15, so the PC
slots 16 to 18 sit two later). Forwarded as GetDesc, the call wrote a description over the title's 8 bytes and
what follows them; the title then went wrong a little later, after its first submission.
The title's call (set_console_caller, as device slots 61 and 74) now goes to the PC slot 16. A host caller, and
every caller when no classifier is installed, keeps the PC GetDesc.
The reading of slot 18 is that of the console queue work in old PR 2490 (Nolan Cotter), which answers an
undetected slot 18 as the frequency getter because it is the only reading that cannot overrun its argument. That
work's layout detection does not apply to main's queue proxy; this is the one rule the boot needs, written for
it. xs_proxy_mock_test: the guest call reaches the mock queue's slot 16 with its pointer and leaves the words
around it; a host call, with a classifier and with none, reaches slot 18.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Device slots 17 to 24 translate a CPU descriptor handle in the title's own range (__XMemAllocationHooks__) to
the real heap's. The five command-list methods that take such handles did not: OMSetRenderTargets (console slot
50), ClearDepthStencilView (51), ClearRenderTargetView (52) and the two ClearUnorderedAccessView (53, 54) went
to the real list with the title's address, which is no descriptor there. On the retail boot the first
ClearRenderTargetView made the list's Close fail.
They translate now, in copies: the caller's arrays are not written, and a handle outside the range is passed as
it is. Slot 51 gets a typed thunk, because its depth is a FLOAT in XMM3, which the all-integer list thunk loses.
This is 0aba6c361 (LeonidaBringup) written again for main's list proxy, where that commit does not apply (it
sits on old PR 2490's list proxy). xs_proxy_mock_test: the five slots with a handle inside the range, one
outside it, and the caller's arrays unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
The retail title resets its command lists through list slot 139, with (allocator proxy, pipeline state). main's
slot map had no entry for it, so the call was recorded and dropped and the list stayed closed. The map sends it
to the PC slot 10, and the unwrap keys on the PC slot, so console slot 10 and console slot 139 both hand the real
list its real allocator (and a wrapped pipeline state the same way) and re-pin the inline cursor.
The mapping and the unwrap rule are those of ef9d0759d (Nolan Cotter; measured by Pipodi), written again for
main's list proxy, where that commit does not apply. xs_proxy_mock_test checks the map entry and a slot 139 call.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
(cherry picked from commit e925b63455)
Adapted to main by Mumogg: main has command-list proxies, so the shared execute function replaces them by their
real lists in a copy of the array (UnwrappedArray), for the console slot 35 as for the PC slot 10, whose test
failed otherwise. The slot 35 mock case passes two mock lists instead of two numbers and checks that they arrive
and that the caller's array is not written.
The stand-in also took a host's ID3D12Device9::ShaderCacheControl call through the proxy and answered S_OK
without reaching the device (found on native Windows by BadgersMC in the review of this change). Slot 74 now
asks the caller classifier slot 61 uses (set_console_caller): a caller in an image the guest loader mapped gets
the stand-in, any other caller, and every caller when no classifier is installed, is forwarded to the PC slot 74
or refused past the PC device's table.
xs_proxy_mock_test: the guest case under a classifier, and the host case with a classifier and with none, on a
device that has ShaderCacheControl and on one that does not.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
The proxy also serves host callers: d3d12_vulkan_device_test drives the Vulkan device through it,
and its ID3D12Device5::CreateMetaCommand call (PC slot 61) landed in proxy_create_sampler_x
(found by nullmarsh on #7115: the test stopped at line 5763 instead of main's known line 6574).
Slot 61 now checks the caller's return address with a classifier the runtime installs
(set_console_caller, the name #7490 uses): D3D12XboxCreateDevice installs
rt::shims::mapped_image_base, so only a caller in an image the guest loader mapped gets
CreateSamplerX. Any other caller, and every caller when no classifier is installed, is forwarded
to the PC slot 61.
xs_proxy_mock_test checks all three cases: no classifier (PC slot 61), a guest caller (PC
CreateSampler with the same words; a null description skipped) and a host caller under an
installed classifier (PC slot 61). d3d12_vulkan_device_test again stops at line 6574, as on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 8f756ebe048af042638ce51a61490f35f4f44ee3)
(cherry picked from commit c915e1da45)
The retail title calls slot 74 once; the PC slot 74 reads the first pointer as kinds and returns E_INVALIDARG, so the title hits an int3. The proxy handler does not call the PC device, writes nothing, logs the three words once, and yields to an env slot override that moves a route onto 74.
(cherry picked from commit cdeee35aa8)
Adapted to main by Mumogg: the queue route inside route_xbox_device_slot calls proxy_create_command_queue_xbox
(the 32-byte description of 0cde63d61), as the inline route did before this commit moved the routes into a
function.