Commit Graph
124 Commits
Author SHA1 Message Date
elforeign ee8347a39f metal: explicit threadgroup widths, measured against the default (#138)
Expose a bounded way to dispatch at a chosen width so every legal
configuration can be checked for identical known answers, including grids
that do not divide evenly, and timed against the default policy. On an
Apple M5 Pro widths 64-256 tie (median 58.8 us GPU), 512 is 6% slower and
1024 about 2x, so the default of 64 stays. run() keeps its signature; the
sized path is a separate private helper.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 02:31:33 -06:00
Ranveer Soni 0e7fa4aa93 Merge pull request #234 from elforeign/task/209-llvm-corpus
test(isa): independent LLVM corpus check of gfx1030 identification (#209)
2026-11-24 13:38:57 +05:30
Ranveer Soni 1ee557bdc4 Merge pull request #233 from atesahmet0/task/197-bswap
Implement 32-bit and 64-bit BSWAP in both CPU engines
2026-11-24 13:38:32 +05:30
elforeign fa4d4b9d71 Merge remote-tracking branch 'origin/main' into task/209-llvm-corpus archive/pull/234/head 2026-11-24 02:06:03 -06:00
elforeign bf3cca0718 isa: independent LLVM corpus check of gfx1030 identification (#209)
Issue #209 asks for LLVM-generated original samples beyond the existing
oracle cases, with measured coverage and unresolved differences. The
corpus has 317 original instructions assembled by llvm-mc and 6,574 byte
probes built from every metadata form's identifying bits: one with zero
operands, one per extension selector its family can carry, and two with
random operand bits. llvm-objdump decodes each probe, giving LLVM's
instruction and the bytes its decoder consumed (llvm-mc --disassemble
re-encodes, which hides consumed length for MIMG NSA).

The test compares identify with every row and pins per-source class
counts, the 130 disagreeing rows and a digest of the random probes, so
any metadata change fails until reviewed. Disagreements are reported, not
fixed: 18 MIMG names LLVM does not know, 6 VOP3 interpolation forms whose
attribute field 255 is read as a literal, and 21 extension cases on
operand-less or SGPR-pair instructions.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 02:05:58 -06:00
Ranveer Soni a86100c00d Merge pull request #231 from elforeign/task/172-extension-word-negative
test(isa): gfx1030 extension-word negative tests (#172)
2026-11-24 13:33:40 +05:30
ates 044f036ea5 Implement 32-bit and 64-bit BSWAP in both CPU engines
Signed-off-by: ates <ahmetrizaates@hotmail.com>
archive/pull/233/head
2026-11-24 10:57:26 +03:00
elforeign 79947ec998 Merge remote-tracking branch 'origin/main' into task/172-extension-word-negative archive/pull/231/head 2026-11-24 01:55:01 -06:00
Ranveer Soni 17fe880bdc Merge pull request #230 from elforeign/feat/sop2-signed-add-sub
shader: add s_add_i32 and s_sub_i32 with signed-overflow SCC (follow-up to #185)
2026-11-24 13:24:39 +05:30
elforeign e93e4e1e2a isa: negative tests for gfx1030 extension words (#172)
Issue #172 asks for independent truncated and invalid literal, SDWA, DPP
and NSA cases, and for length recognition to be kept apart from semantic
validity. Every case starts from bytes llvm-mc assembled from an original
instruction; expected results come from LLVM's disassembly of the cut or
altered bytes, not from the decoder.

Covers 62 proper prefixes of 18 literal/SDWA/DPP/NSA instructions with the
exact length each needs, 7 extension selectors on forms that do not allow
them, two reserved control values that keep their trailer length, and 8
back-to-back pairs whose second instruction starts after the trailer. An
ignored test re-checks every source encoding with LLVM.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 01:54:22 -06:00
elforeign 425327a0f2 shader: add s_add_i32 and s_sub_i32 with signed-overflow SCC
#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>
archive/pull/230/head
2026-11-24 01:48:52 -06:00
Ranveer Soni 1212280ab8 Merge pull request #224 from elforeign/task/171-bc7-decoder
feat(texture): BC7 block decoder, all eight modes, with independent vectors (#171)
2026-11-24 13:13:55 +05:30
Ranveer Soni c6665ebfb4 Merge pull request #229 from elforeign/feat/sop2-scalar-alu
shader: SOP2 scalar add, subtract and bitwise forms with SCC (fixes #185)
2026-11-24 13:13:32 +05:30
elforeign 96e2baeb75 Merge remote-tracking branch 'origin/main' into feat/sop2-scalar-alu
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
archive/pull/229/head
2026-11-24 01:40:26 -06:00
Ranveer Soni b9be341dfc Merge pull request #227 from elforeign/feat/test-inventory
audit: compare Cargo test inventories between two commits
2026-11-24 13:09:55 +05:30
elforeign b2391b4de4 Merge remote-tracking branch 'origin/main' into feat/sop2-scalar-alu
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 01:39:50 -06:00
Ranveer Soni ecc109a7e2 Merge pull request #225 from elforeign/ci/pr-template-check
ci: require pull requests to follow the PR template
2026-11-24 13:09:07 +05:30
Ranveer Soni 67e6565fc2 Merge branch 'main' into ci/pr-template-check archive/pull/225/head 2026-11-24 13:08:58 +05:30
elforeign 994efd38f9 shader: decode and execute SOP2 scalar add, subtract and bitwise forms
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>
2026-11-24 01:38:54 -06:00
Ranveer Soni aac0f31b93 Merge pull request #226 from elforeign/docs/readme-contributors
docs: add contributors section to README
2026-11-24 13:08:35 +05:30
elforeign ef0e472d5d docs: add contributors section to README
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
archive/pull/226/head
2026-11-24 01:37:56 -06:00
elforeign 1784836639 audit: compare Cargo test inventories between two commits
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>
archive/pull/227/head
2026-11-24 01:37:54 -06:00
Ranveer Soni 68fc4e25dc Merge branch 'main' into task/171-bc7-decoder archive/pull/224/head 2026-11-24 13:07:25 +05:30
Ranveer Soni cdaff0a391 Merge pull request #223 from elforeign/task/169-metal-bc4-bc5
feat(metal): native BC4 and BC5 UNORM/SNORM upload and readback (#169)
2026-11-24 13:06:51 +05:30
Ranveer Soni 184149561a Merge pull request #222 from elforeign/docs/plain-reply-claims
docs: claim by plain reply, one-week stale rule
2026-11-24 13:06:34 +05:30
Ranveer Soni e83475be17 Merge pull request #216 from elforeign/feat/gpu-compatibility-expansion
isa: fix isolated-branch inspection and verified form count (follow-up to #166)
2026-11-24 13:06:13 +05:30
elforeign fa55066699 ci: fail pull requests whose description skips the PR template
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 01:35:54 -06:00
elforeign f25060e891 changelog: restore the gfx1030 metadata and shader inspection entries
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>
archive/pull/216/head
2026-11-24 01:35:27 -06:00
elforeign 9318e68840 Merge remote-tracking branch 'origin/main' into feat/gpu-compatibility-expansion
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 01:34:37 -06:00
elforeign abd6698a66 Merge remote-tracking branch 'origin/main' into task/171-bc7-decoder 2026-11-24 01:32:50 -06:00
elforeign 5f8867bd30 Merge remote-tracking branch 'origin/main' into task/169-metal-bc4-bc5 archive/pull/223/head 2026-11-24 01:32:50 -06:00
Ranveer Soni 5ca90bfac0 Merge pull request #221 from atesahmet0/task/177-probe-report-consistency
Test probe report consistency across JSON, Markdown, and CSV
2026-11-24 12:59:38 +05:30
elforeign 7cc35ffd41 Merge remote-tracking branch 'origin/main' into task/169-metal-bc4-bc5
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
2026-11-24 01:28:23 -06:00
elforeign 57f10c1d7c Merge remote-tracking branch 'origin/main' into task/171-bc7-decoder
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
#	crates/texture/src/lib.rs
2026-11-24 01:26:50 -06:00
elforeign 76620e274b texture: iterate texels directly in the BC7 tests
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>
2026-11-24 01:26:34 -06:00
elforeign 240302fabe texture: add a BC7 block decoder from the Khronos BPTC text (#171)
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>
2026-11-24 01:25:45 -06:00
Ranveer Soni 01deb3f8a8 Merge branch 'main' into feat/gpu-compatibility-expansion 2026-11-24 12:55:06 +05:30
Ranveer Soni e6b9a27242 Merge pull request #218 from elforeign/task/168-bc23-audit
test(metal): BC2/BC3 edge blocks, invalid payloads and capability reporting (follow-up to #214)
2026-11-24 12:54:35 +05:30
elforeign 8fdb569052 docs: claim by plain reply, one-week stale rule
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
archive/pull/222/head
2026-11-24 01:23:57 -06:00
Ranveer Soni e79bd1ccaf Merge pull request #220 from elforeign/task/170-bc6h-subset
feat(texture): bounded BC6H subset decoder (single-subset modes) (#170)
2026-11-24 12:51:55 +05:30
Ranveer Soni 066bc3fc83 Merge pull request #217 from elforeign/feat/agent-task-queue
agent queue: command-only triggers, durable claim replay and review fixes (follow-up to #165)
2026-11-24 12:47:00 +05:30
ates a533d8107e Test cross-format probe reports against fixture counts and offsets
Signed-off-by: ates <ahmetrizaates@hotmail.com>
archive/pull/221/head
2026-11-24 10:16:45 +03:00
elforeign 3109b620fd texture: decode the single-subset BC6H modes
#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>
archive/pull/220/head
2026-11-24 01:16:24 -06:00
elforeign 878f554dcd Merge task/168-bc23-audit into task/169-metal-bc4-bc5
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
#	crates/metal/tests/native/texture_bc_alpha.rs
2026-11-24 01:12:31 -06:00
elforeign 46e2d36064 metal: compare non-interpolated BC4/BC5 codes exactly
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>
2026-11-24 01:12:20 -06:00
elforeign d94121bbb0 metal: compare non-interpolated BC2/BC3 codes exactly
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>
archive/pull/218/head
2026-11-24 01:11:43 -06:00
elforeign ef4fbba797 Merge upstream main into task/169-metal-bc4-bc5
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 01:08:59 -06:00
elforeign 97ea2541bb metal: cover BC2/BC3 edge blocks and report missing BC support apart
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>
2026-11-24 01:08:34 -06:00
elforeign f1ec653b91 Merge remote-tracking branch 'origin/main' into feat/agent-task-queue
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
archive/pull/217/head
2026-11-24 01:06:04 -06:00
elforeign b1ab08c09d agent queue: apply claim checks when /reassign creates a claim
/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>
2026-11-24 01:05:47 -06:00