Commit Graph

87 Commits

Author SHA1 Message Date
035da4fa9d docs/boot.md: label the made pipeline pair and the counters' preconditions
The pipeline row now cites the made pair for "made", not the live
counts; the table says the mem-probe rows need LEONIDA_MEM_PROBE at the
start, submit frame needs LEONIDA_SUBMIT_FRAME_SECONDS, and the [rt]
lines are the Vulkan layer's stderr. Retitle the section to three stops
and name the device-loss/watchdog lines and the at device loss reason.

AI-assisted.
2026-12-01 07:35:40 +01:00
57d5c000ee docs/boot.md: tell a compile stall, a held value and host memory apart
A run that ends after the first frame now has a short table of the
[rt] lines to compare: mem-probe's made-pipeline count, list values'
oldest held gate, and the cgroup peak, with the measured shapes from
#2464. Links the gate rule in d3d12_xs_console_abi.md instead of
repeating it.

AI-assisted.
2026-12-01 07:16:28 +01:00
0590fe2777 Merge origin/main (f9f3ec4c6) into the carry of #2173
Current main after #2566; no new conflicts on top of the earlier carry merge.

Co-authored-by: quartz-heron-58 <245169279+quartz-heron-58@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:29:05 +01:00
aacc89a1c3 Merge pull request #1395 from Diegobecker07/old-9961-skip-asserts
runtime: LEONIDA_SKIP_ASSERTS steps over guest asserts without a trace (OLD-9961, RT-526)
2026-11-29 19:27:49 +01:00
950259cd40 Merge pull request #1931 from kawaii-shakal/io-trace
dstorage, fs: LEONIDA_IO_TRACE logs every read the title asks for, flushed as it goes (RT-IO-TRACE)
2026-11-29 16:43:26 +01:00
a793e3fdf4 Merge pull request #1010 from robot00f/docs/d3d12-createdevice-params
docs/boot: the CreateDevice params are 0x50 bytes, not 24 words (D3D12-CREATEDEVICE-PARAMS)
2026-11-29 15:41:29 +01:00
528e0862f2 runtime: LEONIDA_SKIP_ASSERTS steps over guest asserts without a trace (RT-526)
A diagnostic for the retail boot (RT-5 follow-ups), off the hot path and with no behaviour change unless asked
for: LEONIDA_SKIP_ASSERTS=N (src/assert_skip.h, installed by main.cpp before any image code runs under
--init/--run): a vectored handler, added last, steps over up to N int3 (0xCC) at addresses in no host module and
logs each one as module+RVA (and as an int3_skipped trace event when --trace is open). After N it says so once
and the next int3 ends the run as before. An int3 in a host module, a breakpoint with no 0xCC at its address, or
a RIP that is neither at nor one past the 0xCC is passed on. Needs no --trace and no debugger.

Tests (synthetic, no game files): assert_skip_test (int3 in a VirtualAlloc'd page, the limit, a host-module int3,
a two-byte int 3, value parsing) and run_tiny_game_skip_asserts (two int3 in the mapped stand-in game, stepped
over end to end).

Carried over from old upstream PR 9961 (#228) without its caller logging for forwarded device slots, which the
carry-over of old PR 9990 (#1390) brings instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 09:55:11 -03:00
34ddcc1526 Merge origin/main into carry/pr-2173
CMakeLists: d3d12_backend_test (PR) and the Vulkan headers version check (main) both kept.

Co-authored-by: quartz-heron-58 <245169279+quartz-heron-58@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 13:51:23 +01:00
5865220a94 Merge main into boot-render-diagnostics (resolve conflict in tools/boot_trace.py)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 21:42:45 +01:00
29141b4717 Merge upstream main into PR #1931 2026-11-28 13:59:12 +00:00
feaaa13a66 Merge pull request #1423 from GTAVIB4GTAVI/feat/library-code-base-pairs
pso_code_base_pairs: count PSOs by code-base stage (SHADER-CODEBASE-PAIRS)
2026-11-28 12:41:59 +01:00
68595f4a75 Merge pull request #569 from CLHelper/tools/boot-matrix
TOOL-BOOT-MATRIX: tools/boot_matrix.py, how far the retail boot gets for each set of pull requests
2026-11-28 09:02:16 +01:00
7c2de8a936 pso_code_base_pairs: count PSOs by code-base stage (SHADER-CODEBASE-PAIRS)
docs/d3d12_vulkan.md §5.2 leaves the push-constant shape open and says to decide after measuring how many
real PSOs have two code-base stages; row 14 of the docs/boot.md checklist asks the same thing, and
tools/feature_scan.py's header says the pairing is in the executable, not in shaders.rpf. It is in shaders.rpf:
the pipeline library names a program per stage slot, and a stage's resource-layout blob ends with the HASH
digest of the container its code came from, so a stage joins to that program's `uses_code_base` in the
translation index through the container shader_carve.py carved.

The new tool reads the library, as an archive or as a saved library, joins
PSO -> stage slot -> program -> digest -> carved container -> spirv/index.json row, and prints counts only:
graphics PSOs by the number of code-base stages, those stages, the stage slots, the per-stage program counts
and the records it could not resolve. --out writes the same counts as JSON and refuses to name one of its own
inputs.

Measured on Xbox 1.0.2.1 (library 0x65F41EDD 930.048.020, 25,471 graphics records): no PSO has two code-base
stages. 25,027 have none and 444 exactly one - 343 MS, 60 PS, 41 VS - in a corpus of 13,383 VS+PS, 10,726
MS+PS, 1,336 MS, 24 VS and 2 VS+PS+slot 6; 21 records stay unknown because a stage's program is not in the
carve output. Its per-stage program counts (38 VS, 46 PS, 260 MS, 263 CS) are lower than the corpus's own
54 / 93 / 266 / 263: the library holds a second compiled form of 6,522 carved shaders and a program can serve
two slots.

So one 144-byte block with one code base at dwords 34-35 is enough for this package, and the runtime's refusal
of a pair where both stages read it can stand. docs/d3d12_vulkan.md §5.2 and its question 14, docs/boot.md
row 14 and docs/shader_library.md §4 and §6 say so; the stale pairing line in feature_scan.py's header is
corrected, and shader_library.py's header now says slot 6 is used by the 2 records that also have VS and PS.

tests/test_pso_code_base_pairs.py builds the library, the carve folder and both translation-index shapes from
bytes: 9 tests, no game data. The tool's __main__ block sets errors="replace" on stdout like every other tool,
which tests/test_tool_stdout_encoding.py checks. Also run: compileall, scripts/check_no_game_data.py,
test_shader_library.py (21) and test_text_write_line_endings.py (3). Whole-suite comparison, `python -I
scripts/run_semantic_tests.py tests -j 4` on Windows 11: plain 89d7dfcf5 reports 522 files, 8,099 tests, 42 files
failed; with this commit 523 files, 8,108 tests, 42 files failed - the two lists differ only by
test_run_wine_tests and test_build_batch_launch, which both pass alone on this machine and fail under -j 4 on a
loaded box. Those 42 are unchanged by this commit: 30 are pytest-based files that `python -I` cannot import and 6
more are script-style files the runner collects nothing from (ci.yml:87 runs both kinds elsewhere), plus the
Windows-only failures in test_world_names, test_bink_names, test_opus_tags, test_ci_registration and
test_mesh_alloc_single_writer. All of them are filed as findings on #14.

Claimed in the coordination issue as SHADER-CODEBASE-PAIRS (issue #14, comment 7146787349). AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:04:41 -05:00
ad6045b806 d3d12_xs: say so when LEONIDA_D3D12=vulkan is asked of a runtime built without the Vulkan device (RT-VULKAN-REQUESTED-NOT-BUILT)
A gta6rt configured without Vulkan headers is built without
LEONIDA_VULKAN_DEVICE. D3D12XboxCreateDevice then ignored
LEONIDA_D3D12=vulkan without a word and wrapped the host's D3D12 device,
so a run stopped somewhere else and read like a boot result.

It now prints one [rt] d3d12_xs line naming the cause and the configure
options. Which device is created does not change. The reading of the
variable moves to shims/d3d12_backend.h, used by both builds; new CPU-only
test d3d12_backend, registered outside the Vulkan-headers block.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-26 09:53:41 +08:00
bbc7506559 d3d12: stub draws only for this device's mesh stubs; =color stubs override the state that hides them
Review follow-up for #1549:
- record_draw no longer skips a draw with an unregistered PSO: graphics stubs are registered now, so a draw with a PSO from another implementation fails the list again (Close: E_INVALIDARG), as on main. A stub records its kind (none, compute, mesh) when stub_or creates it; stub_pipeline_kind(pso, device) gives it only for the list's own device, and DispatchMesh skips only that mesh stub's draws. A mesh draw with another device's stub fails the list. record_dispatch keeps main's bypass.
- LEONIDA_STUB_PIPELINES=color turns off the title's culling, wireframe fill, sample mask, alpha to coverage, depth and stencil tests, blending and logic op for the stub, keeping the write mask. The B4G4R4A4 fallback's refusal of blending and logic ops now waits until it is known whether the pipeline is such a stub.
- docs/boot.md: the cover needs a triangle topology and stays inside the scissor; what is turned off; which draws stay recording errors.

d3d12_stub_draw_test: =color with CULL_MODE_BACK, FILL_MODE_WIREFRAME, SampleMask 0 and a reverse-Z GREATER test against a depth target cleared to 0; a draw with another implementation's PSO (switch off); DispatchMesh with a mesh stub on its own device's list (closes) and on another device's (fails). Each fails on fa223d8 or on the first version of this fix; every case is reported. The B4G4R4A4 path has no test (the GPUs here render A4R4G4B4).
2026-11-25 21:35:42 -03:00
78159b8865 d3d12: LEONIDA_STUB_PIPELINES builds a real graphics pipeline from built-in stages (MVP-GPU-04)
A graphics PSO whose translated shader is missing used to be created with no Vulkan pipeline and never
registered. Its draws did not become no-ops as the comment said: record_draw refused them, so the whole
list failed to close.

Now a vertex pipeline with a missing translation (no shader library, or no entry for its FSSM/FSPX
program) takes a vertex and a pixel stage from src/stub_pipeline.h and goes through the normal
create_graphics path: registered, built eagerly, drawn through replay and the validation layer.

- LEONIDA_STUB_PIPELINES=1: the vertex stage puts every vertex outside the clip volume, so a draw
  changes no pixel (the old intent), but the render pass, attachments and push constants are real.
- LEONIDA_STUB_PIPELINES=color: every three vertices cover the viewport and the pixel stage writes
  magenta (1 to UINT/SINT targets) to each render target, so stubbed passes show on screen.
- Point-list PSOs get a PointSize write; the vertex stage's Position is a bare output, so
  rect_list_geometry takes it.
- Compute and mesh stubs stay unregistered; record_draw and DispatchMesh now skip a draw on an
  unregistered pipeline as record_dispatch already did, instead of failing the list.

d3d12_stub_draw_test draws with both modes into an RGBA8 and an R32_UINT target and reads them back;
d3d12_stub_pipelines_test now expects a registered pipeline. docs/boot.md describes the switch.
2026-11-25 21:35:10 -03:00
38385762bd dev overlay: the title HUD's VRAM and private memory figures
LEONIDA_DEV_OVERLAY (#2137) showed the working set and free RAM, with
no GPU memory and no private memory. It now shows both, from the same
code as the title HUD:

- src/memory_figures.h holds VramBudget, the private-bytes choice (the
  larger of PrivateUsage and PagefileUsage, since Wine fills only the
  latter), the "RAM ..." and "VRAM ..." text with "n/a" where there is
  no figure, and a publisher for the device's GPU memory figure. No
  Vulkan, and Win32 only under _WIN32, so the overlay's test still
  builds on every host.
- A device with VK_EXT_memory_budget publishes a reader when it is
  created and withdraws it first thing when it is destroyed (the lock
  is held during a read, so a reader never outlives its device).
  latest_vram() calls the reader at most once per 500 ms for both
  views. The HUD reads it instead of its own per-device lambda.
- The overlay's last line is now "RAM 2.5 GB (ws 1.0)   VRAM
  3.5/16.0 GB +0.5 shared"; cores and free RAM keep their own line.

Tests: dev_overlay_test checks the text with and without figures, the
private-bytes fallback, and the publisher (one read per refresh, only
the publishing device withdraws). title_hud_test checks that a HUD
without its own source shows the published figure.
d3d12_vram_budget_test checks that the device publishes its figure
while it lives and withdraws it on release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:18:57 -05:00
d4fb292344 Merge main into rt-title-hud-vram-budget
Brings in #2137 (LEONIDA_DEV_OVERLAY), which the next commit extends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:18:55 -05:00
ffcfe68f12 Merge pull request #2137 from Snooozs/dev-overlay
runtime: LEONIDA_DEV_OVERLAY shows what the runtime is doing over the title's window (RT-DEV-OVERLAY)
2026-11-26 00:02:32 +01:00
340e8a415c Merge pull request #638 from aslan2142/skip-int3-wine
OLD-7824: restore old upstream PR 7824 - startup_trace: LEONIDA_SKIP_INT3 works on title threads and with Wine's breakpoint address
2026-11-25 23:59:09 +01:00
f6cb4aedfc runtime: LEONIDA_DEV_OVERLAY shows what the runtime is doing over the title's window (RT-DEV-OVERLAY)
A click-through window of its own with its own thread: frame and submission rate, a submission's CPU time by phase, the
phase running now, pipeline builds in flight, indirect draws, cores and memory. Off by default. submit_phases keeps
per-phase counts of the threads inside a phase, so overlapping submissions of several queues leave none behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:28:38 +01:00
a6e0360f44 Merge upstream main into io-trace
Conflict resolution assisted by Codex.
2026-11-25 21:56:37 +00:00
244387529b title HUD: VRAM from VK_EXT_memory_budget, private bytes under Wine
The title HUD (#1922, LEONIDA_TITLE_HUD=1) read VRAM from DXGI's
QueryVideoMemoryInfo on the host dxgi.dll and private memory from
PROCESS_MEMORY_COUNTERS_EX::PrivateUsage. Under Wine both read 0.

- VRAM: the runtime's device enables VK_EXT_memory_budget when the GPU
  has it (VulkanDeviceInfo::memory_budget), and
  rt::d3d12::vulkan_vram_budget sums heapUsage and heapBudget over the
  DEVICE_LOCAL heaps (other heaps' usage shown as shared), from
  src/vulkan_memory_budget.h. The HUD calls it once per refresh on its
  own thread. Without the extension it falls back to DXGI, and where
  that has no figure either it shows "VRAM n/a" rather than 0.
- Private memory: Wine's GetProcessMemoryInfo fills only the
  PROCESS_MEMORY_COUNTERS part and leaves PrivateUsage 0; PagefileUsage
  is the same commit-charge figure on Windows 8 and later, so the HUD
  takes the larger of the two.

Tests: title_hud_test checks the sums, the DXGI fallback, the "n/a"
text and the private-bytes choice with made-up values, and that a VRAM
source reaches the title at most once per refresh. The new
d3d12_vram_budget_test checks that the device enables the extension
exactly when the GPU has it and reads a non-zero budget, and skips
(77) without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:56:01 -05:00
83c1bf2791 Merge commit 'refs/fix2/main' into fix2-638 2026-11-25 16:42:43 -05:00
c116c3fa28 Merge main into t-drive-overlay
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>
2026-11-25 16:38:20 -05:00
18d1851cf3 Merge pull request #273 from ubiquitarianism/old-pr/10005
docs/boot.md: what a Wine prefix has to supply, and the quiet failure without it
2026-11-25 18:25:55 -03:00
7c39802eaa Merge pull request #854 from dpalacios69/docs-no-avx-hosts
docs/cpu_features.md: document hosts without AVX and SDE+Wine findings (DOC-NO-AVX-HOSTS)
2026-11-25 22:15:25 +01:00
9439e6083d dstorage, fs: LEONIDA_IO_TRACE logs every read the title asks for, flushed as it goes (RT-IO-TRACE)
When a boot stops, the startup trace names the files the title opened, but most of its reading goes
through DirectStorage requests and ReadFile on files it opened long before. With LEONIDA_IO_TRACE=<file>,
each DirectStorage request (file, offset, sizes, zlib/BCPack, request name) and each ReadFile, ReadFileEx
or ReadFileScatter on a disk file (path, offset, size) is one line with the local time.

The line is flushed at once into a file shared for reading, so the last reads before a crash are on disk
and can be watched while the game runs. Paths are asked of the handle each time, because a handle value
is reused after a close. io_trace_test covers positioned, overlapped and reused-handle reads, DirectStorage
lines with good and bad name pointers, and pipes being left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:02:02 +05:00
1c5e2dcab1 title HUD: with no frame in an interval, show how long since the last one
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>
2026-11-25 21:01:18 +05:00
e86b3ceaa8 d3d12_xs: LEONIDA_TITLE_HUD shows frame rate, memory and pipeline compiles in the window's title bar (RT-TITLE-HUD)
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>
2026-11-25 20:51:50 +05:00
7d87423982 fix: boot_matrix review: every shared report field is checked for its form; builds per head
From an independent read before the next review round:
- report and report --json: the call's outcome must be one the runtime writes, an
  exception code hex or an exit code a number, the access kind read/write/execute,
  else 'other'; a label with free text keeps its name, anything else is '(other)'.
- The base shows as its commit only, PR rows as number, status and skip reason; the
  refs given (N:REF can name a local branch), merge_check verdicts and conflicted
  file names stay in matrix.json.
- run --build builds in runtime/build-boot-matrix-<head>: an export of another set
  over the same tree keeps old file dates, so a shared build folder handed back the
  earlier set's binary.
- merge: a checked-out set branch stops the merge before anything is written;
  Windows device names are refused as set names. A PR merged and then reverted on
  the base stays 'already-merged' (git merges an ancestor as a no-op); documented.
- result.json records the run's options (--env names, timeout, overlay, config).
- Docs and docstring say what the code does (overlay, exit code 1 on a failed build).
2026-11-25 14:00:20 +00:00
55fbc02497 fix: boot_matrix keeps the runtime's whole call label in the shared report
The report cut the last D3D12 call to its first word to drop argument text, but the
runtime writes fixed labels without arguments (d3d12_trace.h), some with spaces:
'Xbox CreatePlacedResourceX (device slot 133)' became 'Xbox'. A label of the shape the
runtime writes (one or two identifier words, optional '(device slot N)', checked
against all 43 labels of three world-start runs) is now shown whole; other text is
still cut to its first word. Tests: real labels kept, argument- and path-like text cut,
the last call of a slot label.
2026-11-25 13:30:47 +00:00
011a62a05e fix: boot_matrix review: a location outside every known module is reported as unmapped
shims::module_offset gives a bare absolute address when the instruction pointer is in
no known module; report and report --json passed it on. A shared location is now
module+RVA (or host:<dll>+RVA, a file name, never a path) or 'unmapped'; result.json
keeps the original. Tests: a crash at a bare address through both report commands,
and the site rule itself. Docstring lines rewrapped to the 120-column limit.
2026-11-25 13:10:28 +00:00
589b52dbb8 fix: boot_matrix review: run refuses a tree that is not the set's head; reports carry only shareable fields
merge writes the blob id of every file of each set's head to <set>/files.json; run
stops (exit 2) before building when the tree lacks one of them or holds other content
(CRLF line ends aside; files the head does not have are ignored). A --gta6rt run is
recorded as built 'prebuilt (unverified)'.

report (Markdown and --json) passes on a fixed list of fields: no access address, no
loader message and no D3D12 call arguments; those stay in each run's result.json.
2026-11-25 08:26:46 +00:00
e2a3b8da82 docs: boot_matrix examples name pull requests of this repository
The examples used numbers from the original repository, which link nowhere now (CONTRIBUTING.md).
2026-11-25 08:26:46 +00:00
db8fa9f113 fix: boot_matrix review: absolute run paths, report only the set's current head, loader error before a handled exception, one ref per PR, safe set names, escaped table cells, exit 2 instead of tracebacks
(cherry picked from commit 810d5bb667ec29ed8e6b3281f0188270bde61172)
(cherry picked from commit 4aa326318b5b24eedd1abd54531916b079cd6ee3)
2026-11-25 08:26:46 +00:00
6b44c4a2d6 feat: boot_matrix run gives each run a fresh overlay and save folder; --cmake-arg for the build
(cherry picked from commit af684001388452f44c47666e606d4927d657a53b)
(cherry picked from commit 6e6efcb4e236ed9a6d85e4f2a072d6b53c172586)
2026-11-25 08:26:46 +00:00
5598371312 feat: boot_matrix says whether a skipped PR conflicts with the base or an earlier PR; an empty set is the base alone
(cherry picked from commit 8acdec1445f6c51e8eef1c22297c6f2c36034149)
(cherry picked from commit 59502aecca5bf43515302f779a6ff67630255083)
2026-11-25 08:26:46 +00:00
2d08a5cc25 feat: tools/boot_matrix.py, how far the retail boot gets for each named set of pull requests
merge: each set is merged onto the base in order with git merge-tree/commit-tree (no checkout,
nothing from a PR runs); PRs merge_check.py finds already on the base, and PRs that conflict with
an earlier one in the set, are skipped and listed. One branch boot-matrix/<set> per set, plus
matrix.json with the translator digest of each head.

run: builds runtime/ in the set's tree (or takes --gta6rt), runs gta6rt --run --trace
--trace-d3d12 with LEONIDA_D3D12=vulkan and a timeout that stops the process tree, summarises the
traces with boot_trace.py and says whether the shader library came from this tree's translator.

report: the newest run of each set as a Markdown table (counts, RVAs and method names only).
(cherry picked from commit a00525cd2f3aadc3a63a1023a5926c315d767416)
(cherry picked from commit 97fa0445b2c053f522396e48f70948a19320230c)
2026-11-25 08:26:46 +00: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
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
681dae3a71 boot_trace: summarize render diagnostics in boot logs
A D3D12 stderr log can carry shader lookup failures, stub pipeline milestones and presenter capture measurements alongside the method trace. The old parser ignored them, so a first-boot report could not say whether the renderer was black or which shader classes were missing without sharing the raw log.

Parse those fixed categories into aggregate counts and include them in --counts-only and text output. No raw game strings or paths are emitted.

Carried from the source patch in Sigtryggur-Mani-Gudmundsson's graphics-runtime-patches collection:
33ab48d3ea/README.md (reading-black-frame-and-missing-shader-evidence-from-a-boot-log)

AI-assisted.
2026-11-24 17:38:23 -06:00
5866d6974e Merge main into OLD-8161, T: overlay folder per process (#684)
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>
2026-11-24 18:33:53 -05:00
dbc43270f8 Merge pull request #947 from ubiquitarianism/claude/bl1-tls-index0
BL-1: tests and docs for the /GA index-0 TLS stop that main already clears (no loader change)
2026-11-24 21:30:59 +01:00
3ba069ebea Merge pull request #891 from SweatierKey/feat/bl6-frame-pacing-drift
runtime: frame pacing drift and latency percentile reporting (BL-6)
2026-11-24 19:24:15 +01: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
b8e2fa88b3 Merge pull request #379 from lines9686-rgb/docs-boot-runbook
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).
2026-11-24 12:38:28 -05:00
b2dda52105 docs/boot: the CreateDevice params are 0x50 bytes, not 24 words (D3D12-CREATEDEVICE-PARAMS) 2026-11-24 14:23:55 -03:00
ba142e7ff5 docs: BL-1, main already clears the /GA index-0 stop; boot.md and the stop table say what it carries
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
2026-11-24 10:32:26 -05:00
7bb915dd3e runtime: frame pacing drift and latency percentile reporting (BL-6) 2026-11-24 15:58:13 +01:00