#185 left both forms unsupported because the pinned XML says only
"carry-out" for them. The AMD RDNA 2 ISA reference guide (GPUOpen,
section 12.1 SOP2 Instructions, p. 101-102, and section 5.3 Scalar
Condition Code, p. 33) defines SCC for both as signed overflow:
add overflows when the operands share a sign that the result lacks;
subtract when the operands' signs differ and the result's sign differs
from S0's. The guide also confirms the unsigned rules used in #185.
Adds both forms to the generated opcodes, the decoder, the reference
(exact signed result must fit in i32), the independent interpreter (the
guide's sign-bit rule over its ripple adder) and the translator, plus
400 boundary programs, eight hand-worked overflow and no-overflow cases
(-1 + 1 and 0 - 1 carry or borrow but do not overflow) and two signed
overflows in the scalar ALU fixture. Inverting the overflow rule in any
one implementation fails three tests. s_min_i32 and the other SOP2
forms stay unsupported.
Refs #185
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
Adds s_add_u32, s_sub_u32, s_addc_u32, s_subb_u32, s_and_b32, s_or_b32
and s_xor_b32 across the chain: generated opcodes from the pinned AMD
XML, a typed ScalarAlu instruction, decoding, the reference interpreter,
the independent semantic-review interpreter and the translator, which
resolves scalar state and SCC as it already does for s_mov/s_cmp.
v_mov_b32_e32 may now read a normal SGPR, so results reach vector code
as constants.
SCC: the XML states carry-out for additions, carry-in for ADDC/SUBB and
nonzero results for bitwise forms. For subtraction it says carry-out
without fixing the polarity; LLVM's lowering of usubo and of 64-bit
subtraction to s_sub_u32/s_subb_u32 requires SCC to be the borrow.
s_add_i32/s_sub_i32 stay unsupported: no pinned source settles whether
their SCC is the carry or signed overflow.
Verified with an original LLVM-assembled fixture and 1,400 boundary
programs (every form, 10x10 operands, SCC clear and set) against exact
integer definitions; translator, reference (exact integers) and
independent interpreter (bit-serial ripple adder) all agree, and all
1,401 programs match on native Metal with validation. LLVM agrees on
every encoding. Breaking any one implementation fails the tests.
Fixes#185
Independent review fixes: both interpreters now require a known SGPR
for v_mov_b32 from an SGPR even in an inactive lane, as translation
does; alias, literal and inline cases also assert the translated result
and run on Metal; rejections are pinned to the SOP2 word's offset; GPU
status is recorded as local evidence with acceptance pending.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
Testing the old #166 and #165 heads silently ran without 12 BC texture
tests that main already had, because those heads predated the merge
that added them; nothing flagged the smaller inventory.
scripts/audit/test_inventory.py lists every test (and the ignored set)
of a base and a candidate commit, each in a temporary detached worktree
it always removes, and reports removed, added, newly ignored and newly
un-ignored tests keyed by package, target and name. Unexplained losses
exit 1; an --allow file with a reason per key explains intended ones.
951189c -> 5450612: removed 12 (all xenora-texture bc_formats), exit 1.
0cac6c4 -> 0cac6c4: 219 tests each side, no change, exit 0.
Fixes#208
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
The upstream merge of main into this branch (01deb3f) resolved the
CHANGELOG conflict by dropping this PR's three entries;
documented_form_counts_match_the_generated_table caught it.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
Strict Clippy (needless_range_loop) rejects indexing the output by the
loop counter; the assertions are unchanged.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
Issue #171 asks for bounded BC7 decoding with independent vectors for
partitions, endpoint precision and indices. All eight modes are decoded:
the partition and anchor tables are extracted mechanically from Khronos
Data Format Specification 1.3 section 20.1, and blocks with a zero low
byte decode to zero as that section requires.
Hand-derived tests cover each mode's distinctive field (P-bits, shared
P-bits, anchors, rotation, index selection, the section's own mode 2
bit-position example), and 430 known-answer vectors come from a separate
clean-room reference decoder. CPU only; no Metal BC7 path is claimed.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
#170 asks for a documented, bounded BC6H subset with explicit rejection
of what is not implemented. This adds a CPU decoder for the four
single-subset modes (Khronos 3, 7, 11 and 15; Microsoft 11 to 14) in
signed and unsigned form, written from the Khronos Data Format 1.3 text
(Tables 121 and 122, unquantization and final unquantization). Reserved
modes decode to zero as the specification requires; the ten two-subset
modes return Bc6hError::UnsupportedMode, and BC6H_SUPPORTED_MODES lists
coverage by mode.
Tests use hand-derived values (saturation to 65504 and -65504, the
11-bit transform wrap, both reversed-bit fields, signed -32768 to
negative infinity) and 128 known-answer vectors from a separate
clean-room reference decoder, 16 per supported and reserved mode.
Flipping the reversed bit order, dropping the wrap mask, using 31/64
for signed data, a 4-bit anchor, accepting mode 0 or not zeroing
reserved modes each fails the tests.
Refs #170
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
The full-texel check applied the two-code tolerance to every channel, so
an endpoint or six-value fixed code outside the anchors could be off by
two and still pass. Each texel's tolerance now comes from its own index:
zero for stored and fixed codes and constant channels, two only for
interpolated codes. A readback kernel that lowers near-maximum red by two
now fails the BC4 and BC5 UNORM tests.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
An independent review of the #214 tests found that the full-texel check
applied the two-code interpolation tolerance to every channel, so an
endpoint, a BC2 alpha nibble or BC3's fixed 0 or 255 outside the anchors
could be off by two and still pass. The tolerance now comes from each
texel's own indices: zero for stored and fixed codes, two only for
interpolated ones. A readback kernel that lowers near-opaque alpha by two
now fails all three tests. The 1.14-code bound is stated as 8/7.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
The section 12 audit of #214 found three gaps: no level narrower than a
block row (Metal's zero-stride single-row upload) or of 1x1, no checks
for zero extents or oversized and block-count-mismatched payloads, and a
missing BC capability surfaced the same way as an implementation fault.
Adds a 5x3 and 1x1 GPU test with hand-derived anchors, the extra upload
rejections, and MetalError::is_capability_unavailable; the GPU tests now
print CAPABILITY UNAVAILABLE or IMPLEMENTATION FAILURE. Rounding the
texture to whole blocks, accepting oversized payloads, or a device
without BC support each makes the tests fail with the matching message.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
/reassign turned a ready task into a claim without the dependency and
file-overlap checks /claim applies, so a maintainer reassignment could
grant two overlapping claims. Run the same checks for the new holder.
Refs #211
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
From independent review of the queue follow-up:
- Bot replies echoed user text (/blocked reasons, /reassign logins,
file patterns) verbatim. Markers count when the bot posts them, so a
reason containing an approval or done marker became a bot marker and
could approve an acceptance command or hide another user's claim.
Echoed text now has angle brackets and backticks escaped.
- /verified accepted a 7-character prefix and ignored extra arguments;
a commit with the same short prefix is cheap to make. Require exactly
one full 40-character SHA, with one parser shared by decide and the
check.
- After a verification, the job looked up the check run by the pull
request head SHA, but pull_request_target runs carry the base branch
SHA, so it found nothing and || true hid it. The verify job now
evaluates the same advisory check itself and no longer needs
actions: write.
- The issue form renders Files inside a ```text fence and the parser
took "text" as a path, so any two form-created tasks overlapped.
Fence lines are skipped.
- A command still unanswered after lease_hours now gets a "Not decided"
reply (window 2 x lease_hours) instead of being dropped silently.
Each fix has a test shown to fail with the fix reverted.
Refs #210, #211
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
Section 12's audit asks for levels that are not whole blocks and for
rejected payloads. Adds a 5x3 (single block row, zero Metal stride) and
1x1 GPU test over BC4/BC5 UNORM and SNORM with hand-derived anchors, the
zero-extent and wrong-length upload rejections, and routes the GPU reads
through the shared capability-aware unwrap. Rounding the texture to whole
blocks, accepting oversized payloads, or a device without BC support each
makes the tests fail with the matching message.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
From independent review:
- The summary said "not executable" for instructions that merely have
no semantic decoding; a decoded program can still fail compilation.
Say "without semantic decoding".
- When identification stops early, a branch target past the identified
prefix was reported invalid although its boundaries are unknown;
report it as unverified.
- The VOP3 and VOP3P literal probes used 1.0, which LLVM encodes as an
inline constant (8 bytes), so neither exercised a literal. Use
0x3f800001 and 0x3c01 and assert the 12-byte encoding and trailer.
- The coverage JSON test now also checks the document's shape.
Refs #183, #184
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
The section 12 audit of #214 found three gaps: no level narrower than a
block row (Metal's zero-stride single-row upload) or of 1x1, no checks
for zero extents or oversized and block-count-mismatched payloads, and a
missing BC capability surfaced the same way as an implementation fault.
Adds a 5x3 and 1x1 GPU test with hand-derived anchors, the extra upload
rejections, and MetalError::is_capability_unavailable; the GPU tests now
print CAPABILITY UNAVAILABLE or IMPLEMENTATION FAILURE. Rounding the
texture to whole blocks, accepting oversized payloads, or a device
without BC support each makes the tests fail with the matching message.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>