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

Open
opened 2026-11-22 21:44:49 +00:00 by rasptum · 1 comment
rasptum commented 2026-11-22 21:44:49 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-22T21:44:49Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6548187569 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/711). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-22T21:44:49Z. --- 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.
R0Y00 commented 2026-11-24 06:48:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T21:55:18Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7086414314 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/711#issuecomment-7086414314). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T21:55:18Z. --- 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.
Sign in to join this conversation.
No labels
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.

Reference
R0Y00/Xbox2Windows#705
No description provided.