compute: accept the SMEM cache controls as no-ops #3634

Manually merged
github merged 4 commits from github-bot/gh-3632 into gh-pr/3632/base 2026-12-01 14:00:52 +00:00 AGit
Owner

@⁠lambirou on GitHub · 2026-11-30 18:18 UTC · original
lambirou:compute/smem-cache-noops → main · +304 −7 · 5 files · 4 commits · merged 2026-12-01 13:57 UTC

Part of the SMEM slice (P2).

This accepts five SMEM cache-control forms as documented no-ops in the compute store profile: s_gl1_inv, s_dcache_inv, s_dcache_wb, s_atc_probe and s_atc_probe_buffer. The model maps SMEM accesses directly to D3D12 buffers and keeps no GL0/GL1 scalar cache, so invalidation, writeback and probe have no state to update; this follows the same cacheless rationale as the buffer_gl0_inv/buffer_gl1_inv no-ops and the operandless s_icache_inv hint. The probe operands are still parsed (probe immediate, base pair and offset), and a malformed line or unexpected modifier is refused by name. s_dcache_discard/_x2, s_memtime, s_memrealtime, s_get_waveid_in_workgroup and the scratch forms stay refused.

Tests

  • compute_store_aot_smem_cache_controls passes and records exactly the five forms; the source-built controls check each lowering is textually identical to the control program and vary the probe/offset operands.
  • compute_store_aot_smem_cache_cli round-trips the five forms and six operand variants through LLVM 15 and the CLI; it skips (77) on hosts without the tools, as designed. On this host the controls pass and the CLI test skips.
  • form_coverage_check.py passes and pins the five forms; the refused neighbours stay uncovered.
  • Expected delta: +5 forms on gfx1013 (SMEM) and +2 on gfx1030 (s_dcache_inv and s_gl1_inv are in the RDNA 2 reference; the other three are gfx1013-only). After the open PRs and this one: 1,743/1,968 and 1,642/1,863.

Limits

The no-op model claims only the cacheless state: it does not model a real invalidation or a probe result. The LLVM 15 CLI round-trip is unavailable on this host, so that part is exercised by CI. No console measurement was made.

AI-assisted.

**@⁠lambirou** on GitHub · 2026-11-30 18:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3632) `lambirou:compute/smem-cache-noops` → `main` · +304 −7 · 5 files · 4 commits · merged 2026-12-01 13:57 UTC Part of the SMEM slice (P2). This accepts five SMEM cache-control forms as documented no-ops in the compute store profile: `s_gl1_inv`, `s_dcache_inv`, `s_dcache_wb`, `s_atc_probe` and `s_atc_probe_buffer`. The model maps SMEM accesses directly to D3D12 buffers and keeps no GL0/GL1 scalar cache, so invalidation, writeback and probe have no state to update; this follows the same cacheless rationale as the `buffer_gl0_inv`/`buffer_gl1_inv` no-ops and the operandless `s_icache_inv` hint. The probe operands are still parsed (probe immediate, base pair and offset), and a malformed line or unexpected modifier is refused by name. `s_dcache_discard`/`_x2`, `s_memtime`, `s_memrealtime`, `s_get_waveid_in_workgroup` and the scratch forms stay refused. ## Tests - `compute_store_aot_smem_cache_controls` passes and records exactly the five forms; the source-built controls check each lowering is textually identical to the control program and vary the probe/offset operands. - `compute_store_aot_smem_cache_cli` round-trips the five forms and six operand variants through LLVM 15 and the CLI; it skips (77) on hosts without the tools, as designed. On this host the controls pass and the CLI test skips. - `form_coverage_check.py` passes and pins the five forms; the refused neighbours stay uncovered. - Expected delta: **+5 forms on gfx1013** (SMEM) and **+2 on gfx1030** (`s_dcache_inv` and `s_gl1_inv` are in the RDNA 2 reference; the other three are gfx1013-only). After the open PRs and this one: **1,743/1,968** and **1,642/1,863**. ## Limits The no-op model claims only the cacheless state: it does not model a real invalidation or a probe result. The LLVM 15 CLI round-trip is unavailable on this host, so that part is exercised by CI. No console measurement was made. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:23:33 +00:00
Author
Owner

@⁠lukaslw-lab on GitHub · 2026-11-30 18:33 UTC · original · reviewed

Reviewed 83b60bd3 by reading the diff; not built or run.

Verdict: comment. The lowering is right, but the recorded evidence for the LLVM round trip contradicts itself. Please fix that before merge. No MUST.

  • SHOULD docs/experiments.md:4635 says the compute_store_aot_smem_cache_cli entry "passed ... in 14.5 s with LLVM 15.0.7's clang integrated assembler" on build 26300. The PR body says the round trip is "unavailable on this host" and that "the CLI test skips". The body also says that part "is exercised by CI", but no CI job runs it. The Linux LLVM job runs compute_store_check.py only in binary mode (.github/workflows/windows.yml:40-43). The pr preset filter matches neither new entry. Without LLVM 15 the entry returns 77 on the Windows dev run. Keep the docs to what was actually run, and leave the CLI result open until a host with LLVM 15 runs it.
  • Checked, no finding:
    • The no-ops continue before the SCC reset (tools/compute_store_aot.py:1430-1444). SMEM writes no SCC, so keeping SCC is correct.
    • They change no pending state. Only s_waitcnt lgkmcnt(0) clears it (:1451), so an extra LGKM-counted instruction on the guest cannot make a load look ready early.
    • After DS, the immediate-wait rule (:1406) still refuses a cache op placed before the wait.
    • Probe validation (:653): 7-bit immediate, aligned pair or quad within s105, signed 21-bit offset or SGPR plus addend, glc/dlc only and in that order.
    • Invalidation and writeback have no state to act on in this profile: SMEM stores lower straight to outputData.Store, and SMEM loads read only the descriptor table and the b0 constant record (:1765-1793), which nothing in the program writes.

Tests: compute_store_aot_smem_cache_controls proves that each form and operand variant lowers to text identical to the control, plus the malformed, modifier and neighbouring refusals. form_coverage_check.py pins the five forms (+2 on gfx1030). CI ran only form_coverage_check.py, in the Linux job. Neither new CTest entry is in the pr preset.

**@⁠lukaslw-lab** on GitHub · 2026-11-30 18:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3632#pullrequestreview-6118130458) · **reviewed** Reviewed `83b60bd3` by reading the diff; not built or run. **Verdict: comment.** The lowering is right, but the recorded evidence for the LLVM round trip contradicts itself. Please fix that before merge. No MUST. - **SHOULD** `docs/experiments.md:4635` says the `compute_store_aot_smem_cache_cli` entry "passed ... in 14.5 s with LLVM 15.0.7's clang integrated assembler" on build 26300. The PR body says the round trip is "unavailable on this host" and that "the CLI test skips". The body also says that part "is exercised by CI", but no CI job runs it. The Linux LLVM job runs `compute_store_check.py` only in `binary` mode (`.github/workflows/windows.yml:40-43`). The `pr` preset filter matches neither new entry. Without LLVM 15 the entry returns 77 on the Windows `dev` run. Keep the docs to what was actually run, and leave the CLI result open until a host with LLVM 15 runs it. - Checked, no finding: - The no-ops `continue` before the SCC reset (`tools/compute_store_aot.py:1430-1444`). SMEM writes no SCC, so keeping SCC is correct. - They change no `pending` state. Only `s_waitcnt lgkmcnt(0)` clears it (`:1451`), so an extra LGKM-counted instruction on the guest cannot make a load look ready early. - After DS, the immediate-wait rule (`:1406`) still refuses a cache op placed before the wait. - Probe validation (`:653`): 7-bit immediate, aligned pair or quad within s105, signed 21-bit offset or SGPR plus addend, `glc`/`dlc` only and in that order. - Invalidation and writeback have no state to act on in this profile: SMEM stores lower straight to `outputData.Store`, and SMEM loads read only the descriptor table and the b0 constant record (`:1765-1793`), which nothing in the program writes. Tests: `compute_store_aot_smem_cache_controls` proves that each form and operand variant lowers to text identical to the control, plus the malformed, modifier and neighbouring refusals. `form_coverage_check.py` pins the five forms (+2 on gfx1030). CI ran only `form_coverage_check.py`, in the Linux job. Neither new CTest entry is in the `pr` preset.
Author
Owner

@⁠lambirou on GitHub · 2026-11-30 20:11 UTC · original

Updated at 05d19fe5. The experiments entry now records exactly what ran here: the controls entry passed in 6.0 s, while the CLI entry returned 77 because LLVM 15 and LLVM-C.dll are not installed. It also states that the Linux CI job runs form_coverage_check.py, not the CLI mode, so no LLVM 15 round-trip is claimed. docs_links_check.py (188 files, 740 links) and form_coverage_check.py pass.

**@⁠lambirou** on GitHub · 2026-11-30 20:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3632#issuecomment-7290552832) Updated at 05d19fe5. The experiments entry now records exactly what ran here: the controls entry passed in 6.0 s, while the CLI entry returned 77 because LLVM 15 and LLVM-C.dll are not installed. It also states that the Linux CI job runs form_coverage_check.py, not the CLI mode, so no LLVM 15 round-trip is claimed. docs_links_check.py (188 files, 740 links) and form_coverage_check.py pass.
# Conflicts:
#	docs/experiments.md
#	tests/compute_store_check.py
#	tests/form_coverage_check.py
Author
Owner

@⁠lukaslw-lab on GitHub · 2026-12-01 01:33 UTC · original · approved these changes

Reviewed 7321cb1d by reading the diff; not built or run. The delta since our review at 83b60bd3 is 05d19fe5, a merge of main and 7321cb1d.

Verdict: approve. The evidence paragraph now records only what ran, and the follow-up to main's MUBUF cache change is consistent. No MUST, no SHOULD.

  • Checked, no finding:
    • 05d19fe5: docs/experiments.md now says the CLI entry returned 77 without LLVM 15 and LLVM-C.dll, that no LLVM 15 round trip has run, and that the Linux job runs form_coverage_check.py, not the CLI mode. That matches the PR body and CI.
    • 7321cb1d: main's MUBUF invalidation change asserted that s_dcache_inv/s_gl1_inv are refused. With this PR they hit the SMEM no-op branch first. Its test now expects output identical to the control for both, and the comment and docs say the same. The malformed buffer_gl*_inv refusal is unchanged.
    • Apart from that comment, the PR's own lines in tools/compute_store_aot.py match 83b60bd3 after the merge. The no-op lowering we checked there (SCC kept, pending untouched, the DS immediate-wait rule, operand validation) stands.

Tests: CI passed at this head. compute_store_aot_smem_cache_controls and the CLI entry are still outside the pr filter, and the LLVM 15 round trip stays open, as the docs now say.

**@⁠lukaslw-lab** on GitHub · 2026-12-01 01:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3632#pullrequestreview-6123608139) · **approved these changes** Reviewed `7321cb1d` by reading the diff; not built or run. The delta since our review at `83b60bd3` is `05d19fe5`, a merge of main and `7321cb1d`. **Verdict: approve.** The evidence paragraph now records only what ran, and the follow-up to main's MUBUF cache change is consistent. No MUST, no SHOULD. - Checked, no finding: - `05d19fe5`: `docs/experiments.md` now says the CLI entry returned 77 without LLVM 15 and `LLVM-C.dll`, that no LLVM 15 round trip has run, and that the Linux job runs `form_coverage_check.py`, not the CLI mode. That matches the PR body and CI. - `7321cb1d`: main's MUBUF invalidation change asserted that `s_dcache_inv`/`s_gl1_inv` are refused. With this PR they hit the SMEM no-op branch first. Its test now expects output identical to the control for both, and the comment and docs say the same. The malformed `buffer_gl*_inv` refusal is unchanged. - Apart from that comment, the PR's own lines in `tools/compute_store_aot.py` match `83b60bd3` after the merge. The no-op lowering we checked there (SCC kept, `pending` untouched, the DS immediate-wait rule, operand validation) stands. Tests: CI passed at this head. `compute_store_aot_smem_cache_controls` and the CLI entry are still outside the `pr` filter, and the LLVM 15 round trip stays open, as the docs now say.
github-bot changed target branch from main to gh-pr/3632/base 2026-12-01 14:00:45 +00:00
github manually merged commit 7321cb1d0c into gh-pr/3632/base 2026-12-01 14:00:46 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.