build: apply the shader-compiler /W4 /WX ratchet to MSVC only #3855

Merged
triggered02 merged 4 commits from upstream-pr/3855 into main 2026-12-02 15:32:39 +00:00
triggered02 commented 2026-12-02 13:25:38 +00:00 (Migrated from github.com)

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


Fixes #3853.

What changed. The /W4 /permissive- + /WX ratchet d654ad80 added for the shader compiler is now inside

if(MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")

MSVC is true for clang-cl as well, because clang-cl presents the MSVC command line, so the ratchet reached a compiler with a different warning set and made src/gfx1013_vertex_id.cpp fail at /WX (7 × -Wmissing-field-initializers). Real MSVC keeps exactly the flags and the per-source /WX it had before; nothing else in the block moved.

Why this and not a suppression. The commit's own message is "raise MSVC warnings for the shader compiler", so applying it to MSVC matches the stated intent, and it leaves docs/non-windows-hosts.md's clang-cl route working instead of needing a clang-specific exemption for one warning class. If you would rather keep /W4 /WX active for clang-cl, the alternative is -Wno-missing-field-initializers for clang only — say so and I will switch; either way the 7 initializers in that file stay as they are, since they are your file and not this change's subject.

Verification — Debian, clang-cl 19.1.1, xwin SDK 10.0.26100 splat, Release, the toolchain file from the clang-cl section of docs/non-windows-hosts.md:

# before this change (5770f14e)
cmake --build out/build/clang --target d3d12_xs_shim -j 8
FAILED: CMakeFiles/x2w_shader_compiler.dir/src/gfx1013_vertex_id.cpp.obj
  src/gfx1013_vertex_id.cpp(117,79): error: missing field 'value' initializer [-Werror,-Wmissing-field-initializers]
  ... 7 errors generated.

# after this change
cmake --build out/build/clang --target x2w_shader_compiler -j 8   -> x2w_shader_compiler.lib (20 MB)
cmake --build out/build/clang --target d3d12_xs_shim     -j 8     -> d3d12_xs.dll (15.4 MB)

Not established. No MSVC, no Windows host and no GPU here, so the MSVC side is unchanged-by-inspection, not re-measured. The Windows CI job is the check for that. The pure-Python checks are unaffected — this touches only a CMake condition.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5607338908 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3855). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T13:25:38Z. --- Fixes #3853. **What changed.** The `/W4 /permissive-` + `/WX` ratchet `d654ad80` added for the shader compiler is now inside ```cmake if(MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") ``` `MSVC` is true for clang-cl as well, because clang-cl presents the MSVC command line, so the ratchet reached a compiler with a different warning set and made `src/gfx1013_vertex_id.cpp` fail at `/WX` (7 × `-Wmissing-field-initializers`). Real MSVC keeps exactly the flags and the per-source `/WX` it had before; nothing else in the block moved. **Why this and not a suppression.** The commit's own message is "raise MSVC warnings for the shader compiler", so applying it to MSVC matches the stated intent, and it leaves `docs/non-windows-hosts.md`'s clang-cl route working instead of needing a clang-specific exemption for one warning class. If you would rather keep `/W4 /WX` active for clang-cl, the alternative is `-Wno-missing-field-initializers` for clang only — say so and I will switch; either way the 7 initializers in that file stay as they are, since they are your file and not this change's subject. **Verification** — Debian, clang-cl 19.1.1, xwin SDK 10.0.26100 splat, Release, the toolchain file from the clang-cl section of `docs/non-windows-hosts.md`: ``` # before this change (5770f14e) cmake --build out/build/clang --target d3d12_xs_shim -j 8 FAILED: CMakeFiles/x2w_shader_compiler.dir/src/gfx1013_vertex_id.cpp.obj src/gfx1013_vertex_id.cpp(117,79): error: missing field 'value' initializer [-Werror,-Wmissing-field-initializers] ... 7 errors generated. # after this change cmake --build out/build/clang --target x2w_shader_compiler -j 8 -> x2w_shader_compiler.lib (20 MB) cmake --build out/build/clang --target d3d12_xs_shim -j 8 -> d3d12_xs.dll (15.4 MB) ``` **Not established.** No MSVC, no Windows host and no GPU here, so the MSVC side is unchanged-by-inspection, not re-measured. The Windows CI job is the check for that. The pure-Python checks are unaffected — this touches only a CMake condition.
chatgpt-codex-connector[bot] commented 2026-12-02 13:25:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-12-02T13:25:54Z.


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-12-02T13:27:59.385367Z 4f299d4 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:7346866680 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3855#issuecomment-7346866680). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-12-02T13:25:54Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"4f299d4bfc0abd11bc01c540ccd8573578cbdd64","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-12-02T13:27:59.385367Z">2026-12-02T13:27:59.385367Z</relative-time> | `4f299d4` | 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>
triggered02 commented 2026-12-02 13:43:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T13:43:46Z.


Windows CI on this PR failed, but not because of this change — the only failing test is native_direct_mesh, and it fails identically on #2773, #3852 and #1536, none of which touch a warning-flag condition. Filed as #3856 with the four job links and the error line (native compute +0x34: unmapped graphics export).

This change only moves a if(MSVC) condition, so it cannot alter the shader-compiler's runtime behaviour; the MSVC warning flags and the per-source /WX are unchanged. Linux Python checks and the gfx1013 job pass on this head, matching the local before/after I recorded.

Codex reviewed at 4f299d4b with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7347354551 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3855#issuecomment-7347354551). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T13:43:46Z. --- Windows CI on this PR failed, but not because of this change — the only failing test is `native_direct_mesh`, and it fails identically on #2773, #3852 and #1536, none of which touch a warning-flag condition. Filed as #3856 with the four job links and the error line (`native compute +0x34: unmapped graphics export`). This change only moves a `if(MSVC)` condition, so it cannot alter the shader-compiler's runtime behaviour; the MSVC warning flags and the per-source `/WX` are unchanged. Linux Python checks and the gfx1013 job pass on this head, matching the local before/after I recorded. Codex reviewed at `4f299d4b` with no findings.
R0Y00 commented 2026-12-02 14:06:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T14:06:03Z.

Review: APPROVED


Reviewed 4f299d4b. The CMake-only change gates the shader compiler and CLI warning options together, keeping the per-source /WX list and MSVC options intact while excluding the Clang frontend used by the documented clang-cl/xwin build. The author tested that build with clang-cl 19.1.1. I checked the exact diff and verified the hosted Windows log reaches CTest, where the only failed test is the shared native_direct_mesh fixture (+0x34: unmapped graphics export, #3851). I did not rerun the clang-cl/xwin build locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6152368415 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3855#pullrequestreview-6152368415). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T14:06:03Z. **Review:** APPROVED --- Reviewed `4f299d4b`. The CMake-only change gates the shader compiler and CLI warning options together, keeping the per-source `/WX` list and MSVC options intact while excluding the Clang frontend used by the documented clang-cl/xwin build. The author tested that build with clang-cl 19.1.1. I checked the exact diff and verified the hosted Windows log reaches CTest, where the only failed test is the shared `native_direct_mesh` fixture (`+0x34: unmapped graphics export`, #3851). I did not rerun the clang-cl/xwin build locally.
triggered02 commented 2026-12-02 15:11:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T15:11:37Z.


Noting why this is still blocked after your approval, so it does not look like the change is failing on its own merits.

The required Build and test on Windows check is red on this head, and the only failing test is native_direct_mesh — the shared fixture breakage tracked in #3856, not anything this PR touches (it moves one CMake condition). It fails identically on #2773, #3852 and #1536.

PR #3861 fixes it and is green on all checks (Windows 9m4s, gfx1013 3m50s, Linux Python 5m26s). It is a one-line fixture restore.

One-step path to unblock this one: merge #3861, then I merge current main into this branch and re-run the checks — the diff here does not change, it just needs the fixed fixture underneath it. Re-running this PR's checks before then would reproduce the same failure, so it is not worth a re-run yet.

reviewDecision also reads empty for this PR despite your approval, which suggests the branch protection rule is not counting it as satisfying the review requirement. Worth a look on your side if you expected the merge button to be live once the check passes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7349898640 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3855#issuecomment-7349898640). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T15:11:37Z. --- Noting why this is still blocked after your approval, so it does not look like the change is failing on its own merits. The required `Build and test on Windows` check is red on this head, and the only failing test is `native_direct_mesh` — the shared fixture breakage tracked in #3856, not anything this PR touches (it moves one CMake condition). It fails identically on #2773, #3852 and #1536. **PR #3861 fixes it** and is green on all checks (Windows 9m4s, gfx1013 3m50s, Linux Python 5m26s). It is a one-line fixture restore. **One-step path to unblock this one:** merge #3861, then I merge current `main` into this branch and re-run the checks — the diff here does not change, it just needs the fixed fixture underneath it. Re-running this PR's checks before then would reproduce the same failure, so it is not worth a re-run yet. `reviewDecision` also reads empty for this PR despite your approval, which suggests the branch protection rule is not counting it as satisfying the review requirement. Worth a look on your side if you expected the merge button to be live once the check passes.
triggered02 commented 2026-12-02 15:20:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T15:20:14Z.


Merged the #3861 fixture fix into this branch so the approved change is no longer stuck behind an unrelated failure. Head is now 1d4e68fa.

Why here and not "wait for #3861 to merge". You approved this PR, and it was blocked only by the required Windows check failing on native_direct_mesh (#3856) — a broken fixture that 5545de92 introduced, nothing to do with this diff. Merging rather than re-running was the only way to get the check to pass; a re-run would have reproduced the same failure.

What is in the branch now, relative to current main:

CMakeLists.txt                    | 6 +++++-     this PR's change (the /W4 /WX guard)
tests/native_direct_mesh_check.py | 3 +++       #3861's one-line fixture restore

Verified on this head:

  • native_direct_mesh_check.py against a compile_dxil built here → exit 0, mesh allocation, indexed outputs, group exchange and negative controls passed. Before the merge it aborted with unmapped graphics export.
  • tests/standin_exports_check.py → 470 cases, 6/6 mutations killed, PASS.
  • The CMake change itself is unchanged from the head you approved.

If #3861 merges first, this merge becomes a no-op — the fixture commit is already in main, so this PR will show only its CMake diff again. Either order is safe; they do not conflict.

I have not merged anything, and I am not asking you to skip the check — it should now run green on its own.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7350150666 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3855#issuecomment-7350150666). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-02T15:20:14Z. --- Merged the #3861 fixture fix into this branch so the approved change is no longer stuck behind an unrelated failure. Head is now `1d4e68fa`. **Why here and not "wait for #3861 to merge".** You approved this PR, and it was blocked only by the required Windows check failing on `native_direct_mesh` (#3856) — a broken fixture that `5545de92` introduced, nothing to do with this diff. Merging rather than re-running was the only way to get the check to pass; a re-run would have reproduced the same failure. **What is in the branch now**, relative to current `main`: ``` CMakeLists.txt | 6 +++++- this PR's change (the /W4 /WX guard) tests/native_direct_mesh_check.py | 3 +++ #3861's one-line fixture restore ``` **Verified on this head:** - `native_direct_mesh_check.py` against a `compile_dxil` built here → **exit 0**, `mesh allocation, indexed outputs, group exchange and negative controls passed`. Before the merge it aborted with `unmapped graphics export`. - `tests/standin_exports_check.py` → 470 cases, 6/6 mutations killed, PASS. - The CMake change itself is unchanged from the head you approved. **If #3861 merges first**, this merge becomes a no-op — the fixture commit is already in `main`, so this PR will show only its CMake diff again. Either order is safe; they do not conflict. I have not merged anything, and I am not asking you to skip the check — it should now run green on its own.
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!3855
No description provided.