shader: check the paired LDS read address snapshot on the host #2348

Merged
RavenCurseBurg merged 1 commit from upstream-pr/2356 into main 2026-11-25 13:37:39 +00:00
RavenCurseBurg commented 2026-11-25 13:33:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T13:33:18Z.


The last review of #2347 found that deleting the address snapshot from the paired LDS read survived its no-argument Python test. Case G uses v6 as both the address and the first result. The host check now requires the snapshot and both indexed reads in that order, so deleting the snapshot fails before a GPU is needed.

I ran python -B tests/startup_gfx2hlsl_compute_check.py on the merged tree and checked that deleting the snapshot locally fails the added assertion. The existing dispatch and overlap readbacks are unchanged. Equal offsets are already documented in the LDS exchange section.

Agent environment: Codex + GPT-6.2 Astra xhigh, Windows x64.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6605660130 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2356). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T13:33:18Z. --- The last review of #2347 found that deleting the address snapshot from the paired LDS read survived its no-argument Python test. Case G uses v6 as both the address and the first result. The host check now requires the snapshot and both indexed reads in that order, so deleting the snapshot fails before a GPU is needed. I ran `python -B tests/startup_gfx2hlsl_compute_check.py` on the merged tree and checked that deleting the snapshot locally fails the added assertion. The existing dispatch and overlap readbacks are unchanged. Equal offsets are already documented in the [LDS exchange section](https://github.com/R0Y00/Xbox2Windows/blob/ec519d0ca7a11e6a8d8e7197a85f67fa5ea6e108/docs/experiments.md#startup-compute-lds-dword-exchange). Agent environment: Codex + GPT-6.2 Astra xhigh, Windows x64.
upstream-sync closed this pull request 2026-11-25 14:04:58 +00:00
tedin7 commented 2026-11-25 14:04:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:37:10Z.

Review: COMMENTED


Review of head 55505e0bef (test-only, 3 lines in tests/startup_gfx2hlsl_compute_check.py).

Findings: 0 P1, 0 P2.

  • The new assert pins the ds_read2_b32 lowering: the address is saved in a before the first result overwrites v6, and both loads use a (offsets 20 and 144 for the offset0:5 offset1:36 fixture). This matches the ISA rule that both reads use the address VGPR as it was before the instruction. It is a real guard for the overlap case, and it extends the existing check_lds suite.
  • Clean-room: no external material.

Commands executed locally:

  • python3 tests/startup_gfx2hlsl_compute_check.py -> exit 0
  • python3 tests/docs_links_check.py -> pass (457 links)
  • python3 tests/bidi_controls_check.py -> pass
  • git diff --check origin/main...HEAD -> clean
  • Mutation: in tools/startup/gfx2hlsl.py (~line 1877) removed the a = <address> snapshot for ds_read2_b32; the test exits 1 with an AssertionError. Reverted with git checkout -- .; the test passes again.
  • GitHub CI: Linux Python checks, gfx1013 fixtures and Build and test on Windows all SUCCESS.

Windows: the PR touches only a .py file, so the pure-Python fast path applies.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6058608656 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2356#pullrequestreview-6058608656). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:37:10Z. **Review:** COMMENTED --- Review of head 55505e0bef768d8bb8021627c7302cbf17feeece (test-only, 3 lines in tests/startup_gfx2hlsl_compute_check.py). Findings: 0 P1, 0 P2. - The new assert pins the ds_read2_b32 lowering: the address is saved in `a` before the first result overwrites v6, and both loads use `a` (offsets 20 and 144 for the `offset0:5 offset1:36` fixture). This matches the ISA rule that both reads use the address VGPR as it was before the instruction. It is a real guard for the overlap case, and it extends the existing check_lds suite. - Clean-room: no external material. Commands executed locally: - `python3 tests/startup_gfx2hlsl_compute_check.py` -> exit 0 - `python3 tests/docs_links_check.py` -> pass (457 links) - `python3 tests/bidi_controls_check.py` -> pass - `git diff --check origin/main...HEAD` -> clean - Mutation: in tools/startup/gfx2hlsl.py (~line 1877) removed the `a = <address>` snapshot for ds_read2_b32; the test exits 1 with an AssertionError. Reverted with `git checkout -- .`; the test passes again. - GitHub CI: Linux Python checks, gfx1013 fixtures and Build and test on Windows all SUCCESS. Windows: the PR touches only a .py file, so the pure-Python fast path applies. 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!2348
No description provided.