Commit Graph

4 Commits

Author SHA1 Message Date
bfb41bd88b Translate v_interp_mov_f32 p10/p20 as per-vertex attribute deltas
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 17:34:46 +00:00
f2cf303237 SHADER-177: model computed I/J barycentrics (v0/v1 overwritten before v_interp) 2026-11-22 04:22:04 -08:00
5aa659ee0b Merge origin/main into interp-guards: compose with #1214's f16 high-half model
Conflicts resolved:
- tools/rdna2spirv.py: kept interp_pair_src ahead of the *_f16 interp's
  attribute() call and took main's attribute(..., half=...) with its
  PerVertexKHR docstring (quackottu's #1214 high model, on main as
  98f485f4): the I/J source guard and the high-half attribute read are
  orthogonal — the guard checks the barycentric VGPR source, `high`
  selects the attribute half. Both methods kept side by side.
- docs/design.md: kept our SHADER-177 contract row and main's updated
  Pixel-shader interpolants row (both rows; main's adds #1214's
  16-bit-interpolation parenthetical).

Also addresses review on #1224 (kapitche, Vonsek):
- per-op I/J roles: v_interp_p1* must read I (v0 or a copy rooted at v0),
  v_interp_p2* must read J (v1 or a copy rooted at v1); swapped
  p1(v1)/p2(v0) and both-v0 pairs are now refused. interp_copy_sources
  tracks each copy chain's root; refusals name the register and the role.
- copy-source provenance (Vonsek measurement row 3): a copy only
  qualifies while its source v0/v1 is itself unwritten up to the copy —
  a copy of an overwritten v0/v1 carries a computed value, not the pair;
  a write after the copy is fine (the copy saved the value; the corpus's
  one copy PS, 7PS_RasterizeWaterVolumeExposedSurface_d0369bb7, is
  exactly this shape and stays byte-identical).
- tests/semantic/test_interp_guards.py: 5 new tests mirroring the
  measurement rows and the role/root rules (now 14). Direct v0/v1 reads
  after an overwrite stay accepted — modelling that computed barycentric
  is the separate provenance follow-up (#1218).

Verified: semantic suite 1153 OK; 200-shader corpus slice 200/200
translated + spirv-val, all 419 output files byte-identical to current
main (426023a5); the copy PS byte-identical to main.
2026-11-22 01:15:18 -08:00
741bc05cbc Translator: refuse unmodelled v_interp I/J pairs and p10/p20 mov (SHADER-177)
v_interp_p1/p2 (f32 and f16) whose VGPR source holds neither the barycentric
pair (v0 = I, v1 = J) nor a plain v_mov_b32 copy of it, and v_interp_mov_f32
with p10/p20, are Unsupported naming the operand, instead of silently
translating as if the register were the pair (#1006 finding 7076073465).
The copy rule keeps the one corpus shader that reads J through
v_mov_b32 v14, v1 translating (bit-identical .spv): zero corpus cost
(117,001 v0 / 116,997 v1 / 4 copied-J f32 sources; 58,950 / 58,950 f16;
6,926 / 6,926 p0 mov). tests/semantic/test_interp_guards.py: refusals,
the copy and copy-chain cases executed, second-write and dpp-copy
refusals, and a mutation check that the guard consults the analysis.
2026-11-22 00:27:55 -08:00