shader: how should 16-bit attribute interpolation bind the high word and attributes above attr0? #711

Open
opened 2026-11-26 22:13:33 +00:00 by github-bot · 1 comment
Owner

@⁠rasptum on GitHub · 2026-11-22 21:44 UTC · original

Follow-up to #640. I have a local prototype that lowers v_interp_p1ll_f16 + v_interp_p2_f16 for the low word of attr0 under round toward zero, with a fixture and draws on WARP and one NVIDIA adapter. Before opening a PR I would like direction on two points, because the narrow shape covers almost none of what I counted.

Counts (one local input, linear instruction order, aggregate only): 4,187 of 12,101 PS records use the pair, always with MODE[3:2] = 3. Of those, 4,095 use the high word, the highest attribute index used is 14, and only 2 use attr0 alone. None reaches the interpolation today: every one first stops earlier (constant buffer binding, unbound entry registers, s_mov_b32).

Question 1: binding. The existing attribute profile binds one desktop TEXCOORD0. What binding model do you want for the high word of an attribute and for attr1 and above? For example two packed halves per desktop component, or separate inputs per word.

Question 2: rounding. The prototype lowers a completed pair to the desktop interpolated value narrowed toward zero to binary16. The console instruction reads binary16 P0, P10 and P20 and evaluates the plane itself, so its result may differ from truncating an exact interpolation when the vertex values are not exact binary16. I cannot measure that here. Is the truncated desktop value acceptable as the definition, or should this stay rejected until someone can measure it on hardware?

I am happy to open the prototype as a draft PR if that is easier to review than a description.

AI assistance: written with Claude (Claude Code); the counts and test runs are from my own machine.

**@⁠rasptum** on GitHub · 2026-11-22 21:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/711) Follow-up to #640. I have a local prototype that lowers `v_interp_p1ll_f16` + `v_interp_p2_f16` for the low word of attr0 under round toward zero, with a fixture and draws on WARP and one NVIDIA adapter. Before opening a PR I would like direction on two points, because the narrow shape covers almost none of what I counted. **Counts** (one local input, linear instruction order, aggregate only): 4,187 of 12,101 PS records use the pair, always with MODE[3:2] = 3. Of those, 4,095 use the `high` word, the highest attribute index used is 14, and only 2 use attr0 alone. None reaches the interpolation today: every one first stops earlier (constant buffer binding, unbound entry registers, `s_mov_b32`). **Question 1: binding.** The existing attribute profile binds one desktop `TEXCOORD0`. What binding model do you want for the `high` word of an attribute and for attr1 and above? For example two packed halves per desktop component, or separate inputs per word. **Question 2: rounding.** The prototype lowers a completed pair to the desktop interpolated value narrowed toward zero to binary16. The console instruction reads binary16 P0, P10 and P20 and evaluates the plane itself, so its result may differ from truncating an exact interpolation when the vertex values are not exact binary16. I cannot measure that here. Is the truncated desktop value acceptable as the definition, or should this stay rejected until someone can measure it on hardware? I am happy to open the prototype as a draft PR if that is easier to review than a description. AI assistance: written with Claude (Claude Code); the counts and test runs are from my own machine.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:13:33 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-22 21:55 UTC · original

A draft PR for the existing narrow prototype is welcome as an experiment. Please label the desktop interpolation followed by RTZ as the measured desktop reference. Keep general high and attr1+ rejected until there is evidence for the input mapping and for rounding of the two guest instructions. For the next fixture, use separate logical coordinates (attribute, channel, word) with distinct low/high values and at least two attributes, so an axis or word swap changes the result. A rounding witness should distinguish binary16 P0/P10/P20 consumed by the guest pair from interpolating a desktop float and narrowing once, ideally near a half-precision boundary. The first-blocker counts are useful to pick fixtures. Please keep them separate from lowered coverage.

**@⁠R0Y00** on GitHub · 2026-11-22 21:55 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/711#issuecomment-7086414314) A draft PR for the existing narrow prototype is welcome as an experiment. Please label the desktop interpolation followed by RTZ as the measured desktop reference. Keep general `high` and attr1+ rejected until there is evidence for the input mapping and for rounding of the two guest instructions. For the next fixture, use separate logical coordinates `(attribute, channel, word)` with distinct low/high values and at least two attributes, so an axis or word swap changes the result. A rounding witness should distinguish binary16 P0/P10/P20 consumed by the guest pair from interpolating a desktop float and narrowing once, ideally near a half-precision boundary. The first-blocker counts are useful to pick fixtures. Please keep them separate from lowered coverage.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#711
No description provided.