docs/boot.md: main added LEONIDA_WRITE_DIR / LEONIDA_SAVE_DIR to the
--overlay bullet and a new "Under Wine on Linux" section; keep both and
the T: paragraph of this branch after main's sentences.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hang read as "0 fps 0.0 ms (worst 0)", which looks like a slow frame. Now it reads
"0 fps, no frame for 12.5 s". title_hud_test checks it after presents stop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tester has no way to see, during a boot, whether the game is slow because of frame time, memory pressure or
pipelines compiled in the frame. With LEONIDA_TITLE_HUD=1 the window the title presents in gets, twice a
second:
- fps and the average and worst frame time from PresentX;
- private memory and working set;
- local GPU memory against the DXGI budget, and shared GPU memory;
- pipelines created and the seconds spent in vkCreate*Pipelines in the last interval (with
LEONIDA_MEM_PROBE);
- time since the first present.
A thread of its own sets the text with SendMessageTimeout, so a busy or hung window thread never holds a
present. title_hud_test drives a real window from another thread and checks the text and the shutdown.
Co-Authored-By: Claude Opus 5.5 <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 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>
Conflict in docs/boot.md, the --overlay switch: main now says the overlay defaults to
<game-dir>\overlay and the package is never written; this branch adds the per-process T: folder
inside the overlay. Kept main's sentence and appended the T: text after it.
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>
Merging.
**Why merged:** OLD-5794: fixes the first-boot runbook in boot.md, and boot_trace now marks relocated modules in its text report. Oliwettoo checked the doc claims against the code ("Ship").
**Why it's good:** test_boot_trace plus the docs tests: 79 passed.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 82a2aabcc. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 566 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 32950551e: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or build/CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
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
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.
Keep completion batches with their owning Vulkan context. Test switching primitives, caller overrides, and the dynamic EXEC and uniform null-descriptor guards used for dimension-specific storage views.
Xiiano's review of old upstream PR 8161: the folder name (start time to
the millisecond plus process id) is not guaranteed unique, and earlier
runs' folders are kept, so a reused id in the same millisecond would
land in a stale folder and bring ERROR_FILE_EXISTS back. Under Wine
every fresh run gets the same small ids (both run_tiny_game_dir runs
here were pid 32).
rt::fs::reserve_unique_dir(base, stem) makes base\stem with
CreateDirectoryW and takes success as ownership; on ERROR_ALREADY_EXISTS
it tries stem-2, stem-3, ... up to 1000 names, and fails with the Win32
error otherwise. T:'s folder is reserved once per overlay under a mutex
(the first T: call or rt::fs::scratch_dir(), which the startup line
calls), so concurrent first calls share it. A failed reservation is
printed once and T: paths fail with ERROR_INVALID_NAME.
rt::fs::scratch_stem() gives the first name tried.
file_system_test: with stem and stem-2 taken, reserve_unique_dir makes
stem-3, new and empty, then stem-4; a file with the next name counts as
taken; max_tries names taken fail with ERROR_ALREADY_EXISTS; a missing
base is made. T: with folders of this process's own stem and stem-2
already kept takes stem-3 and CREATE_NEW succeeds; eight threads making
their first T: call at once reserve one folder. The second-process test
stays.
Restored from old upstream PR 8161 and ported onto the new main: the
base folder and every candidate go through main's win32_io_path, like
the other creates in file_system.cpp, so a long overlay root keeps
working.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
T:\ mapped to <overlay>\.gta6rt-temp, one folder shared by every run and
kept between runs. The title makes its crash dump and crash log there
with CREATE_NEW, and a name an earlier run (or a second process) had
left failed with ERROR_FILE_EXISTS (80), so no report landed (old
upstream issue 7913, measured by Spacecer2 under Wine 11.22).
T:\ now names <overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>, the
process's start time in UTC and its id, made on the first T: call. The
start time keeps a reused process id (Wine hands each fresh prefix the
same small ids) out of an old run's folder. T:\.. cannot climb into the
shared folder, T:\ itself still cannot be removed or moved, and earlier
runs' folders are kept so their crash files can be read. GAME: and G:
are unchanged.
rt::fs::scratch_dir() returns the folder, and the startup line names it:
"console paths: GAME: -> ..., writes -> ..., T: -> ...". The two CMake
checks of that line (run_tiny_game_console_paths, run_tiny_game_dir)
and the synthetic test of the first now expect the T: part.
file_system_test: a CREATE_NEW of a name earlier runs left in
.gta6rt-temp succeeds and lands in the process's own folder; the folder
is stable for the process; a second process (the test started again)
creating the same name on the same overlay succeeds in a folder of its
own; GAME: reads and writes are unchanged. On main these fail with
ERROR_FILE_EXISTS (80), in this process and in the second one.
Restored from old upstream PR 8161 and ported onto the new main: the
folder is made through main's win32_io_path, so long overlay roots keep
working, and the scratch-folder check of the write-open path is kept.
Main's long-overlay T: check now finds scratch.bin in the process's own
folder below .gta6rt-temp.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- docs/boot.md: the Windows PowerShell 5.1 capture survives ErrorActionPreference Stop (PROC-271)
Carried over from old-pr/9939 (old upstream PR 9939), rebased on main.
Spacecer2 measured under Wine 11.22 (old upstream 7599) that LEONIDA_SKIP_INT3 never took
effect: the flag was a block-scope static first read on a title thread, whose
MSVC thread-safe-static guard passed with the object still zero, and the
handler's int3 set and the trace lock had the same shape.
- The flag is read by startup_trace::open(), on the thread that opens the trace,
into a constant-initialized atomic.
- The trace lock is a constant-initialized SRW lock (no constructor, never
destroyed), and the logged int3 sites are a constant-initialized table of
atomics: the handler touches no block-scope static.
- The int3 is found from Rip (Windows) or Rip - 1 (Spacecer2's Wine run), and
Rip always ends one byte past the 0xCC.
- skip_int3 returns false for a null EXCEPTION_POINTERS, record or context.
- LEONIDA_LOG_GAME_EVENTS and LEONIDA_HDR, read on title threads, are cached in
namespace-scope atomics instead of block-scope statics.
int3_skip_test runs each case in a child process: real int3s, the Windows and
the Wine breakpoint forms, the null pointers, the flag read at open() and the
flag off. The wine, null and init cases fail on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Where gta6rt.exe is: runtime\build with build_runtime.ps1 (Ninja), runtime\build\RelWithDebInfo with the
direct CMake (Visual Studio generator) path.
- Without LEONIDA_D3D12=vulkan the trace is not empty: the Xbox-ABI proxy still records device creation, queue,
fence and allocator calls. Say so, and to check the log for "[rt] d3d12: Vulkan device:".
- The runtime writes no "partial" outcome yet (ExecuteCommandLists records ok or failed); only the tool knows it.
- --overlay: the default is already <game-dir>\overlay; the package is never written.
- d3d12_vulkan.md 8.2 no longer repeats questions 16, 19 and 20.
- Triage step 1 asks whether the executable is at its preferred base, but the text report printed module names
only; it now marks a relocated module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The game runs AVX code from its TLS callbacks on, so a CPU or OS without
AVX (a QEMU qemu64 guest) died with a bare 0xC000001D. Check CPUID.1
AVX/OSXSAVE and XCR0 YMM state first, print one line and exit 4 (3 is
LEONIDA_UNIMPLEMENTED=stop). --dry-run is unchanged and
LEONIDA_SKIP_CPU_CHECK=1 skips the check.
AI-assisted.
The retail executable imports D3D12SerializeVersionedRootSignature, and Wine's own d3d12.dll
does not answer that export for the runtime's shim. The result is hard to place: the D3D12 trace
stops at about 1,658 calls, the startup trace ends in an access violation inside the executable,
and nothing in the log but one [rt] line names the cause. Two of us read that as a boot-chain stop
before finding it.
Document the prefix requirement, the three DLLs and the override that make Wine use them, and the
measured difference: 1.4 million calls with no exception against 1,658 calls and a fault.
The queue proxy's PresentX slot is past the PC chain, so nothing recorded
a present: a --trace-d3d12 run of a frame loop could not say how many
frames were presented, or whether one was refused. XboxPresentation::PresentX
now writes one line per call through d3d12_trace::result (ok or failed).
xbox_present_test captures the trace around a blank present and a refused
three-plane call and checks for exactly those two lines.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Squash-merged after diff review of PR #6715 - RT-5: the retail executable maps under gta6rt --dry-run, with 30 unimplemented imports in seven Xbox-only DLLs
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MicrosoftGame.Config declares the identity "GTA6.Probe.PC" and names
game_scarlett_master.exe as the sole entry in ExecutableList, so the
payload is a packaging verification build with the retail payload's
shape rather than a retail dump missing its engine. boot.md also notes
the clean --init pass on all eleven bundled DLLs.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
boot.md's "prepared, not yet run" status was written before a
game_scarlett_master.exe reached the corpus. The measured first run:
map/init/run all clean, and the binary's own output identifies it as a
payload verification probe (verdict PASS over the full 1.0.2.1
payload). The engine image is still absent, so design.md's day-one
note now points at the engine image rather than the probe's name.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>