Commit Graph

18350 Commits

Author SHA1 Message Date
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
30fae13fc2 Merge pull request #326 from FreddyxS 2026-11-21 18:07:40 -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
17072e2237 Merge pull request #322 from Koert Lichtendonk 2026-11-21 18:07:36 -05:00
a42b1990da Merge pull request #311 from Kam471 2026-11-21 18:07:35 -05:00
346552a171 Merge pull request #292 from Kam471 2026-11-21 18:07:35 -05:00
2a06f8fc87 test: cover Visual Studio GPU test build layouts 2026-11-22 00:07:29 +01:00
988aeecf97 test: locate GPU test executables in VS build configs 2026-11-22 00:07:27 +01:00
abefe80779 Merge origin/main into shader-34-wqm; WQM review fixes
- vs/gs/ms: no OpGroupNonUniformQuadSwap (only guaranteed in fragment and
  compute); shuffle from the quad's four lanes there.
- 32-bit forms in wave64 write only their own half of EXEC/VCC and vote SCC
  over that half; mask_src accepts exec_hi. New GPU test cs_wqm_w64_half.
- cs_wqm_w32: read SCC right after s_wqm.
- test_wqm_on_data checks the real constants and shifts; new vs and half tests.
- docs: narrowed claims (SCC vote needs 64-wide or emulation, lane
  assumptions, partial quads, helper invocations untested).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:06:34 +01:00
489258fda5 Resolve colour MSAA regions into destination offsets 2026-11-22 00:05:17 +01:00
d4e767d05a build: keep searching beneath rejected package folders 2026-11-22 00:05:11 +01:00
0727ad722f build: report package version probe mismatches 2026-11-22 00:05:11 +01:00
1ba68dd3c9 build: verify Visual Studio x64 C++ tools in preflight 2026-11-22 00:05:11 +01: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
1718e02155 Merge origin/main into shader-36-gather-wrap
Keep both sides: main's ps_vcc_x2 / ps_tex / bindless and irreducible-CFG tests
next to ps_gather_wrap, main's buffer-format-store row next to the updated
gather row, and both the literal-SGPR table and #298's mask tokens in store_reg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:01:57 +01:00
fe413a2f1c Cancel superseded runs and skip heavy CI on docs-only PRs 2026-11-21 23:59:08 +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
c17cdd8b6b Docs: point CONTRIBUTING.md and AGENTS.md at #313 for the D3D12 layer
The D3D12 -> Vulkan layer is tracked in #313 (critical path, who builds
what, open D3D12 methods); say so next to #156 and #166.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:57:45 +01:00
1186f99340 Merge updated Leonida GPU runner into class compare fix 2026-11-21 23:57:44 +01:00
437081fdb6 Runtime: parse version 1.2 root signatures, and read RTS0 table ranges from their offset
parse_rts0 refused D3D_ROOT_SIGNATURE_VERSION_1_2 blobs. 1.2 is 1.1 plus
D3D12_STATIC_SAMPLER_DESC1::Flags: the PC serializer writes RTS0 version 3 with
14-dword static samplers (13 before). The model gains Version::V1_2 and
StaticSampler::flags. The canonical codec writes the flags only for 1.2, so 1.0/1.1
encodings are byte-for-byte unchanged.

Checking it against the real serializer found an older bug: a descriptor table's
payload is {num_ranges, ranges_offset} with the ranges at that offset, but the
parser read them inline after the count. Every table came back with a wrong range
type and count. The oracle test only covered constants and a CBV, so it never saw it.

root_signature_oracle_test now serializes 1.0, 1.1 and 1.2 signatures with a
two-range table, a root SRV and two static samplers (1.2 with a UINT border colour,
then non-normalized coordinates). Every sampler field, the ranges and the canonical
round trip must match. root_signature_test adds hand-built 1.2 and table payloads
and their truncation controls.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:57:07 +01:00
5560ac86ce Merge origin/main into bpermute-wave32
Resolve the conflicts with the GPU test lists and counts (#203, #212, #218,
#222, #235, #246, #219, #298, #230), and keep main's partial-wave rule for
ds_bpermute_b32 in wave64. The wave32 path gets the same ballot, so a
source lane that isn't running reads 0 there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:56:56 +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
257e3856cc Runtime: GetResourceAllocationInfo on the Vulkan device (D3D-23)
GetResourceAllocationInfo, GetResourceAllocationInfo1 and
GetResourceAllocationInfo2 were generated stubs. Buffers take their width
rounded up to 64 KiB. A texture's size is what its VkImage needs
(vkGetDeviceImageMemoryRequirements, or a throwaway image without it),
rounded up to its D3D12 alignment: 64 KiB, 4 MiB with MSAA, or the small
alignment the description asks for. A 4 KiB request that doesn't qualify
is invalid, as on the PC runtime; the MSAA 64 KiB one has no size limit
there. Texture creation and these queries share one VkImageCreateInfo.

d3d12_vulkan_device_test compares buffer sizes, alignments and invalid
descriptions with the host PC runtime, and checks the per-resource layout
of the Device4/Device8 variants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:55:11 +11:00
dd4c763c11 Docs: the SCC row covers s_min_i32 and s_max_i32 2026-11-21 18:54:42 -04: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
9ef27a9059 Translator: s_min_i32 and s_max_i32 leave SCC at 0 on a tie 2026-11-21 18:54:33 -04:00
ff45269e68 tiny_game: _CRT_SECURE_NO_WARNINGS for its plain fopen (MSVC C4996) 2026-11-21 23:54:13 +01: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
e444c83335 GPU test for the S# and T# mip fields through gfx10_descriptors.h
vk_sampler_test binds a 128x128 two-level texture with the VkSampler from
vulkan_sampler(decode(S#)) and the view range from decode(T#). ps_ssharp
samples it with image_sample_lz and image_sample. check.py judges eight
S#/T# cases per pixel against levels worked out from the S# and T# bits.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:53:51 +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
75e666e615 Runtime: convert UINT render-target clear values numerically 2026-11-21 18:53:21 -04: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