diff options
| author | AlxcBTW <187763517+AlxcBTW@users.noreply.github.com> | 2026-11-22 19:33:56 +0100 |
|---|---|---|
| committer | AlxcBTW <187763517+AlxcBTW@users.noreply.github.com> | 2026-11-22 19:33:56 +0100 |
| commit | 70c1c54cbfa116fae224d91402eee29d45953855 (patch) | |
| tree | 05887112c74458830b986dd5ae0190ccb543e592 /docs/buffer_formats.md | |
| parent | 90b31ac44120c29d318f3729b9e07426d9d37bf2 (diff) | |
| parent | ec8ec4c9a46c6623f1a9c125afd3566da97f1e0c (diff) | |
Merge origin/main into buffer-formats-all-v2
Conflicts in tools/rdna2spirv.py and docs/design.md. Main had meanwhile fixed three of the older
stores this branch found (SHADER-358: f16 toward zero; SHADER-364: exact NORM rounding and the
DST_SEL-dependent routing of a two-component format), so the merge keeps main's mem_f16,
encode_norm_bits and 2-component swizzle, applies them to the new SCALED kinds as well, and passes
the swizzled channels into the shared typed-store encode function (Gen.format_encode_call, now 29
parameters). Gen.norm_encode_exact and EXACT_NORM_CODES go: encode_norm_bits does the same job.
The three expectedFailure tests pass now and pin the older stores to the oracle's words; cs_fmt_all's
16_16_SINT store is (x, 0) through its identity-selector V#. design.md keeps one Typed buffer formats
row; test_buffer_store_format's unsupported-format example is BUF_FMT_INVALID (8_USCALED is
supported now).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/buffer_formats.md')
| -rw-r--r-- | docs/buffer_formats.md | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/docs/buffer_formats.md b/docs/buffer_formats.md index 77f51e063..4a76a715e 100644 --- a/docs/buffer_formats.md +++ b/docs/buffer_formats.md | |||
| @@ -152,23 +152,18 @@ has no SCALED 10_10_10_2) are not in the table. | |||
| 152 | ## Where the translator stood, and what changed | 152 | ## Where the translator stood, and what changed |
| 153 | 153 | ||
| 154 | Decode of every format that was already in `Gen.FORMATS` matches the 880M word for word (the 32 old codes are in the | 154 | Decode of every format that was already in `Gen.FORMATS` matches the 880M word for word (the 32 old codes are in the |
| 155 | table above). **Differences found in the older stores, left as they are** (an existing format stays byte-identical in this | 155 | table above). **Three differences were found in the older stores**; main's SHADER-358 and SHADER-364 fixed them while this branch was open, |
| 156 | change; the three are pinned by an `expectedFailure` in `tests/semantic/test_buffer_formats_all.py`, which starts to | 156 | and `tests/semantic/test_buffer_formats_all.py` (`OlderStoresFollowTheGpu`) pins each to the oracle's words: |
| 157 | fail when someone fixes them): | ||
| 158 | 157 | ||
| 159 | 1. **16_FLOAT, 16_16_FLOAT and 16_16_16_16_FLOAT stores round to nearest even and overflow to infinity** (`Gen.f16_bits` | 158 | 1. **16_FLOAT, 16_16_FLOAT and 16_16_16_16_FLOAT stores** rounded to nearest even and overflowed to infinity; the 880M (and |
| 160 | without `rtz`); the 880M rounds toward zero and saturates to ±65504. In a 200-row sample of edge-heavy inputs, 89 of | 159 | gfx1036) round toward zero and saturate to ±65504 (`Gen.mem_f16`). This is the f16 *format* store, not the d16 data |
| 161 | 200 (16_FLOAT), 132 of 200 and 174 of 200 differed (mostly by 1 ulp). This is the f16 *format* store, not the d16 data | ||
| 162 | rounding of BUILD-161 (#1759). | 160 | rounding of BUILD-161 (#1759). |
| 163 | 2. **UNORM and SNORM stores multiply in f32 and round that**, which rounds twice. 0.3·65535 is 19660.5008 exactly and | 161 | 2. **UNORM and SNORM stores** multiplied in f32 and rounded that, which rounds twice (0.3·65535 is 19660.5008 exactly and |
| 164 | 19660.5 in f32, a tie that goes to 19660; the hardware stores 19661. In the same sample 0 of 200 differed for the 8-bit | 162 | 19660.5 in f32, a tie that went to 19660; the hardware stores 19661). They now round the exact product once |
| 165 | one-component formats and between 1 and 13 of 200 for the others (8_8_8_8_UNORM 9, 16_16_UNORM 7, 16_16_16_16_UNORM 12, | 163 | (`Gen.encode_norm_bits`), for the new SCALED and 10:10:10:2 formats too. |
| 166 | 10_10_10_2_UNORM 13, 2_10_10_10_UNORM 11). The new formats store with an exact integer product | 164 | 3. **A two-component format stored with `buffer_store_format_xyzw` or `_xy`** took (x, y). Through a V# with the identity |
| 167 | (`Gen.norm_encode_exact`). | 165 | selectors the hardware takes (x, w); with the runtime's X,Y,0,1 it takes (x, y); tbuffer takes (x, y). The translator now |
| 168 | 3. **A two-component format stored with `buffer_store_format_xyzw` or `_xy`** takes (x, y) in the translator and (x, w) on the 880M | 166 | chooses by `DST_SEL` as measured on gfx1036 (SHADER-364). This oracle runs the identity selectors only. |
| 169 | (26,523 elements in the run above, the last column of the table; `tbuffer_store_format_*` agrees with the translator). | ||
| 170 | The RDNA2 xy/xyz measurements in `cs_fmt_xy_xyz.asm` do not cover it. **Unresolved: the translator is unchanged until an RDNA2 | ||
| 171 | card shows which is right.** It is pinned as an `expectedFailure` too, and excluded from the validated count. | ||
| 172 | 167 | ||
| 173 | ## Not measured | 168 | ## Not measured |
| 174 | 169 | ||