Commit Graph

4696 Commits

Author SHA1 Message Date
8f12d8c2f5 Merge pull request #2022 from AlxcBTW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:05:12 -05:00
dcd6063eeb Merge pull request #1760 from Luiz Neves
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:05:04 -05:00
6509ca2ce1 Merge pull request #1492 from Vonsek
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:05:00 -05:00
2eb5669566 Merge pull request #837 from DANISBR1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/design.md
2026-11-22 23:04:57 -05:00
da44e54a1a Merge pull request #589 from NWX10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:04:53 -05:00
db34711519 Merge pull request #580 from SirAmong
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/design.md
2026-11-22 23:04:53 -05:00
d16bf9924a Merge pull request #521 from NWX10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:04:51 -05:00
89ef9b9d95 Merge pull request #497 from Luis Baker
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:04:51 -05:00
baefe6d643 Merge main 2d3369a4 into #4113
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 04:54:39 +01:00
31d2798239 d3d12_vulkan_device_test: tell Windows 11 23H2's runtime apart by ID3D12Device11
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.
2026-11-23 04:53:33 +01:00
9e6444fadb Mods: the archetype hook, --archetype-lookup RVA[,ARG]
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>
2026-11-22 22:53:19 -05:00
6a726e708d d3d12: register_literal_samplers above pick_entry's comment; its log names what it counts
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>
2026-11-23 00:50:58 -03:00
7680301628 Merge remote-tracking branch 'origin/main' into w64-idea
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/w64_graphics.py
#	tests/semantic/test_wave64_halves.py
#	tests/test_wave64_halves_fixtures.py
#	tools/wave64_halves.py
2026-11-23 04:50:52 +01:00
72c6b0a0a9 d3d12_present_test: do not assert the screen pixel for a GPU that does not drive the window's monitor 2026-11-22 22:50:49 -05:00
65c3e1e3c2 Merge main (2d3369a4) into test/877-compute-validation
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>
2026-11-23 03:49:50 +00:00
9f304c12af d3d12_typeless_rtv_test: compare castable MSAA RTVs on hosts without relaxed casting
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.
2026-11-23 04:49:32 +01:00
dddf6aaa9a Merge main 7b7d73f8: the device function list keeps main's pipeline cache entries and the render pass ones
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 05:49:06 +02:00
9a4fb379b1 Merge remote-tracking branch 'origin/main' into test-1007
# Conflicts:
#	runtime/test/d3d12_draw_test.cpp
2026-11-23 04:48:00 +01:00
04d020822d Merge main for reserved texture tile mapping 2026-11-23 00:47:18 -03:00
067c579913 d3d12_indirect_dispatch_count_test: check the layer against the expected count
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.
2026-11-23 04:45:57 +01:00
ccb572e33e Merge round-43 sampled indexing fix into storage indexing follow-up 2026-11-23 13:44:31 +10:00
dad0da40a1 Merge round-43 main into sampled descriptor indexing fix 2026-11-23 13:43:27 +10:00
0eb3a7698c d3d12_xs: print D3D12XboxCreateDevice's parameter words with --trace-d3d12 too (RT-310) 2026-11-23 08:42:50 +05:00
60f1d31945 docs(runtime tests): link the KB2j composition from bink_decode_test 2026-11-22 21:41:52 -06:00
4abd83a06b d3d12: pipeline libraries answer their arguments as the host runtime does
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>
2026-11-23 04:41:50 +01:00
2521a683b0 xgameruntime: keep persistent local storage out of GAME:\
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
2026-11-23 04:41:49 +01:00
11a1f88c07 docs(runtime tests): tighten the Bink second-machine wording and link the notes 2026-11-22 21:41:05 -06:00
e69471eaab docs(runtime tests): independent 1.0.2.1 package-gated runs on a second machine
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).
2026-11-22 21:41:05 -06:00
2d3369a4c8 Merge remote-tracking branch 'origin/main' 2026-11-22 22:41:03 -05:00
db51b7d3f9 Mods: mod.json manifests with archetype swaps, and the Mandy prison-intro mod
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>
2026-11-22 22:41:02 -05:00
b136ee4680 Tests: check Microsoft's recorded answers where Wine and Proton have no reference
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.
2026-11-22 20:40:59 -07:00
73ab096615 docs: the measured RDNA2 triangle rule in the Ray tracing row
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>
2026-11-22 20:40:54 -07:00
f173fc0df3 d3d12: cap the GPU address arena at the device's maxBufferSize and maxMemoryAllocationSize
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>
2026-11-22 20:40:03 -07:00
fa5f26db8e Merge origin/main: DXGI device fields coexist with the console-ABI device state 2026-11-22 20:39:59 -07:00
baccecb055 test(runtime): separate Xbox readback CTest registration
Place the CPU check apart from the pending XDXR fixture registration so both changes can land independently.
2026-11-23 04:34:53 +01:00
047b789d7b vulkan: make re-entrant cancel test independent of ready-batch timing
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.
2026-11-23 06:34:12 +03:00
0c104b5eb1 check.py: -h and --help print the usage instead of looking for a shader folder named "--help"
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.
2026-11-23 04:33:53 +01:00
0cb7f52a0a test(runtime): require complete Xbox present readbacks 2026-11-23 03:33:22 +00:00
4a16dc1669 test: run the d3d12_draw logic-op pass on a UINT render target (TEST-1007)
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.
2026-11-23 04:31:55 +01:00
911aead5ac Draw a stratified sample of translated pixel shaders on two GPUs and compare (vk_ps_sweep, tools/ps_sweep.py) 2026-11-22 22:27:18 -05:00
816dc08212 test(runtime): separate cube alpha CTest registration 2026-11-23 03:14:15 +00:00
f31e11ccbb test(runtime): validate alpha in cube texture readback 2026-11-23 03:13:07 +00:00
be8570ace1 Merge remote-tracking branch 'origin/main' into triage-r43
# Conflicts:
#	docs/runtime_imports.md
#	runtime/CMakeLists.txt
#	runtime/shims/xgameruntime.cpp
#	runtime/test/xmem_test.cpp
#	tools/rdna2spirv.py
2026-11-22 22:12:50 -05:00
37e66e90ba GPU tests: preserve wave32 process failures on narrow subgroups 2026-11-22 22:12:41 -05:00
893f44bf8b Forward pipeline progress snapshots to isolate children 2026-11-23 04:03:48 +01:00
ffddfeddcf runtime/README: say where the 1D attachment refusal is
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".
2026-11-23 04:03:02 +01:00
9eee64d8a7 wave64_halves: allow tainted lane selector on uniform v_readlane_b32 (SHADER-314) 2026-11-23 00:02:50 -03:00
8de9ce89df test(runtime): check full presenter synchronization capture 2026-11-23 02:55:52 +00:00
4de96f3b81 Accept UTF-8 BOMs in C++ shader index readers 2026-11-23 03:49:47 +01:00
b1d2a061cd winhttp_offline_test: name the context values and clear the event list of the inheritance block
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>
2026-11-23 05:44:54 +03:00