Commit Graph

844 Commits

Author SHA1 Message Date
98a977b4b7 Merge pull request #335 from milk4sale/gpu-test/cube-store
Tested 0d27fdcf9 merged locally onto main 1504c1af6: cs_imgstore_cube passes everywhere, and nothing else changes state.

Devices: RADV, Mesa 26.3.1, Linux:
- AMD Radeon RX 7900 XTX (RDNA3, gfx1100);
- Ryzen 9 7950X3D iGPU (RDNA2, gfx1036);
- llvmpipe.

New fixture, 10 runs each with run_gpu_tests.py --filter cs_imgstore_cube --require-pass:
- 10/10 natively and 10/10 with LEONIDA_W64_EMULATE=1 on all three devices, 0 bad for all three cube images;
- the validation layer, with sync validation on, reports nothing on either AMD GPU.

Regressions, main vs main + #335:
- Full run_gpu_tests.py on both GPUs, native and emulated: 232/250 → 233/251. The only change is the new PASS.
- Every existing vk_store_test fixture keeps its state.
- tests/test_shader_checks.py and tests/semantic/test_image_cube_store_glc.py pass on both trees.

CI: this head's checks are still queued on GitHub, so I ran the Linux jobs locally. They give the same result on both trees. The only failures are already on main:
- cs_imgload_tfe and cs_imgload_d16_tfe (#31, fixed by #892);
- tests/test_tool_stdout_encoding.py.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 17:21:28 +01:00
1209391777 Merge pull request #893 from TanmaySatyam/fix/old-10032-merge-check-unicode-sep
merge_check: preserve Unicode line separators in squash subjects (OLD-10032)
2026-11-24 11:11:23 -05:00
d4b3a001d2 Merge pull request #572 from DeSunShine/fma64-rt
rdna2spirv, docs: NVIDIA splits a binary64 Fma only when folding an all-constant one; add cs_div_fmas_f64_rt (FMA64-RT)
2026-11-24 10:50:14 -05:00
52742602f9 merge_check: preserve Unicode line separators in squash subjects 2026-11-24 20:29:52 +05:30
6283ea386c Merge pull request #652 from promise-ssss/codex/ci-failure-list-encoding
ci: handle UTF-8 failure list encoding (CI-FAILURE-LIST-ENCODING)
2026-11-24 09:37:51 -05:00
d0da7dade8 Merge pull request #404 from ubiquitarianism/feat/acphal-xma2-decoder
acphal: ACP message queue and background XMA ring decoding with the Rust XMA2 decoder (RT-ACPHAL-XMA2)
2026-11-24 08:44:46 -05:00
de223bed9e Merge pull request #357 from ubiquitarianism/feat/ws2-offline-shim
runtime: add offline loopback-only Winsock2 (ws2_32.dll) shim
2026-11-24 08:44:13 -05:00
51f3160923 Merge pull request #590 from JiyouProt/codex/gpu-valu64-shifts
tests: GPU readback for dynamic 64-bit vector shifts (GPU-VALU64-SHIFTS)
2026-11-24 07:47:23 -05:00
c53766a305 Merge pull request #610 from TuroYT/fix/merge-check-git-missing
merge_check: exit 2 when git cannot be run (MERGE-CHECK-GIT-MISSING)
2026-11-24 07:44:48 -05:00
979e899e65 ci: accept UTF-8 BOM in expected failure lists 2026-11-24 18:42:08 +08:00
078d0144ad run_gpu_tests: report a missing spirv-as instead of a traceback (RUN-GPU-SPIRVAS-MISSING)
spirv_as ran spirv-as without handling OSError, so a missing spirv-as
ended the run with a raw FileNotFoundError after the assemble and
translate steps. It now raises the RuntimeError a failed assembly
already raises, with "spirv-as not found on PATH" (or the OSError text
for other failures to start the tool).

Tests cover the missing-tool and other-OSError messages, a stubbed
successful run, and a nonzero exit with stderr.
2026-11-24 10:55:40 +01:00
5abe553f5f merge_check: exit 2 when git cannot be run (MERGE-CHECK-GIT-MISSING)
The docstring promises exit 2 on a git error. When git is not on PATH,
subprocess.run raised FileNotFoundError, which escaped main() as a
traceback with exit 1. The git() helper now turns the OSError into a
GitError, so the message reads "merge_check: cannot run git: ..." and
the exit code is 2.

Tests cover a patched FileNotFoundError, an empty PATH, and a folder
that is not a repository (git exits nonzero; still exit 2).
2026-11-24 10:53:11 +01:00
49d904fef6 tests: GPU readback for dynamic 64-bit vector shifts (GPU-VALU64-SHIFTS)
Exercise boundary counts and overlapping destination registers with runtime inputs.
AI-assisted with Codex.
2026-11-24 10:15:23 +01:00
10b0052e57 cs_div_fmas_f64_rt: the run-time-operand twin, and name the measured GPUs
Review of #8750: the fused half of the claim had no fixture. The new
cs_div_fmas_f64_rt reads the same a and c from s4..s7 (VKC_SGPRS), so the
driver cannot fold the Fma; it is fused under the default GLSL Fma on the
RTX 4090 here. design.md now names the measured GPUs: the all-constant
Fma is split on the RTX 4090, RTX 3070 and Quadro RTX 4000 (Turing,
Linux) and fused on an RTX 5060 Laptop (Blackwell).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:41:59 +03:00
ce75f144c7 docs/design.md, rdna2spirv: NVIDIA splits a binary64 Fma only when it folds an all-constant one
Correcting #6635's wording. On an RTX 4090 (621.24) the split 0 of the
fma(a, a, c) probe comes from the driver folding an all-constant GLSL Fma
while compiling the pipeline: cs_div_fmas_f64's operands are literals.
The same values read at run time from user SGPRs (VKC_SGPRS) give the
fused 2^-60, as #4536 saw on an RTX 4070. --fma khr is still what makes
both single-rounded. Wording only in design.md's floating-point row,
cs_div_fmas_f64.asm's header, Gen.emit_fma64's docstring, the runner's
split note and test_fma_khr_f64's docstring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:41:59 +03:00
66dac0d938 run_semantic_tests: a package initializer runs once, and a run with no tests fails
`python -m unittest pkg.__init__` imports pkg and then executes the same file again as
pkg.__init__, so a registration in the initializer happens twice in the -j 2 worker while
discover imports it once. Hand unittest the package name instead; module_path() still
resolves the initializer, so the largest-file-first order is unchanged.

A suite whose only module is an empty package initializer reported "1 files, 0 tests, 0
files failed" and exit 0 in parallel mode, where -j 1 (discover) exits 5. A run where every
job ran no tests now prints "no tests ran" and exits 1; an empty initializer next to real
tests is still fine because those count.

Both new cases in tests/test_run_semantic_tests.py fail against the previous script.
2026-11-24 16:02:00 +08:00
0d27fdcf9a GPU fixture cs_imgstore_cube: image_store on dim:SQ_RSRC_IMG_CUBE (GPU-CUBE-STORE)
The "Typed image stores" contract row said a cube storage image was
CPU-checked only (test_image_cube_store_glc.py) and that no GPU fixture
covered it. This adds one:

- runtime/test/shaders/cs_imgstore_cube.asm: rgba8 unorm, r32 uint and
  r32 sint T#s (word3 TYPE = SQ_RSRC_IMG_CUBE); 64 threads store to every
  texel of all six faces, with per-face values so a wrong layer shows.
- vk_store_test "cube": three cube-compatible 8x8 six-layer images bound
  as six-layer 2D-array storage views at bindings 11/12/13, as the
  runtime binds a cube UAV; checks every texel of every layer.
- run_gpu_tests.py and check.py run it; test_shader_checks.py counts it.
- docs/design.md: the row names the fixture and the GPUs it passes on.
  Builds on #44, which rewrote that row.

Passes on an RTX 4070 Ti (NVIDIA 620.70.06) and a Radeon 610M (gfx1036,
RADV Mesa 26.2.6), native and LEONIDA_W64_EMULATE=1. The same fixture
with the face held at 0 fails on both (320/384/384 bad texels).

AI-assisted. No game files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 01:47:49 -06:00
417a7063e5 Merge pull request #477 from ettehn/fix/gpu-runner-store-verdict
Why merged: a device banner printed on stderr no longer replaces a store helper's verdict in GPU test output.
Why it's good: security-reviewed; tested on Windows 11 merged onto main c023a36: 62 -> 64 tests OK (both new tests fail on main); the other 27 run_gpu_tests tests still pass.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 01:58:58 -05:00
cfcedb58e2 acphal: decode XMA contexts with runtime/xma_decoder when cargo is available
Replace the hand-written C++ XMA2/WMA Pro decoder with the Rust decoder
already on main. runtime/CMakeLists.txt builds it at configure time when
cargo is on PATH and links it into gta6rt and acphal_test
(LEONIDA_HAVE_XMA2_DECODER); without cargo, if that build fails, or with
the cl.exe fallback, XMA voices output silence for each packet's frame
count.

The ring engine decodes whole 2048-byte packets: the read offset and the
loop points are used per packet, so a loop plays its end packet in full
and restarts with a fresh decoder at the packet holding the loop start.
The C ABI gains leonida_xma2_decoder_create_hardware (no first-frame drop,
no 64-sample start skip), since the context carries its own skip.

Tested: acphal_test 129 checks (silence) and 125 checks (Rust decoder,
gnullvm build), 0 failures, 3 runs each, clang 23 / mingw x64; cargo fmt
and cargo test (gnullvm); pytest build/docs suites 204 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 03:53:37 -03:00
b45d7c2d14 SEMANTIC-PACKAGE-TESTS: run package initializers in parallel
unittest discover loads TestCase classes defined in a package's __init__.py regardless of the filename pattern. The parallel runner only selected test*.py files, so a failing package initializer could be skipped while -j 1 reported it. Include package initializers in the parallel module list; an empty initializer with no tests is not a failure. Add regressions for failing initializers and for a pattern that matches no test filenames.

AI-assisted.
2026-11-24 00:37:28 -06:00
3eb813ee7c Merge pull request #468 from csmith105/codex/semantic-process-timeout
Why merged: scripts/run_semantic_tests.py gains a per-file timeout and rejects a zero timeout, so one hung semantic test file can't stall the whole run.
Why it's good: security-reviewed (argv-list subprocess on sys.executable only). Tested on Windows 11 merged onto main 8f481cf: tests/test_run_semantic_tests.py 10 passed on main -> 15 passed with this PR (new tests fail without the fix); a real run with --timeout 300 over test_sdwa* ran 40 tests with 0 failures and --timeout 0 is refused. Merges cleanly together with #474.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 01:32:54 -05:00
90eb7284fe Reject semantic-test timeouts beyond portable wait limits 2026-11-23 22:20:42 -08:00
b35b222df1 Keep the GPU helper verdict ahead of the device banner 2026-11-24 14:02:53 +08:00
2a4f650b7b build_llvm_mc.ps1: a relative -Temp is checked as the full path it resolves to
Review by @QemmHD: a relative -Temp under a working directory with % skipped the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:52:50 +03:00
973593f4a7 Add optional timeout to semantic test subprocesses 2026-11-23 21:47:06 -08:00
7f7a596856 Merge remote-tracking branch 'ubiq/main' into feat/ws2-offline-shim
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-24 02:34:35 -03:00
4750df6a06 acphal: add portable XMA2 decoder, ACP message queue, and SHAPE XMA worker
- Add portable C++20 XMA2 packet parser and WMA Pro frame decoder
  (runtime/src/xma2_decoder.{h,cpp}, following FFmpeg wmaprodec.c /
  wmaprodata.h LGPL-2.1-or-later under Leonida's GPL-3.0-or-later)
  with cross-platform xma2_decoder_test.
- Implement IAcpHal command/message queue protocol (REGISTER_MESSAGES,
  UNREGISTER_MESSAGES, LOAD_FLOWGRAPH, COMMAND_COMPLETED, DISCONNECTED,
  queue-full dropped counters, and APU notification word writes) in
  runtime/shims/acphal.cpp.
- Wire a lazily-started, cleanly-joined background XMA2 decoder thread
  pumping enabled SHAPE_XMA_CONTEXT output rings in APU memory.
2026-11-24 01:44:00 -03:00
5dbd92b92d build scripts: refuse a folder with % in its path up front
cmd.exe expands %...% on every line of the generated _build.cmd (twice on a CALL line), and cl.exe rejects a % in the
path-valued /D definitions of the runtime's test targets (D8038) however it is quoted, so a checkout with % in its path
failed in configure, or a few hundred Ninja steps in once the batch was escaped (@ezbyDev's measurements in the original repository).
build_runtime.ps1 now stops before looking for Visual Studio when the checkout path has a %, and build_llvm_mc.ps1 when
-Temp has one, each naming the folder; docs/testing.md gets a Known-problems row. tests/test_build_percent_path.py runs
both scripts with such a path, with git, python and vswhere hidden so that a missing check can't start a real build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:09:02 +03:00
9b59db02f9 ws2_offline: add offline loopback-only Winsock2 (ws2_32.dll) shim (RT-WS2-OFFLINE) 2026-11-24 00:53:14 -03:00
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