test: extra malformed-encoding and per-instruction controls for VLDMXCSR/VSTMXCSR #1174

Merged
tedin7 merged 1 commit from upstream-pr/1181 into main 2026-11-24 04:15:11 +00:00
tedin7 commented 2026-11-24 02:45:04 +00:00 (Migrated from github.com)

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


Change

Test-only follow-up to #1134. It adds cases from the closed-in-favour branch of #1130 that the shared VLDMXCSR/VSTMXCSR lowering tests do not yet pin. No change to tools/. This work is AI-assisted.

  • cpu_aot_vmxcsr_malformed (new, no fixture, no AVX): six malformed VEX loads and six malformed stores (VEX.L = 1 in both prefix lengths, vvvv other than 1111, pp = 01, a register operand, map 0F38) must be refused by lower at their own address in the host-MXCSR profile. #1134 checks only that the decoder calls them invalid, and only for the load. The well-formed VLDMXCSR and VSTMXCSR beside them, with and without VEX.W, must lower to _mm_setcsr and _mm_getcsr.
  • unmasked control: the unmasked-exception refusal is disabled, so mxcsr_after accepts 0x1D80 and must break a rule.
  • Four single-instruction controls on the mixed exports, one per MXCSR instruction (mixldload, mixvstread, mixvldload, mixstread). Each must break a rule in that very export, so a wrong lowering of one form is caught even where the other form is right.

Refs #1093, #1134, #1130.

Verification

  • python3 -B tests/cpu/vmxcsr.py check malformed on this branch: exit 0, "12 malformed VEX loads and stores are refused by the lowering at their address; ...".
  • Negative control 1, VSTMXCSR removed from the lowering: the same command fails with unsupported query operation at 0x1000: vstmxcsr dword ptr [rax].
  • Negative control 2, the lowering made to accept malformed bytes: the same command fails with an assertion.
  • python3 -B tests/rdna2_tools_check.py: OK (skipped=10).
  • Not run locally: the Windows fixture build and cpu_aot_vmxcsr with the five new controls (needs MSVC and ml64); the Windows CI jobs run them. The new variants are generated by editing one export's C++ and the check requires the broken rule to name that export.

Evidence and follow-up

No new binary fixture: the malformed check uses hex bytes written in the test, the controls reuse vmxcsr.asm. MIT, original code, no game files.

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:6573445276 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1181). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T02:45:04Z. --- ## Change Test-only follow-up to #1134. It adds cases from the closed-in-favour branch of #1130 that the shared VLDMXCSR/VSTMXCSR lowering tests do not yet pin. No change to `tools/`. This work is AI-assisted. - `cpu_aot_vmxcsr_malformed` (new, no fixture, no AVX): six malformed VEX loads and six malformed stores (VEX.L = 1 in both prefix lengths, vvvv other than 1111, pp = 01, a register operand, map 0F38) must be refused by `lower` at their own address in the host-MXCSR profile. #1134 checks only that the decoder calls them invalid, and only for the load. The well-formed VLDMXCSR and VSTMXCSR beside them, with and without VEX.W, must lower to `_mm_setcsr` and `_mm_getcsr`. - `unmasked` control: the unmasked-exception refusal is disabled, so `mxcsr_after` accepts 0x1D80 and must break a rule. - Four single-instruction controls on the mixed exports, one per MXCSR instruction (`mixldload`, `mixvstread`, `mixvldload`, `mixstread`). Each must break a rule in that very export, so a wrong lowering of one form is caught even where the other form is right. Refs #1093, #1134, #1130. ## Verification - `python3 -B tests/cpu/vmxcsr.py check malformed` on this branch: exit 0, "12 malformed VEX loads and stores are refused by the lowering at their address; ...". - Negative control 1, `VSTMXCSR` removed from the lowering: the same command fails with `unsupported query operation at 0x1000: vstmxcsr dword ptr [rax]`. - Negative control 2, the lowering made to accept malformed bytes: the same command fails with an assertion. - `python3 -B tests/rdna2_tools_check.py`: OK (skipped=10). - Not run locally: the Windows fixture build and `cpu_aot_vmxcsr` with the five new controls (needs MSVC and ml64); the Windows CI jobs run them. The new variants are generated by editing one export's C++ and the check requires the broken rule to name that export. ## Evidence and follow-up No new binary fixture: the malformed check uses hex bytes written in the test, the controls reuse `vmxcsr.asm`. MIT, original code, no game files. ## 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:44 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:50:14 +00:00 (Migrated from github.com)

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


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-24T03:31:06.422696Z 4de52b0 Draft marked ready
ℹ️ 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:7121118300 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1181#issuecomment-7121118300). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T03:27:55Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"4de52b0513df4e6d42461f27c2e7a4f409fb7b3b","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-24T03:31:06.422696Z">2026-11-24T03:31:06.422696Z</relative-time> | `4de52b0` | Draft marked ready | <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>
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!1174
No description provided.