startup: treat s_setprio as a scheduling hint in gfx2hlsl #1241

Manually merged
github merged 1 commit from gh-pr/1241/head into gh-pr/1241/base 2026-11-26 22:51:38 +00:00
Owner

@⁠triggered02 on GitHub · 2026-11-24 04:59 UTC · original
triggered02:startup/setprio-hint → main · +1 −1 · 1 files · 1 commits · merged 2026-11-24 05:13 UTC

s_setprio only raises or lowers a wave's scheduling priority; it cannot change a shader's result, so it belongs with the other instruction-shaped hints the translator already drops in one() (s_nop, s_inst_prefetch, s_clause, s_code_end, ...).

Without it, two of the four pipelines the title requests during startup failed to translate:

16749053b07554ae: unsupported: s_setprio
80ae81ccd7078a85: unsupported: s_setprio

and their draws were skipped. Measured on the same startup run (GTX 1660 SUPER, driver 32.0.16.1074, Windows 11 build 26200):

before after
pipelines translated / missing 2 / 2 4 / 0
translated draws 3,000, 5,950 not drawn 5,378, none skipped

Translating the two pipelines restores the draws; it does not by itself make the intro appear (the run still stops later in the render path), and no new shortcut is introduced — the instruction is dropped exactly like its neighbours above.

**@⁠triggered02** on GitHub · 2026-11-24 04:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1241) `triggered02:startup/setprio-hint` → `main` · +1 −1 · 1 files · 1 commits · merged 2026-11-24 05:13 UTC `s_setprio` only raises or lowers a wave's scheduling priority; it cannot change a shader's result, so it belongs with the other instruction-shaped hints the translator already drops in `one()` (`s_nop`, `s_inst_prefetch`, `s_clause`, `s_code_end`, ...). Without it, two of the four pipelines the title requests during startup failed to translate: ``` 16749053b07554ae: unsupported: s_setprio 80ae81ccd7078a85: unsupported: s_setprio ``` and their draws were skipped. Measured on the same startup run (GTX 1660 SUPER, driver 32.0.16.1074, Windows 11 build 26200): | | before | after | |---|---|---| | `pipelines translated / missing` | 2 / 2 | **4 / 0** | | translated draws | 3,000, 5,950 not drawn | **5,378, none skipped** | Translating the two pipelines restores the draws; it does not by itself make the intro appear (the run still stops later in the render path), and no new shortcut is introduced — the instruction is dropped exactly like its neighbours above.
`s_setprio` only raises or lowers a wave's scheduling priority; it cannot change a shader's result,
so it belongs with the other instruction-shaped hints the translator already drops (`s_nop`,
`s_inst_prefetch`, `s_waicnt`-class waits). Without it, two of the four pipelines the title requests
during startup failed to translate with `unsupported: s_setprio`, and their draws were skipped.

Measured on the same startup run: pipelines translated 2 / missing 2 became 4 / 0, and translated
draws went from 3,000 with 5,950 not drawn to 5,378 with none skipped.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:51:36 +00:00
github manually merged commit e7c8bfd2b7 into gh-pr/1241/base 2026-11-26 22:51:38 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 05:00 UTC · original · edited 2026-11-24 05:03 UTC

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-24T05:03:16.393677Z e7c8bfd 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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 05:00 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1241#issuecomment-7122543329) · edited 2026-11-24 05:03 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"e7c8bfd2b7829643fe7e92a48bf085e7702b8f6f","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-24T05:03:16.393677Z">2026-11-24T05:03:16.393677Z</relative-time> | `e7c8bfd` | 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>
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 05:03 UTC · original · reviewed

Reviewed commit e7c8bfd2 (Linux host; Windows startup runtime was not executed locally).

Code & Edge-Case Audit

  • tools/startup/gfx2hlsl.py (Stage.one):
    • Adds 's_setprio' to the existing no-op hint tuple alongside s_nop, s_clause, s_inst_prefetch, s_waitcnt, s_code_end, etc., returning None without affecting control flow or register/memory state.
    • s_setprio is SOPP opcode 0x0f (0xbf8fxxxx), where imm16 is a wave priority hint (0..3 on RDNA2; disasm_rdna2.py decodes any imm16). Unlike tools/pixel_aot.py (HINT_LIMITS["s_setprio"] = 3), gfx2hlsl.py drops all listed hint instructions without validating imm16 bounds, which is consistent with its neighbouring hints in Stage.one.
  • Title-neutrality (AGENTS.md): compliant.

Checks Run (Linux / Python)

  • git diff --check origin/main...HEAD: pass (0 issues)
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: pass (16 Markdown files, 280 links)
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: pass (1046 files)
  • Targeted s_setprio check (disasm_rdna2 on 00008fbf / 03008fbf and gfx2hlsl.Stage.one on s_setprio / s_setprio_e32): pass
  • Windows runtime run: not run locally.
**@⁠tedin7** on GitHub · 2026-11-24 05:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1241#pullrequestreview-6033963755) · **reviewed** Reviewed commit `e7c8bfd2` (Linux host; Windows startup runtime was not executed locally). ### Code & Edge-Case Audit - `tools/startup/gfx2hlsl.py` (`Stage.one`): - Adds `'s_setprio'` to the existing no-op hint tuple alongside `s_nop`, `s_clause`, `s_inst_prefetch`, `s_waitcnt`, `s_code_end`, etc., returning `None` without affecting control flow or register/memory state. - `s_setprio` is SOPP opcode `0x0f` (`0xbf8fxxxx`), where `imm16` is a wave priority hint (`0..3` on RDNA2; `disasm_rdna2.py` decodes any `imm16`). Unlike `tools/pixel_aot.py` (`HINT_LIMITS["s_setprio"] = 3`), `gfx2hlsl.py` drops all listed hint instructions without validating `imm16` bounds, which is consistent with its neighbouring hints in `Stage.one`. - Title-neutrality (`AGENTS.md`): compliant. ### Checks Run (Linux / Python) - `git diff --check origin/main...HEAD`: pass (0 issues) - `/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py`: pass (16 Markdown files, 280 links) - `/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py`: pass (1046 files) - Targeted `s_setprio` check (`disasm_rdna2` on `00008fbf` / `03008fbf` and `gfx2hlsl.Stage.one` on `s_setprio` / `s_setprio_e32`): pass - Windows runtime run: not run locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.