Commit Graph

815 Commits

Author SHA1 Message Date
2d7be48dec runtime: restore the console DirectStorage shim (DStorageGetFactory) on main
The merge that brought the mirrored pull requests into main (6dece9231) left the DirectStorage shim out, noting
that it "needs the typed-error zlib inflate". The shim's commits (f87d05fdd, ac1843da2, 00551ba00, by
mariuslozo-boop and Kelebek) are ancestors of main, but its files are not in the tree, so the retail
executable's XCRDAPI.dll!DStorageGetFactory import is unimplemented (issue #47, stop 5 of
docs/retail_boot_chain.md).

- shims/dstorage.cpp, shims/dstorage_xs_abi.h, test/dstorage_test.cpp and docs/directstorage.md are back as
  those commits left them.
- leonida::zlib_inflate reports why it failed through an optional ZlibError* (header, data, checksum, limit),
  which the shim turns into its E_DSTORAGE_ZLIB_* codes. This is the same interface the shim was written
  against, added to main's current table-driven inflater; callers that pass no pointer behave as before.
- registry.cpp classes xcrdapi.dll!DStorageGetFactory as an HRESULT import, the retail spelling #47 found
  missing.
- CMake and scripts/build_runtime.ps1 build the shim into gta6rt, and CMake builds and registers dstorage_test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
2026-11-23 20:23:21 -06:00
6dece92317 Merge TreXito's unmerged PRs: translator fixes, fuzzers, CPU emulation, xapu/chad shims
Merged from the TreXito/mangrove copy of the original repository, which carried
contributor pull requests that were never merged here.

Kept: rdna2spirv fixes (ds_append/ds_consume, v_ldexp_f16 under MODE.FP_ROUND,
thread-group SGPR, fma exact), the differential fuzzers (dot, vint, wint, vrel, cvt,
f16misc, salu, mode) with their tests, the exe/import fail-fast and int3 cause tools,
Zen 2 instruction emulation (cpu_emulation.h) and the xapu.dll/chad.dll shims.

Not taken, because they conflict with different implementations already on main:
the D3D12 Xbox-ABI layer, xmem, acphal, loader TLS, f64_diff, DirectStorage (needs the
typed-error zlib inflate), and the copy's own MANGROVE.md and README changes.
2026-11-23 19:42:33 -05:00
d083a2cc37 Make main's tests green: 12 test files that drifted from the code (#9896)
Twelve test files failed on main at 2d53a8055 (CI's check and semantic-tests steps, run locally): most are a test
and the code it checks changed by different pull requests in the same merge round. Each fix below is either taken
from a closed pull request that already had it, or restores what an earlier merged change intended.

From closed pull requests:
- test_make_game_resume: FakeProc gets poll(), which translate() now calls (#7018)
- test_make_game_empty_translation: the Exited stub gets poll() and the failed-shard path is checked (#7214)
- test_shader_checks: stub table_fetch_test in the Wave64Checks harness and count it (#7433)
- test_runtime_paths: runtime.yml's path filter lists tools/replace_retry.py, which rdna2spirv.py imports (#7029)
- test_psin_names: patch the same_report_path helpers that report_paths now calls (#8719)
- test_report_source_collision: the fixture is a real Bink 2 header; bink_index refuses other files (#7408)
- test_missing_input_exit_codes: tile_probe checks its inputs before it asks for numpy (#4771)

Restored:
- merge_check: a failed `git show` is an error again (5b88d58); 21016cf brought back the lenient read that
  treated it as a new file, while new files are already left out when the diff is read
- rpf_probe: a symlinked --out updates its target again (44d3595); 55d21cc's staged write replaced the link

Updated to the code:
- test_shader_stage_resume: TRANSLATION_SOURCES lists fssm_unpack.py and shader_stage_manifest.py, which the
  translator imports; existing work folders translate once more after this
- test_tool_stdout_encoding: the 15 programs merged without the stdout guard get the same block as the others
- test_rdna2spirv_decode: drop the test of decode_any_format, which SHADER-849 replaced with the table decode
  that tests/semantic/test_format_decode_table.py checks

Co-authored-by: jewmaster1337 <102986566+jewmaster1337@users.noreply.github.com>
Co-authored-by: TanmaySatyam <248538550+TanmaySatyam@users.noreply.github.com>
Co-authored-by: evilclanker9000 <45567075+evilclanker9000@users.noreply.github.com>
Co-authored-by: slint6614-dev <359954236+slint6614-dev@users.noreply.github.com>
Co-authored-by: BlackNife <108077267+Poussistar@users.noreply.github.com>
Co-authored-by: fiestorra <65175643+fiestorra@users.noreply.github.com>
Co-authored-by: fearkov <289226582+fearkov@users.noreply.github.com>
Co-authored-by: DoubleD17 <48109637+DoubleD17@users.noreply.github.com>
2026-11-24 00:21:26 +01:00
3faeaf2ca6 Merge remote-tracking branch 'origin/pr/8980'
# Conflicts:
#	scripts/merge_check.py
2026-11-23 17:43:03 -05:00
8b63b583ae Merge remote-tracking branch 'origin/pr/8995'
# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
2026-11-23 17:41:48 -05:00
17bbb2dfb8 Merge remote-tracking branch 'origin/pr/8946' 2026-11-23 17:41:06 -05:00
0aedf6a72a Merge remote-tracking branch 'origin/pr/8958' 2026-11-23 17:41:03 -05:00
887a0e4ef2 Merge remote-tracking branch 'origin/pr/8965' 2026-11-23 17:41:02 -05:00
0fdb6c375f Merge remote-tracking branch 'origin/pr/8968' 2026-11-23 17:41:01 -05:00
65a84a39a4 Merge remote-tracking branch 'origin/pr/8975' 2026-11-23 17:41:00 -05:00
4c55690e89 Merge remote-tracking branch 'origin/pr/8986' 2026-11-23 17:40:57 -05:00
f48adad761 Merge remote-tracking branch 'origin/pr/9523'
# Conflicts:
#	runtime/CMakeLists.txt
#	scripts/build_runtime.ps1
2026-11-23 17:38:03 -05:00
ff8ff4dd96 Merge remote-tracking branch 'origin/pr/9516'
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 17:37:15 -05:00
c925ac7f79 Merge remote-tracking branch 'origin/pr/9494'
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
2026-11-23 17:36:51 -05:00
97230ed64f Merge remote-tracking branch 'origin/pr/9491' 2026-11-23 17:32:53 -05:00
21714399e8 Merge remote-tracking branch 'origin/pr/9761'
# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
2026-11-23 17:30:03 -05:00
f7b3afcda9 Merge remote-tracking branch 'origin/pr/9754'
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 17:29:12 -05:00
e352ad3d37 Merge remote-tracking branch 'origin/pr/9753' 2026-11-23 17:24:50 -05:00
b055a73352 Merge remote-tracking branch 'origin/pr/9712' 2026-11-23 17:24:39 -05:00
e6b8e21d3e Merge remote-tracking branch 'origin/pr/9705' 2026-11-23 17:24:37 -05:00
d578b4806e Tests: GPU coverage for ds_wrxchg*_rtn_b64, ds_or_rtn_b64, ds_min_f32 and ds_max_rtn_f32
docs/design.md marks the 64-bit LDS exchanges not GPU-verified, and
cs_lds_atomics_ext.asm (#9494) leaves ds_or_b64 and the f32 min/max
forms out. cs_lds_xchg64_ext.asm runs one lane through
ds_wrxchg_rtn_b64 (both dwords left and the returned pair),
ds_wrxchg2_rtn_b64 at offsets 0/2 (four old and four new dwords),
ds_wrxchg2st64_rtn_b64 at offsets 1/2 (512-byte steps), ds_or_rtn_b64,
ds_min_f32 with a quiet NaN in memory and ds_max_rtn_f32 ordering -0.0
below +0.0. The eight expected words are derived in its header from
the rows. Registered in check.py and run_gpu_tests.py next to
cs_lds_b64_cmpst; the wrxchg row notes the GPU check (the min/max and
bitwise b64 rows get theirs in #9494, to keep the two PRs apart).
2026-11-23 14:09:15 -08:00
629704a775 Merge PR #9604 2026-11-23 17:09:00 -05:00
f475ea37f1 Merge PR #9581 2026-11-23 17:08:22 -05:00
84d40f32f7 Merge PR #9580 2026-11-23 17:08:21 -05:00
98d99cfca0 Merge PR #9570 2026-11-23 17:08:03 -05:00
ad6e5d6bbe gta6rt: --init/--run stop with a clear message on a host without AVX
The game runs AVX code from its TLS callbacks on, so a CPU or OS without
AVX (a QEMU qemu64 guest) died with a bare 0xC000001D. Check CPUID.1
AVX/OSXSAVE and XCR0 YMM state first, print one line and exit 4 (3 is
LEONIDA_UNIMPLEMENTED=stop). --dry-run is unchanged and
LEONIDA_SKIP_CPU_CHECK=1 skips the check.

AI-assisted.
2026-11-23 23:07:51 +01:00
196ca722bb build_runtime.ps1: the cl.exe fallback compiles every gta6rt source CMake has
xg_xs.cpp (already missing on main), acphal.cpp, xapu_chad.cpp and
d3d12_xs_pso_stream.cpp were in CMake's add_executable(gta6rt) but not in
the fallback's list. pso_stream is called from d3d12_xs_device.cpp (link
error); the others register their shims at startup, so a fallback build
would have run without them. tests/test_build_runtime_fallback.py checks it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:07:49 +00:00
e688f7df1c Merge PR #9548 2026-11-23 17:07:12 -05:00
a30edd1ad5 Merge PR #9538 2026-11-23 17:06:58 -05:00
8b8de98803 Merge PR #9529 2026-11-23 17:06:44 -05:00
a7d211723a Merge PR #9521 2026-11-23 17:06:35 -05:00
0c4b9f436d Merge PR #9520 2026-11-23 17:06:34 -05:00
1cd7eb9e7c build_runtime: the cl.exe fallback builds vk_sandbox and vk_ps_sweep (EGEN-FALLBACK-SANDBOX-SWEEP)
tools/sandbox.py starts runtime/build/vk_sandbox.exe (without it the tool ends at 'unsupported: vk_sandbox is not built'), and tools/ps_sweep.py --exe / tools/ab_control_flow.py --all-attachments start runtime/build/vk_ps_sweep.exe. CMake builds both in its Vulkan tools loop; the fallback built neither, so a fallback build had no harness for either pixel check of translated shaders.

tests/test_build_runtime_fallback.py collects the harness names every Python tool under tools/, scripts/ and runtime/test/shaders/ starts and requires the fallback to build them: vk_sandbox and vk_ps_sweep fail on 5d74c272 and pass with the two cl lines.
2026-11-23 22:59:31 +01:00
75e158bfc3 run_wine_tests: name missing required tests in the summary table
A required test the Windows build never listed fails the job, but the
--summary table only iterated the results, so the step summary showed no
row explaining the failure. Add one 'missing' row per such test, once
even when --require repeats it.
2026-11-23 16:58:21 -05:00
bef7488733 Merge #3976 into own/slot67
regen_fixtures finds its sources by marker on main, so the two ds_append
sources carry the marker instead of a SHADERS entry. ds_append and
ds_consume join wave64_emulate_opt's always-barrier ops (autogenes-sudo's
fix on #3976): under --wave64-emulate they exchange through a barrier
round, and a guarded one in a multi-wave group hit the translator's assert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 21:49:07 +00:00
040f6aadce Report guest scene output directory creation failures 2026-11-23 15:38:35 -06:00
920b781090 merge_check: keep gitlink updates out of text comparison 2026-11-23 21:35:44 +00:00
2471e0487f run_wine_tests: map checkouts at the Windows drive root 2026-11-23 16:33:34 -05:00
e597d90c12 GPU test cs_w32_partial_permute: ds_permute_b32 in a partial wave32
A 20-thread group is one wave32 with lanes 20-31 never launched. A launched
lane whose source lane is missing gets 0, and a send to a missing lane is
lost. cs_w32_permute and cs_w64x_permute run full waves only. The expected
words are measured with a raw 20-thread hw_oracle kernel on gfx1036.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:32:20 +01:00
9a0a1a2d5f Preserve exact integral decimal counters in shader statistics 2026-11-23 13:30:44 -08:00
5b88d58495 merge_check: report Git blob read failures
Use the diff to identify new files and surface required blob read failures through the existing Git error exit.
2026-11-23 21:28:27 +00:00
cc01a77eac bench_wave64: add emulated-only mode (BUILD-3860) 2026-11-23 22:24:08 +01:00
3746a6ff0b feat: select semantic test files by glob pattern 2026-11-24 00:23:58 +03:00
f967225be8 runtime/shims: shim bcrypt.dll provider lifecycle and RNG with deterministic seed support
Refs: https://github.com/ItsNotRexed/Leonida/issues/9065#issuecomment-7114352737
2026-11-24 04:23:26 +07:00
9a71bb4b2a run_wine_tests: resolve a relative Wine executable before changing directories 2026-11-23 16:23:12 -05:00
c18faa47d5 run_wine_tests: give test processes EOF on stdin 2026-11-23 16:22:59 -05:00
aa2dc43f70 Test fragment color modulation through a constant buffer descriptor table 2026-11-24 05:22:56 +08:00
ced87bf258 runtime/shims: shim api-ms-win-core-com-l1-1-0..3 lifecycle and helpers
Refs: https://github.com/ItsNotRexed/Leonida/issues/9065#issuecomment-7114294575
2026-11-24 04:21:05 +07:00
ccd36246f7 runtime: acphal.dll shim with APU heap management and SHAPE context allocation (RT-5, ASSET-587)
- Resolve Stop 28 boot blocker preventing GTA 6 from launching: acphal.dll!ApuCreateHeap and AcpHalAllocateShapeContexts.
- Implement genuine APU physical memory management (ApuCreateHeap, ApuAlloc, ApuFree, ApuIsVirtualAddressValid, ApuMapApuAddress, ApuMapVirtualAddress):
  - Support cached and non-cached heap allocations with flags routing (flags=2 to non-cached, flags=1/0 to cached).
  - Genuine block tracking allowing proper memory reclamation and reuse upon ApuFree.
  - Disjoint APU 32-bit physical address space mapping with round-trip address conversions.
- Implement IAcpHal interface in AcpHalCreate:
  - Slot 0 (connect): S_OK.
  - Slot 1 (disconnect): S_OK.
  - Slot 2 (submit_command): S_OK (unblocks fatal int3 at +0x43ad94e at boot).
  - Slots 3 and 4 (pop_message, get_num_messages): return 0.
  - Slot 5 (release): releases object.
- Implement GDK SHAPE_CONTEXTS and exact layout:
  - Six context counts and arrays: SRC, EQCOMP, FILTVOL, DMA, XMA, PCM.
  - Structure alignment with xmaContextArray at offset +0x38, matching retail executable measurement (350 contexts x 64 bytes).
  - AcpHalReleaseShapeContexts releases allocated context arrays.
- Classify acphal.dll HRESULT imports in registry.cpp and update unimplemented_policy_test.cpp.
- Add acphal_test in runtime/CMakeLists.txt and python verification test tests/test_acphal_abi.py.
- Update fallback file list in scripts/build_runtime.ps1.

No game data. AI-assisted.
2026-11-23 22:19:47 +01:00
cb242d0209 run_gpu_tests: ps_heap_index is run by d3d12_heap_index_test, so skip it there
The heap-indexing pixel fixture reads the bound CBV/SRV/UAV heap's base from
its root arguments and loads through s[24:27], which vk_harness cannot give it:
it needs a D3D12 device, the layer's root arguments and the code base. Without
an OTHER_HARNESS entry the pixel fallback in the judging loop reaches its
"no checker defined" branch, so the suite reports

  FAIL  ps_heap_index  no checker defined

and exits 1 on every host, Linux included, even though the shader translates
and spirv-val accepts it. ps_heap_index.asm (runtime/test/shaders) names
d3d12_heap_index_test as its owner, as the other OTHER_HARNESS entries do.
2026-11-23 22:14:53 +01:00