A fault address alone does not say whose page it is. Each one now also gets:
- VirtualQuery of the same number on Windows: base, allocation base, state, protection and type. A host
import, a range of the title's memory or a raw CPU pointer that reached a shader shares the number.
- With LEONIDA_ADDRESS_BINDINGS=1, VK_EXT_device_address_binding_report: a debug messenger records the GPU
range of every buffer, image and allocation the driver binds and unbinds (src/address_binding.h). The
report lists the live objects containing the page, the nearest below and above, and recently unbound
objects that held it.
address_binding_test checks the record and the report on synthetic bindings, and the feature and extension
on the device chain. On an RTX 5070 Ti (617.42) the messenger saw ~50,000 binds in a retail boot, and the
world-start WRITE_INVALID address was in none of them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Records the one DStorageGetFactory call site (RT-5): the import comes from XCRDAPI.dll, RCX is the id address {62959D11-D45F-4884-A0A3-F7862EA243AE} at 0x1462FC7D8, RDX is the out pointer at 0x1478F5E78, and the object's slot 8 (call [rax+0x40]) takes 0x02000000 and checks the HRESULT sign.
PC dstorage.h puts SetDebugFlags at slot 6 and SetStagingBufferSize at slot 7, so SetStagingBufferSize at slot 8 confirms one console-only method (SetCpuAffinity) sits alongside the shared SetDebugFlags at slots 6 and 7 while their relative order stays a guess; the module is now measured instead of a name from a library list.
Claimed in ubiquitarianism/leonida#14 (item DSTORAGE-FACTORY-MEASURED).
AI-assisted: yes (Antigravity)
Measure the device presentation slots in the executable: 78-81 are called, from one device-pointer global, at the documented arities (4/4/5/4 with the receiver in rcx), and record the argument registers, stack words and receivers. Row 3527/3528/3529 and the section 7.1 open bullet now say Measured for the slots; the struct layouts and the queue PresentX/SuspendX/ResumeX slots stay Open.
AI-assisted: yes (Antigravity)
pipeline_cache.session.bin can't keep what a crashed run compiled: it is written at device teardown only, and
a cache seeded from the multi-GiB corpus returns the whole corpus, over its write limit. So the slow builds
the corpus misses (the pipeline library's compute programs, 3 to 7 s each on an RTX 5070 Ti) are compiled
again on every boot.
Each graphics and compute build now first asks the corpus cache with
VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT. A miss is built against a second cache, seeded from
pipeline_cache.heavy.bin next to pipeline_cache.bin, so that cache holds only the misses.
A build of at least LEONIDA_HEAVY_PIPELINE_CACHE_MS (500 by default) schedules a write. A thread of its own
writes the cache 3 s after the newest slow build and no later than 20 s after the first unwritten one,
through the session cache's staging file and rename. At teardown it writes what is left. 0 turns it off,
and with it pipelineCreationCacheControl unless LEONIDA_PIPELINE_COMPILE=cache-only asks for it.
Measured with vk_pipeline_check on the RTX 5070 Ti (617.42): a cache-only create of four library compute
programs the corpus lacks returns VK_PIPELINE_COMPILE_REQUIRED in under 1 ms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vulkan run of these fuzzers (--oracle hw,vk) takes its expected words
from a native AMD GPU, so a contributor with an NVIDIA or Intel card cannot
use it. tools/vk_model_fuzz.py runs the programs the fuzzer generates for
the same seed through the translator and vk_compute_test and judges them
against the fuzzer's reference model instead. A program the model declines
is a skip and never reaches the GPU. No existing fuzzer is edited.
tests/test_vk_model_fuzz.py stands in for the GPU, so it needs no Vulkan
device; docs/testing.md has a short section next to the AMD hardware oracle.
On an RTX 4050 Laptop (NVIDIA 621.01) a sext() SDWA source feeding
v_cvt_f32_u32 was converted as signed: v1 = 0x4fbdc08a with src0_sel:BYTE_2
gave -67.0 where the reference model has 0x4f800000. 7 of 400
v_cvt_f32_u32 programs differed; with two shifts (left, then arithmetic
right) the same 400 match, and so do the 4,500 programs of three full
sdwa_diff seeds except one unrelated f16 compare. The bits are the same
as before; the CPU interpreter agrees with the model either way.
Adds tests/semantic/test_sdwa_sext_source.py (every selector, nine values,
no OpBitFieldSExtract in the output), moves the two test_mutations anchors
that named the changed lines, and records the finding in the SDWA row of
docs/design.md.
With VK_EXT_transform_feedback enabled on the device, an SO_STATISTICS heap is a real VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT pool, begun and ended indexed on the stream (vkCmdBeginQueryIndexedEXT / vkCmdEndQueryIndexedEXT). ResolveQueryData copies the two 64-bit results (NumPrimitivesWritten, PrimitivesStorageNeeded) in the same order. The layer still refuses StreamOutput PSOs and still does not implement SOSetTargets, so no primitive reaches a stream yet and the counts stay 0; without the feature the heap is made without a VkQueryPool and resolves zeros, as before.
Select the upload path after checking both format features and image usage. Keep required staging available for mapped linear textures and only retry host backing when the image supports it. Exercise both capability failures with synthetic GPU readback.
AI-assisted-by: OpenAI Codex (gpt-6.2-astra)
A CopyTextureRegion of the depth plane from a D32_SFLOAT_S8_UINT image into a
D32_SFLOAT one was replayed as vkCmdCopyImage. Vulkan requires depth/stencil
formats to match exactly (VUID-vkCmdCopyImage-srcImage-01548), and the NVIDIA
driver (RTX 4070 Laptop, 621.40) wrote past the end of the D32 image: the
world-start WRITE_INVALID device loss, with the fault at the first byte after a
2560x1440 D32_SFLOAT image (VK_EXT_device_address_binding_report) and this VUID
reported by the validation layer just before the loss.
depth_format_pair: two depth formats with the same depth encoding but not the
same VkFormat (D32 / D32S8, D16 / D16S8, X8_D24 / D24S8) take the image ->
scratch -> image path depth <-> colour and A8 copies already use; the depth
aspect has the same texel layout in a buffer on both sides.
replay_copy_offset_test: the D32S8 -> D32 and D32 -> D32S8 depth-plane copies
are staged (no vkCmdCopyImage, depth aspect, 4 bytes a texel), and D32 -> D32
keeps vkCmdCopyImage. Fails without the change (6 checks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runtime's device enables VK_EXT_transform_feedback whenever the extension is present, and AMD's driver makes it part of a pipeline's cache key, so the cache vk_pipeline_check seeds offline no longer hit in gta6rt: pipeline_cache_seed failed 3/3 on an RX 7900 XT (adrianmjim). Link the same VkPhysicalDeviceTransformFeedbackFeaturesEXT the runtime enables, next to the mesh-shader one, and list it with the other always-enabled extensions in the header and docs/pipeline_check.md.
Tested: pipeline_cache_seed passes on an NVIDIA RTX 3080 Ti (NVIDIA does not key on the extension, so it cannot reproduce the AMD failure). AI-assisted.
The same MoltenVK 1.4.2 drops the bias on an Apple M3 and applies it on an
Apple M5 Pro (#1774 review), so the driver-ID rule turned ps_ssharp red on
the M5 Pro. tools/lod_bias_probe.py translates vs_ids and ps_ssharp without
the flag and draws LOD_BIAS 0, +1 and -1 with vk_sampler_test; the flag is
on only when +1 and -1 read the no-bias levels. run_gpu_tests.py, build.py
and make_game.py take its answer; vk_subgroup_info.py is back as on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compute modules over 128 KiB and graphics pipelines of 1 MiB of SPIR-V or more wait at one gate for the process until their estimates fit the memory that is free, instead of one at a time. PipelineCompiles::build gives a submission as many lanes for them as can be in at once, largest first, and fills the rest with small ones. A thread that waits for its place holds no PSO's lock, and one that has a place waits for none. The warm-up's compiles are speculative. LEONIDA_SERIAL_BIG_COMPILES=1 keeps one at a time, 0 has no limit, LEONIDA_BIG_COMPILE_BUDGET_MB fixes the budget.
LargeModuleGate moves to runtime/src (a forwarding header keeps vk_pipeline_check and its test as they are) and gets a second constructor, whose budget is read whenever a place is given or returned. Its modules get in in the order they came, a speculative one only while no demand waits and within a quarter of the budget. large_compile_budget_bytes() is three quarters of the smaller of the free RAM and the room under the commit limit. CPU test: the bound, one always, order, priority, every wake-up, the budget of the moment and the setting.
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).
run_gpu_tests.py, build.py and check.py, native and LEONIDA_W64_EMULATE=1,
on an RX 9070 XT under RADV. One failure on main (cs_imgatomic_ext), which
#1518 fixes on this GPU; build.py stops at cs_dpp_cmp on main and runs
clean with #1444. ms_wave_info_s3 passes in every run here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Keep main's first-run profile without GPU completion labels and this
branch's focused keyboard pad (LEONIDA_KEYBOARD_PAD=1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The layer enables VK_EXT_host_image_copy for WriteToSubresource and
ReadFromSubresource whenever the device has the extension and its
hostImageCopy feature. On an RTX 4070 SUPER (Windows 11) a real boot lost
the device with WRITE_INVALID in 7 of 7 runs that used host image copies
and in 0 of 2 that did not. The mechanism is not known yet.
LEONIDA_HOST_IMAGE_COPY chooses: 0 never, 1 whenever available, auto (the
default, also for unset or unrecognized text) as 1 except on NVIDIA
(vendorID 0x10DE), where it is off. Off, the extension is neither enabled
nor chained, so no image gets host-transfer usage and every CPU texture
copy takes the existing staging submit, as on a device without it.
The choice is a pure function (src/host_image_copy_policy.h) with a unit
test of its table, and device creation logs one line with the choice and
the reason in place of the old "no VK_EXT_host_image_copy" line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
A build without SDL3 answered GameInputCreate with no devices and E_NOTIMPL
for every other slot, so the title waited at its first "press A" prompt
forever: no CI artifact or offline build could get past it.
With LEONIDA_INPUT_SCRIPT set, gameinput_no_sdl.cpp now serves one scripted
pad (an Xbox One gamepad) driven by the script alone: device enumeration
through RegisterDeviceCallback (blocking, async, dispatcher), FindDeviceFromId,
and GetCurrentReading/GetNextReading/GetPreviousReading whose gamepad and UI
navigation state follow the script. Readings are taken when the title asks,
so no thread polls. Without the variable it behaves as before.
The parser, the 300 ms timeline, the button names, the press log lines and
the UI navigation mapping move from gameinput.cpp into gameinput_script.h,
which both shims use; nothing in it needs SDL. gameinput.cpp checks the
shared SDL button numbers against SDL_GamepadButton at compile time.
gameinput_no_sdl_test --input-script (CTest gameinput_no_sdl_script) checks
the scripted pad on a fake clock. Docs: runtime/README.md, docs/gameinput.md,
docs/linux_proton.md, docs/README.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any vulkan/vulkan.h used to be accepted, so headers that are too old (conda-forge's
vulkan-headers resolves to 1.3.231 next to llvm-tools) configured fine and then failed
deep in the build: d3d12_com.h(42) "'calibrated': unknown override specifier" and 100+
errors in d3d12_vulkan_device.cpp, or VkPhysicalDevicePipelineBinaryFeaturesKHR in
vk_harness.cpp.
runtime/cmake/vulkan_headers_version.cmake reads VK_HEADER_VERSION from the headers
Vulkan::Headers points at (FetchContent's $<BUILD_INTERFACE:...> unwrapped) and fails
with the found and needed versions and how to fix it. The minimum, 294, is measured by
building the whole Windows runtime against Khronos header tags: v1.3.294 and SDK
1.4.304.0 build all 555 targets, SDK 1.3.280.0 all but vk_harness, 1.3.231 stops in the
D3D12 layer. Only Windows-runtime configures check, so the portable Linux/macOS tool
builds keep accepting older distribution headers.
tests/test_cmake_vulkan_headers_version.py runs the module with cmake -P on stub
headers and checks that the FetchContent and CI pins meet the minimum.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The launcher runs gta6rt.exe --run once under Wine on Linux, headless on a
private kwin_wayland --virtual --xwayland session (Xvfb has no DRI3, so RADV
cannot present there) or on the current display with --visible. Sound is off
(Wine's audio drivers disabled, Pulse/PipeWire/ALSA pointed at nothing,
LEONIDA_AUDIO=silent for the runtime's silent output endpoint), --device pins
the Vulkan device through MESA_VK_DEVICE_SELECT, and a hard time limit, a lock
and full teardown bound the run. Every path comes from arguments or the
environment.
tools/game_run_summary.py prints counts only: run time, end, exceptions by
code, D3D12 calls by outcome, presents, the top failing calls and the [rt]
lines by category with numbers masked. It never prints a log line.
Tests need no game, Wine or GPU: the script against stubs, the summary on
synthetic run folders. docs/linux_proton.md describes the script.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zip_parts() decided whether a package member's name was safe by comparing
it with safe_folder_name(), which makes a tidy folder label out of free
text: it also collapses runs of spaces, strips them at both ends and cuts
at 80 characters. So a mod holding `read me.txt`, a file name with an
ideographic space or one longer than 80 characters packed without a word
and could not be installed again: "unsafe ZIP member name". The same ZIP
made by hand was refused the same way.
Members are now checked with portable_name(): no separator, control or
reserved character, no trailing dot or space, not a device name. It also
refuses `COM1 .log`, which the label comparison let through.
`pack` runs the same check before it writes anything, so it stops at a
file `install` would refuse (`con.txt` or `a:b` made on Linux) instead of
writing a package nobody can install.
The manager checks a manifest with its own copy of the rules in
runtime/src/mods.h, and the copy had fallen behind in three places.
The "camera" section was not read at all. `list` said of mods/first_person,
which ships in this repository, "no archetype_swaps; this mod currently
changes nothing", and `check` passed a section the runtime skips the mod
for: an unknown view_mode, a first_person_value that is not a whole number
0-255, contexts that are not whole numbers.
A UTF-8 byte-order mark in front of mod.json was reported as invalid JSON,
although the runtime skips it and docs/modding.md says it is accepted.
Notepad's "UTF-8 with BOM" and Windows PowerShell 5.1's -Encoding utf8
write one. `enable`, `disable` and `install` failed on it too. A UTF-16
file is now named as the runtime names it.
"archetype_swaps": null passed as a mod without swaps; the runtime refuses
it.
`list` and `list --json` now show the camera a mod sets, and which mod's
camera wins when several enabled mods have one.
The "32-bit literal source of a signed 64-bit vector op" row of
docs/design.md said its rule (sign-extend in an i64 operand, zero-extend in a
u64/b64 one, Gen.valu_imm_i64) was not measured on hardware.
tools/valu_literal64_probe.py runs 21 op forms (v_cmp/v_cmpx lt/gt i64/u64,
v_ashrrev_i64, v_lshrrev_b64, v_lshlrev_b64, v_mad_i64_i32, v_mad_u64_u32)
x the literals 0xffffff9c, 0x80000000 and 0x7fffffff through tools/hw_oracle
in wave32 and wave64. On an RX 7800 XT (gfx1101) every result follows the
row's rule; the row now says so and that RDNA2 is not measured.
tests/test_valu_literal64_probe.py is CPU-only; its assembler check runs
when LEONIDA_AMD_CLANG has llvm-mc beside it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ru twin of PROC-544 (which lists nine languages without ru) and of
RT-946 (fr): since #1797, `check` runs first, then the selected `shaders`,
`assets` and `runtime` stages run together, and `pipelines` starts once the
translated shaders (and, with runtime, vk_pipeline_check) are ready. The
quickstart still listed them as a strict sequence. Wording follows the README
paragraph and the fr quickstart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R3jaqM4chYafyZwWfSm5TW
The "v_cndmask_b32 source modifiers" row of docs/design.md said the rule
(sign-bit moves, Gen.src_u_sign_mods) was not measured on hardware for this
instruction. tools/cndmask_hw_probe.py runs 15 words x v/-v/|v|/-|v| x
src0/src1 through tools/hw_oracle under ieee 0/1 x denorm32 0/3 in wave32 and
wave64, with a v_add_f32 and a v_mul_f32 in each kernel as controls that show
the MODE is in effect. On an RX 7800 XT (gfx1101) all 120 results are sign-bit
moves in every mode; the row now says so and that RDNA2 is not measured.
tests/test_cndmask_hw_probe.py is CPU-only; its assembler check runs when
LEONIDA_AMD_CLANG has llvm-mc beside it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>