tooling: follow pixel_aot scalar ALU, waits and scratch writes in the cb read trace #1149
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1156"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.pyis a linear pass that proposes descriptor bindings forpixel_aot. It stopped at scalar ALU lines, compound waits and scratch-base writes thatpixel_aotlowers, and it accepted anys_and_b32/s_and_b64intoexec, including formspixel_aotrefuses (for examples_and_b32 exec_lo, s40, 3).The trace now follows the lines
pixel_aotlowers and refuses the others:s_lshl_b32,s_lshr_b32,s_and_b32,s_or_b32,s_xor_b32ands_and_b64into a scalar register, with scalar-register or immediate sources.exec = exec & srestore forms only.pixel_aot).s_waitcntwith counters inside their field widths, including compound waits. It drains outstanding scalar loads when it nameslgkmcnt(0)or is zero.s_waitcnt_depctris not lowered bypixel_aot, so it still ends the trace.The change only affects which programs the trace proposes bindings for;
lowerstill verifies every load. The trace issues no stores or atomics. Docs:docs/experiments.mdscalar buffer loads section.This is AI-assisted work.
Verification
python3 -B tests/rdna2_tools_check.py: Ran 110 tests, OK (skipped=10), including the newtest_pixel_cb_read_trace_follows_translator_scalar_alu_and_waits.tools/pixel_cb_read.pyrestored toorigin/main(072e85b6) the new test fails (trace mismatch on s_lshl_b32 s44, s40, 2); with the change it passes.pixel_aot.lowerresult (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.Evidence and follow-up
loweraccepts in the base fixture; a futurepixel_aotchange to scalar ALU forms needs the agreement table extended.Checklist
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
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".
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:23:18Z.
Review: COMMENTED
No description provided.
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
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".
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) thatpixel_aot.scalar_u32()reads as bit patterns; the 64-bits_and_b64form keeps refusing them, as the translator does.test_pixel_cb_read_trace_follows_translator_scalar_alu_and_waitsgained 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.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 by6e5ed453; this commit goes further and removes the duplicated operand pattern: the cb read trace now askspixel_aot.scalar_u32()whether a 32-bit scalar ALU source is valid, so the two cannot drift apart. The agreement test against the reallower()gains more float, exponent and out-of-range cases.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.
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.
4112316ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
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 15When 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 thoughpixel_aot.scalar_u32()supports that operand. In a valid descriptor-load/wait/ALU/buffer-read program,lower()succeeds butfirst_read()returnsNone; replacing1.0with0x3f800000restores 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 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:23:18Z.
Code review location:
tools/pixel_cb_read.py; line 15Fixed in
6e5ed453(AI-assisted): decimal float immediates are accepted in 32-bit scalar ALU trace lines;41123162then shares the operand validation with pixel_aot.scalar_u32() so the two cannot drift.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 139When 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 syntheticbuffer_color(False)fixture, issuings_buffer_load_dword s60, s[16:19], nullfollowed bys_and_b32 s61, s60, 1without an intervening wait now lets the trace returnRead(4, 16). However,lower()rejects the sequence withConstant read before load completion; adding a wait before the ALU makes lowering succeed. The pending-load validation infirst_descriptor()does not cover this later pass. Track pending destinations and validate ALU reads/writes infirst_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 👍 / 👎.