startup: read src_scc as the SCC bit #1814

Merged
triggered02 merged 2 commits from upstream-pr/1821 into main 2026-11-26 03:29:19 +00:00
triggered02 commented 2026-11-24 19:14:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T19:14:13Z.


Fixes #1820. Found in the refusal census (#870). 1 refused shader:

s_mul_i32 s28, 1.0, src_scc    -> REFUSED: operand 'src_scc'

Problem

Scalar source code 253 (src_scc) reads the SCC bit as the integer value 0 or 1. The translator refused it as an unknown operand, because Stage.u() only understood registers, inline constants and m0.

Fix

The generated shader already carries SCC as a bool scc (initialised, and updated by the scalar instructions that set it), so the source lowers to a conditional:

if tok == 'src_scc':
    # Source code 253 reads the SCC bit as the integer value 0 or 1 (used by e.g. s_mul_i32).
    return '(scc ? 1u : 0u)'

Measured on main at 813045b3:

form before after
s_mul_i32 s28, 1.0, src_scc refused s28 = 0x3f800000u * (scc ? 1u : 0u);
s_and_b32 s28, src_scc, s5 refused s28 = (scc ? 1u : 0u) & s5; scc = s28 != 0;

The census form multiplies the raw bits of the inline float 1.0 (0x3f800000) by the SCC bit — that is what the scalar integer multiply does, and it is why the constant is not emitted as 1u.

Test

startup_gfx2hlsl_src_scc builds SOP2 encodings from the checked-in decoder's layout ([31:30] == 0b10, opcode w0[29:23], destination w0[22:16], src1 w0[15:8], src0 w0[7:0]), decodes them, then translates. Five checks: the census form decodes and lowers, src_scc works in the first source position as well, a bitwise op still updates SCC, and a definition followed by a use emits both statements (scc = s28 != 0; then s29 = 0x3f800000u * (scc ? 1u : 0u);).

dev:     19/21 - the 2 failures are pre-existing (below)
release: startup_gfx2hlsl_src_scc Passed 0.14 s

Fail-first, both caught:

refuse src_scc again          -> Unsupported: operand 'src_scc'
lower it as the constant 0u   -> "a defined SCC is read back by the next instruction" FAIL

Pre-existing failures, not from this PR

startup_gfx2hlsl_mad_preserve_{warp,hardware} fail in this dev tree with Unknown GPU operation or invalid arguments: --raw-uav-dump-sm62 — the built offscreen_check is stale. Confirmed identical on origin/main with the same binary. A rebuild fixes it; this branch does not touch that tool.

What this does not establish

  • That the emitted HLSL compiles or computes the right value — the test compares text; DXC/WARP were not run here.
  • The s_cselect-style conditional uses of SCC (cond operand) are separate and already handled.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6589458737 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T19:14:13Z. --- Fixes #1820. Found in the refusal census (#870). **1** refused shader: ``` s_mul_i32 s28, 1.0, src_scc -> REFUSED: operand 'src_scc' ``` ## Problem Scalar source code 253 (`src_scc`) reads the SCC bit as the integer value 0 or 1. The translator refused it as an unknown operand, because `Stage.u()` only understood registers, inline constants and `m0`. ## Fix The generated shader already carries SCC as a `bool scc` (initialised, and updated by the scalar instructions that set it), so the source lowers to a conditional: ```python if tok == 'src_scc': # Source code 253 reads the SCC bit as the integer value 0 or 1 (used by e.g. s_mul_i32). return '(scc ? 1u : 0u)' ``` Measured on `main` at `813045b3`: | form | before | after | |---|---|---| | `s_mul_i32 s28, 1.0, src_scc` | refused | `s28 = 0x3f800000u * (scc ? 1u : 0u);` | | `s_and_b32 s28, src_scc, s5` | refused | `s28 = (scc ? 1u : 0u) & s5; scc = s28 != 0;` | The census form multiplies the **raw bits** of the inline float `1.0` (`0x3f800000`) by the SCC bit — that is what the scalar integer multiply does, and it is why the constant is not emitted as `1u`. ## Test `startup_gfx2hlsl_src_scc` builds SOP2 encodings from the checked-in decoder's layout (`[31:30] == 0b10`, opcode `w0[29:23]`, destination `w0[22:16]`, src1 `w0[15:8]`, src0 `w0[7:0]`), decodes them, then translates. Five checks: the census form decodes and lowers, `src_scc` works in the first source position as well, a bitwise op still updates SCC, and a definition followed by a use emits both statements (`scc = s28 != 0;` then `s29 = 0x3f800000u * (scc ? 1u : 0u);`). ``` dev: 19/21 - the 2 failures are pre-existing (below) release: startup_gfx2hlsl_src_scc Passed 0.14 s ``` Fail-first, both caught: ``` refuse src_scc again -> Unsupported: operand 'src_scc' lower it as the constant 0u -> "a defined SCC is read back by the next instruction" FAIL ``` ## Pre-existing failures, not from this PR `startup_gfx2hlsl_mad_preserve_{warp,hardware}` fail in this dev tree with `Unknown GPU operation or invalid arguments: --raw-uav-dump-sm62` — the built `offscreen_check` is stale. **Confirmed identical on `origin/main`** with the same binary. A rebuild fixes it; this branch does not touch that tool. ## What this does not establish - That the emitted HLSL compiles or computes the right value — the test compares text; DXC/WARP were not run here. - The `s_cselect`-style conditional uses of SCC (`cond` operand) are separate and already handled. AI-assisted (Claude Code).
tedin7 commented 2026-11-24 20:00:47 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Review of de00628e (startup: read src_scc as the SCC bit). Verdict: no P1, no P2. One optional P3.

What I checked

  • The change is 4 lines in Stage.u(): scalar source code 253 lowers to (scc ? 1u : 0u). bool scc = false; is declared unconditionally in the generated entry (tools/startup/gfx2hlsl.py:1086), so a read before any SCC-setting instruction compiles and reads 0. The SCC write of a read-modify instruction is emitted after the statement that reads it (s28 = (scc ? 1u : 0u) & s5; scc = s28 != 0;), so the read sees the old SCC, as the hardware does.
  • The source is routed through u(), so a float-context use (f()) gets F((scc ? 1u : 0u)), i.e. the integer bit pattern 0/1 reinterpreted as float. That matches what the hardware does with the raw source value, and no new refusal is bypassed.
  • The census form keeps 1.0 as the raw bits 0x3f800000u and multiplies by the SCC bit, which is what a scalar integer multiply does.
  • The change is clean-room and title-neutral: it uses the public scalar source encoding and the PR text names no title.

Commands run (Linux, on exactly de00628ec96b9b2a5f941b0ea47eabbd97f4ff61)

python3 -B tests/startup_gfx2hlsl_src_scc_check.py          -> PASS (5 checks)
for t in tests/startup_gfx2hlsl*_check.py; do python3 -B $t; done   -> 12 scripts, all rc=0
git diff --check origin/main...HEAD                          -> clean
python3 -B tests/docs_links_check.py                         -> Checked 18 Markdown files and 369 links
python3 -B tests/bidi_controls_check.py                      -> no bidirectional controls

Mutations of the PR code (each restored afterwards)

mutation result
'(scc ? 1u : 0u)' to '(scc ? 0u : 1u)' test FAILS (3 checks)
'(scc ? 1u : 0u)' to '0u' test FAILS (3 checks)

So the test does kill a wrong polarity and a constant.

P3 (optional)

  • tools/startup/gfx2hlsl.py gains a blank line with trailing indentation after the return in u(); harmless.

Limits

The generated HLSL is checked as text only; I did not compile it with a shader compiler (none on this host), and nothing in this PR touches C++ or D3D12, so I did not run the Windows pipeline.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6045776565 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#pullrequestreview-6045776565). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:18:49Z. **Review:** COMMENTED --- Review of `de00628e` (`startup: read src_scc as the SCC bit`). Verdict: no P1, no P2. One optional P3. ## What I checked - The change is 4 lines in `Stage.u()`: scalar source code 253 lowers to `(scc ? 1u : 0u)`. `bool scc = false;` is declared unconditionally in the generated entry (`tools/startup/gfx2hlsl.py:1086`), so a read before any SCC-setting instruction compiles and reads 0. The SCC write of a read-modify instruction is emitted after the statement that reads it (`s28 = (scc ? 1u : 0u) & s5; scc = s28 != 0;`), so the read sees the old SCC, as the hardware does. - The source is routed through `u()`, so a float-context use (`f()`) gets `F((scc ? 1u : 0u))`, i.e. the integer bit pattern 0/1 reinterpreted as float. That matches what the hardware does with the raw source value, and no new refusal is bypassed. - The census form keeps `1.0` as the raw bits `0x3f800000u` and multiplies by the SCC bit, which is what a scalar integer multiply does. - The change is clean-room and title-neutral: it uses the public scalar source encoding and the PR text names no title. ## Commands run (Linux, on exactly `de00628ec96b9b2a5f941b0ea47eabbd97f4ff61`) ``` python3 -B tests/startup_gfx2hlsl_src_scc_check.py -> PASS (5 checks) for t in tests/startup_gfx2hlsl*_check.py; do python3 -B $t; done -> 12 scripts, all rc=0 git diff --check origin/main...HEAD -> clean python3 -B tests/docs_links_check.py -> Checked 18 Markdown files and 369 links python3 -B tests/bidi_controls_check.py -> no bidirectional controls ``` ## Mutations of the PR code (each restored afterwards) | mutation | result | |---|---| | `'(scc ? 1u : 0u)'` to `'(scc ? 0u : 1u)'` | test FAILS (3 checks) | | `'(scc ? 1u : 0u)'` to `'0u'` | test FAILS (3 checks) | So the test does kill a wrong polarity and a constant. ## P3 (optional) - `tools/startup/gfx2hlsl.py` gains a blank line with trailing indentation after the `return` in `u()`; harmless. ## Limits The generated HLSL is checked as text only; I did not compile it with a shader compiler (none on this host), and nothing in this PR touches C++ or D3D12, so I did not run the Windows pipeline. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-24 20:00:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T19:26:50Z.

Review: CHANGES_REQUESTED


I found one correctness blocker at de00628e. The new source reads the HLSL SCC variable after any accepted scalar operation, but the startup lowerer has no SCC update for s_add_u32. A source-built sequence that first sets SCC to 0 with a compare, then adds 0xffffffff + 1 with s_add_u32, then moves src_scc to an output will read stale 0 instead of the carry, 1. The positive bitwise sequence in the current test exercises a modeled writer only.

Please either model the reaching SCC writer or refuse the read where the incoming SCC is unverified, including at entry and across control-flow joins. Add a distinguishing carry case and preserve the compare/bitwise case. This can stay scoped to the new scalar source; it does not need to expand support for every SCC writer.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6045904662 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#pullrequestreview-6045904662). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T19:26:50Z. **Review:** CHANGES_REQUESTED --- I found one correctness blocker at de00628e. The new source reads the HLSL SCC variable after any accepted scalar operation, but the startup lowerer has no SCC update for `s_add_u32`. A source-built sequence that first sets SCC to 0 with a compare, then adds `0xffffffff + 1` with `s_add_u32`, then moves `src_scc` to an output will read stale 0 instead of the carry, 1. The positive bitwise sequence in the current test exercises a modeled writer only. Please either model the reaching SCC writer or refuse the read where the incoming SCC is unverified, including at entry and across control-flow joins. Add a distinguishing carry case and preserve the compare/bitwise case. This can stay scoped to the new scalar source; it does not need to expand support for every SCC writer.
chatgpt-codex-connector[bot commented 2026-11-24 20:01:17 +00:00 (Migrated from github.com)

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


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-24T19:15:51.274627Z de00628 PR opened
ℹ️ 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:7141806828 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#issuecomment-7141806828). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T19:14:26Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"de00628ec96b9b2a5f941b0ea47eabbd97f4ff61","has_any_findings":false,"has_unresolved_findings":false,"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-24T19:15:51.274627Z">2026-11-24T19:15:51.274627Z</relative-time> | `de00628` | PR opened | <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>
ChazY11 commented 2026-11-24 21:27:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T21:14:56Z.


Ran it, and broke the three things that matter

This is the PR that superseded my withdrawn #1896, so I checked it against the two points I put in the issue and one more.

At the PR head, device-free:

out/pe-env/Scripts/python.exe -B tests/startup_gfx2hlsl_src_scc_check.py
a defined SCC is read back by the next instruction: ok
PASS      exit 0

Three mutations to Stage.u(), each reverted:

mutation result
the src_scc branch back to raise Unsupported('operand %r' % tok) caught
(scc ? 1u : 0u) → the constant 1u caught
(scc ? 1u : 0u) → (scc ? 0u : 1u) (inverted) caught

The middle one is the case I flagged when withdrawing my duplicate: an implementation that accepts the operand but drops the
multiply's operand bits is otherwise plausible. The fixture asserts the census form emits

s28 = 0x3f800000u * (scc ? 1u : 0u);

i.e. the raw bits of the inline float, with S_1_0 = 242 # the inline float constant 1.0 (its raw bits are 0x3f800000) at
the top of the file. So the distinction is explicit in the fixture, not just in the comment.

The inverted-conditional mutation is the one I added on top: it is a single character swap that keeps every string comparison
about the shape of the expression true, so a fixture that only matched the emitted text loosely would survive it. This one does
not.

Scope note

docs/experiments.md gains a row, which is the one thing my withdrawn branch was missing. Nothing else in gfx2hlsl.py moves.

Verdict

Reviewed. The three behaviours that decide whether this is right are each pinned by a mutation I ran. No objections — this is
the one to merge for #1820.

Notes

  • AI-assisted review.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7144676440 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#issuecomment-7144676440). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T21:14:56Z. --- ## Ran it, and broke the three things that matter This is the PR that superseded my withdrawn #1896, so I checked it against the two points I put in the issue and one more. At the PR head, device-free: ```powershell out/pe-env/Scripts/python.exe -B tests/startup_gfx2hlsl_src_scc_check.py a defined SCC is read back by the next instruction: ok PASS exit 0 ``` Three mutations to `Stage.u()`, each reverted: | mutation | result | |---|---| | the `src_scc` branch back to `raise Unsupported('operand %r' % tok)` | **caught** | | `(scc ? 1u : 0u)` → the constant `1u` | **caught** | | `(scc ? 1u : 0u)` → `(scc ? 0u : 1u)` (inverted) | **caught** | The middle one is the case I flagged when withdrawing my duplicate: an implementation that accepts the operand but drops the multiply's operand bits is otherwise plausible. The fixture asserts the census form emits ```python s28 = 0x3f800000u * (scc ? 1u : 0u); ``` i.e. the **raw bits** of the inline float, with `S_1_0 = 242 # the inline float constant 1.0 (its raw bits are 0x3f800000)` at the top of the file. So the distinction is explicit in the fixture, not just in the comment. The inverted-conditional mutation is the one I added on top: it is a single character swap that keeps every string comparison about the shape of the expression true, so a fixture that only matched the emitted text loosely would survive it. This one does not. ## Scope note `docs/experiments.md` gains a row, which is the one thing my withdrawn branch was missing. Nothing else in `gfx2hlsl.py` moves. ## Verdict Reviewed. The three behaviours that decide whether this is right are each pinned by a mutation I ran. No objections — this is the one to merge for #1820. ## Notes - AI-assisted review.
tedin7 commented 2026-11-25 13:01:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T12:53:33Z.


@triggered02 could you rebase this branch onto current main and force-push?

GitHub reports head de00628e as conflicting with main, so it cannot be merged as is.

Files that conflict with current main (cf97bee1):

  • CMakeLists.txt

Commands run locally:

git fetch origin main pull/1821/head
git merge-tree --write-tree --name-only origin/main FETCH_HEAD
gh pr view 1821 --json mergeable   # CONFLICTING

Once it is rebased and CI is green it will be re-checked right away.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7163001100 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#issuecomment-7163001100). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T12:53:33Z. --- @triggered02 could you rebase this branch onto current `main` and force-push? GitHub reports head `de00628e` as conflicting with `main`, so it cannot be merged as is. Files that conflict with current `main` (`cf97bee1`): - `CMakeLists.txt` Commands run locally: ``` git fetch origin main pull/1821/head git merge-tree --write-tree --name-only origin/main FETCH_HEAD gh pr view 1821 --json mergeable # CONFLICTING ``` Once it is rebased and CI is green it will be re-checked right away. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 14:04:18 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Review of head 4ee046058db02b1220015088b21f4ce96f1becc4 (Linux only).

Summary: src_scc (scalar source 253) now lowers to (scc ? 1u : 0u) in Stage.u(). Small, correct, in scope for #1820 / #870. No P1.

Checked locally:

  • git diff --stat origin/main...HEAD: 4 files, +116 (CMakeLists, docs/experiments.md, new test, gfx2hlsl.py +4).
  • python3 tests/startup_gfx2hlsl_src_scc_check.py -> PASS (all 5 checks ok).
  • python3 tests/startup_gfx2hlsl_sdwa_check.py -> PASS (neighbouring check unaffected).
  • python3 tests/docs_links_check.py -> 457 links ok.
  • python3 tests/bidi_controls_check.py -> no bidi controls.
  • git diff --check origin/main...HEAD -> clean.
  • Mutation: flipped the lowering to (scc ? 0u : 1u). The test fails on 3 checks (census form, first position, def-then-use), so the new logic is killed. Reverted.
  • reads_scc() (gfx2hlsl.py:588) already matches 'src_scc' in asm, so the calculated-PC/descriptor checks already treat it as an SCC reader. bool scc is declared in the generated prologue (line 4218), so the emitted expression always compiles.
  • Title is neutral, test is registered in CMake next to its siblings, docs section added.

Findings:

  • P1: none.
  • P2: none blocking. The lowering is string-checked only. Repo convention for gfx2hlsl lowerings is a WARP readback vs CPU reference; a dispatch with SCC set and clear (e.g. s_cmp then s_mul_i32 ..., src_scc) would close that. Fine as a follow-up since the expression is a plain ternary.
  • nit: u() is also reached with low16_only=True. src_scc returns the full 0/1 either way, which is correct (value fits in 16 bits), but a one-line comment would make that explicit.
  • nit: CI checks (Linux, Windows, gfx1013 fixtures) were still pending when I reviewed; confirm they are green before merge.

No Windows run: the change is a pure-Python string lowering, no C++ touched.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6058519394 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#pullrequestreview-6058519394). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:31:07Z. **Review:** COMMENTED --- Review of head `4ee046058db02b1220015088b21f4ce96f1becc4` (Linux only). Summary: `src_scc` (scalar source 253) now lowers to `(scc ? 1u : 0u)` in `Stage.u()`. Small, correct, in scope for #1820 / #870. No P1. Checked locally: - `git diff --stat origin/main...HEAD`: 4 files, +116 (CMakeLists, docs/experiments.md, new test, gfx2hlsl.py +4). - `python3 tests/startup_gfx2hlsl_src_scc_check.py` -> PASS (all 5 checks ok). - `python3 tests/startup_gfx2hlsl_sdwa_check.py` -> PASS (neighbouring check unaffected). - `python3 tests/docs_links_check.py` -> 457 links ok. - `python3 tests/bidi_controls_check.py` -> no bidi controls. - `git diff --check origin/main...HEAD` -> clean. - Mutation: flipped the lowering to `(scc ? 0u : 1u)`. The test fails on 3 checks (census form, first position, def-then-use), so the new logic is killed. Reverted. - `reads_scc()` (gfx2hlsl.py:588) already matches `'src_scc' in asm`, so the calculated-PC/descriptor checks already treat it as an SCC reader. `bool scc` is declared in the generated prologue (line 4218), so the emitted expression always compiles. - Title is neutral, test is registered in CMake next to its siblings, docs section added. Findings: - P1: none. - P2: none blocking. The lowering is string-checked only. Repo convention for gfx2hlsl lowerings is a WARP readback vs CPU reference; a dispatch with SCC set and clear (e.g. `s_cmp` then `s_mul_i32 ..., src_scc`) would close that. Fine as a follow-up since the expression is a plain ternary. - nit: `u()` is also reached with `low16_only=True`. `src_scc` returns the full 0/1 either way, which is correct (value fits in 16 bits), but a one-line comment would make that explicit. - nit: CI checks (Linux, Windows, gfx1013 fixtures) were still pending when I reviewed; confirm they are green before merge. No Windows run: the change is a pure-Python string lowering, no C++ touched. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 14:05:08 +00:00 (Migrated from github.com)

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


@triggered02 could you rebase this branch onto current main and force-push?

GitHub reports head 5dc597c1 as conflicting with main, so it cannot be merged as is.

Files that conflict with current main (214ed093):

  • CMakeLists.txt
  • docs/experiments.md

Commands run locally:

git fetch origin main pull/1821/head
git merge-tree --write-tree --name-only origin/main FETCH_HEAD
gh pr view 1821 --json mergeable   # CONFLICTING

Once it is rebased and CI is green it will be re-checked right away.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7163625179 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#issuecomment-7163625179). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:20:02Z. --- @triggered02 could you rebase this branch onto current `main` and force-push? GitHub reports head `5dc597c1` as conflicting with `main`, so it cannot be merged as is. Files that conflict with current `main` (`214ed093`): - `CMakeLists.txt` - `docs/experiments.md` Commands run locally: ``` git fetch origin main pull/1821/head git merge-tree --write-tree --name-only origin/main FETCH_HEAD gh pr view 1821 --json mergeable # CONFLICTING ``` Once it is rebased and CI is green it will be re-checked right away. AI-assisted; commands listed were executed locally.
triggered02 commented 2026-11-25 14:05:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T13:24:12Z.


Rebased onto current main and force-pushed.

  • #1821 (src_scc): merged main in, resolved the CMakeLists.txt registration conflict keeping both sides, head is 5dc597c1. startup_gfx2hlsl_src_scc and startup_translator pass.
  • #1778 (modifier-free): head 7a72fab0. Merging main surfaced a real behaviour change — v_interp_mov_f32 now decodes the parameter selector as p10, p20, p0 and refuses p10/p20 because they need per-vertex attribute values. My test used the old p0 encoding, which now decodes as p10, so it failed. Fixed the fixture (src1 = 2 for p0) and added checks that p10 and p20 are refused rather than read as p0. startup_gfx2hlsl_modifier_free and startup_translator pass.
  • #1722 (1D sampling): head b96eb6b7; the only conflict was an older docs/experiments.md paragraph you had since rewritten, so I kept main's version of it and dropped my wording-only change there. startup_gfx2hlsl_image_1d, startup_image_sample_l and startup_translator pass.

Two of the five I closed rather than rebased, because their content is already on main or duplicated:

  • #1856 (binary16 class compare): main already has the class16 helper, the v_cmp_class_f16/v_cmpx_class_f16 dispatch and tests/startup_gfx2hlsl_cmp_class_f16_check.py, so the branch was integrated directly and the PR was redundant.
  • #1793 (v_mul_hi_u32): duplicated by #1747, which is earlier and carries binary/draw modes with a hardware draw under fxc and dxc. I commented there with the two things worth porting from mine (the instruction-byte construction note and the edge-case list) and deferred to that PR.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7163725798 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#issuecomment-7163725798). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-25T13:24:12Z. --- Rebased onto current `main` and force-pushed. - `#1821` (`src_scc`): merged `main` in, resolved the `CMakeLists.txt` registration conflict keeping both sides, head is `5dc597c1`. `startup_gfx2hlsl_src_scc` and `startup_translator` pass. - `#1778` (modifier-free): head `7a72fab0`. Merging `main` surfaced a real behaviour change — `v_interp_mov_f32` now decodes the parameter selector as `p10, p20, p0` and refuses `p10`/`p20` because they need per-vertex attribute values. My test used the old `p0` encoding, which now decodes as `p10`, so it failed. Fixed the fixture (`src1 = 2` for `p0`) and added checks that `p10` and `p20` are refused rather than read as `p0`. `startup_gfx2hlsl_modifier_free` and `startup_translator` pass. - `#1722` (1D sampling): head `b96eb6b7`; the only conflict was an older `docs/experiments.md` paragraph you had since rewritten, so I kept `main`'s version of it and dropped my wording-only change there. `startup_gfx2hlsl_image_1d`, `startup_image_sample_l` and `startup_translator` pass. Two of the five I closed rather than rebased, because their content is already on `main` or duplicated: - **#1856** (binary16 class compare): `main` already has the `class16` helper, the `v_cmp_class_f16`/`v_cmpx_class_f16` dispatch and `tests/startup_gfx2hlsl_cmp_class_f16_check.py`, so the branch was integrated directly and the PR was redundant. - **#1793** (`v_mul_hi_u32`): duplicated by #1747, which is earlier and carries `binary`/`draw` modes with a hardware draw under fxc and dxc. I commented there with the two things worth porting from mine (the instruction-byte construction note and the edge-case list) and deferred to that PR. AI-assisted (Claude Code).
triggered02 commented 2026-11-25 14:05:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T13:28:32Z.


Rebased onto current main (214ed093) and force-pushed — the branch is now a single clean commit on top of main rather than a merge chain, so the conflicts are gone.

Head is 4b0b6ae5-style single-commit history (the exact SHA is in the PR): Stage.u() gains the src_scc case, tests/startup_gfx2hlsl_src_scc_check.py is registered at the sdwa anchor, and docs/experiments.md has its own ## \src_scc` as a scalar source` section instead of a paragraph spliced between unrelated ones.

Verification on this tree: startup_gfx2hlsl_src_scc and startup_translator pass, docs links check passes (19 files / 457 links).

Note for the other two: I am re-creating #1778 and #1722 the same way (fresh single commit on current main) rather than merging main repeatedly, since main moves faster than a merge chain stays valid.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7163830766 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#issuecomment-7163830766). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-25T13:28:32Z. --- Rebased onto current `main` (`214ed093`) and force-pushed — the branch is now a single clean commit on top of main rather than a merge chain, so the conflicts are gone. Head is `4b0b6ae5`-style single-commit history (the exact SHA is in the PR): `Stage.u()` gains the `src_scc` case, `tests/startup_gfx2hlsl_src_scc_check.py` is registered at the `sdwa` anchor, and `docs/experiments.md` has its own `## \`src_scc\` as a scalar source` section instead of a paragraph spliced between unrelated ones. Verification on this tree: `startup_gfx2hlsl_src_scc` and `startup_translator` pass, docs links check passes (19 files / 457 links). Note for the other two: I am re-creating #1778 and #1722 the same way (fresh single commit on current main) rather than merging main repeatedly, since main moves faster than a merge chain stays valid. AI-assisted (Claude Code).
triggered02 commented 2026-11-25 17:01:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T16:18:06Z.


Addressed the CHANGES_REQUESTED correctness blocker from @R0Y00 and the review nits from @tedin7 in the latest commit on startup/src-scc (re-created as a single clean commit on origin/main 7092683a).

What changed

  1. Verified incoming SCC tracking (tools/startup/gfx2hlsl.py):

    • Stage.u() refuses src_scc (Unsupported: src_scc with unverified SCC) unless self.scc_verified is True on the reaching path in the current block.
    • self.scc_verified starts False at shader entry (Stage.translate() and getattr(self, 'scc_verified', False) for unit probes), is reset to False at every branch target / control-flow join and on non-fallthrough terminators, and is cleared after SCC_UNMODELLED scalar ops (s_add_u32, s_sub_u32, etc. — after reading their own sources so s_add_u32 dst, src_scc, 1 still reads the incoming verified SCC), descriptor-elided SCC writes, calculated-PC s_add_u32/s_addc_u32, and s_wqm_b32/s_wqm_b64.
    • Modeled SCC writers (set_scc(), set_exec_scc(), scalar_wide_op()) set self.scc_verified = True.
    • Added the explicit comment in Stage.u() noting src_scc returns (scc ? 1u : 0u) cleanly for low16_only=True as well (0/1 fits in 16 bits).
  2. Tests (tests/startup_gfx2hlsl_src_scc_check.py, 12 checks via full Stage.translate()):

    • Entry refusal: src_scc at offset 0 in s_mul_i32 and s_and_b32 refuses with src_scc with unverified SCC.
    • Distinguishing carry case: s_cmp_eq_u32 0, 1 (sets scc = false) → s_add_u32 s1, 0xffffffff, 1 (hardware carry 1, unmodeled in HLSL) → s_mul_i32 s28, 1.0, src_scc refuses with src_scc with unverified SCC instead of reading stale 0.
    • Preserved compare & bitwise cases: s_cmp_eq_u32 0, 0 → s_mul_i32 s28, 1.0, src_scc, s_and_b32 s27, s4, s5 → s_and_b32 s28, src_scc, s5 → s_mul_i32 s29, 1.0, src_scc, and low16_only=True all pass.
    • Input-before-write: s_cmp_eq_u32 0, 0 → s_add_u32 s1, src_scc, 1 passes, while a subsequent src_scc refuses.
    • Control-flow join: s_cmp_eq_u32 → s_cbranch_scc0 → s_nop 0 → src_scc at the branch target refuses; a modeled compare inside the joined block before src_scc passes.

Measured checks

  • tests/startup_gfx2hlsl_src_scc_check.py: 12/12 ok, PASS.
  • All 62 tests/startup_gfx2hlsl_*_check.py scripts (including startup_gfx2hlsl_sopk_accum_check.py): 62/62 passed.
  • ctest --preset dev --no-tests=error -R '^(startup_gfx2hlsl_src_scc|startup_gfx2hlsl_sopk_accum|startup_translator)$': 3/3 passed.
  • tests/docs_links_check.py (464 links) and tests/bidi_controls_check.py (1,723 files): passed.
  • Fail-first mutations on tools/startup/gfx2hlsl.py: flipping (scc ? 1u : 0u), bypassing the scc_verified check in u(), dropping the SCC_UNMODELLED clear, and dropping the join clear all fail startup_gfx2hlsl_src_scc_check.py (exit 1).

Not established

  • No DXC/WARP GPU dispatch was run on the emitted src_scc ternary expression.

AI-assisted (Gemini).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167767951 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#issuecomment-7167767951). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-25T16:18:06Z. --- Addressed the `CHANGES_REQUESTED` correctness blocker from @R0Y00 and the review nits from @tedin7 in the latest commit on `startup/src-scc` (re-created as a single clean commit on `origin/main` `7092683a`). ### What changed 1. **Verified incoming SCC tracking (`tools/startup/gfx2hlsl.py`):** - `Stage.u()` refuses `src_scc` (`Unsupported: src_scc with unverified SCC`) unless `self.scc_verified` is `True` on the reaching path in the current block. - `self.scc_verified` starts `False` at shader entry (`Stage.translate()` and `getattr(self, 'scc_verified', False)` for unit probes), is reset to `False` at every branch target / control-flow join and on non-fallthrough terminators, and is cleared after `SCC_UNMODELLED` scalar ops (`s_add_u32`, `s_sub_u32`, etc. — **after** reading their own sources so `s_add_u32 dst, src_scc, 1` still reads the incoming verified SCC), descriptor-elided SCC writes, calculated-PC `s_add_u32`/`s_addc_u32`, and `s_wqm_b32`/`s_wqm_b64`. - Modeled SCC writers (`set_scc()`, `set_exec_scc()`, `scalar_wide_op()`) set `self.scc_verified = True`. - Added the explicit comment in `Stage.u()` noting `src_scc` returns `(scc ? 1u : 0u)` cleanly for `low16_only=True` as well (0/1 fits in 16 bits). 2. **Tests (`tests/startup_gfx2hlsl_src_scc_check.py`, 12 checks via full `Stage.translate()`):** - **Entry refusal:** `src_scc` at offset 0 in `s_mul_i32` and `s_and_b32` refuses with `src_scc with unverified SCC`. - **Distinguishing carry case:** `s_cmp_eq_u32 0, 1` (sets `scc = false`) → `s_add_u32 s1, 0xffffffff, 1` (hardware carry 1, unmodeled in HLSL) → `s_mul_i32 s28, 1.0, src_scc` refuses with `src_scc with unverified SCC` instead of reading stale 0. - **Preserved compare & bitwise cases:** `s_cmp_eq_u32 0, 0` → `s_mul_i32 s28, 1.0, src_scc`, `s_and_b32 s27, s4, s5` → `s_and_b32 s28, src_scc, s5` → `s_mul_i32 s29, 1.0, src_scc`, and `low16_only=True` all pass. - **Input-before-write:** `s_cmp_eq_u32 0, 0` → `s_add_u32 s1, src_scc, 1` passes, while a subsequent `src_scc` refuses. - **Control-flow join:** `s_cmp_eq_u32` → `s_cbranch_scc0` → `s_nop 0` → `src_scc` at the branch target refuses; a modeled compare inside the joined block before `src_scc` passes. ### Measured checks - `tests/startup_gfx2hlsl_src_scc_check.py`: 12/12 `ok`, `PASS`. - All 62 `tests/startup_gfx2hlsl_*_check.py` scripts (including `startup_gfx2hlsl_sopk_accum_check.py`): 62/62 passed. - `ctest --preset dev --no-tests=error -R '^(startup_gfx2hlsl_src_scc|startup_gfx2hlsl_sopk_accum|startup_translator)$'`: 3/3 passed. - `tests/docs_links_check.py` (464 links) and `tests/bidi_controls_check.py` (1,723 files): passed. - Fail-first mutations on `tools/startup/gfx2hlsl.py`: flipping `(scc ? 1u : 0u)`, bypassing the `scc_verified` check in `u()`, dropping the `SCC_UNMODELLED` clear, and dropping the join clear all fail `startup_gfx2hlsl_src_scc_check.py` (exit 1). ### Not established - No DXC/WARP GPU dispatch was run on the emitted `src_scc` ternary expression. AI-assisted (Gemini).
triggered02 commented 2026-11-25 18:01:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T18:00:03Z.


@R0Y00 the CHANGES_REQUESTED blocker from your review of de00628e is addressed in 619dfcf3 (branch startup/src-scc, re-created as a single commit on origin/main), and I replied with the mapping in my previous comment: the SCC update for s_add_u32 (and the other scalar ops the fixture exercises) is now tracked, so a source-built s_scc read after an accepted scalar operation sees the updated bit rather than a stale one.

The check for that specific sequence is ests/startup_gfx2hlsl_src_scc_check.py (the "stale SCC after s_add_u32" control fails if the update is removed). startup_translator_check.py, docs_links_check.py and the ctest regex from the PR description are green on 619dfcf3.

Could you re-review when you have a moment so the CHANGES_REQUESTED state is cleared? Nothing else has changed since that comment.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170297379 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#issuecomment-7170297379). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-25T18:00:03Z. --- @R0Y00 the CHANGES_REQUESTED blocker from your review of de00628e is addressed in 619dfcf3 (branch startup/src-scc, re-created as a single commit on origin/main), and I replied with the mapping in my previous comment: the SCC update for s_add_u32 (and the other scalar ops the fixture exercises) is now tracked, so a source-built s_scc read after an accepted scalar operation sees the updated bit rather than a stale one. The check for that specific sequence is ests/startup_gfx2hlsl_src_scc_check.py (the "stale SCC after s_add_u32" control fails if the update is removed). startup_translator_check.py, docs_links_check.py and the ctest regex from the PR description are green on 619dfcf3. Could you re-review when you have a moment so the CHANGES_REQUESTED state is cleared? Nothing else has changed since that comment.
triggered02 commented 2026-11-25 18:01:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T18:00:35Z.


Correction to my comment above — I described the fix backwards, and the test file says the opposite of what I wrote.

The branch does not track an SCC update for s_add_u32. It treats s_add_u32 (and the other scalar writers the lowerer does not model) as an unverified SCC writer: the emitted HLSL has no SCC assignment, so the tracked state becomes "unverified", and any later src_scc read is refused with src_scc with unverified SCC instead of reading a stale scc variable. That is the safe direction for exactly the case in your review: s_cmp_eq_u32 sets SCC=0, s_add_u32 0xffffffff + 1 sets the hardware carry, and a following src_scc would otherwise read the stale 0.

The control that pins your blocker is in tests/startup_gfx2hlsl_src_scc_check.py:

  • §4, s_add_u32 carry after compare leaves SCC unverified and is refused — asserts refused_reason(...) == 'src_scc with unverified SCC' for the compare → s_add_u32 carry → src_scc sequence.
  • §5, reading src_scc after s_add_u32 is refused — the plain unmodeled-writer case, and s_add_u32 reading incoming verified src_scc is accepted for the input-before-write ordering.
  • §6, src_scc across a control-flow join is refused — the same state across a branch join.

Verified on branch head 619dfcf3 just now: tests/startup_gfx2hlsl_src_scc_check.py exit 0, tests/startup_translator_check.py exit 0, tests/docs_links_check.py exit 0 (git diff --check clean, tree clean). Removing the unverified-SCC transition makes §4/§5/§6 fail with the stale-scc lowering, so this is a fail-first control for the review point.

Nothing else in the PR changed; still asking for a re-review to clear CHANGES_REQUESTED.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170309934 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#issuecomment-7170309934). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-25T18:00:35Z. --- Correction to my comment above — I described the fix backwards, and the test file says the opposite of what I wrote. The branch does **not** track an SCC update for `s_add_u32`. It treats `s_add_u32` (and the other scalar writers the lowerer does not model) as an **unverified SCC writer**: the emitted HLSL has no SCC assignment, so the tracked state becomes "unverified", and any later `src_scc` read is **refused** with `src_scc with unverified SCC` instead of reading a stale `scc` variable. That is the safe direction for exactly the case in your review: `s_cmp_eq_u32` sets SCC=0, `s_add_u32 0xffffffff + 1` sets the hardware carry, and a following `src_scc` would otherwise read the stale 0. The control that pins your blocker is in `tests/startup_gfx2hlsl_src_scc_check.py`: - §4, `s_add_u32 carry after compare leaves SCC unverified and is refused` — asserts `refused_reason(...) == 'src_scc with unverified SCC'` for the compare → `s_add_u32` carry → `src_scc` sequence. - §5, `reading src_scc after s_add_u32 is refused` — the plain unmodeled-writer case, and `s_add_u32 reading incoming verified src_scc is accepted` for the input-before-write ordering. - §6, `src_scc across a control-flow join is refused` — the same state across a branch join. Verified on branch head `619dfcf3` just now: `tests/startup_gfx2hlsl_src_scc_check.py` exit 0, `tests/startup_translator_check.py` exit 0, `tests/docs_links_check.py` exit 0 (`git diff --check` clean, tree clean). Removing the unverified-SCC transition makes §4/§5/§6 fail with the stale-`scc` lowering, so this is a fail-first control for the review point. Nothing else in the PR changed; still asking for a re-review to clear `CHANGES_REQUESTED`.
upstream-sync closed this pull request 2026-11-26 04:04:02 +00:00
tedin7 commented 2026-11-26 04:04:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:21:48Z.

Review: COMMENTED


Review of head bc801eb1 (Linux). @R0Y00's blocker from de00628e looks addressed. A re-review from you is needed to clear the changes-requested state.

What I checked:

  • src_scc now lowers to (scc ? 1u : 0u) only while scc_verified is set. set_scc, set_exec_scc and the compare path set it. It is cleared at entry, at every join, at a non-fallthrough block start, after s_add_u32/s_addc_u32 on varying data, after every SCC_UNMODELLED op, and on the descriptor path. So the requested case (compare sets SCC to 0, then s_add_u32 0xffffffff + 1, then read src_scc) is refused instead of reading a stale 0. The test has that carry case and keeps the compare/bitwise case.
  • Mutations: dropping the SCC_UNMODELLED reset makes the carry checks fail (2 MISMATCH). Dropping the join reset also fails. Dropping only the if not falls: reset at a block start does not fail any check. A branch-only target also goes through the join path, so that line looks redundant rather than unguarded. All changes were reverted.
  • It merges cleanly with current main (21 commits ahead, including the scalar null work from #2698).
  • #2577 is not a duplicate: it says "Depends on #1821" and extends the proof across branch targets. This PR goes first.

Not blocking, but worth adding: the accepted read is checked only as translated text. A small D3D12 WARP readback (compare sets SCC, then s_mov_b32 sX, src_scc stored and read back against a CPU reference) would prove the emitted (scc ? 1u : 0u) on a device. That is what other new gfx2hlsl lowerings carry.

Commands (Linux, on bc801eb1 merged with origin/main locally, not pushed): python3 tests/startup_gfx2hlsl_src_scc_check.py PASS, python3 tests/startup_gfx2hlsl_scalar_null_check.py ok, python3 tests/startup_gfx2hlsl_compute_check.py ok, python3 tests/startup_translator_check.py 0 failed, python3 tests/startup_gfx2hlsl_scalar_table_arity_check.py 0 failed. Win2025 on this head is running, and a receipt will follow.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068124398 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#pullrequestreview-6068124398). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:21:48Z. **Review:** COMMENTED --- Review of head `bc801eb1` (Linux). @R0Y00's blocker from `de00628e` looks addressed. A re-review from you is needed to clear the changes-requested state. What I checked: - `src_scc` now lowers to `(scc ? 1u : 0u)` only while `scc_verified` is set. `set_scc`, `set_exec_scc` and the compare path set it. It is cleared at entry, at every join, at a non-fallthrough block start, after `s_add_u32`/`s_addc_u32` on varying data, after every `SCC_UNMODELLED` op, and on the descriptor path. So the requested case (compare sets SCC to 0, then `s_add_u32 0xffffffff + 1`, then read `src_scc`) is refused instead of reading a stale 0. The test has that carry case and keeps the compare/bitwise case. - Mutations: dropping the `SCC_UNMODELLED` reset makes the carry checks fail (2 MISMATCH). Dropping the join reset also fails. Dropping only the `if not falls:` reset at a block start does not fail any check. A branch-only target also goes through the join path, so that line looks redundant rather than unguarded. All changes were reverted. - It merges cleanly with current `main` (21 commits ahead, including the scalar `null` work from #2698). - #2577 is not a duplicate: it says "Depends on #1821" and extends the proof across branch targets. This PR goes first. Not blocking, but worth adding: the accepted read is checked only as translated text. A small D3D12 WARP readback (compare sets SCC, then `s_mov_b32 sX, src_scc` stored and read back against a CPU reference) would prove the emitted `(scc ? 1u : 0u)` on a device. That is what other new gfx2hlsl lowerings carry. Commands (Linux, on `bc801eb1` merged with `origin/main` locally, not pushed): `python3 tests/startup_gfx2hlsl_src_scc_check.py` PASS, `python3 tests/startup_gfx2hlsl_scalar_null_check.py` ok, `python3 tests/startup_gfx2hlsl_compute_check.py` ok, `python3 tests/startup_translator_check.py` 0 failed, `python3 tests/startup_gfx2hlsl_scalar_table_arity_check.py` 0 failed. Win2025 on this head is running, and a receipt will follow. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-26 04:04:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T03:24:41Z.

Review: APPROVED


The updated source proof refuses unknown SCC at entry, after an unmodelled carry writer, and across a join. It reads the old verified SCC when the same instruction overwrites it, and accepts a fresh modelled writer inside the joined block. I reran all 12 source checks, the SDWA controls and the neighboring startup translator checks on this integrated head.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068142311 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1821#pullrequestreview-6068142311). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T03:24:41Z. **Review:** APPROVED --- The updated source proof refuses unknown SCC at entry, after an unmodelled carry writer, and across a join. It reads the old verified SCC when the same instruction overwrites it, and accepts a fresh modelled writer inside the joined block. I reran all 12 source checks, the SDWA controls and the neighboring startup translator checks on this integrated head.
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!1814
No description provided.