startup: lower v_pack_b32_f16 with op_sel and neg/abs in gfx2hlsl #2467

Merged
denn0x merged 5 commits from upstream-pr/2475 into main 2026-11-25 23:30:04 +00:00
denn0x commented 2026-11-25 17:48:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-25T17:48:08Z.


What

tools/startup/gfx2hlsl.py had no handler for v_pack_b32_f16, so a stage that uses it was refused.

It now lowers D[15:0] = S0.f16, D[31:16] = S1.f16 (AMD RDNA 2 ISA, VOP3 V_PACK_B32_F16):

  • op_sel: op_sel[i] selects the high half of source i. LLVM 15 declares the instruction VOP3_OPSEL.
  • neg and abs: both act on bit 15 of the selected half, abs first.
  • Bit copy: the halves are copied as bits, the same way pixel_aot lowers this instruction. No binary16 denormal flush and no NaN quieting is modelled. This is an assumption; it was not measured.
  • Sources: VGPR and SGPR only. An inline float constant on a binary16 operand is a binary16 value, which u() would give as the binary32 word, so constants are refused.
  • Refused: a destination op_sel bit and clamp.

The instruction was refused before, so no stage that already translated changes. The cache revision stays as it is.

Test

tests/startup_gfx2hlsl_pack_b32_f16_check.py (new). It is registered in CMake as startup_gfx2hlsl_pack_b32_f16, in the Python CI list and in AGENTS.md.

The fixture is synthetic VOP3 words, and the check asserts the decoder's printed op_sel and modifier forms. For every op_sel[0..1] × abs × neg combination, the emitted expression is evaluated in Python over sample register pairs. The result is compared with a bit reference written in the test (2304 cases). An SGPR source is checked as well.

  • Controls (refused): destination op_sel, clamp, the inline float 1.0, the inline integer 1.
  • Negative controls:
    • an expression with the halves swapped is caught by the reference;
    • so is an expression that applies neg before abs;
    • without op_v_pack_b32_f16 the instruction is refused, as on main.
python -B tests/startup_gfx2hlsl_pack_b32_f16_check.py
pack_b32_f16: 2304 (op_sel, abs, neg, value) cases match the reference; SGPR source accepted; swapped halves and neg-before-abs caught; destination op_sel, clamp and constants refused; refused without the handler

On main, the check fails with gfx2hlsl.Unsupported: v_pack_b32_f16. The emitted expression form compiles with dxc 1.8.2502 cs_6_0.

  • Translator checks: every tests/startup_gfx2hlsl_*_check.py, tests/startup_image_*_check.py (except the device-only startup_image_get_lod_view_check.py, which needs a device), startup_translator_check.py, startup_flat_param_check.py, startup_inline_sampler_check.py and startup_compute_request_offline_check.py pass.
  • Build: all builds (Ninja Release, MSVC Build Tools 18, Windows 10.0.26300). Device-free, so there were no GPU runs and no capability skips.

Refs #1723

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6610349055 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2475). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-25T17:48:08Z. --- ## What `tools/startup/gfx2hlsl.py` had no handler for `v_pack_b32_f16`, so a stage that uses it was refused. It now lowers `D[15:0] = S0.f16, D[31:16] = S1.f16` (AMD RDNA 2 ISA, VOP3 `V_PACK_B32_F16`): - **op_sel:** `op_sel[i]` selects the high half of source i. LLVM 15 declares the instruction `VOP3_OPSEL`. - **neg and abs:** both act on bit 15 of the selected half, abs first. - **Bit copy:** the halves are copied as bits, the same way `pixel_aot` lowers this instruction. No binary16 denormal flush and no NaN quieting is modelled. This is an assumption; it was not measured. - **Sources:** VGPR and SGPR only. An inline float constant on a binary16 operand is a binary16 value, which `u()` would give as the binary32 word, so constants are refused. - **Refused:** a destination op_sel bit and clamp. The instruction was refused before, so no stage that already translated changes. The cache revision stays as it is. ## Test `tests/startup_gfx2hlsl_pack_b32_f16_check.py` (new). It is registered in CMake as `startup_gfx2hlsl_pack_b32_f16`, in the Python CI list and in AGENTS.md. The fixture is synthetic VOP3 words, and the check asserts the decoder's printed op_sel and modifier forms. For every op_sel[0..1] × abs × neg combination, the emitted expression is evaluated in Python over sample register pairs. The result is compared with a bit reference written in the test (2304 cases). An SGPR source is checked as well. - **Controls (refused):** destination op_sel, clamp, the inline float `1.0`, the inline integer `1`. - **Negative controls:** - an expression with the halves swapped is caught by the reference; - so is an expression that applies neg before abs; - without `op_v_pack_b32_f16` the instruction is refused, as on `main`. ``` python -B tests/startup_gfx2hlsl_pack_b32_f16_check.py pack_b32_f16: 2304 (op_sel, abs, neg, value) cases match the reference; SGPR source accepted; swapped halves and neg-before-abs caught; destination op_sel, clamp and constants refused; refused without the handler ``` On `main`, the check fails with `gfx2hlsl.Unsupported: v_pack_b32_f16`. The emitted expression form compiles with dxc 1.8.2502 `cs_6_0`. - **Translator checks:** every `tests/startup_gfx2hlsl_*_check.py`, `tests/startup_image_*_check.py` (except the device-only `startup_image_get_lod_view_check.py`, which needs a device), `startup_translator_check.py`, `startup_flat_param_check.py`, `startup_inline_sampler_check.py` and `startup_compute_request_offline_check.py` pass. - **Build:** `all` builds (Ninja Release, MSVC Build Tools 18, Windows 10.0.26300). Device-free, so there were no GPU runs and no capability skips. Refs #1723
tedin7 commented 2026-11-25 19:03:56 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Review of head b340d16 (gfx2hlsl lowering of v_pack_b32_f16, 5 files). This PR does not claim startup progress, so no game result is needed. Merge is a decision for @R0Y00 (see the open point below).

Code (tools/startup/gfx2hlsl.py, op_v_pack_b32_f16)

  • op_sel picks the high half per source; abs is applied before neg on bit 15; the low half uses low16_only. This matches the stated semantics.
  • Refusals are conservative: destination op_sel, clamp, constants, any other modifier, non-VGPR/SGPR sources, ranges wider than one register.
  • The instruction raised Unsupported before, so no stage that already translated changes. The unchanged cache revision is consistent with that.
  • Bit-copy semantics (no denormal flush, no NaN quieting) match the merged pixel_aot lowering (#1001, #1013). The PR says openly that this is an assumption and not measured.

Test (tests/startup_gfx2hlsl_pack_b32_f16_check.py)

  • Registered in CMake, the Linux CI list in windows.yml, and AGENTS.md. The PR's own Linux CI run executed it (ok, 2304 cases), so the changed workflow line is exercised.
  • Open point for @R0Y00: the repo rule for shader/math lowerings is a real D3D12 WARP GPU readback against a CPU reference. This test evaluates the emitted expression in Python against a bit reference, and the PR body says only that the form compiles with dxc cs_6_0. There is no WARP readback. The expression is plain integer shifts, masks and xor, so the risk is low, but the rule is not met as written. Whether to accept or ask for a WARP case is your call.

Mutations I ran locally (each made the check fail; then reverted)

  • High-half shift >> 16 changed to >> 15: AssertionError on op_sel:[1,0,0].
  • Sign flip ^ 0x8000u changed to ^ 0x4000u: AssertionError on -v1.

Duplicates and siblings

  • gh pr list --state all --search v_pack_b32_f16: only #1001 and #1013 (both merged, pixel_aot side). No open PR covers the gfx2hlsl lowering. No other open or merged PR covers this slice.
  • No FETCH_*-style sibling table is involved. The PR body cites #1723, and the PR does not depend on another PR.

Windows results

  • The author's body reports a local Windows build and the translator checks, with no head SHA. I did not re-run them and cannot say which head they cover.
  • PR CI on b340d16: Windows build/test pass, Linux Python checks pass, gfx1013 fixtures pass; two jobs skipped.

Commands run locally (Linux worktree at the head SHA)

  • python3 -B tests/startup_gfx2hlsl_pack_b32_f16_check.py: pass
  • git diff --check origin/main...HEAD: clean
  • python3 tests/docs_links_check.py: pass
  • python3 tests/bidi_controls_check.py: pass
  • Two mutations as above.

No Windows VM was used, no update-branch, no merge action.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6063065072 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2475#pullrequestreview-6063065072). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T18:41:20Z. **Review:** COMMENTED --- Review of head b340d16 (gfx2hlsl lowering of `v_pack_b32_f16`, 5 files). This PR does not claim startup progress, so no game result is needed. Merge is a decision for @R0Y00 (see the open point below). **Code (`tools/startup/gfx2hlsl.py`, `op_v_pack_b32_f16`)** - op_sel picks the high half per source; abs is applied before neg on bit 15; the low half uses `low16_only`. This matches the stated semantics. - Refusals are conservative: destination op_sel, clamp, constants, any other modifier, non-VGPR/SGPR sources, ranges wider than one register. - The instruction raised `Unsupported` before, so no stage that already translated changes. The unchanged cache revision is consistent with that. - Bit-copy semantics (no denormal flush, no NaN quieting) match the merged pixel_aot lowering (#1001, #1013). The PR says openly that this is an assumption and not measured. **Test (`tests/startup_gfx2hlsl_pack_b32_f16_check.py`)** - Registered in CMake, the Linux CI list in `windows.yml`, and AGENTS.md. The PR's own Linux CI run executed it (`ok`, 2304 cases), so the changed workflow line is exercised. - Open point for @R0Y00: the repo rule for shader/math lowerings is a real D3D12 WARP GPU readback against a CPU reference. This test evaluates the emitted expression in Python against a bit reference, and the PR body says only that the form compiles with dxc `cs_6_0`. There is no WARP readback. The expression is plain integer shifts, masks and xor, so the risk is low, but the rule is not met as written. Whether to accept or ask for a WARP case is your call. **Mutations I ran locally (each made the check fail; then reverted)** - High-half shift `>> 16` changed to `>> 15`: AssertionError on `op_sel:[1,0,0]`. - Sign flip `^ 0x8000u` changed to `^ 0x4000u`: AssertionError on `-v1`. **Duplicates and siblings** - `gh pr list --state all --search v_pack_b32_f16`: only #1001 and #1013 (both merged, pixel_aot side). No open PR covers the gfx2hlsl lowering. No other open or merged PR covers this slice. - No `FETCH_*`-style sibling table is involved. The PR body cites #1723, and the PR does not depend on another PR. **Windows results** - The author's body reports a local Windows build and the translator checks, with no head SHA. I did not re-run them and cannot say which head they cover. - PR CI on b340d16: Windows build/test pass, Linux Python checks pass, gfx1013 fixtures pass; two jobs skipped. **Commands run locally (Linux worktree at the head SHA)** - `python3 -B tests/startup_gfx2hlsl_pack_b32_f16_check.py`: pass - `git diff --check origin/main...HEAD`: clean - `python3 tests/docs_links_check.py`: pass - `python3 tests/bidi_controls_check.py`: pass - Two mutations as above. No Windows VM was used, no `update-branch`, no merge action. AI-assisted; commands listed were executed locally.
ChazY11 commented 2026-11-25 19:04:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:01:38Z.


Seven mutations on the handler body, all caught — including the abs/neg order the docstring calls out

Baseline: pack_b32_f16: 2304 (op_sel, abs, neg, value) cases match the reference; SGPR source accepted; swapped halves and neg-before-abs caught; destination op_sel, clamp and constants refused; refused without the handler, exit 0, and the whole startup_gfx2hlsl_* family passes.

mutation of op_v_pack_b32_f16 result
halves emitted in the other order (`halves[1] halves[0] << 16`)
abs mask widened & 0x7fffu → & 0xffffu caught
the neg ^ 0x8000u dropped caught
abs and neg swapped in order (xor first, then mask) caught
destination op_sel bit accepted (sel[2] check removed) caught
SGPR source refused instead of accepted caught
op_sel ignored (all three selection bits forced to 1) caught

The fourth row is the one that matters most and the one I expected to survive: applying neg first and abs second is a plausible transcription of "neg and abs act on bit 15", and it is wrong — the mask would clear the sign bit that the xor just set, so -|x| would come out as |x|. Your fixture kills it, which means the abs first, then neg sentence in the docstring is actually pinned rather than merely stated.

One thing worth knowing about the fixture's own strength

2304 cases is the full cross product of (op_sel, abs, neg) — 2³ selection × 2² modifiers × 16 half patterns? Whatever the exact factorisation, the count is high enough that the four bit-level mutations above cannot pass by luck, and I would leave the size alone even though it costs runtime, because this is the only place in the tree that models the f16 sign bit.

Two small suggestions

  1. half = '(%s >> 16)' % self.u(tok) for sel[i] but self.u(tok, low16_only=True) otherwise — the asymmetry is correct (the high half needs the whole word, the low half does not), but it reads like an inconsistency. A one-word comment there would save the next reader a minute.
  2. The mods loop accepts exactly one op_sel:[a,b,c] token and refuses anything else — that is right for VOP3A, and it means an op_sel on a _e64 form with a different spelling is a refusal rather than a silent default. Worth one line in the docstring, since the pattern is stricter than it looks.

The docstring's honesty about what is not modelled — binary16 denormal flush, NaN quieting, "an assumption, not measured" — is exactly what a reader needs to decide whether this lowering applies to their shader.

AI-assisted; the seven mutations were run locally on Windows 11 build 26300.9974.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170334687 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2475#issuecomment-7170334687). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T18:01:38Z. --- ## Seven mutations on the handler body, all caught — including the abs/neg order the docstring calls out Baseline: `pack_b32_f16: 2304 (op_sel, abs, neg, value) cases match the reference; SGPR source accepted; swapped halves and neg-before-abs caught; destination op_sel, clamp and constants refused; refused without the handler`, exit 0, and the whole `startup_gfx2hlsl_*` family passes. | mutation of `op_v_pack_b32_f16` | result | |---|---| | halves emitted in the other order (`halves[1] | halves[0] << 16`) | **caught** | | abs mask widened `& 0x7fffu` → `& 0xffffu` | **caught** | | the neg `^ 0x8000u` dropped | **caught** | | **abs and neg swapped in order** (xor first, then mask) | **caught** | | destination `op_sel` bit accepted (`sel[2]` check removed) | **caught** | | SGPR source refused instead of accepted | **caught** | | `op_sel` ignored (all three selection bits forced to 1) | **caught** | The fourth row is the one that matters most and the one I expected to survive: applying `neg` first and `abs` second is a plausible transcription of "neg and abs act on bit 15", and it is wrong — the mask would clear the sign bit that the xor just set, so `-|x|` would come out as `|x|`. Your fixture kills it, which means the `abs first, then neg` sentence in the docstring is actually pinned rather than merely stated. ## One thing worth knowing about the fixture's own strength `2304 cases` is the full cross product of (op_sel, abs, neg) — 2³ selection × 2² modifiers × 16 half patterns? Whatever the exact factorisation, the count is high enough that the four bit-level mutations above cannot pass by luck, and I would leave the size alone even though it costs runtime, because this is the only place in the tree that models the f16 sign bit. ## Two small suggestions 1. **`half = '(%s >> 16)' % self.u(tok)` for `sel[i]` but `self.u(tok, low16_only=True)` otherwise** — the asymmetry is correct (the high half needs the whole word, the low half does not), but it reads like an inconsistency. A one-word comment there would save the next reader a minute. 2. **The `mods` loop accepts exactly one `op_sel:[a,b,c]` token and refuses anything else** — that is right for VOP3A, and it means an `op_sel` on a `_e64` form with a different spelling is a refusal rather than a silent default. Worth one line in the docstring, since the pattern is stricter than it looks. The docstring's honesty about what is *not* modelled — binary16 denormal flush, NaN quieting, "an assumption, not measured" — is exactly what a reader needs to decide whether this lowering applies to their shader. AI-assisted; the seven mutations were run locally on Windows 11 build 26300.9974.
denn0x commented 2026-11-25 19:04:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-25T18:02:50Z.


Thanks for the mutation run. I took both suggestions in a comments-only commit: there is now a note on why the high half reads the whole word and the low half only bits 15:0, and the docstring says that any modifier other than the one op_sel:[a,b,c] spelling is refused. The check still reports 2304 cases.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170362671 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2475#issuecomment-7170362671). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-25T18:02:50Z. --- Thanks for the mutation run. I took both suggestions in a comments-only commit: there is now a note on why the high half reads the whole word and the low half only bits 15:0, and the docstring says that any modifier other than the one `op_sel:[a,b,c]` spelling is refused. The check still reports 2304 cases.
tedin7 commented 2026-11-25 20:04:23 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Review of head b340d16c (against current main).

What is good:

  • op_v_pack_b32_f16 (tools/startup/gfx2hlsl.py): op_sel, abs-then-neg on bit 15, low half reads only bits 15:0, constants and dst op_sel/clamp refused. Matches the ISA text in the docstring.
  • No other open or merged PR covers v_pack_b32_f16 in gfx2hlsl. The registrations (CMake, windows.yml list, AGENTS.md) are consistent.

Blocking, missing test type:

  • The new check evaluates the emitted expression in Python against a Python bit reference (tests/startup_gfx2hlsl_pack_b32_f16_check.py). It never compiles the HLSL or runs it on D3D12 WARP. A shader/math lowering needs a real WARP draw with GPU readback compared to a CPU reference. Sibling checks already do it with the shared startup_gfx2hlsl_lane_alu helpers (check_draw, draw <dxc> <offscreen_check> <warp|hardware>; see tests/startup_gfx2hlsl_cvt_pk_u8_check.py, startup_gfx2hlsl_mul_hi_check.py).
  • Why it matters here: the Python eval cannot catch HLSL-side problems such as uint shift/precedence, how u(..., low16_only=True) is emitted, or ^ 0x8000u typing. All of these are only seen by dxc plus the GPU result.
  • Fix: move the check onto the lane_alu family (an ops/draw/mutations entry for v_pack_b32_f16, with the op_sel x abs x neg sets as draw inputs, two mutations such as swapped halves and neg before abs), or add a draw mode to this check. Keep the current 2304-case Python reference as a cheap Linux check.

Commands run locally: python3 -B tests/startup_gfx2hlsl_pack_b32_f16_check.py (pass); one mutation (halves swapped in the handler) made it fail as expected; python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py, git diff --check origin/main...HEAD (OK). No Win2025 run: stopped at review, and the branch is 24 behind main (needs update-branch before merge).

Not merged for now.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6063400228 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2475#pullrequestreview-6063400228). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T19:06:45Z. **Review:** COMMENTED --- Review of head b340d16c (against current main). What is good: - `op_v_pack_b32_f16` (`tools/startup/gfx2hlsl.py`): op_sel, abs-then-neg on bit 15, low half reads only bits 15:0, constants and dst op_sel/clamp refused. Matches the ISA text in the docstring. - No other open or merged PR covers `v_pack_b32_f16` in gfx2hlsl. The registrations (CMake, `windows.yml` list, AGENTS.md) are consistent. Blocking, missing test type: - The new check evaluates the emitted expression in Python against a Python bit reference (`tests/startup_gfx2hlsl_pack_b32_f16_check.py`). It never compiles the HLSL or runs it on D3D12 WARP. A shader/math lowering needs a real WARP draw with GPU readback compared to a CPU reference. Sibling checks already do it with the shared `startup_gfx2hlsl_lane_alu` helpers (`check_draw`, `draw <dxc> <offscreen_check> <warp|hardware>`; see `tests/startup_gfx2hlsl_cvt_pk_u8_check.py`, `startup_gfx2hlsl_mul_hi_check.py`). - Why it matters here: the Python eval cannot catch HLSL-side problems such as `uint` shift/precedence, how `u(..., low16_only=True)` is emitted, or `^ 0x8000u` typing. All of these are only seen by dxc plus the GPU result. - Fix: move the check onto the `lane_alu` family (an `ops`/`draw`/`mutations` entry for `v_pack_b32_f16`, with the op_sel x abs x neg sets as draw inputs, two mutations such as swapped halves and neg before abs), or add a `draw` mode to this check. Keep the current 2304-case Python reference as a cheap Linux check. Commands run locally: `python3 -B tests/startup_gfx2hlsl_pack_b32_f16_check.py` (pass); one mutation (halves swapped in the handler) made it fail as expected; `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py`, `git diff --check origin/main...HEAD` (OK). No Win2025 run: stopped at review, and the branch is 24 behind main (needs update-branch before merge). Not merged for now. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-26 00:00:45 +00:00
tedin7 commented 2026-11-26 00:00:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:26:30Z.

Review: COMMENTED


Review of head 3d5bb508 against origin/main (comment review).

Checked:

  • op_v_pack_b32_f16: op_sel selects the high half per source, abs is applied before neg on bit 15, the low half reads only bits 15:0, the high half reads the whole word. Constants, destination op_sel, clamp and unknown modifiers are refused. No sibling handler or table is left out; no other open PR covers this slice (#1001 and #1013 are the merged pixel_aot lowering it mirrors).
  • Test: the Python check covers 2304 (op_sel, abs, neg, value) cases against a bit reference, plus SGPR and refusal controls. The new startup_gfx2hlsl_pack_b32_f16_{warp,hardware} tests add a real D3D12 draw with readback. CMake, the Python CI list and AGENTS.md are all registered.

Commands run locally on a worktree at the exact head:

  • python3 -B tests/startup_gfx2hlsl_pack_b32_f16_check.py: passes.
  • python3 tests/docs_links_check.py: ok. python3 tests/bidi_controls_check.py: ok. git diff --check origin/main...HEAD: clean.
  • Mutations, each makes the check fail: dropping the abs mask, changing the neg mask to 0x4000, inverting the op_sel choice.

Not verified here: the D3D12 draw tests (no Windows run in this review). The only workflow change is one added line in the Python CI list.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6066395998 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2475#pullrequestreview-6066395998). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T23:26:30Z. **Review:** COMMENTED --- Review of head `3d5bb508` against origin/main (comment review). Checked: - `op_v_pack_b32_f16`: op_sel selects the high half per source, abs is applied before neg on bit 15, the low half reads only bits 15:0, the high half reads the whole word. Constants, destination op_sel, clamp and unknown modifiers are refused. No sibling handler or table is left out; no other open PR covers this slice (#1001 and #1013 are the merged `pixel_aot` lowering it mirrors). - Test: the Python check covers 2304 (op_sel, abs, neg, value) cases against a bit reference, plus SGPR and refusal controls. The new `startup_gfx2hlsl_pack_b32_f16_{warp,hardware}` tests add a real D3D12 draw with readback. CMake, the Python CI list and AGENTS.md are all registered. Commands run locally on a worktree at the exact head: - `python3 -B tests/startup_gfx2hlsl_pack_b32_f16_check.py`: passes. - `python3 tests/docs_links_check.py`: ok. `python3 tests/bidi_controls_check.py`: ok. `git diff --check origin/main...HEAD`: clean. - Mutations, each makes the check fail: dropping the abs mask, changing the neg mask to `0x4000`, inverting the op_sel choice. Not verified here: the D3D12 draw tests (no Windows run in this review). The only workflow change is one added line in the Python CI list. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-26 00:01:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T23:23:34Z.


I added the independent D3D12 draw requested in review and resolved the adjacent CMake registrations against current main. On 3d5bb508, ctest --preset release --no-tests=error -R '^startup_gfx2hlsl_(pack_b32_f16($|_)|cvt_pk_int16_controls$|cvt_off_f32_i4_controls$)' -V passed 5/5, zero skips. WARP and RTX 4060 Laptop matched the four packed integer words under FXC and DXC. Removing negation changes the expected words and fails the readback on both. This validates the desktop lowering and bit-preservation controls. The updated head is ready for the required CI.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7177496910 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2475#issuecomment-7177496910). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T23:23:34Z. --- I added the independent D3D12 draw requested in review and resolved the adjacent CMake registrations against current main. On `3d5bb508`, `ctest --preset release --no-tests=error -R '^startup_gfx2hlsl_(pack_b32_f16($|_)|cvt_pk_int16_controls$|cvt_off_f32_i4_controls$)' -V` passed 5/5, zero skips. WARP and RTX 4060 Laptop matched the four packed integer words under FXC and DXC. Removing negation changes the expected words and fails the readback on both. This validates the desktop lowering and bit-preservation controls. The updated head is ready for the required CI.
tedin7 commented 2026-11-26 00:01:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:29:48Z.


Win2025 WARP receipt for head 729eb037 after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 729eb0379dad7e51d2b8d19420c8840adc1c28e8:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 0.47s (configure 1.78s)
    • Test (ctest --preset dev -R '^startup_gfx2hlsl_pack_b32_f16($|_warp$)' --parallel 6 --no-tests=error --output-on-failure): 2/2 passed (0.63s: startup_gfx2hlsl_pack_b32_f16 0.14s, startup_gfx2hlsl_pack_b32_f16_warp 0.52s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 0.90s (configure 1.81s)
    • Test (ctest --preset release -R '^startup_gfx2hlsl_pack_b32_f16($|_warp$)' --parallel 6 --no-tests=error --output-on-failure): 2/2 passed (0.59s: startup_gfx2hlsl_pack_b32_f16 0.14s, startup_gfx2hlsl_pack_b32_f16_warp 0.48s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (0.6s), tests/startup_buffer_address_check.py ok (0.4s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_request_offline_check.py ok (0.5s), tests/startup_compute_store_format_xyzw_check.py ok (0.3s), tests/startup_compute_translate_check.py ok (0.2s), tests/startup_flat_param_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.1s), tests/startup_gfx2hlsl_bit_alu_check.py ok (0.7s), tests/startup_gfx2hlsl_capture_check.py ok (0.9s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.3s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.3s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.1s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.2s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.1s), tests/startup_gfx2hlsl_f32_nan_check.py ok (4.2s), tests/startup_gfx2hlsl_fma_mix_check.py ok (0.1s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.1s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.1s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.1s), tests/startup_gfx2hlsl_interp_p2_hi_check.py ok (0.2s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.2s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.1s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.3s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (2.2s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.1s), tests/startup_gfx2hlsl_refusals_check.py ok (0.5s), tests/startup_gfx2hlsl_root_check.py ok (0.7s), tests/startup_gfx2hlsl_sad_check.py ok (0.3s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_table_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.2s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.1s), tests/startup_gfx2hlsl_shift64_check.py ok (0.2s), tests/startup_gfx2hlsl_sload_const_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (4.9s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (0.8s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.1s), tests/startup_gfx2hlsl_swap_check.py ok (0.2s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (3.8s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.3s), tests/startup_image_2d_array_check.py ok (0.1s), tests/startup_image_3d_check.py ok (0.1s), tests/startup_image_gather_lz_check.py ok (0.5s), tests/startup_image_load_d16_check.py ok (0.8s), tests/startup_image_sample_a16_check.py ok (0.2s), tests/startup_image_sample_b_check.py ok (0.2s), tests/startup_image_sample_c_check.py ok (0.2s), tests/startup_image_sample_l_check.py ok (0.2s), tests/startup_image_sample_lod_check.py ok (0.5s), tests/startup_inline_sampler_check.py ok (0.1s), tests/startup_mesh57_skeleton_check.py ok (0.4s), tests/startup_run_ps1_check.py ok (8.5s), tests/startup_run_sh_check.py skipped (0.1s), tests/startup_sampler_heap_check.py ok (0.1s), tests/startup_shader_cache_rekey_check.py ok (1.5s), tests/startup_smem_address_check.py ok (0.1s), tests/startup_stream_fetch_check.py ok (0.2s), tests/startup_stream_interface_check.py ok (0.2s), tests/startup_translator_check.py ok (0.3s)
  • sccache: 6/8 hits; wall 55.2s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7177639913 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2475#issuecomment-7177639913). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T23:29:48Z. --- Win2025 WARP receipt for head 729eb037 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `729eb0379dad7e51d2b8d19420c8840adc1c28e8`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `0.47s` (configure `1.78s`) - Test (`ctest --preset dev -R '^startup_gfx2hlsl_pack_b32_f16($|_warp$)' --parallel 6 --no-tests=error --output-on-failure`): **2/2 passed** (`0.63s`: `startup_gfx2hlsl_pack_b32_f16` `0.14s`, `startup_gfx2hlsl_pack_b32_f16_warp` `0.52s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `0.90s` (configure `1.81s`) - Test (`ctest --preset release -R '^startup_gfx2hlsl_pack_b32_f16($|_warp$)' --parallel 6 --no-tests=error --output-on-failure`): **2/2 passed** (`0.59s`: `startup_gfx2hlsl_pack_b32_f16` `0.14s`, `startup_gfx2hlsl_pack_b32_f16_warp` `0.48s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`0.6s`), `tests/startup_buffer_address_check.py` ok (`0.4s`), `tests/startup_buffer_format_word3_table_check.py` ok (`0.1s`), `tests/startup_compute_request_offline_check.py` ok (`0.5s`), `tests/startup_compute_store_format_xyzw_check.py` ok (`0.3s`), `tests/startup_compute_translate_check.py` ok (`0.2s`), `tests/startup_flat_param_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_ci_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_bit_alu_check.py` ok (`0.7s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_cselect_mask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_cvt_alu_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cvt_pk_int16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`4.2s`), `tests/startup_gfx2hlsl_fma_mix_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_getpc_refusal_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_handler_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_image_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_image_get_lod_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_int_med3_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_interp_p2_hi_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_join_symbols_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_loop_constants_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_overwrite_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_operand_count_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`2.2s`), `tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_refusals_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_root_check.py` ok (`0.7s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_saveexec_same_reg_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_brev_fold_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_m0_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_table_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sdwa_cvt_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sgpr_spill_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_shift64_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sload_const_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_smem_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sop2_complement_check.py` ok (`4.9s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`0.8s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`3.8s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`2.3s`), `tests/startup_image_2d_array_check.py` ok (`0.1s`), `tests/startup_image_3d_check.py` ok (`0.1s`), `tests/startup_image_gather_lz_check.py` ok (`0.5s`), `tests/startup_image_load_d16_check.py` ok (`0.8s`), `tests/startup_image_sample_a16_check.py` ok (`0.2s`), `tests/startup_image_sample_b_check.py` ok (`0.2s`), `tests/startup_image_sample_c_check.py` ok (`0.2s`), `tests/startup_image_sample_l_check.py` ok (`0.2s`), `tests/startup_image_sample_lod_check.py` ok (`0.5s`), `tests/startup_inline_sampler_check.py` ok (`0.1s`), `tests/startup_mesh57_skeleton_check.py` ok (`0.4s`), `tests/startup_run_ps1_check.py` ok (`8.5s`), `tests/startup_run_sh_check.py` skipped (`0.1s`), `tests/startup_sampler_heap_check.py` ok (`0.1s`), `tests/startup_shader_cache_rekey_check.py` ok (`1.5s`), `tests/startup_smem_address_check.py` ok (`0.1s`), `tests/startup_stream_fetch_check.py` ok (`0.2s`), `tests/startup_stream_interface_check.py` ok (`0.2s`), `tests/startup_translator_check.py` ok (`0.3s`) - `sccache`: 6/8 hits; wall `55.2s` AI-assisted; commands listed were executed locally.
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!2467
No description provided.