Commit Graph

541 Commits

Author SHA1 Message Date
d11e39bb39 Merge pull request #599 from LuanFreitas 2026-11-21 20:38:54 -05:00
2452a5b89a Merge pull request #575 from IAmNotSiob 2026-11-21 20:38:53 -05:00
e5d9f28a4f Merge pull request #489 from eIBart0 2026-11-21 20:38:47 -05:00
dbb3319681 Shader: pack d16 image sample/gather results with integer f32->f16 RTE
Work around an amdvlk64 pipeline-creation crash (0xC0000005 on RX 9070 XT)
triggered when GLSL.std.450 PackHalf2x16 on an OpImageSampleExplicitLod d16
result feeds a structured loop (OpLoopMerge inside OpSelectionMerge) using
OpGroupNonUniformAny.

Replace PackHalf2x16 at the two d16 image_gather4*/image_sample* sites in
tools/rdna2spirv.py with a branchless pure-integer IEEE-754 binary16 RTE
packer (Gen.f32_to_f16_int / Gen.pack_f16_pair_int). Leave all other
PackHalf2x16 call sites unchanged.

Add unit tests covering edge cases and a 58,368-value sweep across all 256
exponents (tests/test_d16_pack.py), SPIR-V translation/validation tests for
d16 image_sample and image_gather4 (tests/test_translate.py), and a synthetic
GPU sample shader (runtime/test/shaders/ps_texture_sample_d16.asm).
2026-11-21 22:24:31 -03:00
14d81dd093 SHADER-86: align mem_diff reference with RX 6700 typed-buffer decode
Repeat missing channels, drop the old norm-ulp1/missing-w32 splits, and allow DST_SEL 1 in the fuzzer.
2026-11-21 22:23:22 -03:00
baa6beed3a SHADER-86: match RX 6700 typed buffer decode (repeat, OpFDiv, DST_SEL 1)
Missing channels use c mod n, UNORM/SNORM divide by (2^n-1), and DST_SEL 1 is integer 1 for UINT formats.
2026-11-21 22:23:21 -03:00
b3688332f2 Merge origin/main into fuzz-3-f32-valu (regen_fixtures.py: keep ps_f32_mods and ps_f64_mods)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:22:45 +01:00
6f4bd2a9bb Merge remote-tracking branch 'origin/main' into shader-55-56
# Conflicts:
#	docs/design.md
#	tests/spirv_interp.py
#	tools/rdna2spirv.py
2026-11-22 02:22:31 +01:00
8521b0b465 Merge origin/main into fuzz-3-f32-valu
spirv_mini_interp.py: keep main's _F32 (sNaN bits, #533) and its vector-aware
RoundEven/Floor/Ceil/Trunc; keep this branch's fma_f32, OpFDiv and
Exp2/Log2/Sqrt/InverseSqrt. regen_fixtures.py: both sides' shaders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:21:00 +01:00
6e1efe8929 Merge pull request #596 from bbareth 2026-11-21 20:09:29 -05:00
29b3af57f7 Merge pull request #595 from bbareth 2026-11-21 20:09:28 -05:00
4c61012539 Merge pull request #593 from bbareth 2026-11-21 20:09:28 -05:00
905b6afb9a Merge pull request #591 from bbareth 2026-11-21 20:09:28 -05:00
60e196519b Merge pull request #588 from andretuta 2026-11-21 20:09:27 -05:00
19902b0a8e Merge pull request #586 from bbareth 2026-11-21 20:09:27 -05:00
77cab3ba26 Merge pull request #584 from bbareth 2026-11-21 20:09:26 -05:00
8b47705e69 Merge pull request #583 from bbareth 2026-11-21 20:09:26 -05:00
5fd6399fba Merge pull request #578 from bbareth 2026-11-21 20:09:25 -05:00
16a9d64e1f Merge pull request #577 from NRXM 2026-11-21 20:09:25 -05:00
1a6078b6d7 Merge pull request #574 from bbareth 2026-11-21 20:09:25 -05:00
767e716dd6 Merge pull request #571 from bbareth 2026-11-21 20:09:24 -05:00
44ea12da0e Merge pull request #570 from eIBart0 2026-11-21 20:09:24 -05:00
a409452f03 Merge pull request #569 from bbareth 2026-11-21 20:09:24 -05:00
56e2551cdc Merge pull request #557 from bbareth 2026-11-21 20:09:21 -05:00
425d040ec8 Merge pull request #556 from bbareth 2026-11-21 20:09:21 -05:00
e4212556c3 Merge pull request #553 from NRXM 2026-11-21 20:09:20 -05:00
556be0647a Merge pull request #552 from bbareth 2026-11-21 20:09:20 -05:00
298a69da7e Merge pull request #551 from eIBart0 2026-11-21 20:09:19 -05:00
81f0bab87c Merge pull request #549 from NRXM 2026-11-21 20:09:19 -05:00
c555b4c2bd Merge pull request #512 from SuarezPM 2026-11-21 20:09:17 -05:00
6a55f981e0 Merge pull request #503 from Tomgamer 2026-11-21 20:09:16 -05:00
2720df12a1 Merge origin/main into f64-output-modifiers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
#	tests/semantic/regen_fixtures.py
2026-11-22 02:07:19 +01:00
c7ea4b4aaa Merge the upstream two-mip fixture with the a16 gradient test
Keep both texture draws in the standalone checker, the GPU runner and its expected case count.
2026-11-22 02:04:42 +01:00
b6eda1e60c Translator: flush f16 denormals in the quantized interpolant path
AI-assisted. Addresses IAmNotSiob's review on #512 (he is taking the
arithmetic sites under SHADER-56/#513; f16_roundtrip stays here).

SPIR-V's OpQuantizeToF16 returns +0/-0 when the magnitude is too small for a
normal f16, and it pins no rounding mode. The docstring, the design row and the
test's rule text now say "round to nearest, f16 denormals flushed to signed
zero" and warn against reusing the helper where denormals or a rounding mode
matter.

The mini-interpreter used struct.pack('<e'), which keeps f16 subnormals: it was
more precise than any conforming driver, so a test could pass here and fail on a
GPU. It now flushes after float_to_half, and the test's independent oracle does
the same. A new case pins 1e-6 -> +0.0 and -1e-6 -> -0.0 through a translated
flagged shader (PS input 1e-6 is an f16 subnormal, 6.1e-5 is the smallest
normal); without the interpreter flush that test is red.

Existing 1.1 -> 1.099609375 pin and the opcode pin are unchanged.
2026-11-21 22:04:36 -03:00
2a41e7a44c Navmesh: decode 0DRP cover-point pages, 0x00010015 tiles and Band-3 grids (ASSET-22) 2026-11-21 22:03:23 -03:00
97e0b626a5 ab_control_flow.py: --count, --runs and --timeout must be at least 1
select_candidates() checks `len(picked) >= count` after appending, so
--count 0 or a negative count still picked (and ran) one shader.
--runs 0 rendered nothing and classified every shader as "dispatch form
failed to run", and --timeout 0 gave the harness no time at all. The
three options are now positive whole numbers (argparse errors before
the output folder is made), and select_candidates() refuses a count
below 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:03:07 +01:00
7463b94180 Merge remote-tracking branch 'origin/main' into salu-sext-flbit 2026-11-21 22:02:52 -03:00
320531ec67 Merge remote-tracking branch 'origin/main' into valu-add-nc-clamp
# Conflicts:
#	docs/design.md
2026-11-21 22:02:29 -03:00
511a45e886 tex_export.py: --limit must be at least 1
`if a.limit: texs = texs[: a.limit]` read --limit 0 as "no limit" and
exported every texture in the index, and a negative --limit silently
dropped the last textures. --limit is now a positive whole number (an
argparse error otherwise, before the output folder is made), and the
slice runs whenever it is given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:02:09 +01:00
829ba98078 Merge remote-tracking branch 'origin/main' into valu-lerp-u8 2026-11-21 22:01:59 -03:00
8423530e5f world_index.py: --limit 0 is not "no limit", and the scan window is checked
scan_rpf() used `min(size, pos + limit) if limit else size`, so
--limit 0 scanned the whole archive. --start and --limit were plain
ints: a negative --limit gave an end before the start (an empty scan
reported as a normal run), a negative --start searched from the top of
the file, and a --start inside the RPF9 header or past the end was used
as given. --start must now be 0 or more and --limit at least 1
(argparse errors), and a --start outside an archive's data area is one
line and exit 2, before any report is written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:01:19 +01:00
96ec04967a rdna2spirv.py: check --limit and --shard before translating anything
`files[: a.limit] if a.limit else files` read --limit 0 as "no limit"
and translated the whole corpus, and a negative --limit dropped the
last shaders instead of being refused. --shard was split and used
unchecked: 0/0 ended in "slice step cannot be zero", 9/8 translated
nothing and wrote an empty index.part9.json that --merge then reads,
and anything that isn't i/n was a traceback.

Both are now argparse types: --limit must be at least 1, and --shard
must be i/n with n >= 1 and 0 <= i < n. A bad value is a usage error
(exit 2) before --out is created. The translation itself is unchanged,
and make_game.py's own "--shard i/jobs" values are all valid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:00:01 +01:00
a67d215b2c fssm_header.py: a missing path is one line, and --limit can't be negative
files_of() treated anything that is not a file as a folder, so a
missing path ended in a FileNotFoundError traceback. --limit was a
plain int used as paths[:limit], so --limit -1 silently dropped the
last blob and --limit -5 the last five, reported as a normal tally.
The path is now checked first (exit 2, one line), and --limit must be
0 or more (an argparse error otherwise).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:55:59 +01:00
a4996c7ab4 Merge origin/main into f64-output-modifiers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:55:11 +01:00
94482638cc anim_index.py: a missing source or an output it can't write is one line
main() caught only ValueError from the scan, so a missing source
(os.path.getsize), a folder that can't be listed or a stream that
can't be read ended in an OSError traceback, as did an output path in
a folder that doesn't exist. Both now exit through sys.exit() with one
line naming the path, like the ValueError case already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:55:07 +01:00
d80f9a4d34 gamedata_index.py: a missing target or a refused archive is one line
A missing target went to ArchiveSource and failed there; an empty or
short archive raised the RuntimeError the tool builds from
rpf9_carve.py's own message, but nothing caught it, so it surfaced as
a traceback; a carve folder without index.json, or with one that has
no "files" list, ended in FileNotFoundError / KeyError tracebacks.
main() now checks the target exists and prints each of these as one
line, exit 2, before --csv or --json is written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:54:17 +01:00
5c8cc4fade Part 3: f16 FMAs round once, to f16 (SHADER-55)
v_fma_f16, v_fmac_f16 and v_pk_fma_f16 used GLSL Fma (rounded to f32) and then narrowed, a double rounding;
an RX 6700 matches a correctly rounded f16 FMA in 12,612/12,612 cases (#374). fma_f16_odd: exact f32 product,
TwoSum, round-to-odd at f32, then f16_bits. Design row for f16 rounding.
2026-11-22 01:53:21 +01:00
8b5ef5f62a Part 2: narrow f16 ALU results with integer ops, not PackHalf2x16 (SHADER-56, #513)
Drivers fold PackHalf2x16 -> UnpackHalf2x16 to a no-op, so a following f16 op saw the unrounded f32 (#513:
v_pk_add_f16 -> v_pk_mul_f16 1 ulp off under --wave64-emulate on NVIDIA; v_cvt_pkrtz_f16_f32 rounding to
nearest on llvmpipe). Gen.f16_bits converts with integer ops (RTE, or RTZ with +-65504 for pkrtz) and is used
by f16_out, v_cvt_f16_f32, v_pk_*_f16, f16 sin/cos, v_interp_p2_f16, v_fma_mix* and f16_rtz.
tests/spirv_interp.py gains OpU{Less,Greater}ThanEqual and OpFUnordNotEqual.
2026-11-22 01:53:21 +01:00
4c842cd11e Merge pull request #548 from Spaghetih 2026-11-21 19:53:12 -05:00
3dee137e53 Merge pull request #546 from Luiz Neves 2026-11-21 19:53:12 -05:00