tools/pknorm_probe.py runs v_cvt_pknorm_i16_f32 / v_cvt_pknorm_u16_f32 through the translator on the CPU interpreter
and, with --oracle hw, natively through tools/hw_oracle in wave32 and wave64 under five MODEs. On an RDNA2 iGPU
(gfx1036) every NaN half (74 of 74: quiet, signalling, both signs, payloads, in S0 and S1) gives 0, as the translator
assumes, whatever IEEE, DX10_CLAMP and the f32 denormal mode are.
The rounding does not match: the hardware rounds the exact product x * 32767 (or 65535) once, while the translator
rounds the f32 OpFMul product and then RoundEven, one off on 28 of 28 near-tie inputs in both directions. Recorded in
docs/design.md and docs/shader_validation.md; the translator is not changed here. tests/test_pknorm_probe.py checks
four near-tie words against a hand derivation and the translator side's double rounding and NaN zero.
Since #1567 made the game's S# words literals, 16 corpus gathers with
CLAMP mode 6 (clamp border) failed as Unsupported. Modes 6 and 7 (mirror
once border) now give a tap outside [0, n-1] the S# border colour's
channel (BORDER_COLOR_TYPE, word 3 [31:30]: transparent black, opaque
black, opaque white), for literal and run-time S#s; a table border
colour stays Unsupported on a literal S#, and half-border modes 4 and 5
keep their old handling. GPU test ps_gather_border, translator tests and
the contract row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Known approximations row still said v_cos_f16, v_exp_f16 and
v_log_f16 were unmeasured, although the f16 transcendentals row from
#1310 (FUZZ-29) records that the f16 field of FP_ROUND is ignored by
all seven transcendentals. Cite that row instead; the translator
already treats them the same, so no code change.
main currently carries this row three times after the merge round, so
the sentence is fixed in each copy.
A listing is LLVM's text for the instruction it decoded, not the bytes it
read. translate() compared the two only for listings with undecodable words
(the re-anchoring path); a clean listing was translated from the text alone,
so a field the disassembler drops would be translated as 0 without a word.
llvm-mc's gfx1013 decoder does drop the VOP3 op_sel bits (14:11) of 16-bit
VOPC compares and re-encodes them as 0.
check_printed_encodings() runs for every other listing whose header names
its code range and whose fssm/ or fspx/ blob holds that range: each
instruction's printed encoding must be the bytes at its offset, with
same_encoding's exceptions, or the shader is Unsupported. Hand-written
listings, run_gpu_tests.py's synthetic listings and the tests' header-only
blobs are not checked.
On the 1.0.2.1 corpus the 25,030 clean listings hold 30,335,381
instructions and none differs (754 fall under same_encoding's exceptions);
the 166 16-bit VOPC compares have op_sel clear.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spirv-val's structured-control-flow checking cost grows roughly with the cube
of the nesting depth: over the 1.0.2.1 corpus the deepest block sits 118
constructs deep and about 85% of validation time is in modules nested 20 or
deeper. cfg_structure.depth() measures the tree and a module deeper than
MAX_STRUCTURED_DEPTH (16) is emitted in the existing flat dispatch-loop form
instead, which emits the same blocks and only changes the routing. Depth
5-12 shows no gain, hence the bound at 16.
- int_hw_probe: VOP3 clamp on the carry-out add/sub ops (#1831) and v_cvt_rpi/flr's exact floor(x+0.5) and NaN
sign saturation (#1856) now translate as gfx1035 measured, so KNOWN_DIVERGENCES is empty. The known-divergence
test reports a synthetic entry. shader_validation.md says so, and design.md loses the stale duplicate
v_cvt_flr/rpi row a "both" merge left that still called them open.
- docs/README.md: one Other languages line (fr, pt-BR, zh-CN, pl-PL, tr, ru, ja); docs/i18n/README.md: one row
each for pt-BR and zh-CN (the newer).
- anim_rigs, d16_format_probe, pe_shader_containers: text writes name newline="\n" (#1615);
pe_shader_containers guards stdout (#1428).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both were rejected while v_add_nc_u16 / v_sub_nc_u16 are translated.
They take the same 16-bit path (op_sel source and destination halves, the
other half kept); without clamp they are bit-identical to the u16 forms,
and clamp saturates the exact signed result to [-32768, 32767].
tests/semantic/test_valu_add_sub_nc_i16.py covers a value grid with and
without clamp, op_sel and equality with the u16 forms. docs/design.md
row added.
translate() clips the LDS array to 16,384 dwords, so a native compute
shader whose RSRC2 LDS_SIZE allocates more than 64 KiB passed the cap
check with a cut array (review on #1882). The check now counts the LDS
at max(array, RSRC2 allocation) and refuses it. A need that comes only
from a constant ds offset keeps the clipped array: the +4-dword slack
makes an in-range b32 at offset 65,524 compute as 65,540 B, and a real
offset past 64 KiB is out of range on hardware.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M = (M & ~DATA) | DATA2, the _rtn_ form returning the old M. Emitted as
an atomic AND with ~DATA (its result is the old M, exactly) and an atomic
OR with DATA2; the memory is exact unless another lane's op on the same
dword lands between the two.
tests/semantic/test_lds_mskor.py runs them in the interpreter.
docs/design.md row added.
- On GFX10 a device-scope load is `glc dlc` and a device-scope store `glc` (Mesa ac_get_hw_cache_flags sets
exactly these bits for ACCESS_COHERENT). The 10 POPS pixel shaders read-modify-write their ordered images that
way, but a glc image_load was translated as a read of the sampled array (no coherent form in SPIR-V) and no
storage view was Coherent, so under the fragment-shader interlock a read could miss the previous fragment's store.
- A glc image_load now reads the storage view the stores write (OpImageRead, StorageImageReadWithoutFormat, class
picked from the T# FORMAT as for stores); a shader with a glc image load or store decorates its storage views
Coherent. Every other image_load keeps SHADER-151's sampled path (byte-identical output).
- glc on a sampled read (image_sample*, image_gather*, image_load_mip) or on a dimension without storage views is
Unsupported instead of silently non-coherent; dlc alone (CU scope) stays non-coherent.
- tests/semantic/test_image_coherent.py (real translator; 7 of 10 fail on the old one) and a docs/design.md row.
buffer_store_format_d16_xyzw into every narrow UINT/SINT format, read back
from gfx1036 (wave32 and wave64 alike): a SINT half is sign-extended before
the clamp. Dropping the signed d16 source for sint now fails 10 rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1686 folded a known SGPR offset into the immediate before the 32-bit
truncation (s_buffer_load) or the 21-bit sign extension (s_load), so
s12 = -4 with offset:20 read byte 16 instead of being out of range, and an
s_load sOFF of 2^20 or more turned negative. Hardware does not wrap
(@Pierre-Kookis, gfx1036); the run-time path adds zext(sOFF & ~3) to the
normalised immediate in 64 bits. The fold now does the same. Found and
GPU-reproduced by @Impre-visible.
tests/semantic/test_smem_const_offset.py runs each case with the offset
as a constant and through v_readfirstlane, against the measured rule.
docs/design.md: the row says it (and a duplicated copy of the row goes).