Commit Graph

1249 Commits

Author SHA1 Message Date
59879f2347 Stop timed-out Wine test process groups
Run each POSIX test in its own session and stop the group on timeout or interruption. A helper that inherits the output pipe must be stopped even when the launcher already exited.
2026-11-23 02:50:05 +00:00
71d8f86853 Translator: v_permlane16/x16 FI=0 and BOUND_CTRL for source lanes off in EXEC (SHADER-74)
op_sel:[FI, BOUND_CTRL] decides what a lane gets when the lane it reads is off in EXEC (or absent from a
workgroup smaller than the wave): FI=1 reads its value, FI=0 keeps the destination (BOUND_CTRL=0) or writes 0
(BOUND_CTRL=1). Measured on RDNA2 (issue #374). The activity of the source lane is shuffled with absent lanes
redirected first, as ds_lane_read does, and the old destination is a plain load, as dst() does.
cs_w32_permlane_fi (GPU) and test_permlane_fi (CPU); the shuffle-count and destination-select controls of
test_valu_permlane16 follow the extra activity shuffle on the FI=0 path.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:37:38 -05:00
a021da3bfa First look: rebuild when the loader TLS helper is missing 2026-11-23 03:27:37 +01:00
26d2473378 Fail Wine tests when the mapped working directory is invalid 2026-11-23 03:20:46 +01:00
6fedabb12d first_look.ps1: rebuild gta6rt.exe when it is older than the runtime sources
It built the loader only when runtime\build\gta6rt.exe was missing, so after a pull the day-one dry run used the
old binary and its shim to-do list described the old shim table, with no error. A loader older than any file under
runtime\src, runtime\shims or runtime\CMakeLists.txt is now rebuilt first (the copy on this machine was two days
behind main). tests/test_first_look_rebuild.py covers both cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:19:13 -05:00
c14daecc6b Report GPU test workspace creation errors 2026-11-23 03:16:12 +01:00
61c9aaa318 Keep Wave64 benchmark dispatches within Vulkan device limits 2026-11-23 03:03:33 +01:00
89438d24e6 BUILD-1216: protect metadata inputs from JSON overwrite 2026-11-22 22:44:40 -03:00
1d4d4c6185 fix(tests): keep Wine fixture setup verdicts by occurrence
A later setup with the same listed name could hide a failed setup from a required consumer. Keep fixture verdicts keyed by the same test index as their dependencies.
2026-11-23 02:42:01 +01:00
7de2d4461b rdna2spirv: ignore omod on f16 results with denormals kept, keep clamp (gfx1036) 2026-11-23 04:39:01 +03:00
6535919f47 vs_input_survey: a vertex-shader index entry without a string file is a one-line error 2026-11-22 20:32:28 -05:00
3c7b0403c3 Validate CTest working directory and output expression value types
Merge upstream main and reject malformed paths or output expressions before drive mapping. Preserve CTest's lists, the existing string form, and arbitrary values on properties the runner does not consume. Five new bad-value cases fail before the change. All 53 runner tests pass on Debian, and the reader accepts an actual CTest 3.31.6 JSON listing.

AI-assisted (Codex).
2026-11-22 22:19:42 -03:00
e511fad4f6 Find Wave64 benchmark tools in CMake configuration directories 2026-11-23 02:17:50 +01:00
565bb51424 BUILD-1216: prevent audit JSON output from overwriting .s disassembly listings 2026-11-22 21:49:17 -03:00
f87d05fdd3 runtime: console DirectStorage (DStorageGetFactory) with file-to-memory reads
Serve the Xbox DirectStorage API (IDStorageFactoryX2, IDStorageQueueX2,
IDStorageFileX, IDStorageStatusArrayX) under dstorage_xs.dll, xcrdapi.dll and
dstorage.dll. Declarations are our own (shims/dstorage_xs_abi.h), written from
the public GDK reference; layouts are pinned with static_asserts.

- OpenFile goes through the registry's kernel32!CreateFileW, so GAME: paths use
  the console path mapping and the write overlay. GetHandle returns a ReOpenFile
  handle with its own file position.
- One worker thread per queue runs submitted entries in order: file and memory
  requests, status arrays, ID3D12Fence::Signal, EnqueueSetEvent (on a duplicate
  of the title's handle taken at enqueue).
- Auto-submit at half the capacity (or disabled through DSTORAGE_QUEUE_OPTIONS),
  enqueue into a full queue waits, CancelRequestsWithTag (a cancelled request is
  a success and not a failure), error record and error event, Close and the last
  Release drain the queue, IDStorageFileX::Close waits for the file's submitted
  reads.
- Request checks: reserved bits, source type, BCPack/swizzle ranges, sizes,
  1 GiB limit, null and foreign objects and closed files (also for zero-size
  requests), end of file, inaccessible memory.
- zlib, BCPack, swizzle and physical pages return E_NOTIMPL (later PRs).
- Interface ids of the X interfaces are not public: a creating call accepts and
  logs a new id per object kind, but refuses system COM ids (IMarshal,
  IAgileObject, ...) and the PC DirectStorage ids; QueryInterface accepts only
  IUnknown, the PC IDStorageStatusArray id (same shape) and the ids creating
  calls accepted for that kind. Bad arguments are logged once per method.
- registry.cpp classifies xcrdapi.dll!DStorageGetFactory as HRESULT; the cl.exe
  fallback in build_runtime.ps1 builds the new shim too.

ctest dstorage: 258 checks over synthetic files in %TEMP%, no GPU, no game data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:48:51 +01:00
87da932770 run_gpu_tests: an unsupported: reason wins over the generic wave64 skip
For a whole-wave dump a missing OpFmaKHR was reported as "no 64-wide compute
subgroup" on a device that does have one, because the wave64 rule ran before
the reason the program printed. Read the "unsupported:" line first; without
one the old text stays.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015z45kpL5aWzXuYTbhn6b52
2026-11-22 21:35:01 -03:00
b9a8aca16a GPU tests: skip a draw when any stage needs OpFmaKHR the device lacks
docs/testing.md says a module that needs OpFmaKHR exits 77 (a SKIP) on a
device without VK_KHR_shader_fma, but only the fragment module was checked
in vk_harness, and vk_texture_test, vk_sampler_test and vk_bindless_test
never refused the vertex module (vs_ids carries FMAKHR). Under
LEONIDA_FMA=khr such a pair failed vkCreateGraphicsPipelines with -13 and
run_gpu_tests.py reported a FAIL.

ShaderFma::accepts_file() checks one module file. vk_harness (vertex module,
VKH_MESH_COMPUTE module), vk_texture_test, vk_sampler_test and
vk_bindless_test use it for every stage; vk_sampler_test also enables the
feature when the device has it, like the others. judge_cs_dump treats exit 77
with an "unsupported:" line as a skip for the non-wave64 dumps too
(cs_w32_new_ops).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015z45kpL5aWzXuYTbhn6b52
2026-11-22 21:19:17 -03:00
c5e6cc5c38 run_gpu_tests: a missing or partial readback fails its test, not the suite
ps_interp_f16_high (also drawn by ms_f16_pack) and ps_ij_computed still
unpacked their readbacks with a bare struct.iter_unpack("<4I", ...): a
file whose size isn't a multiple of 16 raised struct.error, a missing
one FileNotFoundError, and nothing caught either, so the run ended there
and every other test's result was lost. They now read it like #3442's
Mandelbrot fix, read_raw_u32(raw) if the file exists, else no pixels,
which the checkers already report as a failure of that test.

tests/test_run_gpu_readback_size.py: the suite with the harness stood
in for, a missing, empty, partial-pixel and one-byte-short readback for
each test (6 of the 8 cases crash the suite on main).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:15:02 +01:00
4f760c1aed Shader: isolate wave32 pixel operations in wider subgroups (SHADER-731) 2026-11-22 20:07:05 -04:00
e58a605118 GPU test cs_global_mem_ext: global/buffer atomics, 8/16-bit global stores, d16 loads
global_atomic_*, global_atomic_*_x2, buffer_atomic_*_x2 and the 8/16-bit
global stores and d16 loads were merged with semantic tests only.
cs_global_mem_ext.asm, laid out like cs_global_neg_offset (40 groups, one
thread, heap offsets as addresses), seeds a heap and stores eight words;
check.py (GLOBAL_OFFSET) and run_gpu_tests.py expect them.

tests/semantic/test_global_mem_ext_fixture.py runs the fixture on the
CPU against values computed in the test and checks both runners expect
the same words. test_shader_checks.py's fake harness answers every
GLOBAL_OFFSET entry.
2026-11-22 20:53:26 -03:00
9668102f53 GPU test ps_cndmask_sign_mods: v_cndmask_b32 modifiers keep NaN and denormal bits
Signalling NaNs and a denormal through -v, |v| and -|v| on src0 and src1.
On an RTX 5060 Ti (driver 621.14) the old FAbs path gave 0x7fffffff for
|0xff800001| (the driver's canonical NaN); with the sign-bit moves all
4096 pixels are exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:45:02 +01:00
211dbd07f7 Keep Wine prefix setup and tests on one Xvfb display 2026-11-22 23:18:12 +00:00
f03dcbdeb5 ci: check the WineHQ and apt.llvm.org signing keys' fingerprints
The wine job wrote https://dl.winehq.org/wine-builds/winehq.key straight
into /etc/apt/keyrings and the translator-tests job piped
https://apt.llvm.org/llvm-snapshot.gpg.key into gpg --dearmor, so apt
trusted whatever key those URLs served that day. Every other download in
CI is pinned (actions by commit, glslang by SHA-256, the Vulkan headers
by commit).

scripts/check_apt_key.py (standard library, gpg --show-keys) requires
the downloaded file to hold exactly one primary key with the given
fingerprint; both steps now download to a temporary file, check it
against the fingerprint each project publishes (WineHQ D43F6401...672F,
apt.llvm.org 6084F3CF...7421) and only then install it.

tests/test_check_apt_key.py: the parser and the check with a stand-in
gpg (the key, another key, two primary keys, subkeys, an unreadable
file, no gpg), the command line, and a scan of .github/workflows that
fails for a key download not checked right after (both of today's
downloads fail it on the old workflows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:17:34 +01:00
17eeb26109 Preserve guest scene results on redirected Windows streams
FIocker reported that a successful scene run under a CJK output path raised UnicodeEncodeError while printing report.json to a cp1252 pipe. Keep the stream encoding and escape only characters it cannot represent, including in failure diagnostics.

Reported-by: @FIocker (PR #3986, issuecomment-7087348910)
2026-11-22 16:15:56 -07:00
3ff2bfe819 Preserve CTest DEPENDS order in the Wine runner 2026-11-22 23:11:50 +00:00
e8ea6447f5 Resolve relative checkout paths before launching Wine tests 2026-11-23 00:00:56 +01:00
bc425352cd scripts: robust recursive directory cleanup with readonly reset in build_llvm_mc.ps1 (BUILD-139)
When cleaning up temporary build and clone directories on Windows, files with
the ReadOnly attribute (such as git objects in the sparse clone) cause
PowerShell's Remove-Item to fail with an UnauthorizedAccessException or
IOException, leaving gigabytes of files behind in $Temp.

Implement Remove-DirectoryRobust:
1. Recursively strip ReadOnly attributes across all nested files and directories.
2. Retry Remove-Item with backoff for brief file handle locks.
3. Fall back to Windows cmd rmdir /s /q which handles read-only attribute trees natively.
4. Add unit test in tests/test_build_llvm_mc_cleanup.py verifying teardown of read-only hierarchies.
2026-11-22 23:59:52 +01:00
6d3b3f9f4e Handle malformed CTest skip codes in the Wine runner 2026-11-22 23:56:00 +01:00
d2e989c46e Merge main into valu-int-misc (#1492)
runtime/test/shaders/check.py
scripts/run_gpu_tests.py
tests/semantic/regen_fixtures.py
tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 23:49:26 +01:00
fedc442476 Allow Tier 3 reference on any selected GPU
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-22 18:46:56 -04:00
0fc8a15c56 rdna2spirv: ds_append and ds_consume (LDS)
One add / subtract of the wave's active-lane count at the offset address,
done by the first active lane; the old value to every active lane by a
subgroup shuffle (an exchange round under --wave64-emulate). Measured
natively on gfx1036: the offset alone is the address, M0 does not move it.
The gds form stays Unsupported. GPU fixtures cs_w32/w64_ds_append, semantic
test test_ds_append.py, design.md row.

AI-assisted.
2026-11-22 23:44:51 +01:00
5fec4f2827 Test a scripted 600-frame headless scene from a mapped guest 2026-11-22 15:43:53 -07:00
f8b4f03bb7 Add native Tier 3 inner coverage reference probe
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-22 18:43:12 -04:00
1291a6878c GPU tests: raw barycentrics under perspective (ps_persp_bary, vs_persp)
The raw-barycentric tests draw with vs_ids, where clip w = 1 at every vertex, so nothing checked that the raw
i/j (and the attributes) follow perspective-correct weights. vs_persp draws one triangle at screen (5,8),
(57,16), (21,55) with clip w = 1, 2, 4 and per-vertex attr0; ps_persp_bary is ps_bary's code drawn with it.
check.py's bary_persp_problem compares every pixel with CPU weights p_k = (l_k / w_k) / sum(l_m / w_m) from the
screen-space weights l_k, checks that pixels outside stay clear, and requires the affine weights to differ by
more than 100x the tolerance on every judged pixel, so a NoPerspective regression can't pass. run_gpu_tests.py
uses the same reference (PIXEL_VS, DRAWN_WITH). Suggested by Vonsek in #794.

On main it runs the native BaryCoordKHR path (it skips without VK_KHR_fragment_shader_barycentric, like
ps_bary); any barycentric fallback that lands (#804) is exercised by it too. Checked on an RX 5700 XT (RADV)
through a GS fallback: passes at wave32 and wave64; with NoPerspective on the fallback's input, all 1149
covered pixels fail while the interpolated attributes still match. New tests/test_bary_persp_oracle.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:37:21 -06:00
c3c1048f95 docs(contracts): split docs/design.md contract table into docs/contracts/*.json with generator 2026-11-23 02:27:42 +04:00
19c4a7b538 ci: add behavioral sabotage gate for changed semantic tests 2026-11-23 02:24:10 +04:00
22a86b1d57 scripts: add parallel preflight_pr.py mirroring fast CI checks 2026-11-23 02:24:10 +04:00
f02e952272 CI: a macOS (Apple Silicon) job for the runtime on MoltenVK and the Python suites
runtime.yml gets a macos job on macos-26: Homebrew's MoltenVK, Vulkan headers and
loader, llvm-mc, SPIRV-Tools and glslang; the runtime built through sccache; ctest
and run_gpu_tests.py on MoltenVK. ci.yml gets macos-python: the standard-library
loop, the semantic suite alongside it, and the pytest files with Homebrew's llvm-mc.

The hosted runner's Metal device is Apple Paravirtual device (family Mac2), which
MoltenVK runs on; KosmicKrisp finds no device there. macos-15 can't build the
runtime (Xcode 16's libc++ has no floating-point std::from_chars).

The two tests that fail on MoltenVK today, also on an M3 Max, are listed with the
pull requests that fix them (xdxr_build_check: #2423, ps_ssharp: #1845);
scripts/ci_expected_failures.py fails the step on any other failure and notes an
expected one that passes.
2026-11-23 02:21:52 +04:00
62bce63d1c Clean up failed Wine drive setup 2026-11-22 23:21:17 +01:00
72f5d2f0d7 audit_shader4_regs: list ds_nop in DS_HAS_DST to match tools/lane_masks.py 2026-11-22 22:21:01 +00:00
1741a03155 Reject broken quoted rows in shader_stats CSV 2026-11-22 23:18:32 +01:00
ed91cd250a Tests: GPU checks for v_med3_f32/f16 with a NaN in S2 or in two operands
ps_fnan_med3 puts its NaN in S0 only, so no GPU test reached the cases
ps_fnan_med3_s2 (f32) and ps_f16_fnan_med3 (f16), with inputs read from
memory at run time and words derived from the measured rule in
docs/design.md (with any NaN operand, med3 is min3 with the NaNs
ignored). The all-NaN case is left out: its payload is not modelled.

Registered in check.py and run_gpu_tests.py; the semantic fixtures and
GpuFixtures tests run them through the interpreter, where the
translator before #2029 fails them (undefined FClamp on a NaN).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:18:01 +01:00
6da1c717fc Merge main into hw-mad-u32-u16 (#2494)
docs/design.md
tests/semantic/regen_fixtures.py

AI-assisted.
2026-11-22 23:15:36 +01:00
4646a5ee73 audit_shader4_regs: non-returning DS ops read every operand and write nothing
ds_add_u32 v1, v2 and the other non-_rtn LDS atomics (cmpst, mskor, the
f32/f64/u64/b64 forms, src2 forms) and ds_gws_init/ds_gws_barrier treated
args[0] as a written destination, so a later read of the LDS address
register was not reported as read-before-write. A ds_ op now has no
destination unless it has _rtn or is ds_read*, ds_swizzle, ds_permute,
ds_bpermute, ds_append, ds_consume or ds_ordered_count, the rule
tools/lane_masks.py already uses.
2026-11-22 22:13:53 +00:00
cd30309409 Merge main into gpu-vopc-int (#2220)
tests/semantic/regen_fixtures.py

AI-assisted.
2026-11-22 23:12:43 +01:00
e8c9155965 Merge remote-tracking branch 'origin/main' into run-gpu-tests-exit-status-in-fail-line
# Conflicts:
#	tests/test_run_gpu_tests.py
2026-11-23 00:05:29 +02:00
35616ce677 build_runtime.ps1: fall back to native cmake + ninja on PATH
# Conflicts:
#	scripts/build_runtime.ps1
#	tests/test_build_runtime_fallback.py
2026-11-23 00:04:40 +02:00
1a193dbf9c Merge pull request #3825 from haizenc 2026-11-22 17:04:05 -05:00
8a109eb7c5 Merge pull request #3792 from Vonsek 2026-11-22 17:03:50 -05:00
5816b2404d Merge pull request #3786 from DanielDeGiorgio 2026-11-22 17:03:47 -05:00