<feed xmlns='http://www.w3.org/2005/Atom'>
<title>npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/runtime/src/pe_loader.cpp, branch feat/gdk-lifecycle-window-hook</title>
<subtitle>[no description]</subtitle>
<id>https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=feat%2Fgdk-lifecycle-window-hook</id>
<link rel='self' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=feat%2Fgdk-lifecycle-window-hook'/>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/'/>
<updated>2026-11-25T00:38:04+00:00</updated>
<entry>
<title>Merge main into RT-PROTON-STORY-LOAD (#984)</title>
<updated>2026-11-25T00:38:04+00:00</updated>
<author>
<name>Jan Trencansky</name>
<email>jan.trencansky@protonmail.com</email>
</author>
<published>2026-11-25T00:38:04+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=39879ce0fdcaea23ce3919c1e845dd360b17b0f8'/>
<id>urn:sha1:39879ce0fdcaea23ce3919c1e845dd360b17b0f8</id>
<content type='text'>
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 -&gt; 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 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>[integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)</title>
<updated>2026-11-24T17:42:12+00:00</updated>
<author>
<name>Moriz82</name>
<email>72836413+Moriz82@users.noreply.github.com</email>
</author>
<published>2026-11-24T17:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=273b3bdf9d6e736442ad584ad464df6e86ee928b'/>
<id>urn:sha1:273b3bdf9d6e736442ad584ad464df6e86ee928b</id>
<content type='text'>
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 &lt;47513553+Plaaasma@users.noreply.github.com&gt;
Co-Authored-By: Claude Fable 5.2 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles</title>
<updated>2026-11-24T09:47:22+00:00</updated>
<author>
<name>Khuraie</name>
<email>83483964+Khuraie@users.noreply.github.com</email>
</author>
<published>2026-11-23T15:42:39+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=522faa2ee4ad77b00d11057543497f9e31c3ff05'/>
<id>urn:sha1:522faa2ee4ad77b00d11057543497f9e31c3ff05</id>
<content type='text'>
(cherry picked from commit 355201c51e6aba95c582e2df344782b22e97bb31)
</content>
</entry>
<entry>
<title>pe_loader: refuse an import address table or TLS index in the headers</title>
<updated>2026-11-24T06:29:32+00:00</updated>
<author>
<name>Kal0s-design</name>
<email>356578040+Kal0s-design@users.noreply.github.com</email>
</author>
<published>2026-11-23T08:57:43+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=db8a0cc793b722be588ddbeade2d2c2b7d4b7373'/>
<id>urn:sha1:db8a0cc793b722be588ddbeade2d2c2b7d4b7373</id>
<content type='text'>
After map_image, the loader writes into the mapped image twice: the bound
address of every import and the image's TLS index. Every step after it
(parse_exports, bind_imports, protect_sections, register_unwind,
initialise, ~Loader) reads the headers back from the mapping. A
FirstThunk or AddressOfIndex below SizeOfHeaders therefore replaced
e_lfanew or the section table, and the next read went outside the image
or used headers nobody validated. The loader already refuses a section
or a base relocation there; this closes the two remaining writes.

An index at RVA 0 is refused too: index_rva doubles as "no index", so the
index was silently never written.

Found by mutation fuzzing rt::Loader::load. The six new cases in
test_pe_loader_bounds build their images by hand; four of them fail
without this change.

Co-Authored-By: Claude Sonnet 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>pe_loader: a compat DLL Windows cannot load is refused without a "Bad Image" box</title>
<updated>2026-11-24T02:50:56+00:00</updated>
<author>
<name>natterman12</name>
<email>92529018+natterman12@users.noreply.github.com</email>
</author>
<published>2026-11-24T02:50:56+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=682fd0561cd5e649d199adb9633b81b26baf26a6'/>
<id>urn:sha1:682fd0561cd5e649d199adb9633b81b26baf26a6</id>
<content type='text'>
resolve_compat() calls LoadLibraryExW on a file from LEONIDA_COMPAT_DIR. For
a file Windows cannot map (truncated, wrong machine, not a PE image) the
system raises a modal "Bad Image" hard-error box, and LoadLibraryExW does
not return until someone clicks OK. The loader reports that failure itself
one line later, so the box only stalls it: gta6rt hangs on a headless
machine, and loader_test, which writes such a file on purpose, waits for a
click in every unattended ctest run.

The load now runs with SEM_FAILCRITICALERRORS set on the calling thread, and
the thread's previous error mode is restored afterwards. The Windows error
code is read before the mode is put back.

loader_test checks that the mode comes back unchanged, that the message
still carries the error code, and that the refusal does not wait on a box.

Co-Authored-By: Claude Fable 5.2 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'origin/pr/8969'</title>
<updated>2026-11-23T22:41:01+00:00</updated>
<author>
<name>ItsNotRexed</name>
<email>300290919+ItsNotRexed@users.noreply.github.com</email>
</author>
<published>2026-11-23T22:41:01+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=b05999eb74a7ec2c86f5e00d9f1e3fe8025227e6'/>
<id>urn:sha1:b05999eb74a7ec2c86f5e00d9f1e3fe8025227e6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pe_loader: a thread that existed before load() gets the /GA TLS view too (EGEN-GA-TLS-EXISTING-THREAD)</title>
<updated>2026-11-23T21:13:50+00:00</updated>
<author>
<name>evilclanker9000</name>
<email>45567075+evilclanker9000@users.noreply.github.com</email>
</author>
<published>2026-11-23T21:13:50+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=4710549aff9032227812359e1f6a3c220d928bbb'/>
<id>urn:sha1:4710549aff9032227812359e1f6a3c220d928bbb</id>
<content type='text'>
load() rewrites a /GA executable's `mov r64, gs:[58h]` reads to a TlsAlloc slot whose value is a per-thread
view with the image's block at [0] (pe_loader.h, tls_ga_slot). install_thread_block creates that view for
the loading thread and for threads started after load(), but install_on_existing_threads gave the threads
that were already running only the block in TEB-&gt;ThreadLocalStoragePointer[tls_index]. A rewritten index-0
read on such a thread then loaded null and dereferenced it: the task queue runs a title's callbacks on pool
workers that predate the load, so this is the same AV the main thread had at exe+0x104075, moved to a worker.

Each existing thread now also gets a view of its own in TEB-&gt;TlsSlots[ga_slot], and ~Loader, the thread's
detach event and a reused thread id free it with the block.

Tested: runtime/test/loader_tls_test.cpp maps a new handmade /GA EXE fixture (tiny_ga_tls) and reads its
__declspec(thread) value from the loading thread, from a thread that existed before load() and from a later
one, then again after a second load(). Without the pe_loader change that test dies with 0xC0000005 on the
existing thread; with it all 95 checks pass. ctest -R loader: 4/4 passed (Windows 11, MSVC 19.44,
RelWithDebInfo, no GPU needed).

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>pe_loader: give a /GA executable its own TLS at index 0 (retail boot AV at exe+0x104075)</title>
<updated>2026-11-23T20:34:37+00:00</updated>
<author>
<name>ItsNotRexed</name>
<email>300290919+ItsNotRexed@users.noreply.github.com</email>
</author>
<published>2026-11-23T20:34:37+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=b7a3fed28d53bb8c53b74eeff2ab65165a0d1c92'/>
<id>urn:sha1:b7a3fed28d53bb8c53b74eeff2ab65165a0d1c92</id>
<content type='text'>
The retail game_scarlett_master.exe is built with /GA: it reads its TLS as
ThreadLocalStoragePointer[0] directly, without _tls_index, because the process
EXE always owns index 0. Mapped into gta6rt, index 0 belongs to gta6rt.exe, so
the game's allocator read gta6rt's TLS block and faulted at exe+0x104075.

load() now rewrites each `mov r64, gs:[58h]` in the EXE's executable sections
(53,246 sites in the retail exe) to `mov r64, gs:[1480h + 8 * slot]`, reading a
TlsAlloc slot (TEB-&gt;TlsSlots). Each thread's value there is a small view with
the image's TLS block at [0] and at [tls_index]. The rewrite is the same length
and runs before any of the image's code, TLS callbacks included. DLLs and
images whose index is already 0 are left alone; LEONIDA_TLS_GA_PATCH=0 turns it
off.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>runtime: opt-in compat-module directory (LEONIDA_COMPAT_DIR)</title>
<updated>2026-11-23T19:51:59+00:00</updated>
<author>
<name>Rafa23xz</name>
<email>174075006+Rafa23xz@users.noreply.github.com</email>
</author>
<published>2026-11-23T19:51:59+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=7fc6fa72851362875b7105087030ac651db92b35'/>
<id>urn:sha1:7fc6fa72851362875b7105087030ac651db92b35</id>
<content type='text'>
When LEONIDA_COMPAT_DIR names a folder, an import whose DLL is a file
there binds to that DLL's export. Windows loads it from the full path
(LoadLibraryExW, DLL-load-dir + System32 search, never the game folder),
so it takes no manual static-TLS slot. The step comes before shims,
bundled modules and the host, and the DLL owns all imports of its
module: a missing symbol binds to the unimplemented thunk, not a shim.
Unset or empty: no change.

Measured on the 1.0.2.1 executable: --dry-run goes from 20 unimplemented
imports (AcpHal 9, chad 5, xapu 5, XCRDAPI 1) to 0 with the four
matching omonkeyz/xbox-emulator crates in the folder (and their
TOMBOX_* static initializers turned off; see runtime/README.md).

loader_test: five cases with a synthetic OS-loadable DLL (no game data).

AI-assisted (Claude Code).
</content>
</entry>
<entry>
<title>Loader: W lookups find a mapped image by its non-ASCII name; ANSI lookups ignore case outside ASCII (#6754)</title>
<updated>2026-11-23T16:47:01+00:00</updated>
<author>
<name>c4k3ss</name>
<email>77441265+c4k3ss@users.noreply.github.com</email>
</author>
<published>2026-11-23T16:47:01+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=0656b0b200590d355dea4f7a9fdb1d141051ce55'/>
<id>urn:sha1:0656b0b200590d355dea4f7a9fdb1d141051ce55</id>
<content type='text'>
Squash-merged after diff review of PR #6754</content>
</entry>
</feed>
