compute: lower the DS _src2 family #3594

Manually merged
github merged 1 commit from github-bot/gh-3592 into gh-pr/3592/base 2026-11-30 12:15:53 +00:00 AGit
Owner

@⁠lambirou on GitHub · 2026-11-30 12:02 UTC · original
lambirou:compute/ds-src2 → main · +704 −38 · 5 files · 1 commits · merged 2026-11-30 12:11 UTC

Part of the DS slice (P7).

This adds the DS _src2 family in the private-LDS profile (gfx1030 16-byte records): ds_add_src2_f32/u32/u64, ds_sub_src2_u32/u64, ds_rsub_src2_u32/u64, ds_and_src2_b32/b64, ds_or_src2_b32/b64, ds_xor_src2_b32/b64, ds_inc_src2_u32/u64, ds_dec_src2_u32/u64, ds_min_src2_f32/f64/i32/i64/u32/u64, ds_max_src2_f32/f64/i32/i64/u32/u64 and ds_write_src2_b32/b64 — the 31 _src2 lines of docs/coverage/gfx1013.tsv (the table has 31, not 32). The second source is the same lane's dword or qword at A + 4 * offset, and the update stays inside the proven record. ds_write_src2 only needs the source.

Refusals: an offset mode carried in the VGPR address, an offset outside the record, an unaligned 64-bit pair, an uninitialized source, a missing destination for a read-modify-write form, the group-shared gfx1013 profile (its second address can cross lanes and its atomic order is not modelled), a 4-byte stride, a lane-guarded form, GWS and ds_ordered_count. f32/f64 min/max keep the old value on NaN, equality and opposite signed zeros; add/sub/rsub, inc/dec and the integer comparisons follow the 32/64-bit carry/borrow rules.

Tests

  • compute_store_aot_lds_src2_warp and _hardware pass: 64 source-built programmes and 37 mutants, 320 words compared per dispatch, 0 mismatch (WARP and AMD Radeon RX 9060 XT, driver 32.0.32029.2010).
  • The existing DS/LDS family still passes (22/22 in the agent run; compute_store_aot_ds_route_warp re-run after the rebase).
  • form_coverage_check.py pins exactly the 31 _src2 forms and keeps GWS and ds_ordered_count uncovered; docs_links_check.py passes.
  • Expected full table after the merge: 1,620/1,968 gfx1013 and 1,574/1,863 gfx1030 (the _src2 forms are absent from the RDNA 2 reference).

Limits

Only the private-LDS profile is covered; the group-shared gfx1013 profile still refuses _src2. Only direct immediate offsets 0..3 (0 or 2 for a 64-bit pair) are accepted; the VGPR offset mode, dynamic offsets and sources outside the record stay refused. GWS (6 forms) and ds_ordered_count need a separate barrier/order model. The binary/LLVM round-trip was not run locally (llvm-mc absent); the static _src2 controls are wired into that mode. The D3D12 debug layer is unavailable on this host.

AI-assisted.

**@⁠lambirou** on GitHub · 2026-11-30 12:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3592) `lambirou:compute/ds-src2` → `main` · +704 −38 · 5 files · 1 commits · merged 2026-11-30 12:11 UTC Part of the DS slice (P7). This adds the DS `_src2` family in the private-LDS profile (gfx1030 16-byte records): `ds_add_src2_f32/u32/u64`, `ds_sub_src2_u32/u64`, `ds_rsub_src2_u32/u64`, `ds_and_src2_b32/b64`, `ds_or_src2_b32/b64`, `ds_xor_src2_b32/b64`, `ds_inc_src2_u32/u64`, `ds_dec_src2_u32/u64`, `ds_min_src2_f32/f64/i32/i64/u32/u64`, `ds_max_src2_f32/f64/i32/i64/u32/u64` and `ds_write_src2_b32/b64` — the 31 `_src2` lines of `docs/coverage/gfx1013.tsv` (the table has 31, not 32). The second source is the same lane's dword or qword at `A + 4 * offset`, and the update stays inside the proven record. `ds_write_src2` only needs the source. Refusals: an offset mode carried in the VGPR address, an offset outside the record, an unaligned 64-bit pair, an uninitialized source, a missing destination for a read-modify-write form, the group-shared gfx1013 profile (its second address can cross lanes and its atomic order is not modelled), a 4-byte stride, a lane-guarded form, GWS and `ds_ordered_count`. f32/f64 min/max keep the old value on NaN, equality and opposite signed zeros; add/sub/rsub, inc/dec and the integer comparisons follow the 32/64-bit carry/borrow rules. ## Tests - `compute_store_aot_lds_src2_warp` and `_hardware` pass: 64 source-built programmes and 37 mutants, 320 words compared per dispatch, 0 mismatch (WARP and AMD Radeon RX 9060 XT, driver 32.0.32029.2010). - The existing DS/LDS family still passes (22/22 in the agent run; `compute_store_aot_ds_route_warp` re-run after the rebase). - `form_coverage_check.py` pins exactly the 31 `_src2` forms and keeps GWS and `ds_ordered_count` uncovered; `docs_links_check.py` passes. - Expected full table after the merge: **1,620/1,968** gfx1013 and **1,574/1,863** gfx1030 (the `_src2` forms are absent from the RDNA 2 reference). ## Limits Only the private-LDS profile is covered; the group-shared gfx1013 profile still refuses `_src2`. Only direct immediate offsets 0..3 (0 or 2 for a 64-bit pair) are accepted; the VGPR offset mode, dynamic offsets and sources outside the record stay refused. GWS (6 forms) and `ds_ordered_count` need a separate barrier/order model. The binary/LLVM round-trip was not run locally (`llvm-mc` absent); the static `_src2` controls are wired into that mode. The D3D12 debug layer is unavailable on this host. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 12:03:35 +00:00
github-bot changed target branch from main to gh-pr/3592/base 2026-11-30 12:15:46 +00:00
github manually merged commit 618fa06db2 into gh-pr/3592/base 2026-11-30 12:15:53 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.