compute: lower gfx1013 buffer_load_format from the descriptor format #2142

Merged
archielcqp-a11y merged 3 commits from upstream-pr/2150 into main 2026-11-25 02:23:24 +00:00
archielcqp-a11y commented 2026-11-25 01:44:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by archielcqp-a11y on 2026-11-25T01:44:53Z.


Refs #2022 (item A, first slice, as scoped in this comment)

Summary

compute_store_aot refused gfx1013 buffer_load_format_*. It now reads the t0 format at run time from V# word 3, the same way the descriptor-format stores (#1542) read theirs.

  • Format input: a ready s_buffer_load constant word, named once per formatted load with --load-format-constant, in program order.

  • Decode: one HLSL function, load_descriptor_format(formatWord, addr, channels). It accepts the same fixed bits as the stores (the GFX10 identity 0x01000FAC and the legacy identity 0x00000FAC) and the same formats:

    • 32-bit UINT and FLOAT, one to four channels;
    • 8_8_8_8_UNORM, 16_16_UNORM and 10_10_10_2_UNORM;
    • 16_16_FLOAT and 16_16_16_16_FLOAT;
    • 16-bit UNORM, SNORM, UINT, SINT and FLOAT.
  • Conversions: all integer arithmetic, so the result does not depend on the GPU's float division.

    • UNORM is x / (2^n - 1), rounded to nearest even binary32 by long division.
    • SNORM16 is max(x / 32767, -1), rounded the same way.
    • FLOAT16 widens exactly and keeps a NaN payload.
    • 16-bit UINT and SINT zero-extend and sign-extend the low halfword.

    Whether the RDNA buffer-format unit rounds the same way is not verified.

  • Invalid loads publish nothing (per the review on #2022). A load is valid only when its opcode reads exactly the format's channel count, the format is handled, and the fixed bits are an identity value. load_descriptor_format reports that validity. Every load is staged before the first store, and if any load is invalid the invocation returns before storing. The format words are uniform constants, so the whole dispatch leaves u0 unwritten, and zero data from a valid read stays distinguishable from a refusal.

  • Still refused:

    • the d16_ forms (I dropped them from the slice the comment described);
    • offen, a missing idxen, a misaligned offset, and a read that leaves the stride;
    • gfx1030, --source-format, and a missing, unready or unused format word.
  • Not in this PR: the descriptor is still the static t0 binding. Taking it from the heap at run time is slice 2, so the programs counted in #2022 are not unblocked yet.

Harness: a --compute-store-case file may now end with 320 t0 words (tests/compute_check.cpp). Without them, t0 keeps its generated input_word(i) words, so existing cases are unchanged.

Fixture

compute_store_aot_descriptor_load_format_{warp,hardware} and compute_load_format_controls (tests/compute_load_format_check.py).

Program: source-built gfx1013 assembly in LLVM 15 spelling. A group of four makes fourteen loads from an 80-byte t0 record into a 120-byte u0 record: one per format kind plus two legacy words, each with its matching opcode width.

Inputs: threads 0 to 3 carry chosen edge values:

  • 0 and full scale, and 1/65535;
  • -32768 and -32767;
  • FLOAT16 denormals, ±infinity, a quiet NaN with a payload, and -0;
  • all-zero fields.

Threads 4 to 7 are pseudo-random.

Reference: a Python model that rounds with Fraction.

Readback: all 320 words for one group and for two.

Invalid formats: four runs each make one load invalid, and each must leave all 320 words at the sentinel:

  • 8_SNORM;
  • an xyz opcode on 32_32_32_32_UINT;
  • an xy opcode on 32_FLOAT;
  • a non-identity DST_SEL.

On those runs, a reference that publishes zeros for the invalid load must fail, and so must one with the D3D (0, 0, 0, 1) fill for the xy opcode.

Negative controls:

  • Eight wrong references must fail on the valid run, at their first differing word:
    • a UNORM divided by 2^n, and a truncated UNORM;
    • an SNORM without the -1 clamp, and a zero-extended SINT16;
    • FLOAT16 halves swapped, and flushed denormals;
    • the legacy word ignored;
    • the neighbouring thread's element.
  • Seven mutated HLSL sources must fail on the valid run:
    • a ratio that never rounds up, and flushed denormal halves;
    • the SNORM sign dropped, and SNORM divided by 32768;
    • a zero-extended SINT16, and the legacy fixed bits ignored;
    • the format read from the wrong constant.
  • Four more must fail on the invalid runs: the refusal removed, a narrower or a wider opcode accepted, and the selectors ignored.
  • Dropping only the -1 clamp is not observable: long division of 32768 by 32767 also gives 1.0. I replaced that mutation and say so in the docs.
  • With the lowering removed, its channel count changed, or the refusal dropped, controls fails.
  • A control checks that the gfx1030 caller-format loads lower as before.

LLVM 15: assembles the fixture. lower of the disassembly and the CLI output both match lower of the source.

Results

Run at f3a6819 (on 38fa531), Windows 10 build 19045, debug layer enabled, 0 debug errors and 0 debug warnings on every dispatch.

Command WARP 1.0.22 (app-local) NVIDIA GeForce RTX 3080, driver 32.0.15.9174
tests/compute_load_format_check.py draw pass (27 s) pass (28 s)

Other checks:

  • tests/compute_load_format_check.py binary with LLVM 15 (llvm-mc -mcpu=gfx1013): pass.
  • tests/compute_load_format_check.py controls: pass.
  • tests/compute_store_check.py binary with LLVM 15: pass.
  • tests/compute_store_check.py draw-descriptor-store-format on WARP: pass. It uses the 16-constant case form.
  • tests/compute_alu_xor3_check.py draw on WARP: pass.
  • form_coverage_check, docs_links_check, bidi_controls_check and shader_census_check: pass.

CTest at f3a6819. The pull-request CI uses the pr smoke preset, which does not run these tests, so this local output is the readback evidence:

1/3 Test  #462: compute_load_format_controls ........................   Passed    3.09 sec
2/3 Test  #991: compute_store_aot_descriptor_load_format_hardware ...   Passed   11.16 sec
3/3 Test #1179: compute_store_aot_descriptor_load_format_warp .......   Passed   28.02 sec
100% tests passed, 0 tests failed out of 3

Each draw run ends with descriptor_load_format: 6 dispatches, 13 wrong references and 11 mutated sources checked.

No capability skips. The first WARP run took 46 s, so the new tests have a 120 s timeout.

cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R '^compute_(store_aot_descriptor_load_format_|load_format_controls$)' -V

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6595217144 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2150). Originally posted by [archielcqp-a11y](https://github.com/archielcqp-a11y) on 2026-11-25T01:44:53Z. --- Refs #2022 (item A, first slice, as scoped in [this comment](https://github.com/R0Y00/Xbox2Windows/issues/2022#issuecomment-7149454342)) ## Summary `compute_store_aot` refused gfx1013 `buffer_load_format_*`. It now reads the t0 format at run time from V# word 3, the same way the descriptor-format stores (#1542) read theirs. - **Format input:** a ready `s_buffer_load` constant word, named once per formatted load with `--load-format-constant`, in program order. - **Decode:** one HLSL function, `load_descriptor_format(formatWord, addr, channels)`. It accepts the same fixed bits as the stores (the GFX10 identity `0x01000FAC` and the legacy identity `0x00000FAC`) and the same formats: - 32-bit UINT and FLOAT, one to four channels; - `8_8_8_8_UNORM`, `16_16_UNORM` and `10_10_10_2_UNORM`; - `16_16_FLOAT` and `16_16_16_16_FLOAT`; - 16-bit UNORM, SNORM, UINT, SINT and FLOAT. - **Conversions:** all integer arithmetic, so the result does not depend on the GPU's float division. - UNORM is `x / (2^n - 1)`, rounded to nearest even binary32 by long division. - SNORM16 is `max(x / 32767, -1)`, rounded the same way. - FLOAT16 widens exactly and keeps a NaN payload. - 16-bit UINT and SINT zero-extend and sign-extend the low halfword. Whether the RDNA buffer-format unit rounds the same way is not verified. - **Invalid loads publish nothing** (per the [review on #2022](https://github.com/R0Y00/Xbox2Windows/issues/2022)). A load is valid only when its opcode reads exactly the format's channel count, the format is handled, and the fixed bits are an identity value. `load_descriptor_format` reports that validity. Every load is staged before the first store, and if any load is invalid the invocation returns before storing. The format words are uniform constants, so the whole dispatch leaves u0 unwritten, and zero data from a valid read stays distinguishable from a refusal. - **Still refused:** - the `d16_` forms (I dropped them from the slice the comment described); - `offen`, a missing `idxen`, a misaligned offset, and a read that leaves the stride; - gfx1030, `--source-format`, and a missing, unready or unused format word. - **Not in this PR:** the descriptor is still the static t0 binding. Taking it from the heap at run time is slice 2, so the programs counted in #2022 are not unblocked yet. **Harness:** a `--compute-store-case` file may now end with 320 t0 words (`tests/compute_check.cpp`). Without them, t0 keeps its generated `input_word(i)` words, so existing cases are unchanged. ## Fixture `compute_store_aot_descriptor_load_format_{warp,hardware}` and `compute_load_format_controls` (`tests/compute_load_format_check.py`). **Program:** source-built gfx1013 assembly in LLVM 15 spelling. A group of four makes fourteen loads from an 80-byte t0 record into a 120-byte u0 record: one per format kind plus two legacy words, each with its matching opcode width. **Inputs:** threads 0 to 3 carry chosen edge values: - 0 and full scale, and `1/65535`; - -32768 and -32767; - FLOAT16 denormals, ±infinity, a quiet NaN with a payload, and -0; - all-zero fields. Threads 4 to 7 are pseudo-random. **Reference:** a Python model that rounds with `Fraction`. **Readback:** all 320 words for one group and for two. **Invalid formats:** four runs each make one load invalid, and each must leave all 320 words at the sentinel: - `8_SNORM`; - an `xyz` opcode on `32_32_32_32_UINT`; - an `xy` opcode on `32_FLOAT`; - a non-identity `DST_SEL`. On those runs, a reference that publishes zeros for the invalid load must fail, and so must one with the D3D (0, 0, 0, 1) fill for the `xy` opcode. **Negative controls:** - Eight wrong references must fail on the valid run, at their first differing word: - a UNORM divided by `2^n`, and a truncated UNORM; - an SNORM without the -1 clamp, and a zero-extended SINT16; - FLOAT16 halves swapped, and flushed denormals; - the legacy word ignored; - the neighbouring thread's element. - Seven mutated HLSL sources must fail on the valid run: - a ratio that never rounds up, and flushed denormal halves; - the SNORM sign dropped, and SNORM divided by 32768; - a zero-extended SINT16, and the legacy fixed bits ignored; - the format read from the wrong constant. - Four more must fail on the invalid runs: the refusal removed, a narrower or a wider opcode accepted, and the selectors ignored. - Dropping only the -1 clamp is not observable: long division of 32768 by 32767 also gives 1.0. I replaced that mutation and say so in the docs. - With the lowering removed, its channel count changed, or the refusal dropped, `controls` fails. - A control checks that the gfx1030 caller-format loads lower as before. **LLVM 15:** assembles the fixture. `lower` of the disassembly and the CLI output both match `lower` of the source. ## Results Run at `f3a6819` (on `38fa531`), Windows 10 build 19045, debug layer enabled, 0 debug errors and 0 debug warnings on every dispatch. | Command | WARP 1.0.22 (app-local) | NVIDIA GeForce RTX 3080, driver 32.0.15.9174 | |---|---|---| | `tests/compute_load_format_check.py draw` | pass (27 s) | pass (28 s) | Other checks: - `tests/compute_load_format_check.py binary` with LLVM 15 (`llvm-mc -mcpu=gfx1013`): pass. - `tests/compute_load_format_check.py controls`: pass. - `tests/compute_store_check.py binary` with LLVM 15: pass. - `tests/compute_store_check.py draw-descriptor-store-format` on WARP: pass. It uses the 16-constant case form. - `tests/compute_alu_xor3_check.py draw` on WARP: pass. - `form_coverage_check`, `docs_links_check`, `bidi_controls_check` and `shader_census_check`: pass. CTest at `f3a6819`. The pull-request CI uses the `pr` smoke preset, which does not run these tests, so this local output is the readback evidence: ``` 1/3 Test #462: compute_load_format_controls ........................ Passed 3.09 sec 2/3 Test #991: compute_store_aot_descriptor_load_format_hardware ... Passed 11.16 sec 3/3 Test #1179: compute_store_aot_descriptor_load_format_warp ....... Passed 28.02 sec 100% tests passed, 0 tests failed out of 3 ``` Each draw run ends with `descriptor_load_format: 6 dispatches, 13 wrong references and 11 mutated sources checked`. No capability skips. The first WARP run took 46 s, so the new tests have a 120 s timeout. ```powershell cmake --build --preset dev --target offscreen_check ctest --preset dev --no-tests=error -R '^compute_(store_aot_descriptor_load_format_|load_format_controls$)' -V ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-25 03:01:07 +00:00
tedin7 commented 2026-11-25 03:01:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:09:06Z.

Review: COMMENTED


Review of head 95d75de097 (comment only).

Scope read: tools/compute_store_aot.py (new descriptor_load_hlsl, load lowering, --load-format-constant), tests/compute_check.cpp (optional t0 source words), tests/compute_load_format_check.py, CMake/CI wiring, docs.

Commands run locally (Linux, worktree at the head SHA):

  • git diff --stat origin/main...HEAD: 8 files, +644/-9.
  • python3 -B tests/compute_load_format_check.py controls: passes.
  • python3 tests/docs_links_check.py: self-test passed, 18 files, 399 links.
  • python3 tests/bidi_controls_check.py: 1438 files, no bidi controls.
  • git diff --check origin/main...HEAD: clean.
  • gh pr checks 2150: Linux checks, fixture assembly and "Build and test on Windows" pass; /O2 and chart publish skipped; PR is MERGEABLE, title is neutral.

Mutation (local, reverted with git checkout -- .):

  • Rounding tie in descriptor_ratio (r != 0u || odd -> odd) and snorm16 clamp (<= -32767 -> < -32767): controls still passes. That is expected, since controls only inspects translation text. These mutations can only be caught by the compute_store_aot_descriptor_load_format_<adapter> GPU readback, which has its own mutation list. I did not rerun that on Win2025.

Findings:

  • P1: none.
  • P2: none.
  • Nit: the Windows job log does not show the new compute_store_aot_descriptor_load_format_* test by name. Please paste the WARP ctest line in the PR body so the readback evidence is checkable.
  • Nit: descriptor_snorm16_load(uint half) reuses half as a parameter name. It matches the existing descriptor_rmw16 usage and compiles, but a different name would be safer.
  • Nit: in main(), the descriptor_format_constant= and rsrc2= lines have lost their indentation. This is cosmetic, not a behaviour change.

Notes: the whole-dispatch suppression on an invalid format is documented in the docstring and docs/experiments.md, and the unused-constant and not-ready-constant checks fail closed. I found no clean-room concerns; sources cited are public AMD ISA docs.

Not run: Win2025 WARP/GPU proof (relying on the PR's stated results and the green Windows CI job).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6050595809 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2150#pullrequestreview-6050595809). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T02:09:06Z. **Review:** COMMENTED --- Review of head 95d75de097854822362c99bc654e60d6aab5c639 (comment only). Scope read: `tools/compute_store_aot.py` (new `descriptor_load_hlsl`, load lowering, `--load-format-constant`), `tests/compute_check.cpp` (optional t0 source words), `tests/compute_load_format_check.py`, CMake/CI wiring, docs. Commands run locally (Linux, worktree at the head SHA): - `git diff --stat origin/main...HEAD`: 8 files, +644/-9. - `python3 -B tests/compute_load_format_check.py controls`: passes. - `python3 tests/docs_links_check.py`: self-test passed, 18 files, 399 links. - `python3 tests/bidi_controls_check.py`: 1438 files, no bidi controls. - `git diff --check origin/main...HEAD`: clean. - `gh pr checks 2150`: Linux checks, fixture assembly and "Build and test on Windows" pass; /O2 and chart publish skipped; PR is MERGEABLE, title is neutral. Mutation (local, reverted with `git checkout -- .`): - Rounding tie in `descriptor_ratio` (`r != 0u || odd` -> `odd`) and snorm16 clamp (`<= -32767` -> `< -32767`): `controls` still passes. That is expected, since `controls` only inspects translation text. These mutations can only be caught by the `compute_store_aot_descriptor_load_format_<adapter>` GPU readback, which has its own mutation list. I did not rerun that on Win2025. Findings: - P1: none. - P2: none. - Nit: the Windows job log does not show the new `compute_store_aot_descriptor_load_format_*` test by name. Please paste the WARP ctest line in the PR body so the readback evidence is checkable. - Nit: `descriptor_snorm16_load(uint half)` reuses `half` as a parameter name. It matches the existing `descriptor_rmw16` usage and compiles, but a different name would be safer. - Nit: in `main()`, the `descriptor_format_constant=` and `rsrc2=` lines have lost their indentation. This is cosmetic, not a behaviour change. Notes: the whole-dispatch suppression on an invalid format is documented in the docstring and `docs/experiments.md`, and the unused-constant and not-ready-constant checks fail closed. I found no clean-room concerns; sources cited are public AMD ISA docs. Not run: Win2025 WARP/GPU proof (relying on the PR's stated results and the green Windows CI job). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 03:01:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:20:16Z.

Review: COMMENTED


Review of head f3a6819f6b681edad9c4ab3efbb37638dc9d0e53. P1=0, P2=0.

Checked

  • Title is neutral and the PR is mergeable. Linux, fixtures and Windows CI jobs pass on this exact head. The /O2 job is skipped.
  • descriptor_ratio: the long division gives exponent 126 - lead, 24 mantissa bits plus one round bit, and sticky r != 0. Ties go to even and a carry reaches the exponent. The loop runs at most 41 of its 48 steps for d < 2^16, so it always finishes.
  • descriptor_half: the denormal exponent is top + 103 and the mantissa shift is 23 - top. Inf and NaN payloads are preserved.
  • SNORM16 maps -32768 and -32767 to -1.0. SINT16 sign-extends with (int)(x << 16) >> 16.
  • Validity: the fixed bits must be an identity value, the format must be known, and the channel count must equal the opcode's. Otherwise return suppresses every store, as agreed on #2022.
  • The format-constant bookkeeping rejects missing, unused and not-yet-ready constants. d16 loads are refused.

Commands run locally

  • python3 tests/compute_load_format_check.py printed nothing and exited 0.
  • python3 tests/docs_links_check.py: 18 files, 399 links.
  • python3 tests/bidi_controls_check.py: clean.
  • git diff --check origin/main...HEAD: clean.

Mutations

  • I mutated the new HLSL three times: exponent 126u to 125u, dropped the sticky bit in the rounding, and SNORM clamp <= -32767 to < -32767.
  • The Linux controls mode exited 0 for all three. It never runs the HLSL, so only the Windows draw mode can catch them.
  • That mode carries its own mutated-shader checks, and compute_store_aot_descriptor_load_format_* is wired into CTest and windows.yml.
  • I did not reproduce a Windows run. The win2025 helper refused ("PowerShell -EncodedCommand length (22904 chars) exceeds Windows cmd.exe 8,191-char limit"). The Windows job on this head is green. I could not confirm from here that the WARP test ran rather than hit its skip code (77).

Nits

  • tools/compute_store_aot.py, read-bounds check: read_bytes = 4 * components rejects a load whose real footprint is smaller. For example, 8_8_8_8 xyzw at offset 0 uses 4 bytes but needs 16 inside source_stride. This is safe (it only refuses), but it is stricter than the format. A one-line comment would help.
  • The Linux controls mode checks only the Python reference, so it can't catch HLSL regressions. A sentence in docs/experiments.md saying so would avoid false confidence.

The PR body says the RDNA buffer-format unit's rounding is unverified, and I agree that is the open risk.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6050736190 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2150#pullrequestreview-6050736190). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T02:20:16Z. **Review:** COMMENTED --- Review of head `f3a6819f6b681edad9c4ab3efbb37638dc9d0e53`. P1=0, P2=0. **Checked** - Title is neutral and the PR is mergeable. Linux, fixtures and Windows CI jobs pass on this exact head. The /O2 job is skipped. - `descriptor_ratio`: the long division gives exponent `126 - lead`, 24 mantissa bits plus one round bit, and sticky `r != 0`. Ties go to even and a carry reaches the exponent. The loop runs at most 41 of its 48 steps for d < 2^16, so it always finishes. - `descriptor_half`: the denormal exponent is `top + 103` and the mantissa shift is `23 - top`. Inf and NaN payloads are preserved. - SNORM16 maps -32768 and -32767 to -1.0. SINT16 sign-extends with `(int)(x << 16) >> 16`. - Validity: the fixed bits must be an identity value, the format must be known, and the channel count must equal the opcode's. Otherwise `return` suppresses every store, as agreed on #2022. - The format-constant bookkeeping rejects missing, unused and not-yet-ready constants. d16 loads are refused. **Commands run locally** - `python3 tests/compute_load_format_check.py` printed nothing and exited 0. - `python3 tests/docs_links_check.py`: 18 files, 399 links. - `python3 tests/bidi_controls_check.py`: clean. - `git diff --check origin/main...HEAD`: clean. **Mutations** - I mutated the new HLSL three times: exponent `126u` to `125u`, dropped the sticky bit in the rounding, and SNORM clamp `<= -32767` to `< -32767`. - The Linux `controls` mode exited 0 for all three. It never runs the HLSL, so only the Windows `draw` mode can catch them. - That mode carries its own mutated-shader checks, and `compute_store_aot_descriptor_load_format_*` is wired into CTest and `windows.yml`. - I did not reproduce a Windows run. The `win2025` helper refused ("PowerShell -EncodedCommand length (22904 chars) exceeds Windows cmd.exe 8,191-char limit"). The Windows job on this head is green. I could not confirm from here that the WARP test ran rather than hit its skip code (77). **Nits** - `tools/compute_store_aot.py`, read-bounds check: `read_bytes = 4 * components` rejects a load whose real footprint is smaller. For example, `8_8_8_8` xyzw at offset 0 uses 4 bytes but needs 16 inside `source_stride`. This is safe (it only refuses), but it is stricter than the format. A one-line comment would help. - The Linux `controls` mode checks only the Python reference, so it can't catch HLSL regressions. A sentence in `docs/experiments.md` saying so would avoid false confidence. The PR body says the RDNA buffer-format unit's rounding is unverified, and I agree that is the open risk. AI-assisted; commands listed were executed locally.
archielcqp-a11y commented 2026-11-25 03:01:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by archielcqp-a11y on 2026-11-25T02:17:07Z.


@tedin7 thanks for the review. All three nits are addressed in f3a6819:

  • WARP ctest line: now in the description. The pull-request CI runs the pr smoke preset, which doesn't include this test, so the description now carries the local CTest output for the controls and both adapters.
  • half parameter: descriptor_snorm16_load now takes bits16.
  • Indentation in main(): the two lower() argument lines are indented like the rest of the call.

No behaviour change. Controls, the LLVM 15 round trip and both readbacks pass again.

On the two mutations you noted (the tie rule in descriptor_ratio and <= -32767 to < -32767), neither can change a result here:

  • Tie rule: UNORM and SNORM16 divide by an odd number, so x / d never ends in an exact binary tie.
  • SNORM clamp: -32767 / 32767 is exactly -1.0 either way.

The GPU mutation list therefore covers rounding with the never-rounds-up form, and SNORM with the sign and divisor forms.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7150532769 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2150#issuecomment-7150532769). Originally posted by [archielcqp-a11y](https://github.com/archielcqp-a11y) on 2026-11-25T02:17:07Z. --- @tedin7 thanks for the review. All three nits are addressed in `f3a6819`: - **WARP ctest line:** now in the description. The pull-request CI runs the `pr` smoke preset, which doesn't include this test, so the description now carries the local CTest output for the controls and both adapters. - **`half` parameter:** `descriptor_snorm16_load` now takes `bits16`. - **Indentation in `main()`:** the two `lower()` argument lines are indented like the rest of the call. No behaviour change. Controls, the LLVM 15 round trip and both readbacks pass again. On the two mutations you noted (the tie rule in `descriptor_ratio` and `<= -32767` to `< -32767`), neither can change a result here: - **Tie rule:** UNORM and SNORM16 divide by an odd number, so `x / d` never ends in an exact binary tie. - **SNORM clamp:** `-32767 / 32767` is exactly -1.0 either way. The GPU mutation list therefore covers rounding with the never-rounds-up form, and SNORM with the sign and divisor forms.
Sign in to join this conversation.
No reviewers
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!2142
No description provided.