Skip to content

[integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD) - #984

Merged
aslan2142 merged 39 commits into
ProjectLeonida:mainfrom
Moriz82:integration/proton-story-load
Nov 25, 2026
Merged

aslan2142 merged 39 commits into
ProjectLeonida:mainfrom
Moriz82:integration/proton-story-load

Conversation

@Moriz82

@Moriz82 Moriz82 commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Claimed in the coordination issue as: RT-PROTON-STORY-LOAD (claim).

Depends on: none. Conflicts with / overlaps: #968 (queue slot 31, which this branch does not implement and needs), #974 (graphics root arguments and mesh user data), #976 (runtime BCPack decoder), #969 (DirectStorage destination pages), #939 (Windows first-run integration), #980 (device-loss log). Where they overlap, theirs take precedence; this branch will be rebased onto them.

Draft. It is one squashed commit on ece4ba5b3 (2026-11-23) and conflicts with main in 21 files. It is opened now so the Linux support and the test results are visible and so pieces can be claimed and split out; see "How this can land" below.

What and why

A fork of this project was developed on a Linux machine under Proton/Wine and tested on native Windows by a second contributor. On both, the retail 1.0.2.1 package now:

  1. launches and shows the package splash and the launch movie,
  2. goes through the first-run pages, legal pages and the landing prompt with a pad or the keyboard pad,
  3. runs the story load to its end, with the loading slideshow drawing its artwork,
  4. enters the world phase.

A first world frame is not verified yet on any machine. docs/linux_proton.md (new) has the Linux setup, the timeline of a healthy boot, the machines and where it stops.

Every item below was a stop on at least one machine:

Area Change
Presentation Frames are presented in the title's own window; they went to a window that was never shown.
Input Press log, right-stick keys, input scripts of any length (they were silently cut at 63 characters).
DirectStorage Reads pin write-watched destination pages; page-list scatter/gather; BCPack with unshuffle; a predictor file generated locally by tools/build_dstorage_history.py; bounded staging.
Story-load stall One device allocation per streamed texture exhausted the driver's CPU-visible mappings near 16,000 images. Small streamed images share pooled pages (LEONIDA_TITLE_IMAGE_POOL).
Image memory Host-copy usage excluded plain device-local memory on NVIDIA, so 4.8 GB of images spilled into host memory; streamed images are filled through staging. Private backing of placed and streamed images is deferred to their first write or GPU copy: VRAM at the end of the load 11.8 GB → ~5 GB on Linux; host private memory 22-24 GB → 11.9 GB on Windows.
Barriers An enhanced texture barrier into LAYOUT_UNDEFINED is accepted; it failed Close, which the title treats as fatal.
Bindless set A table rebuild that cannot allocate degrades instead of refusing the submission; larger 2D-array/3D/1D arrays; a fnv1a_fmix32 descriptor hash (runtime and translator halves, off until a library carries the marker), because the table had clustered to 8.4 M slots for 42 k keys.
Directly indexed heaps The heap offset is supplied in the user-data dword after the explicit root arguments, for compute dispatches and VS/PS/GS draws. The culling programs read their descriptors from offset zero before. Mesh stages are not covered.
Title buffers A window outside the arena when title reservations fragment it; opt-in persistent device-local copies of streamed buffer views.
Translator Loop bounds at structured exits (5,128 compute modules have loops); the eight FidelityFX programs that use a packed-dot form the disassembler skips, so all 29 translate (credit to the encoding found in #281); bounds modes per buffer view kind; no backing read for channel-less formats; a compaction option.
Native Windows A write fault on a shared page is retried under the tracker lock (a race ended the process in the story load); one tracker per run of shared pages (refresh 59 ms → under 1 ms); write-watched title memory; xmem's fault lock never waits for the process heap; root-layout fixes in the graphics test shaders.
Diagnostics, all off by default Device-loss report with the last dispatches and NVIDIA checkpoints, a probe of the descriptors a compute dispatch receives, a memory probe, LEONIDA_SKIP_COMPUTE and LEONIDA_STUB_PIPELINES. The last two are for finding a stop, not for shipping around one: every program they were used on has a fix in this branch or an open item below.

Where it stops now, on both platforms: the title's ~300 calls per boot to queue slot 31 are ignored here (#968 addresses that), so streamed pages never reach their destinations and the culling compute at world start reads outside mapped memory; mesh stages do not get the heap offset.

Tested

Linux: CachyOS (kernel 7.3), Proton Experimental (Wine 11), Ryzen 5 5600X, 16 GB RAM, RTX 4070 12 GB, NVIDIA 620.73. Cross-built with clang-cl 23 and an xwin SDK. About 80 boots of the retail package on 2026-11-24; the last ones run the story load to its end in 540-630 s with ~14,000-26,000 presents and no refused submission, then lose the device in the world phase's first compute work.

Windows A (second contributor, Plaaasma): Windows 11, Core i9-13900K, 64 GB RAM, RTX 4070 Ti 12 GB, NVIDIA 630.20, MSVC 2022. Same stages at ~70 s (initialisation), ~110 s (story load) and the same stop at ~120-190 s. Each fix in the table was confirmed there or found there. ctest -R d3d12_: 126 of 127 pass with 5 skipped on that machine.

Windows B: Windows 11, Ryzen 7 9800X3D, RTX 5070. Joining; no results to report yet.

Unit tests run under Wine on the Linux machine against this tree: d3d12_existing_heap_test, d3d12_compute_test, d3d12_graphics_direct_heaps_test, xg_xs_test (88 checks), vk_bindless_grow_test, bindless_sizing_test, descriptor_table_test, shader_library_test, title_write_watch_test (18), command_list_test, replay_texture_barrier_test, d3d12_close_parity_test (117 cases), startup_trace_test (27), vulkan_title_image_pool_test. Known red there: three checks of xmem_test on physical-page views under Wine, and one stress test skipped under Wine (a heap-lock deadlock in the fault path that is fixed natively and still open under Wine). Translator: the suites for loop bounds, buffer bounds, the descriptor hash (eight shared vectors, interpreter and GPU) and the recovered FidelityFX forms pass; all 2,680 paired compute programs and 29 of 29 FidelityFX programs translate.

GPUs tested: NVIDIA RTX 4070 (620.73, Linux/Proton); NVIDIA RTX 4070 Ti (630.20, Windows 11). No AMD or Intel GPU was available: RADV and the Intel paths are untested by us.

AI-assisted: yes (Claude Code and Codex agents wrote most of it; every result above comes from boots and test runs on the machines named, not from the agents' say-so).

How this can land

I do not expect this to merge as one pull request. Suggested order, each as its own claimed ID and small PR on current main, and I am glad to hand any of them to whoever wants it:

  1. docs/linux_proton.md and scripts/linux-boot/ (no code).
  2. The LAYOUT_UNDEFINED barrier and the bindless flush (each with its test).
  3. Image pooling, device-local placement and deferred backing.
  4. Directly indexed heap offsets (after D3D-448-GRAPHICS: graphics root arguments in the console layout, mesh shaders through a window #974, since it changes where graphics root arguments live).
  5. Translator loop bounds and the FidelityFX forms.
  6. The native Windows write-fault and tracker fixes.

Checklist

  • Based on current main and merges cleanly: no, see above.
  • One topic: no, an integration branch.
  • No game data, keys or decryption, including in logs or reports quoted here. scripts/check_no_game_data.py passes on the tree; the text above has counts, timings and settings only.
  • New translator rules are in the contract table of docs/design.md, with how they were confirmed.

🤖 Generated with Claude Code

@Moriz82
Moriz82 marked this pull request as ready for review November 24, 2026 16:28
@Poussistar

Copy link
Copy Markdown
Contributor

Rebase needed: on main (3ed8e50b7) git apply fails on 26 files of this diff, starting at docs/README.md:73, then docs/d3d12_vulkan.md:2118, docs/design.md:181, make_game.py:1807, runtime/CMakeLists.txt:106, runtime/cmake/translator_deps.cmake:15, runtime/shims/d3d12_vulkan_device.cpp:5120 ... tools/rdna2spirv.py:12436, tools/shader_library.py:257.

Nothing in it can be checked on this host (Linux, no Wine, no MSVC) until it is rebased, and the runtime tests it touches need Windows anyway, so this is only the conflict report. AI-assisted. No game files.

@Moriz82

Moriz82 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Splitting this up, as asked. This pull request stays open as the tracking branch and is not meant to merge as one piece. Each topic is being cut onto current main as its own small pull request, with its own claim in #14, its own tests, and a text that says what was run. This comment is the index; I edit it as children open (26 so far).

Child PR What Size
RT-DIRECT-HEAP-COMPUTE #1064 A compute dispatch with a directly indexed heap receives the bound heap's offset after its explicit root arguments (a hypothesis: a layout census pairs 7 of 2,959 entries, all agree); GPU test and rollback switch 8 files, +422/−14
SHADER-MUBUF-OFFSET-WRAP #1068 buffer_address formed off + soffset + index * stride in 32 bits, so index −1 passed OOB_SELECT 2 and 3 as base − stride; now 64-bit, with a semantic test that fails on main 4 files, +212/−26
SHADER-COMPACT-SPIRV #1073 --compact-spirv: optional SPIRV-Tools passes on the assembled module before validation, interfaces and bindings preserved; off by default 6 files, +52/−5
RT-INPUT-SCRIPT-LENGTH #1074 LEONIDA_INPUT_SCRIPT: scripts of any length (a 64-byte buffer made longer ones read as unset) and the timed button presses they schedule on the keyboard pad; regression test 4 files, +115/−11
RT-TITLE-TEXTURE-VIEWS #1079 Slots 70/71: an SRV or UAV that names a live placed texture by address and description resolves to that image instead of a null descriptor; GPU test and rollback switch 8 files, +258/−39
RT-BINDLESS-TABLE-DEGRADE #1092 Bindless table: a replacement that cannot allocate no longer refuses the submission (host memory, retry, in-place rewrite, or the last uploaded table); 2D-array/3D/1D arrays sized from device limits; GPU test that refuses allocations 6 files, +629/−58
RT-STARTUP-TRACE #1096 Startup trace: an access-violation event also reports the memory region at the faulting address (state, protection, type, bounds) 2 files, +10
SHADER-BUFFER-BOUNDS #1097 A structured buffer SRV checks the field offset against the record stride (bounds mode 0, as structured UAVs), not only the index; GPU test with a typed control 4 files, +23/−10
TEST-CRT-ARGV-WINE #1098 Startup command-line fixture: under Wine an argv already configured at process attach is accepted when it equals the final one (the fixture failed there before the loader ran) 1 files, +19/−3
RT-STREAM-TRANSFER-BARRIER #1099 Back-to-back buffer copies on one queue are ordered by a transfer memory barrier before each copy (dependency from #354, credited); replay fixture and rollback switch 3 files, +64/−5
RT-PLACED-IMAGE-DEFER #1100 Slot 133: placed render targets, depth targets and UAV textures bind their memory at first use instead of at creation; GPU readback test and rollback switch 6 files, +194/−15
SHADER-LOOP-GUARD #1101 --loop-limit: each translated loop takes its structured exit after a bounded number of header visits per entry (default 65,536, 0 disables); semantic tests with an unreachable exit 10 files, +241/−14
LINUX-PROTON-DOCS-SCRIPTS #1251 scripts/linux-boot: cross-build configure, a launcher that boots the loader under Wine or Proton with the network off, and a systemd --user unit with memory samples and a digest of how the boot ended; docs/linux_proton.md; a test of the scripts' refusals that needs no Wine 8 files, +449
TEST-ATOMIC-SOFFSET-BOUNDS #1275 Test only: a raw buffer_atomic_* addressed through soffset alone, on both sides of the bound, for the 32-bit, float min/max and _x2 lowerings; no test passed a non-zero soffset to an atomic before 1 files, +31
SHADER-TYPED-RESERVED-FORMATS #1276 A buffer_load_format_* whose run-time FORMAT has no decoder (INVALID or reserved) no longer reads the V#'s memory; values unchanged for all 128 codes; CPU read-log test, not GPU-verified 4 files, +29/−5
SHADER-LEGACY-MUL-SUBNORMAL #1277 v_mul_legacy_f32: one magnitude test per operand serves as input flush and zero override, and the result is flushed again only after output scaling; same words in 3,703 swept cases, 22 assembly lines instead of 37 per multiply 3 files, +37/−6
TOOLS-PE-SHADER-CONTAINERS #1278 pe_shader_containers.py: a console program stored as a raw deflate record is found, listed after the plain containers and extracted inflated (strict checks on sizes, stream end and content); hand-built tests, 3 fail on main 3 files, +182/−3
TOOLS-LIBRARY-COMPUTE-BY-HASH #1281 shader_library.py: a compute program used with different state blobs gets an entry per state (only the last was kept), and --compute-hashes FILE unpacks programs by code SHA-256; synthetic library tests, 3 fail on main 3 files, +204/−15
TOOLS-DISASM-WAVE-SIZE #1282 shader_disasm.py tells llvm-mc the wave size, so a wave64 program's lane masks are listed as register pairs; fspx_unpack.py and shader_library.py pass the dispatch state's wave size; hand-written tests, 5 fail on main; corpus not re-disassembled 8 files, +196/−7
TOOLS-DISASM-BOUNDED-LISTING #1283 shader_ir.parse_file reads a listing a line at a time and counts llvm-mc's messages without holding them (peak 0.17 MB instead of 9.2 MB on a 4.5 MB synthetic listing); same result on 20,000 random listings; the shader_disasm.py half is left to #623 2 files, +61/−23
RT-MEMORY-PROBE #1291 LEONIDA_MEM_PROBE=<seconds> (opt-in): live pipelines, shader modules, VkDeviceMemory per type, arena use and process memory on stderr, plus an smaps summary under Wine; unset, nothing is wrapped; stand-in table test in both forms 5 files, +907
RT-PRESENT-PROBE #1293 LEONIDA_PRESENT_PROBE=1 and LEONIDA_CAPTURE_SOURCE=1 (opt-in): where a presented frame was lost (clears, draws, PresentX calls and refusals, blit/compose/blank) and a read-back of the presented texture; unset, no line and no file; test in both forms 7 files, +909/−12
SHADER-FFX-PACKED-DOT #1301 rdna2spirv.py takes the stored op_sel_hi 5 of a v_dot4_i32_i8 with an inline integer S1 from the bytes (llvm-mc prints none) instead of refusing the listing; every other dropped selector stays refused. The rule for an inline source is not measured on hardware; the text names the one oracle kernel that settles it. 3 files, +80/−2
SHADER-WATERFALL-FULL-WORD #1320 wave64_halves.py: the tier B waterfall proof takes only an unmodified whole-word integer equality; a float, 16-bit, SDWA or DPP compare (which the old check accepted, with 64 lanes and two waves of 32 giving different results) is tier C. Metadata only; corpus census not re-run. 3 files, +47/−3
RT-SKIP-COMPUTE-DIAGNOSTIC #1341 LEONIDA_SKIP_COMPUTE=<part>[,...] (opt-in, unset by default): a named compute program is not built and its direct and indirect dispatches are dropped while the rest of the list runs, to isolate a program that hangs the GPU or loses the device; unset, nothing changes. 5 files, +363/−3
RT-TRACE-SUCCESSFUL-OPENS #1363 --trace also records the first 600 successful guest file opens (file_open: path, access mask, caller), on a budget of their own, so a stalled boot shows which files it had reached; the open's last error is kept. Trace off: nothing changes. 5 files, +103/−11

Merged so far: #1074 (input scripts of any length).

The whole diff is mapped (312 paths, every hunk assigned to one topic), so nothing is left behind in this branch at the end. Still being cut, built and tested on main alone: the remaining translator and tool topics, the opt-in diagnostics, pooled and device-local image memory, title buffer windows, DirectStorage pinned reads, and the native Windows write-fault fixes. A topic that turns out to be carried by an open pull request already is dropped and named here.

Held until the pull request they build on merges: the graphics-stage heap offsets (on #974).

Dropped, because main or an open pull request already has it: the enhanced barrier into LAYOUT_UNDEFINED (#1055, #600), the typed-store format switch (#829), the cube-store LLVM_MC argument fix (#837), the short FSPX prologue (#583), the thread stack dump (#576), the f32 DPP lane compares (#957, merged), the full-wave s_flbit_i32_b64 / s_bitreplicate_b64_b32 masks (#593; three lines of mask tracking follow once it merges) and the slot-67 operand-form tests (on main already, or the behaviour of #1043), and the bulk inflate (#1081). The DirectStorage trace census waits for the trace it reads, and the draw-input and descriptor-heap probes for the descriptor tables they probe. Queue slot 31 will be reduced to what #968 does not already cover; the same check is made for every topic before it is cut.

@Poussistar: thank you for the conflict report. Rather than rebasing 300 files in one commit, every child is based on current main and checked there on its own.

AI-assisted (Claude Code and Codex agents); each child states what was built and run, and on which machine.

🤖 Generated with Claude Code

… 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>
@Moriz82
Moriz82 force-pushed the integration/proton-story-load branch from ac7c344 to 273b3bd Compare November 24, 2026 17:42
@oscarlosu-lab

Copy link
Copy Markdown
Contributor

Tested ac7c3449d on an additional native Windows 11 machine using scripts/windows-boot/boot.ps1 (MSVC 19.52 x64 RelWithDebInfo, -DLEONIDA_SDL3_FETCH=ON, local history.bcph built via tools/build_dstorage_history.py, 28352 translated shaders):

  • Machine: Windows 11 (10.0.26300.0), NVIDIA GeForce RTX 3060 12 GB (driver 621.35, Vulkan 1.4.357), 32 GB RAM
  • Commit: ac7c3449d
  • Overrides vs boot.ps1 defaults: -Seconds 360 -InputScript "a@45,a@60,a@75,a@90,a@120,a@150,a@180"
  • States: t=0s game=0 session=0 | t=5s game=1 session=0 | t=10s game=2 session=0 | t=40s game=2 session=1 | t=75s game=3 session=3 | t=125s game=3 session=d (story load reached)
  • Presents: PresentX ok 8909, failed 0
  • Captures: 40 captured, 40 non-black; last mean rgb 103.97 64.45 107.77; brightest 188.84 149.63 149.90
  • Device faults: none (0 device loss; LEONIDA_DEVICE_FAULT=1 logged normal submitted-dispatch breadcrumbs)
  • First D3D12 refusal/unsupported counts: ID3D12Device2::CreatePipelineState: failed 2, unsupported 224 (0 PresentX failures)

@oscarlosu-lab

Copy link
Copy Markdown
Contributor

Follow-up on native Windows 11 + RTX 3060 (driver 621.35, 32 GB RAM) with #984 (ac7c3449d) + #968 (f2268abea, CopyPageMappingsBatchX):

  • xmem_test.exe: OK (316 checks)
  • queue slot 31 (CopyPageMappingsBatchX): 46 calls (pool of 63632 pages), 0 refusal / not mapped errors
  • States: t=0s game=0 session=0 | t=5s game=1 session=0 | t=10s game=2 session=0 | t=40s game=2 session=1 | t=80s game=3 session=3 | t=95s game=3 session=d (remained at session=d through t=415s in a 421 s run)
  • Presents / captures: PresentX ok 9000, failed 0, 40/40 non-black (last mean rgb 103.00 63.15 106.83, brightest 168.77 144.08 126.01), 0 device loss.

@Plaaasma

Copy link
Copy Markdown
Contributor

Native Windows side of this work, from the second contributor (Plaaasma). AI-assisted: written and run with Claude Code agents, checked by me.

Machine: Windows 11, Intel i9-13900K, 64 GB RAM, NVIDIA RTX 4070 Ti (12 GB, driver 630.20), MSVC 2022, Vulkan backend, no Wine.

What runs natively: init reaches the running state in about 70 s, the landing prompt and first-run setup pages render and take pad input, and the story load starts at about 110 s with its slideshow art (BCPack via the locally built predictor). With the streamed-geometry copies enabled, every streamed buffer view was backed and the load ran to about 220 s. After that a compute program writes through an address that isn't mapped yet. That's the open wall, shared with the Linux/Proton machine.

What I wrote or found, now part of this branch:

  • Write faults on shadowed title pages: the retry-or-reopen decision now happens under the tracker lock. Two threads faulting on one page could otherwise refuse a write and crash the title mid-load.
  • One write tracker per run of shared pages, instead of one per copy, cut the per-submission refresh on my machine from about 59 ms to 0.14 ms.
  • Write-watched title memory (MEM_WRITE_WATCH + GetWriteWatch) cuts write faults 2–2.5×, with no throughput cost in a 3+3 boot comparison. A second review found a stale-copy race and a process-heap deadlock, and both are fixed with tests. On by default on Windows, opt-in under Wine.
  • The xmem fault lock no longer waits on the process heap while it is held. The new test hung 3 of 3 runs before the fix and passes after; under Wine it still hangs, so it is skipped there for now.
  • An enhanced barrier into LAYOUT_UNDEFINED no longer poisons a command list; the layer's behaviour matches WARP.
  • The bindless image arrays are sized from device limits, and a failed table growth no longer refuses a whole submission.
  • The heap-offset user-data dword is now written for graphics root signatures that use the directly indexed heaps.
  • Test fixes: graphics test shaders moved to the console root layout (they rendered black), the 64-wide subgroup case skips on a 32-wide device, and a test caught up with a constructor change. ctest -R d3d12_ passes 126 of 127 natively, and the remaining failure is the subgroup case fixed here.

Happy to run native Windows checks on any of the split-out PRs.

@Tyrannys

Copy link
Copy Markdown
Contributor

Native Windows result with #968 added, and a crash past the load that #984 alone does not reach. Counts and shapes only, no game addresses.

Setup: Windows 11, RTX 4070 SUPER (64 GB RAM), own 1.0.2.1 copy. ac7c3449d + #968 cherry-picked (conflicts resolved by keeping both; one fix: copy_page_mappings reads g_mapped's value directly, since this branch stores the page number there). RelWithDebInfo, SDL3, local history.bcph, LEONIDA_SKIP_INT3=1, input script a@60..a@500 every 10 s.

Works: package splash, launch movie, first-run pages, loading slideshow with its artwork. With #968 the story load finishes; without it (#968 answered E_NOTIMPL) the title stays on the landing screen for 9 min, as your notes predict.

Then a crash, every run: an access violation in title code at a random time after the load: 36, 197, 242, 287 and 477 s in five runs. Each time the last new runtime event before it is the title's first ExecuteIndirect (list slot 61, the DISPATCH/105 signature), i.e. world start. The faults look like corrupted title objects, not a bad pointer from the layer: a vtable pointer into unrelated data, an object field holding two floats (0x44000000, 0x41800000), reads at -1 and at small offsets from an unrelated base. A different object each run.

Ruled out, one run each:

  • slot 31 source pages that are not mapped: 0 misses in a counting build (every source page was in g_mapped);
  • slot 31 timing: waiting for the queue's earlier work (Signal + CPU wait) before each remap still crashes (36 s and 197 s);
  • skipped title asserts: no int3 reached in these runs;
  • the world-start compute programs: LEONIDA_SKIP_COMPUTE on the three programs built right before the crash, still crashes (242 s);
  • a rejected command list: no rejected a call line in any run.

So something writes into the title's memory after the load, and it is not one of the obvious paths. The page-watch / shadow copies (kernel_writes, the slot-133 shadows: ~360 MiB in ~3,700 copies, ~200 trackers at the end of the load) are the writers into title memory I have not been able to rule out; with #968 remapping pages under them for the first time, that is where I would look first. Happy to run any build or switch you want on this machine.

AI-assisted (Claude Code).

@CLHelper

Copy link
Copy Markdown
Contributor

Tested on a smaller Windows machine: Windows 11, RTX 4060 Laptop (8 GB VRAM, NVIDIA 576.80), MSVC 19.44 / Ninja / RelWithDebInfo, own 1.0.2.1 copy, head ac7c3449d built unchanged except for #968's queue slot 31 (CopyPageMappingsBatchX, which the description says this branch needs) ported onto it by hand. Shaders translated by this branch's make_game.py --stages shaders (every shard: all translated, all pass spirv-val; the 12 executable programs too); BCPack predictor file from tools/build_dstorage_history.py with the native trainer (57 pools, 5,435 BPTC chunks). Your Windows settings: LEONIDA_DEVICE_TYPE=6 (ConsoleMode answered 0x60), LEONIDA_ARENA_MB=2048, LEONIDA_DEVICE_FAULT=1, keyboard pad with an input script pressing A every 15 s from 30 s, pipeline cache with startup checkpoints. One run of 480 s allowed.

What it reaches here (seen in captures of the window, none posted):

  • The launch art at ~110 s and the first-run pages with their text and button prompts, up to "Finish setup" at ~240 s. A big step on this machine: other stacks on it stop at a nearly empty first-run row.
  • Peeks: 0x7446510 2 then 3 from 60 s; 0x98f828c low dword 0, 1, 3, then 0xd from 120 s to the end.
  • Queue slot 31 with the port: every call handled (32 calls by the last report, 0 ranges refused).

Where it stops: at 293 s the device is removed. The last batch is refused (queue replay refused a batch at vulkan_backend.h:2900), present failed (VkResult -4), PresentX ... hr 0x887a0005, and the title takes its device-removed exit (int3 at game_scarlett_master.exe+0x2474606, rsi = 0x887a0005). The window shows a page with only SCROLL/BACK prompts and a spinner by then. LEONIDA_DEVICE_FAULT gives no vendor data and an empty description, 0 checkpoints on every queue; the last submitted dispatches in its log are library/lib_cs_01726 (5x5x33) on the direct queue, which is only what ran last, not a cause. 10,766 PresentX before that. I have not looked further (VRAM headroom at 8 GB is my first suspect, not measured).

AI-assisted.

@CLHelper

Copy link
Copy Markdown
Contributor

Follow-up, second run on the same machine and build (warm pipeline cache, same settings, 420 s allowed), with GPU memory sampled every 2 s:

  • No device loss this time: the run went to the time limit (412 s), so the 293 s loss of the first run did not reproduce. GPU memory peaked at 5.7 of 8 GB (nvidia-smi), gta6rt's private memory about 11.6 GB; VRAM headroom was not the cause.
  • From ~120 s to the end the peeks stay at 0x7446510=3, 0x98f828c low dword 0xd, the GPU is mostly idle, and the window shows first-run pages whose button prompts draw (SETTINGS / CONTINUE / BACK) but whose content area stays empty with a spinner. The A presses (every 15 s) keep arriving.
  • The branch's own counters in that phase: slot-70 views awaiting readable memory: 86, title textures (refresh): ... 64 over memory not readable yet, title textures null views by reason: no address 43. So it looks like the page content waits for streamed memory that never becomes readable on this machine; I have not traced which requests those are.

AI-assisted.

@hubeton

hubeton commented Nov 24, 2026 •

Copy link
Copy Markdown

Native Windows retest on an RTX 3060 Ti (8 GB, NVIDIA 621.24), Windows 11 build 26300. Both runs used Xbox 1.0.2.1, the Vulkan backend, the same 29,276 translated shaders and local BCPack profile, and fresh overlays. Built with clang-cl in RelWithDebInfo.
Test system: Intel Core i9-13900K (24 cores, 32 threads), 64 GB RAM, RTX 3060 Ti 8 GB, NVIDIA driver 621.24, Windows 11 build 26300.9974.

One run per configuration, with a shared pipeline cache. AI-assisted testing and report.

milk4sale pushed a commit to milk4sale/leonida that referenced this pull request Nov 25, 2026
…C-README-BOOT-STATUS)

The status still said the game does not boot and the PE loader row said it
was untested against the real executable. Since ubiquitarianism#321, ubiquitarianism#939 and ubiquitarianism#984, main
boots the game from your own copy on native Windows and on Linux through
Proton, through the story load into the world phase, as
docs/linux_proton.md and docs/first_run_ui.md record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TanmaySatyam added a commit to TanmaySatyam/leonidaContinue that referenced this pull request Nov 25, 2026
Builds on ProjectLeonida#984 (which landed IXPackageImpl4, slots 5-10, 22, and 39): wires the remaining IXPackageImpl 1-3 EnumeratePackages (slots 28/35) and RegisterPackageInstalled (slots 29/36/40) vtable entries to the offline implementation, adds the nine flat C XPackage* exports in SHIM_TABLE(xgameruntime) forwarding to the same handlers, and adds unit tests in xgameruntime_test.cpp.
aslan2142 pushed a commit that referenced this pull request Nov 25, 2026
…LOG-ENGLISH)

runtime/shims/d3d12_xs_device.cpp printed "[rt] d3d12_xs: state blob: campo
sin identificar en 0x%03x = 0x%08x", the only Spanish [rt] line; it came in
with #984. It now reads "unidentified field at", as aslan2142 proposed in
the coordination issue (#1608). The format arguments are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aslan2142 added a commit that referenced this pull request Nov 26, 2026
…re_dot4_inline_sel

The general rule from #1495 (dot4_op_sel_fields / restore_dot4_op_sel,
ported from luizwidmer/palmetto) took the stored op_sel/op_sel_hi of any
v_dot4_i32_i8 that llvm-mc printed with the defaults. That translated
op_sel 0 / op_sel_hi 5 with a VGPR second source, a word #1317's
test_fspx_dot4_op_sel_disasm.py (case (0, 5)) requires to stay refused:
only op_sel 2 / op_sel_hi 5 was measured on gfx1036. The translator suite
failed there.

Resolve it on the measured side:
- drop dot4_op_sel_fields and restore_dot4_op_sel;
- keep main's restore_dot4_inline_sel (#984) and its three call sites:
  the clean-listing check, the forward re-anchor search, and the exact
  re-anchor window #1662 added today. The general rule does not cover
  only those cases, so it cannot replace them;
- tests/semantic/test_dot4_printed_op_sel.py now checks that the
  inline-integer form is restored in a clean listing and on re-anchoring,
  and that op_sel_hi 5 with a VGPR S1, op_sel 1 / op_sel_hi 6,
  op_sel_hi 4 and a non-default S2 half stay refused;
- docs/design.md "Signed-byte dot products" states how each form was
  confirmed (hardware for op_sel 2 / op_sel_hi 5, a corpus count for the
  inline-integer form, refused otherwise); docs/fspx.md follows.

This also settles the #1662 / #1862 overlap: #1662's call site stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
milk4sale pushed a commit to milk4sale/leonida that referenced this pull request Nov 26, 2026
…red fields

llvm-mc decodes a VOP3P v_dot4_i32_i8 whose op_sel_hi is not [1,1,1] (op_sel bit 1 clear) but
prints and re-encodes it with op_sel 0 / op_sel_hi 7, so translate() refused it as a dropped
field. When those two fields are the only difference between the stored and the printed bytes,
they are now read from the blob, in check_printed_encodings and in both re-anchoring paths, and
the v_dot4_i32_i8 rule applies them as measured on gfx1036 (a non-default S2 half stays
refused). Any other difference is still refused.

This replaces ProjectLeonida#984's restore_dot4_inline_sel, which took one case of the same form (op_sel_hi
[1,0,1] with an inline integer S1); that case is covered by the general check. The words llvm-mc
rejects (op_sel 2 / op_sel_hi 5) are printed by shader_disasm.py (ProjectLeonida#1317) and recovered from the
blob by skipped_form. The approach comes from luizwidmer/palmetto (GPL-3.0).

Test: tests/semantic/test_dot4_printed_op_sel.py, hand-built words; design.md contract row and
docs/fspx.md updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.