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>
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review findings from shdann's Windows run of the new console queue/list
work:
- d3d12_debug_markers (and every GPU harness compiled against the PC
headers) drove lists through the console-shaped proxy, so PC slots past
26 — including the PIX markers at 56-58, which have no console
counterpart — reached unrelated console methods or were dropped.
create_device_proxy gains console_lists: false hands the real
(PC-shaped) list back from CreateCommandList. The GPU tests pass false;
the title path keeps the console default.
- queue_proxy asserted E_NOTIMPL for the queue's console tail, but those
slots deliberately answer S_OK now — frame pacing flows through them.
The test's contract is updated; the fence tail stays refused.
- ChildProxy::queue_layout was a plain unsigned char read and written
from many threads; it is atomic like the device-wide detection it
caches.
xs_proxy_mock_test and loader_test pass under Wine; the modified test
objects compile clean under clang-cl. The GPU harnesses need a real
adapter — covered by shdann's Windows run.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
A tester on #3951 saw a slot-67 lookup miss with the real FidelityFX DLL where the base build had none, and read it as
the proxy taking one program's kind 6 with another program's kind 0.
Pinned from the DLL's code and run on all 29 payloads: its FSPX reader (0x1a20) and the same loop inline for a
container store kinds 0, 1, 6 and 7 in four pairs from one payload, and the pipeline function copies them to +0x08,
+0x18, +0x28 (the kind-6 copy, with kind 6's own size at +0x30) and +0x38 of the description. That is the layout the
proxy reads, and code and state of one call always come from the same program. A harness that maps the DLL without
running it, calls its reader on each payload and builds the description that way resolves every translated program
to its own entry through slot 67 on the Vulkan device (26 of 29 on main aa2988cc; the other 3 are refused), on
llvmpipe, the integrated GPU and the RX 7900 XTX.
So the proxy does not mix programs. What fits the report: with slot 11 answered, the DLL goes on to its next pipeline,
which that translation (20 of 29) does not have; only the first call of a slot is announced, so the miss read as the
first call's.
- d3d12_xs_device.cpp: every failed slot-67 call is logged with its number and the four sizes.
- d3d12_fspx_compute_test: dll_slot67 builds the description from a container's own directory the way the DLL does
(reader pair order, pointers into the payload, kind 6 copied into a 256-rounded buffer padded with 0xcc); each
program resolves to its own translation with its own state. A proxy that read kind 0 from +0x18 or kind 6 with
the rounded size fails the test.
- docs/fspx.md, d3d12_command_objects.md, d3d12_vulkan.md: how the layout was pinned, and what happens when a later
program is not translated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rt::rootsig::pack_stage() lays a root signature out for one stage the
way the console compiler does: root order from the stage base, a table
one dword (its 32-bit VA), a root view two, constants one per value,
and the first parameter that does not fit refused (the spill array
behind s[0:1] is not modelled).
Compute (base s4) is measured: on the package's FidelityFX DLL, whose 29
compute containers carry their RTS0 next to the console-compiled program,
base plus span equals RSRC2 USER_SGPR in 29 of 29, and
root_sig_contract.py --model console finds all 20 translated programs
compatible (the s0 model contradicts 7). VS/PS/GS s8 and MS s16 stay a
census hypothesis.
The compute bind point now uses this layout; graphics keeps pack(),
since every stage reads one push-constant block and a mesh shader (s16)
and a pixel shader (s8) would collide. A signature carries both
layouts; binding it where its layout refused it invalidates the list.
Test fixtures follow: the compute GLSL shaders read the new places, and
the asm fixtures a D3D12 compute PSO runs are built with
LEONIDA_USER_DATA_SHIFT=4 (compute_fixture.py shifts every SGPR and the
RSRC2 user count), so the standalone harness keeps using them at s0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After slot 67 (or 62) creates a pipeline, amd_fidelityfx_upscaler_xbox.dll calls the pipeline's slot 11, past the
public ID3D12PipelineState, and the slot-67 mapping dropped the dispatch state, so two programs with the same code and
different kind 0 could not be told apart there.
- d3d12_xs_device.cpp: with kind 0 present (the DLL always passes it), slot 67 builds one FSPX payload from the four
pointer and size pairs (leonida::fspx_payload_from_parts) and passes it as CS, so the device uses the code and
state keys. Every pair is checked before it is read; an inconsistent one refuses the call. Without kind 0 the
kind-6 bytes go on alone, as before.
- d3d12_vulkan_device.cpp: XboxPipelineStateStubs puts console slots 9, 10 and 11 into the pipeline's vtable ahead
of Object's virtual destructor (one slot under MSVC, two under GCC), so they are slots 9 to 11 on both. Slot 11
returns a blob holding 0; 9 and 10 return E_NOTIMPL.
- Why 0, measured on 1.0.2.1: the DLL zeroes the value before the call, keeps it at 0 when slot 11 fails or returns
no object, and with 0 skips the scratch buffer and list slot 141 at dispatch. None of the 29 programs sets
COMPUTE_PGM_RSRC2.SCRATCH_EN or has a scratch instruction, and kind-0 words 0 to 2 are the same in all 29, so no
per-program scratch size is there.
- Tests: shader_library_test (payload building, refused pairs, the #1911 review case through slot-67 parts) and
d3d12_fspx_compute_test (slot 67 with four pairs picks the right one of two programs sharing their code, bad pairs
refused, slot 11 and its object's slot 3 and 4, reference counts unchanged).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d3d12_compute and the other tests that write a translator-style shader library under
the temp directory (d3d12_draw, d3d12_set0_compute, d3d12_msaa_draw, d3d12_fspx_compute,
d3d12_pipeline_library, d3d12_subgroup, d3d12_bundle, d3d12_typeless_families,
shader_library) used one fixed folder name. Two copies running at once (ctest -j, or two
suites in one Wine prefix or TMPDIR) shared it, and one copy's remove_all deleted the
modules the other was loading: on an Apple M3 Max under Wine with MoltenVK 1.4.3, four
copies of d3d12_compute at once failed 6 of 40 runs (PSO creation at lines 245/357, or
exit 3 from an uncaught filesystem_error in copy_file), while 125 runs one at a time all
passed.
test_temp_dir.h names the folder <temp>/<name>_<pid>, removes it on scope exit (early
returns included), and copies the compiled-in LEONIDA_TEST_*_SPV files with an error
code, so a missing file is reported by name instead of ending the test with abort().
docs/testing.md lists both symptoms.
d3d12_fspx_compute, d3d12_msaa_draw, d3d12_set0_compute and
d3d12_pipeline_library build PSOs from 144-byte shaders. On a device
whose maxPushConstantsSize is 128 (AMD's Windows driver on RDNA2 iGPUs,
some Intel Arc drivers) the layer refuses those PSOs with E_NOTIMPL, as
D3D-14 intends, so the tests failed at the first CreatePipelineState and
ctest reported 4 failures on a correct runtime. They now exit 77 there
(SKIP_RETURN_CODE in CMake) with the reason; pipeline_library still runs
its library-blob checks first. Devices with 144 bytes or more are
unchanged. d3d12_compute and d3d12_draw are left to #2402, which runs
their --pc-tail-ubo path on such devices.
AI-assisted.
Review on #1911: two containers with the same kind-6 program and different kind-0 entries (32x1x1 and 64x1x1)
translate to different modules but got the same fspx_code_sha256, so both resolved to the same pipeline.
- tools/fspx_unpack.py writes the kind-0 entry as fspx/<name>.state; tools/shader_meta.py records its SHA-256 as
fspx_state_sha256 next to fspx_code_sha256.
- make_game.py: entries with the same code and state keys must have identical modules, otherwise the FSPX step fails
naming both programs and drops the index. The same code key with other state keys is allowed.
- runtime: a container or bare payload (kinds 0 and 6 present) matches the code key and then the state key; no match
is E_INVALIDARG. A bare kind-6 program (slot 67, no kind 0) takes the code key's entries when their modules are
identical, and is refused with E_INVALIDARG and an "ambiguous" log line when they differ.
- Tests: the review case in tests/test_fspx_shaders_stage.py, shader_library_test and d3d12_fspx_compute_test.
- docs/fspx.md: the two keys and the ambiguous case.
On 1.0.2.1 the 29 kind-6 programs are distinct, so nothing resolved wrongly before: 17 translated entries, 17
distinct code keys, 17 distinct (code, state) pairs, all 17 found from the container and from the bare program.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The FidelityFX DLL creates its compute pipelines from FSPX programs (docs/fspx.md): through slot 67 with the bare
kind-6 program, then through slot 62 with the DXBC container whose ACCC part holds the payload. Both ended in
E_INVALIDARG: the layer took only FSSM bytecode, the build never translated the DLL and the index had no key for it.
- make_game.py: the shaders stage unpacks the package's DLL with tools/fspx_unpack.py --disasm into
<work>/shaders/fspx and translates it into <work>/shaders/spirv/fspx, with the same wave64 mode and fallback
flags. The step is redone as a whole when the DLL, its tools, llvm-mc or the flags change (fspx_build.json,
written last) and never makes the game's shaders run again.
- tools/shader_meta.py: an entry of a program without an FSSM blob gets fspx_code_sha256, the SHA-256 of
fspx/<name>.code.
- runtime/src/shader_library.h: the library also loads <dir>/fspx/index.json and finds entries by
fspx_code_sha256. compute_program() takes an FSSM program as before, the kind-6 bytes of an ACCC container or of a
bare FSPX payload, and a bare kind-6 program recognized by its prologue; the directory is parsed with the DLL
reader's rules and bounds-checked, so a malformed one is refused.
- create_compute: looks the program up by the key of its kind and uses those bytes as the code base.
- Tests: shader_library_test (parsing, malformed directories, lookup, the fspx folder), d3d12_fspx_compute_test
(PSOs from both forms, a dispatch each, refused inputs) and tests/test_fspx_shaders_stage.py.
- Docs: the lookup in docs/fspx.md; slots 62 and 67 in d3d12_command_objects.md and d3d12_vulkan.md. The size the
slot-67 description carries at +0x30 is kind 6's own size, read from the DLL's code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>