tooling: follow pixel_aot scalar ALU, waits and scratch writes in the cb read trace #1149

Merged
tedin7 merged 4 commits from upstream-pr/1156 into main 2026-11-24 04:07:19 +00:00
tedin7 commented 2026-11-24 01:56:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T01:56:42Z.


Change

The constant-buffer read trace in tools/pixel_cb_read.py is a linear pass that proposes descriptor bindings for pixel_aot. It stopped at scalar ALU lines, compound waits and scratch-base writes that pixel_aot lowers, and it accepted any s_and_b32/s_and_b64 into exec, including forms pixel_aot refuses (for example s_and_b32 exec_lo, s40, 3).

The trace now follows the lines pixel_aot lowers and refuses the others:

  • s_lshl_b32, s_lshr_b32, s_and_b32, s_or_b32, s_xor_b32 and s_and_b64 into a scalar register, with scalar-register or immediate sources.
  • The exec = exec & s restore forms only.
  • Whole-register writes to the scratch base (value range checked as in pixel_aot).
  • Any s_waitcnt with counters inside their field widths, including compound waits. It drains outstanding scalar loads when it names lgkmcnt(0) or is zero.
  • An ALU result over a table or descriptor register, an ALU line touching a load still outstanding, and a wait that does not drain the load all end the trace.
  • s_waitcnt_depctr is not lowered by pixel_aot, so it still ends the trace.

The change only affects which programs the trace proposes bindings for; lower still verifies every load. The trace issues no stores or atomics. Docs: docs/experiments.md scalar buffer loads section.

This is AI-assisted work.

Verification

  • python3 -B tests/rdna2_tools_check.py: Ran 110 tests, OK (skipped=10), including the new test_pixel_cb_read_trace_follows_translator_scalar_alu_and_waits.
  • Negative control: with tools/pixel_cb_read.py restored to origin/main (072e85b6) the new test fails (trace mismatch on s_lshl_b32 s44, s40, 2); with the change it passes.
  • The test checks each line against the real pixel_aot.lower result (agreement table, accepted and refused forms) and runs end-to-end traces. Nine mutations must each end the trace: table half overwritten, table high half made non-zero, outstanding load read by ALU, outstanding load written by ALU, descriptor never drained, partial lgkm drain, duplicate counter, read result clobbered, read never drained.
  • No GPU adapter involved; no readback needed because nothing is lowered.

Evidence and follow-up

  • No new fixtures. Programs in the test are synthetic.
  • Assumption: the lines accepted are exactly those lower accepts in the base fixture; a future pixel_aot change to scalar ALU forms needs the agreement table extended.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6572846659 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T01:56:42Z. --- ## Change The constant-buffer read trace in `tools/pixel_cb_read.py` is a linear pass that proposes descriptor bindings for `pixel_aot`. It stopped at scalar ALU lines, compound waits and scratch-base writes that `pixel_aot` lowers, and it accepted any `s_and_b32`/`s_and_b64` into `exec`, including forms `pixel_aot` refuses (for example `s_and_b32 exec_lo, s40, 3`). The trace now follows the lines `pixel_aot` lowers and refuses the others: - `s_lshl_b32`, `s_lshr_b32`, `s_and_b32`, `s_or_b32`, `s_xor_b32` and `s_and_b64` into a scalar register, with scalar-register or immediate sources. - The `exec = exec & s` restore forms only. - Whole-register writes to the scratch base (value range checked as in `pixel_aot`). - Any `s_waitcnt` with counters inside their field widths, including compound waits. It drains outstanding scalar loads when it names `lgkmcnt(0)` or is zero. - An ALU result over a table or descriptor register, an ALU line touching a load still outstanding, and a wait that does not drain the load all end the trace. - `s_waitcnt_depctr` is not lowered by `pixel_aot`, so it still ends the trace. The change only affects which programs the trace proposes bindings for; `lower` still verifies every load. The trace issues no stores or atomics. Docs: `docs/experiments.md` scalar buffer loads section. This is AI-assisted work. ## Verification - `python3 -B tests/rdna2_tools_check.py`: Ran 110 tests, OK (skipped=10), including the new `test_pixel_cb_read_trace_follows_translator_scalar_alu_and_waits`. - Negative control: with `tools/pixel_cb_read.py` restored to `origin/main` (072e85b6) the new test fails (`trace mismatch on s_lshl_b32 s44, s40, 2`); with the change it passes. - The test checks each line against the real `pixel_aot.lower` result (agreement table, accepted and refused forms) and runs end-to-end traces. Nine mutations must each end the trace: table half overwritten, table high half made non-zero, outstanding load read by ALU, outstanding load written by ALU, descriptor never drained, partial lgkm drain, duplicate counter, read result clobbered, read never drained. - No GPU adapter involved; no readback needed because nothing is lowered. ## Evidence and follow-up - No new fixtures. Programs in the test are synthetic. - Assumption: the lines accepted are exactly those `lower` accepts in the base fixture; a future `pixel_aot` change to scalar ALU forms needs the agreement table extended. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets.
upstream-sync closed this pull request 2026-11-24 06:46:34 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:46:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T02:38:35Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e126db40f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6032858479 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#pullrequestreview-6032858479). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T02:38:35Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `e126db40f3` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-24 06:46:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:23:18Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6033191567 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#pullrequestreview-6033191567). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T03:23:18Z. **Review:** COMMENTED --- _No description provided._
chatgpt-codex-connector[bot commented 2026-11-24 06:46:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T04:11:15Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41123162a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6033528530 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#pullrequestreview-6033528530). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T04:11:15Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `41123162a8` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-24 06:50:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T02:40:56Z.


Fixed the P2 finding: the 32-bit scalar ALU trace now accepts the decimal float immediates (1.0, -0.5) that pixel_aot.scalar_u32() reads as bit patterns; the 64-bit s_and_b64 form keeps refusing them, as the translator does. test_pixel_cb_read_trace_follows_translator_scalar_alu_and_waits gained three agreement rows (s_or_b32 ... 1.0, s_and_b32 ... -0.5, s_and_b64 ... 1.0); the first fails before the change ("trace mismatch on s_or_b32 s44, s40, 1.0") and passes after. python3 -B tests/rdna2_tools_check.py: 110 tests OK (10 skipped). Merged origin/main (no force). AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120380139 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#issuecomment-7120380139). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T02:40:56Z. --- Fixed the P2 finding: the 32-bit scalar ALU trace now accepts the decimal float immediates (`1.0`, `-0.5`) that `pixel_aot.scalar_u32()` reads as bit patterns; the 64-bit `s_and_b64` form keeps refusing them, as the translator does. `test_pixel_cb_read_trace_follows_translator_scalar_alu_and_waits` gained three agreement rows (`s_or_b32 ... 1.0`, `s_and_b32 ... -0.5`, `s_and_b64 ... 1.0`); the first fails before the change ("trace mismatch on s_or_b32 s44, s40, 1.0") and passes after. `python3 -B tests/rdna2_tools_check.py`: 110 tests OK (10 skipped). Merged origin/main (no force). AI-assisted.
tedin7 commented 2026-11-24 06:50:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T02:42:25Z.


AI-assisted. The inline float constants (for example s_or_b32 s44, s40, 1.0) were already accepted by 6e5ed453; this commit goes further and removes the duplicated operand pattern: the cb read trace now asks pixel_aot.scalar_u32() whether a 32-bit scalar ALU source is valid, so the two cannot drift apart. The agreement test against the real lower() gains more float, exponent and out-of-range cases.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120403125 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#issuecomment-7120403125). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T02:42:25Z. --- AI-assisted. The inline float constants (for example `s_or_b32 s44, s40, 1.0`) were already accepted by 6e5ed453; this commit goes further and removes the duplicated operand pattern: the cb read trace now asks `pixel_aot.scalar_u32()` whether a 32-bit scalar ALU source is valid, so the two cannot drift apart. The agreement test against the real `lower()` gains more float, exponent and out-of-range cases.
tedin7 commented 2026-11-24 06:50:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T04:06:07Z.


@codex review

AI-assisted: the inline findings are fixed and answered in their threads; please re-read the current head.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7121707438 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#issuecomment-7121707438). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T04:06:07Z. --- @codex review AI-assisted: the inline findings are fixed and answered in their threads; please re-read the current head.
chatgpt-codex-connector[bot commented 2026-11-24 06:50:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T02:31:37Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T04:11:18.173604Z 4112316 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120230409 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#issuecomment-7120230409). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T02:31:37Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"41123162a827125fbbc965557e97f1645a3e8b74","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T04:11:18.173604Z">2026-11-24T04:11:18.173604Z</relative-time> | `4112316` | Manual request | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot commented 2026-11-24 06:50:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T02:38:35Z.

Code review location: tools/pixel_cb_read.py; line 15

@@ -11,6 +11,11 @@
 IMM = r"(null|0x[0-9a-f]+)"
 DESCRIPTOR = re.compile(rf"s_load_dwordx4 {SPAN}, {SPAN}, {IMM}")
 BUF_READ = re.compile(rf"s_buffer_load_dword(x[248]|x16)? (s\d+|s\[\d+:\d+\]), {SPAN}, (null|0x[0-9a-f]+|s\d+)")
+SALU_B32 = ("s_lshl_b32", "s_lshr_b32", "s_and_b32", "s_or_b32", "s_xor_b32")
+SALU_OPERAND = re.compile(r"s\d+|-?[0-9]{1,10}|0x[0-9a-f]{1,8}")

P2 Badge Accept floating inline constants in 32-bit scalar ALU traces

When a newly supported 32-bit ALU instruction uses an inline floating constant, such as s_or_b32 s44, s40, 1.0, this pattern rejects it even though pixel_aot.scalar_u32() supports that operand. In a valid descriptor-load/wait/ALU/buffer-read program, lower() succeeds but first_read() returns None; replacing 1.0 with 0x3f800000 restores the trace and produces identical lowered HLSL. Consequently, the new ALU support still loses valid CB-read classifications for these operands. Extend the 32-bit operand recognition to cover the lowering-supported floating immediate spellings and include them in the agreement test.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4674836074 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#discussion_r4674836074). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T02:38:35Z. **Code review location:** `tools/pixel_cb_read.py`; line 15 ~~~~diff @@ -11,6 +11,11 @@ IMM = r"(null|0x[0-9a-f]+)" DESCRIPTOR = re.compile(rf"s_load_dwordx4 {SPAN}, {SPAN}, {IMM}") BUF_READ = re.compile(rf"s_buffer_load_dword(x[248]|x16)? (s\d+|s\[\d+:\d+\]), {SPAN}, (null|0x[0-9a-f]+|s\d+)") +SALU_B32 = ("s_lshl_b32", "s_lshr_b32", "s_and_b32", "s_or_b32", "s_xor_b32") +SALU_OPERAND = re.compile(r"s\d+|-?[0-9]{1,10}|0x[0-9a-f]{1,8}") ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Accept floating inline constants in 32-bit scalar ALU traces** When a newly supported 32-bit ALU instruction uses an inline floating constant, such as `s_or_b32 s44, s40, 1.0`, this pattern rejects it even though `pixel_aot.scalar_u32()` supports that operand. In a valid descriptor-load/wait/ALU/buffer-read program, `lower()` succeeds but `first_read()` returns `None`; replacing `1.0` with `0x3f800000` restores the trace and produces identical lowered HLSL. Consequently, the new ALU support still loses valid CB-read classifications for these operands. Extend the 32-bit operand recognition to cover the lowering-supported floating immediate spellings and include them in the agreement test. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-24 06:50:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:23:18Z.

Code review location: tools/pixel_cb_read.py; line 15

@@ -11,6 +11,11 @@
 IMM = r"(null|0x[0-9a-f]+)"
 DESCRIPTOR = re.compile(rf"s_load_dwordx4 {SPAN}, {SPAN}, {IMM}")
 BUF_READ = re.compile(rf"s_buffer_load_dword(x[248]|x16)? (s\d+|s\[\d+:\d+\]), {SPAN}, (null|0x[0-9a-f]+|s\d+)")
+SALU_B32 = ("s_lshl_b32", "s_lshr_b32", "s_and_b32", "s_or_b32", "s_xor_b32")
+SALU_OPERAND = re.compile(r"s\d+|-?[0-9]{1,10}|0x[0-9a-f]{1,8}")

Fixed in 6e5ed453 (AI-assisted): decimal float immediates are accepted in 32-bit scalar ALU trace lines; 41123162 then shares the operand validation with pixel_aot.scalar_u32() so the two cannot drift.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4675122364 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#discussion_r4675122364). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T03:23:18Z. **Code review location:** `tools/pixel_cb_read.py`; line 15 ~~~~diff @@ -11,6 +11,11 @@ IMM = r"(null|0x[0-9a-f]+)" DESCRIPTOR = re.compile(rf"s_load_dwordx4 {SPAN}, {SPAN}, {IMM}") BUF_READ = re.compile(rf"s_buffer_load_dword(x[248]|x16)? (s\d+|s\[\d+:\d+\]), {SPAN}, (null|0x[0-9a-f]+|s\d+)") +SALU_B32 = ("s_lshl_b32", "s_lshr_b32", "s_and_b32", "s_or_b32", "s_xor_b32") +SALU_OPERAND = re.compile(r"s\d+|-?[0-9]{1,10}|0x[0-9a-f]{1,8}") ~~~~ --- Fixed in 6e5ed453 (AI-assisted): decimal float immediates are accepted in 32-bit scalar ALU trace lines; 41123162 then shares the operand validation with pixel_aot.scalar_u32() so the two cannot drift.
chatgpt-codex-connector[bot commented 2026-11-24 06:50:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T04:11:15Z.

Code review location: tools/pixel_cb_read.py; line 139

@@ -59,8 +131,12 @@ def scalar_writes(line):
     if line in ("s_wqm_b64 exec, exec", "s_wqm_b64 exec_lo, exec_lo",
                 "s_wqm_b32 exec_lo, exec_lo", "s_wqm_b32 exec, exec"):
         return ()
-    if op in ("s_and_b64", "s_and_b32") and dest in ("exec", "exec_lo"):
+    if exec_and(line):
         return ()
+    if (match := FLAT_SCRATCH_WRITE.fullmatch(line)) and flat_scratch_value(match[1]):
+        return ()
+    if form := salu_form(line):
+        return form[0]

P2 Badge Track all pending scalar loads in the read pass

When another buffer load precedes the traced descriptor's first read, first_read() does not track that other load's pending destination. In a two-buffer variant of the synthetic buffer_color(False) fixture, issuing s_buffer_load_dword s60, s[16:19], null followed by s_and_b32 s61, s60, 1 without an intervening wait now lets the trace return Read(4, 16). However, lower() rejects the sequence with Constant read before load completion; adding a wait before the ALU makes lowering succeed. The pending-load validation in first_descriptor() does not cover this later pass. Track pending destinations and validate ALU reads/writes in first_read() too, otherwise the CB diagnostic reports a completed read and can emit its probe despite encountering the documented outstanding-load stop condition.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4675412159 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1156#discussion_r4675412159). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T04:11:15Z. **Code review location:** `tools/pixel_cb_read.py`; line 139 ~~~~diff @@ -59,8 +131,12 @@ def scalar_writes(line): if line in ("s_wqm_b64 exec, exec", "s_wqm_b64 exec_lo, exec_lo", "s_wqm_b32 exec_lo, exec_lo", "s_wqm_b32 exec, exec"): return () - if op in ("s_and_b64", "s_and_b32") and dest in ("exec", "exec_lo"): + if exec_and(line): return () + if (match := FLAT_SCRATCH_WRITE.fullmatch(line)) and flat_scratch_value(match[1]): + return () + if form := salu_form(line): + return form[0] ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Track all pending scalar loads in the read pass** When another buffer load precedes the traced descriptor's first read, `first_read()` does not track that other load's pending destination. In a two-buffer variant of the synthetic `buffer_color(False)` fixture, issuing `s_buffer_load_dword s60, s[16:19], null` followed by `s_and_b32 s61, s60, 1` without an intervening wait now lets the trace return `Read(4, 16)`. However, `lower()` rejects the sequence with `Constant read before load completion`; adding a wait before the ALU makes lowering succeed. The pending-load validation in `first_descriptor()` does not cover this later pass. Track pending destinations and validate ALU reads/writes in `first_read()` too, otherwise the CB diagnostic reports a completed read and can emit its probe despite encountering the documented outstanding-load stop condition. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
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!1149
No description provided.