Commit Graph

398 Commits

Author SHA1 Message Date
8550970f10 Merge upstream GPU fixture dependencies into the two-mip test
Preserve the cube test's isolated vertex shader and count the new upstream compute checks alongside the two-mip draw.
2026-11-22 00:28:50 +01:00
dbc785f9e5 Merge pull request #332 from fearkov
# Conflicts:
#	tests/semantic/regen_fixtures.py
2026-11-21 18:09:52 -05:00
273e53c8fc Merge pull request #300 from FreddyxS
# Conflicts:
#	tests/semantic/regen_fixtures.py
2026-11-21 18:09:14 -05:00
0d5ba399c0 Merge pull request #247 from crastinator
# Conflicts:
#	scripts/run_gpu_tests.py
2026-11-21 18:07:52 -05:00
7761916406 Merge pull request #303 from mrb-eel 2026-11-21 18:07:42 -05:00
0f50016a5f Merge pull request #304 from DiazE117 2026-11-21 18:07:41 -05:00
e2460bfbec Merge pull request #245 from DiazE117 2026-11-21 18:07:41 -05:00
fcd980d3c4 Merge pull request #325 from dcastell1 2026-11-21 18:07:40 -05:00
77fb672cf2 Merge pull request #312 from Tim Elery
# Conflicts:
#	docs/textures.md
2026-11-21 18:07:40 -05:00
81d3776d90 Merge pull request #314 from FreddyxS 2026-11-21 18:07:38 -05:00
76add28b8a Merge pull request #315 from Vonsek 2026-11-21 18:07:38 -05:00
811ee91fea Merge pull request #337 from Ewann 2026-11-21 18:07:38 -05:00
97a76333b9 Merge pull request #336 from bbareth 2026-11-21 18:07:38 -05:00
1d2e9cc5ae Merge pull request #323 from Ayinaki 2026-11-21 18:07:37 -05:00
76d3449434 Merge pull request #321 from Jan Kříž 2026-11-21 18:07:37 -05:00
93953ebd75 Merge pull request #320 from Rayhan Robin 2026-11-21 18:07:37 -05:00
abef7cd401 Merge pull request #308 from NWX10 2026-11-21 18:07:37 -05:00
31e2c12bef Merge pull request #307 from NWX10 2026-11-21 18:07:36 -05:00
a42b1990da Merge pull request #311 from Kam471 2026-11-21 18:07:35 -05:00
c5dc2d0330 shader_carve.py: reject incomplete DXBC parts 2026-11-22 00:04:21 +01:00
77db72f602 run_gpu_tests: find the test programs in RelWithDebInfo/Release (TEST-38)
With the Visual Studio generator the test programs land in build/<Config>, and the runner only looked in the build
folder itself, so --build had to point at the subfolder (#166, RX 9070 XT entry). resolve_build_dir() looks in the
build folder first, then in RelWithDebInfo, Release, Debug and MinSizeRel, and takes the configuration that has all
three required programs and was built last. If none has them, the folder given is kept for the error message.
2026-11-22 00:04:20 +01:00
10d6d4b876 test(fuzz): differential coverage for the integer and bit VALU family
FUZZ-1: model the integer/bit VALU block in tools/cpu_ref.py and add
those ops to the shader_diff program table: v_add_nc_u32, v_sub_nc_u32,
v_subrev_nc_u32, v_mul_u32_u24, v_mul_i32_i24, v_mul_lo_u32,
v_mul_hi_u32/i32, v_mad_u32_u24/i32_i24, v_min_u32/u32, v_max_i32/u32,
v_bfe_u32/i32, v_bfi_b32, v_alignbit_b32, v_alignbyte_b32, v_perm_b32
and v_med3_i32/u32.

Pinned known-answer tests cover the boundaries: bfe width cut and zero,
perm selector ranges (bytes, sign bits, constants), align shift 0 and
24, signed mul_hi, 24-bit sign extension and mad wraparound.

The generator keeps integer ops away from registers last written by a
float op: Vulkan does not promise a NaN payload and the comparison
accepts both-NaN, so reusing those bits as an integer would compare an
unobservable payload. Unobservable as a float, not as an integer.

Verified CPU-only: 28 cpu_ref tests, 6 shader_diff tests, 423 semantic
tests, and 8000 seeded programs (8 seeds x 1000) with 0 mismatches and
0 skips. GPU confirmation on the 5090 is pending.
2026-11-21 23:57:59 +01:00
1186f99340 Merge updated Leonida GPU runner into class compare fix 2026-11-21 23:57:44 +01:00
eb629d41a8 Decode BVH4 header and node pointer fields
The indexer treated the pre-header wrapper words as the root and labelled the real header fields as counts. Parse the documented XboxBvh4Header fields, decode root node pointers, and document the runtime node and leaf layouts while keeping the dehydrated packed stream open.
2026-11-21 22:55:52 +00:00
adbe6fd42e Tests: ps_scc_minmax checks SCC of s_min and s_max on a tie 2026-11-21 18:54:42 -04:00
02c89a380b bink_index.py: one line end per CSV row on stdout; a missing target is an error, not a traceback
The CSV written to stdout (the default output) used csv's "\r\n" on a text stream
that already turns "\n" into the platform line end, so every row ended "\r\r\n" on
Windows and a redirected index read as one blank row after each row. The stdout writer
now uses lineterminator="\n", as awc_manifest.py does; --out files were already right.

A target that does not exist ended in a FileNotFoundError traceback from
os.path.getsize; it now prints an error and exits 2, as awc_manifest.py does.

Tests: a stdout stream that writes "\r\n" like Windows' (so the check also runs on
Linux CI) and the missing-target exit code; both fail without the fix.
2026-11-21 23:54:13 +01:00
fe8cd6bc72 Tools: reject out-of-range --start/--limit in RPF index tools
Adds the #283 argparse validators to anim_index, rbf0_index, restofworld_index and rpf9_carve: --start >= 0, --limit >= 1 (decimal or 0x hex), and --max-inflate >= 1 in restofworld_index. Bad ranges now exit 2 before any scan or output instead of silently scanning everything, less, or nothing. Synthetic CLI tests in all four test files; docs notes for each tool.

New item claimed in #156. AI-assisted (OpenCode).
2026-11-21 16:53:41 -06:00
6005d7e2f0 tests: eight more wave64 mask and vote GPU tests across 64 lanes on the CPU
run_workgroup now steps every invocation one instruction per round, so a
load after a store sees all lanes' stores as in a SIMD wave (cs_w64x_load_
ballot_load read a later store before), allows a partial last subgroup, and
answers OpGroupNonUniformAny, All and BitwiseOr Reduce; BallotFindLSB,
IAddCarry and UGreaterThan are per lane. A shuffle from a lane that is not
running is an undefined value.

test_wave64_subgroup_ops runs cs_w64x_ballot, _readfirstlane,
_load_ballot_load, _partial, cs_wave64_ballot, cs_wm_bfm64, cs_wm_half_cmp
and cs_wavemask without --wave64-emulate:
- one 64-wide subgroup: every word equals check.py (cs_wavemask: all 64 lanes);
- two 32-wide subgroups: the pinned words equal what an RTX 4070 SUPER
  (driver 610.88) wrote, three runs each; cs_wavemask 64 mismatches with
  lane 0 = 0x00081021 on both;
- removing 21cef25's ballot guard makes cs_w64x_partial use an undefined value.

403 semantic tests pass (397 before). AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:53:07 -06:00
56c4594243 Use the float conversion opcodes now supported on main 2026-11-21 23:52:00 +01:00
7fefe7f425 Merge upstream cube sampling with the two-mip Vulkan fixture
Keep the cube array at its original extent and allocate a separate upload range for the two-dimensional mip chain. Both shader registrations now run through the updated upstream runner.
2026-11-21 23:51:27 +01:00
4d18ef9d62 Merge branch 'main' into fix/rdna2-float-to-int-saturation 2026-11-21 23:51:23 +01:00
55f8387f98 tests: model OpGroupNonUniformBallot for the wave64 ds_bpermute guard
21cef25 keeps a wave64 ds_bpermute result only where a ballot of the running
invocations has the source lane. run_workgroup now answers
OpGroupNonUniformBallot per subgroup, and OpGroupNonUniformBallotBitExtract
is evaluated per lane.

Rebased on 3fae38a: 395 semantic tests pass. RTX 4070 SUPER, driver 610.88:
LEONIDA_W64_EMULATE=1 run_gpu_tests.py 45/47 (cs_wavemask and ps_vcc_x2
skip); without emulation the three cs_w64x dumps still match the wrap model,
24/24 words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:51:03 -06:00
87c56d2d8a tests: record the RTX 4070 SUPER measurement of the wave64 wrap model
Without --wave64-emulate, vk_compute_test on cs_w64x_readlane, _writelane and
_bpermute (NVIDIA GeForce RTX 4070 SUPER, subgroup 32, driver 610.88, Vulkan
SDK 1.4.363.0, llvm-mc 21.1.8 in WSL) wrote exactly WRAP32_EXPECTED: 24 of 24
words. With LEONIDA_W64_EMULATE=1, scripts/run_gpu_tests.py passes 42/44 on
the same GPU (cs_wavemask and ps_vcc_x2 skip).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:51:03 -06:00
2fde230ea2 tests: run wave64 cross-half lane ops across 64 lanes of the translated SPIR-V
spirv_mini_interp gains run_workgroup: invocations run in lockstep and meet at
OpGroupNonUniformShuffle (Subgroup scope), with an explicit subgroup size. A
shuffle from a lane outside the subgroup raises UndefinedResult, or wraps
mod the subgroup size on request (the issue #94 symptom, a model and not the
spec). A shift by at least the bit width is now an undefined value that only
raises when used: v_mbcnt computes 1 << lane for lanes >= 32 and selects it
away, which is valid SPIR-V.

test_wave64_cross_half translates cs_w64x_readlane, cs_w64x_writelane and
cs_w64x_bpermute (no --wave64-emulate):
- one 64-wide subgroup: all 24 words equal check.py's GPU values;
- two 32-wide subgroups: bpermute and the writelane writes stay exact, a
  cross-half readlane is undefined; the wrap model gives the words a 32-wide
  GPU without emulation is predicted to show;
- SPIR-V sabotages (readlane lane & 31, bpermute without its half base) must
  change the 64-wide result.

CPU only (Windows 11, Python 3.11.9): 382 semantic tests pass. Not yet
measured on a GPU. AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:51:03 -06:00
4dfdbc3f0e fix: build the vertex shader for filtered cube tests
The cube harness loads vs_ids at runtime, so a standalone fragment filter needs the same draw dependency as the ordinary texture fixture.
2026-11-21 23:50:12 +01:00
024dc0ecdd Cover malformed and missing viewer manifests 2026-11-21 23:49:26 +01:00
b262056ac7 Tools: measure the common.rpf content-set graph
Add gamedata_graph.py, which rebuilds the XML payloads from a carve and measures document -> content-set -> target edges. Include ids are joined only on exact equality; missing ids stay dangling and common:/ is not normalized to $(common)/.

Add synthetic tests for includes, a cycle, reachability, prefix classification, unparsed payloads and output redaction. Add a measured docs page linked from the index.
2026-11-21 22:47:26 +00:00
b933118d32 GPU tests: run ps_vcc_x2 on the GPU with a seeded V# and heap in vk_harness (TEST-19)
ps_vcc_x2 reads two dwords through the V# in s[0:3], but vk_harness pushed zeros and bound no memory, so on the
GPU it read address 0 and lost the device; run_gpu_tests.py skipped it and check.py left it out. vk_harness now
takes VKH_SGPRS (user SGPRs, decimal or 0x hex) and VKH_HEAP (addr=word seeds in a 64 KiB device-address heap,
passed as the heap base). bufferDeviceAddress and shaderInt64 are enabled only then; a device without them gets
"unsupported: ..." and exit 77, which both runners report as SKIP. Both runners give ps_vcc_x2 the V# and words
tests/semantic uses and expect 0x11223344 0x55667788 0 0.
2026-11-22 00:44:48 +02:00
80fb7f2e41 Textures: add clean-room BCPack decoder (rANS + BC1/BC3/BC4/BC5) 2026-11-21 14:44:27 -08:00
d73fa3cab0 tests: shader_profile's --per-shader check goes through run_profile (#263 x #282)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:42:48 -05:00
2442ad124a tests/docs: follow this round's both-side merges (shader_profile test uses #263's run_profile, drop duplicated table rows)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:42:27 -05:00
ce1eb6ae85 Merge latest Leonida main into class compare fix 2026-11-21 23:42:07 +01:00
0bcf104719 Merge upstream/main and retain both Vulkan texture checks 2026-11-21 23:41:25 +01:00
0d05c803c1 tests: one SHADERS list in regen_fixtures (two merges each kept their own)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:39:45 -05:00
fafcc4197b Merge pull request #284 from S1m0ne1997
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 17:38:43 -05:00
175a4d4bfe Merge pull request #277 from mrb-eel 2026-11-21 17:38:42 -05:00
383156b0f5 Merge pull request #299 from AlxcBTW 2026-11-21 17:38:42 -05:00
cd4fc9a606 Merge pull request #247 from crastinator 2026-11-21 17:38:38 -05:00
30ad4802c4 Merge pull request #298 from AlxcBTW
# Conflicts:
#	docs/design.md
#	tests/test_translate.py
2026-11-21 17:38:35 -05:00
a4e435fac2 Merge pull request #276 from eIBart0 2026-11-21 17:38:33 -05:00