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>
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>
#741 added row 4a (the Wine-only gameinput.dll ordinal 1 stop) directly under row 4 of
docs/retail_boot_chain.md, which this branch edits. Both rows are kept unchanged.
tests/test_docs_*.py: 47 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
docs/boot_leads.md sends a reader to implement BL-1 because "the retail run on main ends in the stop-4 shape".
That line comes from retail_boot_intel_host.md, measured at main 867d922f. b7a3fed28 (the loader rewrites a
/GA executable's index-0 TLS reads) landed on main after that, and 4710549af after it, so the lead as written
describes a main that no longer exists. The integration tree's #4313 is a second design for the same stop
(the runtime's own EXE gives up index 0 at process start), not a fix main is missing.
- boot.md, triage step 3: what the stop looks like, what load() does about it, the log line that counts the
rewritten reads, the switch that turns the rewrite off, and the two tests.
- retail_boot_chain.md, row 4: #4313 is what the measured tree had; main carries b7a3fed28 and 4710549af.
- boot_leads.md, BL-1: a Status entry with the same, and what is left of the lead.
Nothing was run on the retail executable for this (it needs game files), and all three places say so.
Tested at main a28927849: tests/test_docs_*.py, 47 pass; the repository-consistency set (test_cmake_*,
test_shader_stage_resume, test_runtime_paths, test_docs_*, test_make_game_*, test_check_no_game_data*,
test_run_semantic_tests), 566 pass and 5 skip. scripts/check_no_game_data.py on the three files: clean.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
Under Wine the retail boot stops at GameInput.dll ordinal 1 (GameInputCreate)
right after stop 4: without the SDL3-built GameInput shim and its #1 alias, the
import binds to Wine's builtin stub. Measured by hcristosm in the old
coordination issue. Added as row 4a so the Windows stops keep their numbers.
Restored from old upstream PR 7383 and updated for #127, which merged the #1
alias (old upstream PR 7216's change): the "what clears it" cell now names #127
and says which builds still stop here (no SDL3, LEONIDA_SDL3=OFF, the cl.exe
fallback), and the link into the old repository is replaced by the measurer's
name and #127's Wine 11.21 reproduction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BatSmacker84 on old upstream PR 7998:
- The summary line now separates indirect vtable calls, indirect vtable tail jumps, and sites
through a verified dispatch routine. The JSON gains calls, tail_jumps and dispatch_sites. On the
1.0.2.1 executable: 95 sites = 94 calls + 1 tail jump (slot 2), 0 through a dispatch routine.
- "lists every" and "lower bound" are gone from the docstring, the help text and §5. The tool reports
the statically resolved sites for the device paths it follows; a slot without a row isn't shown
to be uncalled.
tupacfan04's secondary points from the review of the dispatch-routine commit, still open until now:
- A creator out-pointer in an object member was labelled "memory slot", yet it was dropped at the
next call. It is now "object member (followed until the next call)"; a stack slot is "stack slot".
- The no-.pdata window walk is tested, and it now goes on past a ret while a forward branch target
is still ahead.
- Conditional branches have tests: the device carried past an early return, and a join where only
one path holds the device.
Census unchanged: 95 sites across 42 slots, 12 not resolved. 15 tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every E9 was a tail call, including the `jmp rel32` MSVC emits for a long branch inside a function.
With the device in an argument register, such a jump counted as the device passed to another call,
it cleared the state, and it ended a window walk early (YordiLorenzo, pr-sorter). Slot 14 dropped out
of the fixture with pr-sorter's patch.
The walk now follows forward branches. A `jmp` (E9 or EB) or a conditional branch to a later
address in the walked range carries the known state to its target. There it is met with the
fall-through's state, keeping a fact only when both paths agree (vtable loads from either path are
merged). Past a `ret` or unconditional jump, the carried state replaces it. A jump back into the range
(a loop) carries nothing and isn't a tail call. Only a `jmp` out of the range is a tail call.
pr-sorter's repro is a test, together with the short form and a backward jump.
Census on the 1.0.2.1 executable: 83 -> 95 sites, still 42 slots, with no site or slot lost. 12 more
sites are behind a conditional branch around an early return: slot 17 (+5), slot 24 (+5), slot 133
(+2). Not resolved stays at 12: vtable loads with no matched call 2 -> 1, calls handed the device
9 -> 10, stores 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the two independent checks on old upstream PR 7998:
- The tool reads the executable only, so a slot called only from a bundled DLL is absent. Slot 76 is
the example: docs/d3d12_vulkan.md records the FidelityFX upscaler DLL calling it, so its absence
is not "unused by the title" (TheAirborneCoder).
- A credited table of TreXito's independent static read for slots 49, 50, 55, 57 and 81, with
matching site counts. These are their reads, not the tool's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A direct call with a method pointer left in rax was counted as that slot whatever the call reached,
so a helper that only returns made a slot appear (shdann's repro on old upstream PR 7998). The target, or for
`call [rip+p]` the code the file's pointer p holds, must now reach `jmp rax` or `call rax` within 16
instructions without writing rax, calling or returning first (conditional branches allowed): the CFG
no-op dispatch and a guard check that ends in `jmp rax`. Verified targets are cached. Any other
target goes to a new "dispatch calls to unverified targets" count, never a slot.
The fixture's GUARD pointer now holds a `jmp rax` stub; new functions call a guard-check stub (slot
counted) and a helper that only returns (not counted, reported as not resolved), and shdann's patch
is a test. The census on the 1.0.2.1 executable is unchanged: all 83 sites are `call [vtable+disp]`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/d3d12_device_calls.py follows D3D12XboxCreateDevice's (or D3D12CreateDevice's) out-pointer to
the globals and stack slots that hold the device, and counts per vtable slot the `mov v,[device]` then
`call [v+disp]` / `call reg` / dispatch-with-rax sites, with the register that holds the device (rcx,
or rdx for the console's return-buffer form) and an argument-count estimate. What it can't follow
(vtable loads with no matched call, the device handed to other functions or stored to non-stack
memory, creator out-pointers it can't follow) is counted, not guessed. Slots 0-43 carry the PC
method names; past 43 only the slots the repository has measured are named.
The text report holds slot numbers and counts only; --out is required. Tested on a hand-built PE
(tests/test_d3d12_device_calls.py); docs/retail_boot_chain.md §5 has the method and its limits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
A retail title places a 256x256 R32_FLOAT texture through Xbox device slot 133
and then clears it through the value GetGPUVirtualAddress returns, used as a CPU
pointer. The layer answers 0 for a texture, as D3D12 does, so the title wrote
256 KB at address 0. XCL measured the same clear and returns the address the
title placed the resource at (its PR #168).
A slot-133 placed texture still gets its committed fallback image, but records
the title address and reports it from GetGPUVirtualAddress. Ordinary textures
still answer 0 and buffers are unchanged. The pixels do not alias the title's
pages yet, so a write through the address is not uploaded; that is the
page-mapper work and is called out in docs/d3d12_vulkan.md.
Tests: d3d12_existing_heap_test checks that the RENDER_TARGET layout and the
COMMON retry both answer the title address; it exits 0, and gta6rt links.
AI-assisted: DeepSeek V4.1 Flash 1017 (Alibaba Token Plan); coordinated by Qwen4 Max Preview.