Commit Graph

9534 Commits

Author SHA1 Message Date
7c24cd1434 test(semantic): interpreter tests for scalar shifts s_lshl_b64, s_lshr_b64, s_ashr_i64 2026-11-21 19:03:47 +01:00
4d402c717c test(tools): test manifest directory hashing, creation, verification, and corruption detection 2026-11-21 19:03:20 +01:00
85842cc574 test(tools): add test_shader_profile.py and opcode/register profiling in shader_profile.py 2026-11-21 19:02:51 +01:00
eff14e0b62 test(tools): test synthetic DXBC container scanning and boundary validation in shader_carve 2026-11-21 19:02:42 +01:00
84776d4137 test(semantic): add perspective interpolation parameter tests (v_interp_p1_f32, v_interp_p2_f32) 2026-11-21 19:02:29 +01:00
aa02d3b8a1 test(semantic): add interpreter tests for LDS basic allocation and workgroup bounds 2026-11-21 19:01:57 +01:00
4db3b06e61 test(tools): author test_bc_feature.py covering BC1-BC7 block compression and bit-depth 2026-11-21 19:01:43 +01:00
3e6cde78ec Tools: emit D3D12->Vulkan build metadata in spirv/index.json 2026-11-21 15:01:07 -03:00
fb18e1f0ff test(semantic): author semantic interpreter tests for s_barrier control 2026-11-21 19:00:56 +01:00
50b52aed7b test(tools): add make_game preflight and toolchain tests 2026-11-21 19:00:50 +01:00
dd85598678 test(tools): add unit tests for make_game argument validation and stage flow 2026-11-21 19:00:15 +01:00
29a4630688 test(tools): add test_fssm_unpack covering container carving, headers, alignment, and CRC bounds 2026-11-21 19:00:13 +01:00
8eff3c4965 test(tools): add unit tests for hashdict joaat, harvesting, and lookup 2026-11-21 18:57:13 +01:00
c13ce17f14 amd_swizzle: parse pattern cells instead of eval
eval(cell, {}, env) still exposes builtins, so a crafted header
passed via AMD_SWIZZLE_HEADER could run code. addrlib's tables only
use symbols, integers and ^, so parse exactly that and reject the rest.
2026-11-21 14:47:23 -03:00
6582fa2dcb Make Vulkan shader checks aware of wave64 support 2026-11-21 19:46:32 +02:00
e065f6f355 Audio: readable AWC bank/stream manifest without exporting
Add tools/awc_manifest.py, a stdlib CSV/JSON manifest of every stream in .awc banks. It reads the layout through awc_opus.parse_awc/music_channels, reports durations and suspicious metadata, and skips unreadable banks with a warning. Add a synthetic-bank unittest (PCM16, float32, Opus, streamed music, bad magic); music_channels gains a default-on collect_packets flag so metadata callers avoid packet copies.
2026-11-21 17:44:26 +00:00
58cb83df2c Report model decode failure reasons in rpf9dump 2026-11-22 01:35:55 +08:00
8ecbfa9d52 tests: run test_awc_opus's main() serially (--jobs 1); the pool can't pickle the privately loaded module
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 12:28:46 -05:00
c116ba0286 Merge pull request #24 from Kam471 2026-11-21 12:26:30 -05:00
3c400001c0 Merge pull request #23 from Kam471 2026-11-21 12:26:30 -05:00
51b79339fb Manifest: hash files with --jobs (parallel create/verify)
Default is half the CPU count; --jobs 1 keeps serial hashing. create rebuilds entries in walk order so the JSON does not depend on completion order, and verify prints problems in manifest order so its output and exit code are identical for every job count. Progress now reports completed file counts from the main thread instead of per-file worker lines.
2026-11-21 17:00:39 +00:00
dd637c9975 Tests: AWC packaging (PCM16, float32, Ogg Opus) with synthetic banks 2026-11-21 16:59:27 +00:00
4b251d1cb6 Merge pull request #15 from Mulkku
# Conflicts:
#	runtime/test/vk_store_test.cpp
#	runtime/test/vk_texture_test.cpp
#	runtime/test/vulkan_loader.h
#	tools/rdna2spirv.py
2026-11-21 11:47:52 -05:00
af5dc7be3b Merge pull request #20 from ttd0x
# Conflicts:
#	.github/workflows/ci.yml
2026-11-21 11:47:13 -05:00
d70f44b292 Merge pull request #1 from Ewann 2026-11-21 11:46:54 -05:00
693cc4f841 Merge pull request #17 from Kam471 2026-11-21 11:46:52 -05:00
439887f04f Tests: check computed values with a small SPIR-V interpreter
tests/spirv_interp.py runs the straight-line, single-lane SPIR-V the translator
emits for branch-free shaders (binary32 rounding after every op, GLSL.std.450
subset, Function/Output variables). Unknown opcodes raise NotImplementedError.

- test_values.py: 49 value checks over the supported instruction families, with
  references written in plain Python from the ISA definitions.
- test_f16_op_sel_values.py: 84 value checks for op_sel on f16 VOP3 ops (all
  select combinations, neg/abs/clamp, fmac).
- listing.py: hand-written listing helper. shader_ir.parse_file treats the first
  line of a listing as its header, so the helper writes one; test_f16_op_sel.py
  used to lose its first instruction and now uses the helper.

None of these need llvm-mc or spirv-tools. Mutation-checked: breaking the
op_sel source index or the destination merge makes them fail.
2026-11-21 17:46:28 +01:00
a7a1c01658 Translator: support op_sel on f16 VOP3 ops
v_fma_f16, v_med3_f16, v_add/sub/mul/max/min_f16, the f16 unary ops and v_fmac_f16
used to raise Unsupported when op_sel was present. Source bit i now reads the high
half of source i and the last bit writes the high half of the destination, the
other half being kept (Mesa ACO can_use_opsel, RDNA2 ISA VOP3 OP_SEL).

The f16 read/write sequences move into f16_in/f16_out/opsel_bits. Output without
op_sel is unchanged apart from SSA numbering.

Tests: tests/test_f16_op_sel.py uses hand-written listings (no llvm-mc needed).
2026-11-21 17:46:28 +01:00
695ae01d21 tests: value-level regression tests for RDNA2 -> SPIR-V pixel shaders
Add tests/semantic: translate two hand-written, branch-free pixel shaders
(ps_sdwa, ps_ops) and execute the resulting SPIR-V with a small strict
interpreter, asserting every mrt0 word against hand-derived expectations.
Catches wrong-value regressions (SDWA selects/sext, min3/max3, bfe_i32,
packed f16 FMA) that spirv-val cannot.

- Standard library only; no LLVM, SPIRV-Tools, GPU or game files.
- Interpreter rejects unmodelled constructs instead of approximating.
- Negative controls sabotage translated output; mutation tests sabotage a
  temporary copy of tools/ and require the matching test to fail.
- Fixtures are generated from runtime/test/shaders/*.asm.
- CI job semantic-tests (Windows + Ubuntu, Python 3.12), discovery limited
  to tests/semantic.
2026-11-21 18:27:51 +02:00
f247d8aac0 Audio: gate --wav preflight on assets; add audio_wav regression test
Only require ffmpeg when the assets stage will run, so --wav with shaders/runtime only is not blocked. Add tests/test_audio_wav.py: standard-library unittest, skipped without ffmpeg, pinning a 1 s Ogg Opus to an exact 48,000-frame 16-bit mono 48 kHz WAV and checking resume and missing-ffmpeg behaviour.
2026-11-21 16:12:07 +00:00
e64ab9d3cc Shaders: fail when llvm-mc can't disassemble; accept a WSL command in LLVM_MC
The official Windows LLVM build ships no llvm-mc.exe and has no AMDGPU
target, which is what issue #7 ran into. A tool that existed but could
not disassemble produced empty output, so shader_disasm.py counted 0
invalid words, wrote an empty .s per shader and reported every one as
"clean"; make_game.py then translated nothing.

Probe one s_endpgm before the run and stop with the tool's own error.
Empty per-shader output is now "failed" and exits 1, never "clean".
LLVM_MC may be a whole command line, so Windows can call WSL's llvm-mc:

    set LLVM_MC=wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc

make_game.py accepts the same form in preflight and need(); README and
design.md now state the real requirement. New tests cover a missing
tool, a missing AMDGPU target, empty output and the success path.
2026-11-21 15:39:35 +00:00
987e8471ee Fix RDNA2 wave masks and flat inputs
Preserve whole-wave mask operations, saved EXEC values and flat
pixel inputs when generating SPIR-V. Keep a dispatch-loop fallback
alongside structured control flow and share the descriptor probe.

Add reproducible GPU fixtures for these cases and exercise the
control-flow and mask analyses in CI.
2026-11-21 16:56:54 +02:00
1d3b9bfe4c tests: synthetic ISG1/OSG1 and PSV0 DXBC for the gs_tri and ms_tri samples 2026-11-21 10:00:24 +01:00
44021cb729 Add pytest regression tests for the RDNA2 -> SPIR-V translator 2026-11-21 09:17:32 +01:00