Windows 11 23H2's in-box runtime (D3D12Core 10.0.22621.5415) has
ID3D12Device10 but not ID3D12Device11, and still answers six cases as
Windows 10 does: the HARDWARE_PROTECTED heap (committed and heap), resource
flag 0x400 on a buffer and on a texture, 2049 shader-visible samplers, and a
type -1 command list. The test told Windows 10 apart by a missing
ID3D12Device10, so it failed on 23H2 at argument_mismatches and then at
heap_mismatches.
Those five comparable cases now need ID3D12Device11 on the host, and
windows10_refusal() excuses its one pair on a host without ID3D12Device11.
The other ID3D12Device10 cases agree on 23H2 and are unchanged.
code_hooks.h hooks a function of the mapped game image without patching it: every direct call/jmp rel32 to it in the
image's executable sections is pointed at a thunk that saves rcx/rdx/r8/r9 and xmm0-3, passes the hash (argument 0
or 1) through leonida::mods::active().remap() and jumps on to the original. gta6rt installs it right after mapping,
before any image code runs, and logs how many call sites it redirected, so a --dry-run with a candidate RVA tells
whether it is the archetype lookup. ctest code_hooks runs the thunk on x64 functions written into memory (call and
tail jump remapped, r8 preserved, a branch elsewhere left byte for byte). With the executable's lookup RVA this
applies mods/mandy_prison_intro; docs/modding.md says how to find it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pick_entry's comment had ended up above the new helper, and the log line
ended in "words" while printing the number of literal S#s. Reported by
@zzEmmazz on #2906.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vk_compute_test.cpp: keep both includes (vk_validation.h from this branch,
cs_wave_probe_spv.h from main).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In-box WARP 10.0.22621.5415 (Windows 11 23H2) reports
OPTIONS12.RelaxedFormatCastingSupported = 0 and refuses a castable-format list
in CreateCommittedResource3 with E_INVALIDARG, so the test failed at its
castable 4x MSAA case although it only checked for ID3D12Device10.
When the host cannot cast, the layer's castable RGBA8_UNORM resource is now
compared with an RGBA8_TYPELESS resource on the host: the same views over the
same bytes give the same expected readback, so no case is skipped. Hosts with
relaxed casting keep the castable resource on both sides.
In-box WARP 10.0.22621.5415 (Windows 11 23H2) reuses the first count for the
second counted ExecuteIndirect after a GPU copy overwrites the count buffer
(0 -> 3 gives 0/0, 1 -> 3 gives 2/2), so the test failed on every 23H2 host
although the layer gives the expected result in all eight cases.
The layer is now compared with expected(). WARP must still match it, except
when it gives exactly the stale-count result in a GPU-update case; that case
is printed with the WARP build instead of failing the test.
d3d12_pipeline_library_host_test runs 46 CreatePipelineLibrary /
ID3D12PipelineLibrary1 calls that need no pipeline state object on the
Vulkan-backed device and on the host runtime, and compares each HRESULT and
what happened to the output pointer (74 values). On the host every call runs
in a child process with a fresh device: a call that faults there leaves the
runtime broken, and in-process the next call failed fast (0xC0000409). On main 25 values differed (RTX
3060, driver 610.88); now none do:
- A foreign, truncated or corrupt blob, the other device's serialized
library, or a null pointer with a size is E_INVALIDARG, and the output
pointer is left as it was (the layer answered DRIVER_VERSION_MISMATCH and
nulled it). One of the layer's own blobs from another format version stays
D3D12_ERROR_DRIVER_VERSION_MISMATCH.
- A pipeline library is a device child, not a pageable object:
QueryInterface(ID3D12Pageable) is E_NOINTERFACE.
- Load*Pipeline with a null output is E_INVALIDARG, not E_POINTER.
Not compared, and printed as such: the serialized size and bytes (each
device's own), and the calls the host faults on (Serialize(nullptr, n),
StorePipeline with a null PSO, Load* with a null name or description), which
the layer answers E_INVALIDARG.
d3d12_pipeline_library_test expected DRIVER_VERSION_MISMATCH for a foreign or
tiny blob; it now expects E_INVALIDARG, and DRIVER_VERSION_MISMATCH for one of
ours from another version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All six gated tests pass on Windows 11 / Ryzen 7 7800X3D / RX 7900 XTX
(32.0.32015.7029) against an independently verified package on main d0835dd9:
pe_loader, fsr_dispatch (steps 1-7; context created as on WARP, dispatch stops
at the documented compute-pipeline refusal), bvh_builder (WARP per RT-89),
bink_decode, bink_audio and bink_play_headless.
New measured facts recorded:
- bink_audio: 1280x720 1-track 0x7000 binkaudio_dct 48 kHz stereo stream,
181 frames -> 1,158,400 PCM bytes (6.033 s), calls=181, no pre-roll.
- bink_decode: a KB2j-revision 512x512 15-frame stream decodes (2 shim / 58
host / 0 unimplemented imports, frames 0 and 1 differ), so both revisions
decode through the loader on more than one package copy.
- bink_play: 720p 181-frame headless decode at 672 fps on this CPU.
Offsets, sizes and counts only; no game data. movies.rpf indexing reproduced
docs/movies.md exactly (515 streams, 1,094,744 padding bytes, 22,812 unread).
gta6rt reads mods/<folder>/mod.json next to gta6rt.exe (or --mods DIR), checks each and logs it. An archetype swap
names two models the game has (by joaat name or 0x hash): when the game asks for `from` it gets `to`. The swaps
are loaded into leonida::mods::active(); they apply once the game's archetype lookup is hooked, which needs the
executable's address for it (docs/modding.md, Day one).
mods/mandy_prison_intro swaps Lucia's player model player_story000_00 (0xE472B687) for cs_mandy (0xD7C0CDFF), the
ids measured in the packs tables; mods_test checks joaat reproduces both. Conditions narrower than "always" are
refused until a hook provides mission state. No game data in either.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under Wine the host D3D12 is vkd3d and under Proton vkd3d-proton, and
Proton's EnumWarpAdapter returns the hardware adapter, so the host and
WARP references six tests compare with are not Microsoft's runtime:
d3d12_r9g9b9e5_uav, d3d12_method_variants and d3d12_sampler2 fail under
Proton (the last two crash inside vkd3d-proton), d3d12_fence_timing and
d3d12_subresource_copy under both, d3d12_private_data under Wine.
The six skip the host comparison there with hostwine::host_is_wine() and
check the layer against Microsoft's answers recorded in the test instead,
so Wine and Proton still check values. d3d12_r9g9b9e5_uav gets WARP's
words for its six clear cases, from the packing rule in
docs/d3d12_vulkan.md. d3d12_subresource_copy and d3d12_private_data get
answer tables, taken from the records that Windows runs on NVIDIA and AMD
compared with Microsoft's runtime with no mismatches; LEONIDA_D3D49_DUMP=1
prints the host's record on Windows to regenerate them. The other three
already had recorded answers. Windows still compares with the live
runtime too.
docs/design.md: the triangle sentences of the Ray tracing row now give the rule measured on an RX 6800 (gfx1030,
AMD 26.11.2, 2026-11-22, the kernels tools/bvh_tri_probe.py builds, 1,204 results): the invalid-ray result, the shear from the
direction, k = |d[kz]|^3 times (T, det, b_i, b_j), the miss words, t >= 0 without an extent test, +0 and
0xFFC00000, RDNA2's tie rule, how the translator computes them, what a consumer dividing by word 1 sees and where
the earlier normalised words differed, and what was not measured. The box sentences are unchanged.
docs/bvh.md 7a: the translator's triangle words against the software step's. cs_bvh32.asm: the derivation of the
scene's triangle words follows the measured rule; the words are unchanged (k = 1 and |det| = 1 there).
Co-Authored-By: Claude Opus <noreply@anthropic.com>
create_arena clamped LEONIDA_ARENA_MB to 16..4095 MiB and never read the device's buffer limits. The RX 6800
(AMD 26.11.2) reports 2 GiB for both, so LEONIDA_ARENA_MB=3000 made d3d12_compute_test fail under
LEONIDA_VK_VALIDATION=1: one vkAllocateMemory over maxMemoryAllocationSize per device. The size is now decided by
src/arena_size.h (min of the request, maxBufferSize and, for the buffer's memory requirement, maxMemoryAllocationSize,
rounded down to MiB), read with the device's other Vulkan 1.3 properties into VulkanDeviceInfo (0: query; a test sets
a smaller one), and logged once when a limit cuts the request. arena_size_test checks the decision on the CPU;
d3d12_compute_test checks the arena against the real limits and a simulated 32 MiB maxMemoryAllocationSize. Tested
on an RX 6800, Windows 11, AMD 26.11.2: ctest 133/133, and the 3000 MiB validation run now passes with no errors.
Co-Authored-By: Claude Opus <noreply@anthropic.com>
Case 6 assumed both fences were in one ready batch. The dispatcher may wake after the first signal, leaving B in pending_ when A calls cancel(B); in that case cancel() correctly runs B's callback before it returns. Assert the real contract instead: B must not run after cancel(B) returns, whether it was pending or already in a ready batch. Set the A-side flags in one lock scope so the waiter cannot see them half-updated. Red control on the parent source: 0/100 pass; fixed: 100/100 pass.
Shdann and Exopus independently reproduced the timing dependence; kapitche verified the fix on two GPUs.
main() took sys.argv[1] as the folder build.py wrote, so check.py --help went on to
"Test programs not found". Same fix as build.py in #4409: -h/--help print the module docstring
and exit 0; every other invocation is unchanged.
D3D12 allows logic ops on UINT targets only; Intel Arc returns the source on UNORM. The XOR draw now runs on its own R8G8B8A8_UINT target with a uint pixel shader, and the expected pixels are the integer XOR.
The view path builds TEXTURE1D/TEXTURE1DARRAY RTVs (line_target_view); what is refused is creating a
1D texture with ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL. Name that instead of "1D attachments".
Test only, no change of behaviour: the contexts 7, 9, 11 and 0x51 and the "no value" sentinel get constexpr names,
and the static event list is cleared before the block records into it.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>