Conflict in runtime/shims/d3d12_xs_device.cpp, proxy_copy_descriptors_simple:
keep this branch's copy_null_rtv_marks call and main's fsdraw::enabled()
gate for the descriptor-copy diagnostic.
tools/rdna2spirv.py merged without a textual conflict, but #1662 on main
calls restore_dot4_inline_sel in the exact re-anchoring path, which this
branch had deleted. The merge puts main's function back so that call
resolves; the next commits reconcile it with the dot4 op_sel rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
int3_from tried the byte at Rip first and only then checked
ExceptionAddress against it. With Rip one past the 0xCC and
ExceptionAddress on it (a mixed form), a second 0xCC at Rip (int3
padding) was taken first and then refused by the address check, so that
int3 was not skipped. Each candidate (Rip, then Rip - 1) now has to agree
with ExceptionAddress before it is taken. Main did not skip it either,
so this closes a gap rather than a regression. int3_skip_test gets a
"padding" case for it.
The std::set the old dedupe used is gone, so its include goes too; the
candidate loop needs <initializer_list>. Both raised in review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/shims/startup_trace.h: main added the tls_index0 example event
and the exception's region/regs fields to the header comment; keep them,
add this branch's delay_import_unimplemented example and renumber seq.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve physical window aliases across remaps, order console list values,
and replay bounded indirect graphics with captured draw state. Coordinate
pipeline lifetime, texture refresh and queue teardown. Add synthetic CPU
and GPU coverage for the integrated paths.
Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
#984 (273b3bdf9) put RVAs and file offsets of the retail executable into code, docs and scripts.
The code paths that need one now read it from an environment variable and are off when it is
unset; the docs and examples say the location is measured locally.
- runtime/src/main.cpp: the hang-watchdog kick takes its trap and kick RVAs from
LEONIDA_TITLE_WATCHDOG_KICK="<trap RVA>,<kick RVA>" (hex), still only when the trap
instruction is at the first one. Unset, the watchdog stays armed, as before by default;
LEONIDA_TITLE_WATCHDOG=1 keeps it armed, and LEONIDA_TITLE_WATCHDOG=0 without the RVAs says
once that it needs them. The LEONIDA_PEEK example uses placeholders.
- runtime/shims/startup_trace.h: the transient-pool dump fires at the int3 that
LEONIDA_POOL_DIAG_AT names (`<module>+0x<offset>`, as the trace prints it), off when unset.
- scripts/windows-boot/boot.ps1: LEONIDA_PEEK's default comes from LEONIDA_GAME_STATE_RVA and
LEONIDA_SESSION_STATE_RVA (no peek when unset), and the RESULT digest matches those values;
the examples and README use placeholders.
- runtime/README.md documents LEONIDA_TITLE_WATCHDOG_KICK and LEONIDA_POOL_DIAG_AT.
- docs/fspx.md, docs/d3d12_vulkan.md, docs/movies.md, docs/embedded_shaders.md and a comment in
runtime/shims/d3d12_xs_alloc_size.h drop the addresses and offsets.
This follows the same change on the earlier integration branch (#1495).
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>
Delay imports are bound eagerly (deliberate: --dry-run shows the whole import surface). A delay-loaded DLL or
function that nothing serves becomes an unimplemented thunk returning 0 at its first call, where Windows'
delay-load helper raises 0xC06D007E / 0xC06D007F, which a title can catch for a fallback. The binding is
unchanged; --trace now writes a delay_import_unimplemented event (module, import) for each such import at load,
so the first boot names them before any image code runs.
docs/runtime_imports.md gets two notes on where the loader differs from Windows: the eager delay binding above,
and that DLL_THREAD_ATTACH reaches TLS callbacks in TLS slot order, which puts the executable before the DLLs it
imports (Windows' order is undocumented). runtime/README.md lists the new trace event and now says the loader
applies DIR64 and HIGHLOW relocations and rejects HIGH, LOW and HIGHADJ (old upstream 761).
startup_trace_test gets a synthetic DLL with one ordinary and two delay imports (one missing, one bound to
kernel32): exactly one delay_import_unimplemented event, naming the missing delay import.
Findings by cynbun in the old upstream coordination issue (old upstream 7231).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
With no debugger attached, OutputDebugStringW raises DBG_PRINTEXCEPTION_WIDE_C and, when nothing
handles it, calls OutputDebugStringA on its own ANSI copy of the text, which raises
DBG_PRINTEXCEPTION_C. The trace handler logged both, so every wide debug line appeared twice, the
second one lossy (characters outside the ANSI code page became "?").
Remember the wide exception's ANSI pointer (ExceptionInformation[3]) in a thread_local and skip the
ANSI exception whose string pointer ([1]) matches it. Every debug string on the thread resets the
marker, so only the exception right after the wide one is ever skipped and a later
OutputDebugStringA is still logged. startup_trace_test checks one UTF-8 line for a non-ASCII
OutputDebugStringW and that the OutputDebugStringA after it is still there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review on #1756 (Vonsek):
- The trace is opened before the loader reads the image, so `wb` could
truncate an input named by mistake (the image itself). open() now
uses "x" mode and fails with EEXIST on an existing path; gta6rt says
so and exits with 2.
- OutputDebugStringA text is in the ANSI code page. It is converted
to UTF-8 before quoting, so a byte such as 0xE9 no longer breaks the
JSON lines. Host module names now come from GetModuleFileNameW,
converted to UTF-8, for the same reason.
startup_trace_test: an existing file is refused with EEXIST and its
bytes survive, the trace stays off; an ANSI debug string with 0xE9
appears as its UTF-8 form and the whole file is valid UTF-8.
Writes one JSON object per line, flushed per event: module maps, TLS
callbacks, DllMain results, the first call of each unimplemented import
with its caller as module+RVA, OutputDebugString text, exceptions with
module+RVA and a short unwind, and the exit code. A vectored handler
records and returns EXCEPTION_CONTINUE_SEARCH, so behaviour is unchanged.
Off by default.
startup_trace_test builds a synthetic DLL image (no game data) and
checks each event kind.