shader: add qword return forms #1054

Closed
lambirou wants to merge 1 commit from upstream-pr/1061 into main
lambirou commented 2026-11-23 23:56:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-23T23:56:00Z.


Change

Complete the qword _rtn family in the private LDS compute path. The five forms already landed
by #942 (add, sub, rsub, and, or) are kept; this adds:

  • ds_xor_rtn_b64
  • ds_min_rtn_i64
  • ds_max_rtn_i64
  • ds_min_rtn_u64
  • ds_max_rtn_u64

The lowerer validates the returned destination pair, captures the old pair before any write and
returns it beside the updated pair. ds_inc_u64 and ds_dec_u64 remain for XCL-16.

Verification

  • python -B tests/compute_store_check.py binary <llvm-mc> <llvm-objcopy> <libLLVM-23>
    • Exit 0 with the local LLVM toolchain.
  • ctest --preset dev --no-tests=error -R '^compute_store_aot_lds_qword_' -V
    • 2/2 passed:
      • WARP: Microsoft Basic Render Driver, driver 10.0.26100.10068, 320 words compared per
        case, 0 mismatches.
      • Hardware: AMD Radeon RX 9060 XT, vendor 1002, device 7590, driver 32.0.32029.2010,
        Windows 10 Pro 26H2 build 26300.10075, debug layer unavailable, 320 words compared per
        case, 0 mismatches.
  • The ten _rtn names are checked explicitly. The fixture aliases destination and source and
    compares both the old and new pairs for one and two groups.
  • Mutants detected: removed carry (word 1), returned new pair instead of old (for example
    ds_add_rtn_u64 word 2, ds_min_rtn_i64 word 2, ds_max_rtn_i64 word 70), and a signed
    comparison for unsigned min/max (word 0).
  • docs_links_check.py: Self-test passed., Checked 15 Markdown files and 237 links..
  • git diff --check origin/main...HEAD: clean.
  • Not run: the full CTest suite, the release preset, unrelated GPU tests and a real archive scan.

Evidence and follow-up

  • Branch shader/qword-return-forms, head 0749207, based on 1a6425e.
  • The fixture profile is the existing private LDS gfx1030 profile, not gfx1013.
    ds_group rejects a gfx1013 fixture before the DS instruction, so this PR does not claim a
    gfx1013 test. Extending that profile is a separate change if the acceptance requires it.
  • docs/experiments.md records that the ten returning qword operations copy the old pair and
    that the fixture aliases destination and data. No README row changes.
  • Provenance: the five existing forms come from #942 in this repository; no XCL code, table or
    output was used. The change is a source-built gfx1030 fixture and a CPU reference.
  • Follow-up: XCL-16 adds ds_inc_u64/ds_dec_u64 and their return forms. A future change can
    widen ds_group to gfx1013 with its own evidence.
  • No game files, dumps, shader bytes, title paths or secrets are included.

Checklist

  • One reviewable behavior: the five missing qword return forms.
  • Positive fixture and carry/old-pair/signed-comparison mutants.
  • WARP and hardware results with adapter, driver, Windows build and debug layer.
  • Documentation updated.
  • No game files, dumps, logs or secrets.
  • Provenance checked; no XCL code used.
  • AI-assisted (Codex).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6571366486 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1061). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-23T23:56:00Z. --- ## Change Complete the qword `_rtn` family in the private LDS compute path. The five forms already landed by #942 (add, sub, rsub, and, or) are kept; this adds: - `ds_xor_rtn_b64` - `ds_min_rtn_i64` - `ds_max_rtn_i64` - `ds_min_rtn_u64` - `ds_max_rtn_u64` The lowerer validates the returned destination pair, captures the old pair before any write and returns it beside the updated pair. `ds_inc_u64` and `ds_dec_u64` remain for XCL-16. ## Verification - `python -B tests/compute_store_check.py binary <llvm-mc> <llvm-objcopy> <libLLVM-23>` - Exit 0 with the local LLVM toolchain. - `ctest --preset dev --no-tests=error -R '^compute_store_aot_lds_qword_' -V` - 2/2 passed: - WARP: Microsoft Basic Render Driver, driver 10.0.26100.10068, 320 words compared per case, 0 mismatches. - Hardware: AMD Radeon RX 9060 XT, vendor 1002, device 7590, driver 32.0.32029.2010, Windows 10 Pro 26H2 build 26300.10075, debug layer unavailable, 320 words compared per case, 0 mismatches. - The ten `_rtn` names are checked explicitly. The fixture aliases destination and source and compares both the old and new pairs for one and two groups. - Mutants detected: removed carry (word 1), returned new pair instead of old (for example `ds_add_rtn_u64` word 2, `ds_min_rtn_i64` word 2, `ds_max_rtn_i64` word 70), and a signed comparison for unsigned min/max (word 0). - `docs_links_check.py`: `Self-test passed.`, `Checked 15 Markdown files and 237 links.`. - `git diff --check origin/main...HEAD`: clean. - Not run: the full CTest suite, the release preset, unrelated GPU tests and a real archive scan. ## Evidence and follow-up - Branch `shader/qword-return-forms`, head `0749207`, based on `1a6425e`. - The fixture profile is the existing private LDS **gfx1030** profile, not gfx1013. `ds_group` rejects a gfx1013 fixture before the DS instruction, so this PR does not claim a gfx1013 test. Extending that profile is a separate change if the acceptance requires it. - `docs/experiments.md` records that the ten returning qword operations copy the old pair and that the fixture aliases destination and data. No README row changes. - Provenance: the five existing forms come from #942 in this repository; no XCL code, table or output was used. The change is a source-built gfx1030 fixture and a CPU reference. - Follow-up: XCL-16 adds `ds_inc_u64`/`ds_dec_u64` and their return forms. A future change can widen `ds_group` to gfx1013 with its own evidence. - No game files, dumps, shader bytes, title paths or secrets are included. ## Checklist - [x] One reviewable behavior: the five missing qword return forms. - [x] Positive fixture and carry/old-pair/signed-comparison mutants. - [x] WARP and hardware results with adapter, driver, Windows build and debug layer. - [x] Documentation updated. - [x] No game files, dumps, logs or secrets. - [x] Provenance checked; no XCL code used. - [x] AI-assisted (Codex).
upstream-sync closed this pull request 2026-11-24 06:46:04 +00:00
R0Y00 commented 2026-11-24 06:49:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T00:02:25Z.


These five returning forms already have a pending implementation in #944, after the #942 prerequisite. Please coordinate with @stan495 in that PR before changing the same LDS path again. An independent comparison of signed-high/unsigned-low ties, overlap and the old-value mutation would be useful. We can retain distinct test coverage with attribution in one candidate.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7117636124 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1061#issuecomment-7117636124). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T00:02:25Z. --- These five returning forms already have a pending implementation in #944, after the #942 prerequisite. Please coordinate with @stan495 in that PR before changing the same LDS path again. An independent comparison of signed-high/unsigned-low ties, overlap and the old-value mutation would be useful. We can retain distinct test coverage with attribution in one candidate.
lambirou commented 2026-11-24 06:49:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T00:34:28Z.


Closing in favor of #944 per maintainer review. The implementation is the same five returning forms; #944 is the one candidate. Our independent WARP/hardware, tie, overlap and old-value-mutation coverage is described in #944 and the branch is retained locally if a test-only follow-up is useful.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7118209200 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1061#issuecomment-7118209200). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-24T00:34:28Z. --- Closing in favor of #944 per maintainer review. The implementation is the same five returning forms; #944 is the one candidate. Our independent WARP/hardware, tie, overlap and old-value-mutation coverage is described in #944 and the branch is retained locally if a test-only follow-up is useful.

Pull request closed

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!1054
No description provided.