sync: merge main into cpp-migration #3038

Closed
github-bot wants to merge 39 commits from gh-pr/3038/head into gh-pr/3038/base
Owner

@⁠tedin7 on GitHub · 2026-11-27 09:35 UTC · original
tedin7:sm2-sync-main-cpp → cpp-migration · +10773 −368 · 130 files · 39 commits · closed without merging

Part of #1198

What this unblocks: cpp-migration catches up with main (37 commits), so PRs based on cpp-migration stop falling behind.

Merge commit of origin/main into cpp-migration (no rebase, no force). Four conflicts, resolved keeping both sides:

  • src/startup_stubs/d3d12_compute_dispatch.inl: the in-process translation (translate_compute_natively) stays next to the new root SRV resolver; the per-key retry gate uses main's manifest_retry.due() and still tries the native translation first.
  • tests/startup_stream_consumer.cpp: main's table-offset / root-changed / heap-changed modes plus cpp-migration's dispatch-records32.
  • tests/startup_run_ps1_check.py: the stub record carries both the native SDK field and main's title id and storage fields.
  • tools/startup/gfx2hlsl.py: main's vconst literal tracking now sits in set_v (git had paired it with the wrong function).

Verification:

  • git merge origin/main on a branch from origin/cpp-migration; python3 -m py_compile tools/startup/gfx2hlsl.py tests/startup_run_ps1_check.py: ok.
  • No conflict markers left; no Windows run (CI decides). Merge with a MERGE commit, not squash.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-27 09:35 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3038) `tedin7:sm2-sync-main-cpp` → `cpp-migration` · +10773 −368 · 130 files · 39 commits · closed without merging Part of #1198 What this unblocks: cpp-migration catches up with main (37 commits), so PRs based on cpp-migration stop falling behind. Merge commit of origin/main into cpp-migration (no rebase, no force). Four conflicts, resolved keeping both sides: - `src/startup_stubs/d3d12_compute_dispatch.inl`: the in-process translation (`translate_compute_natively`) stays next to the new root SRV resolver; the per-key retry gate uses main's `manifest_retry.due()` and still tries the native translation first. - `tests/startup_stream_consumer.cpp`: main's table-offset / root-changed / heap-changed modes plus cpp-migration's `dispatch-records32`. - `tests/startup_run_ps1_check.py`: the stub record carries both the native SDK field and main's title id and storage fields. - `tools/startup/gfx2hlsl.py`: main's `vconst` literal tracking now sits in `set_v` (git had paired it with the wrong function). Verification: - `git merge origin/main` on a branch from origin/cpp-migration; `python3 -m py_compile tools/startup/gfx2hlsl.py tests/startup_run_ps1_check.py`: ok. - No conflict markers left; no Windows run (CI decides). Merge with a MERGE commit, not squash. AI-assisted; commands listed were executed locally.
Document the Windows 10 GPU Check results, including the Shader Model 6.5 capability skip.

Refs #1.
Submit an explicit render-target clear before the main sequence and the skipped-draw control. Preserve the pixel-history checks.

Refs #1268.
Validate module names and row shape before publishing routing metadata. Exercise boundary and mutation controls.
Reject boolean and malformed inputs to the host commit budget check. Cover page bounds and mocked Windows API behavior.
Support a bounded uniform sampler diamond for explicit 2D LOD operations. Validate both sampler definitions and exercise both selectors, swapped bindings and supported limits with source-built fixtures.
Preserve modulo-32-bit subtraction in the non-returning, barrier-delimited LDS profile while avoiding the reported groupshared PSO creation failure. Pin both additions with a readback mutation.
Use the spatial coordinates for LOD on supported 2D-array resources and retain the derivative and static sampler checks. Verify two slices and two derivative scales against direct HLSL.
Compare canonical script paths while preserving command arguments and the original execution paths.
Use the existing bitwise binary32 scaling contract and pin the lowering with source-built decode and refusal controls.

Refs #2618.
Validate a bounded calculated branch to a pure terminating continuation and verify byte-exact extraction with LLVM 15.
Bind eligible raw table SRVs directly to a placed buffer alias when enabled. Preserve combined index and shader read states and validate the full rounded range.

Fixes #2976.
Clear the three inherited dump switches before applying each explicit fixture case.
Select the high or low word with bit five and preserve lane-mask refusals. Verify both operations with source-built controls.
Compare both scalar words and preserve the refusal of lane masks. Exercise equality, inequality and each independently differing half.
Track submitted diagnostic readback ownership until its matching fence completes. Retire timed-out work asynchronously and disable reuse on device removal or failed signals.
Invalidate the high VCC proof for a live unsigned VOP3B carry and rotate both runtime shader request keys.
Preserve untouched channels when disjoint pixel stores target the same texel. Keep full-mask array and compute behavior.
Select the original half encoding for each packed result, retaining signed zero and the one-NaN rules.

Refs #2022.
Permit dead opaque selects and refuse numerical, joined-descriptor and high-pair uses.

Refs #2618.
Lower the per-byte average with the rounding bit and reject unsupported encoded modifiers.
Bind tracked, bounded root SRV ranges during translated compute Dispatch and keep the indirect route restricted to fixed-table raw buffers.
Outline a staged control-flow proof with source-built fixtures and negative controls.
Lay out separately testable translator, pipeline creation and mesh dispatch milestones.
Add a source-built CPU reference for node intersection and pointer decoding, with model-only witnesses.
Retry missing graphics and compute manifests with a bounded shared backoff. Reset the schedule once a manifest appears.
Refuse stale command-list resubmissions before execution when a released upload chunk has been recycled. Keep the behavior behind X2W_D3D12_RING_RELEASE_AT_SUBMIT.

Fixes #2948.
Lower full-channel compute stores to 1D and 3D texture UAVs and validate the selected mip and W range when binding. Cover both dimensions with source-built readbacks and refusal controls.

Refs #2022 and #2274.
Use the runtime-dependent readback words to distinguish fused FMad from separate multiply and add. Preserve the compiler-folded first word in both probe models and include the first mismatches in diagnostics.

Fixes #2883.
Lower 64-bit scalar bit clear and set with six-bit indexing. Preserve the index when it aliases the destination pair and verify both operations with source-built readbacks and rejection controls.
Keep in-flight present signature resources when the fence reports device removal. Re-observe the fence after the bounded teardown wait and publish a sample only after verified completion.
Record the observed mip choices, error bounds, negative controls, adapter and pinned toolchain for the AMD Radeon RX 9070 XT report.
Use literal paths when checking and reading MicrosoftGame.config. Cover normal and bracketed paths and an absent manifest with a matching sibling.
Verify the selected descriptor offset and same-heap rebind. Confirm the exact table refusal with untouched output when the root or view heap invalidates the binding.

Refs #2470.
Validate dimensions, pitch, format names and padding before tiling or linearizing block surfaces. Add source-built round-trip, refusal and mutation coverage.
Use streaming-store intrinsics for supported non-temporal stores and preserve native SIMD alignment faults. Compare source-built native and lowered stores byte for byte with fault and mutation controls.
Lower the FP32 box32 intersection with constant descriptor and node inputs. Preserve original child order when sorting is disabled. Cover exact WARP and hardware readback and miss-fill controls.
Lower byte permutation, sign-byte selection and constant selectors through on-demand HLSL helpers. Cover exact selectors and modified instruction refusals with source-built controls.
Conflicts: d3d12_compute_dispatch.inl (native translation kept next to the
root SRV resolver; manifest retry gate kept with the native attempt),
startup_stream_consumer.cpp (table-offset/heap-change modes and records32),
startup_run_ps1_check.py (native SDK + title id + storage fields),
gfx2hlsl.py (vconst tracking moved into set_v).
main moved the runtime request keys to x2w-startup-shader-29 / 29cs; the C++
reader, its fixtures and the doc still hashed revision 28, so a native
translation refused every compute request with 'compute request key mismatch'.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:41:22 +00:00
github-bot closed this pull request 2026-11-27 10:41:22 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-27 10:07 UTC · original

Focused Windows receipt for head e3397e416 (pull/3038/head, default pool, dev and release run in parallel, Windows 11 build 26100, WARP and the VM's hardware adapter).

x2w_pipe.py win2025 3038 --regex '^startup_(compute_dispatch|stream_consumer|stream_draw|run_ps1|gfx2hlsl|native_graphics|list_cost_bench|view_token)'   (on 75aa29d3)
x2w_pipe.py win2025 3038 --regex '^(startup_(compute_dispatch|stream_consumer|run_ps1)|native_(compute_clear|direct_container|startup_request_cache))'   (on e3397e41)
  • First run on the plain merge (75aa29d3): 370/372 passed on dev and on release. The two red tests, startup_compute_dispatch_native_{warp,hardware}, were a real conflict between the two sides: main moved the runtime request revision to x2w-startup-shader-29 / 29cs, while the C++ reader on cpp-migration, two fixtures and one doc still hashed revision 28 ("compute request key mismatch"). e3397e416 moves them to 29.
  • Second run (e3397e41): 23/24 passed on dev and on release. startup_compute_dispatch_native_warp skips (no 32-lane waves on WARP) and _hardware skips on the VM adapter; native_compute_clear, native_direct_container and native_startup_request_cache_warp pass.
  • One red remains: native_startup_request_cache_hardware, debug layer "Shader wants wave lane count of 32 but maximum wave lane count for device is 4". The VM adapter has 4-lane waves. It fails the same way on an unrelated cpp-migration PR head (#3018, fb760133), so it is not caused by this merge; the test needs a wave-size skip.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-27 10:07 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3038#issuecomment-7215496895) Focused Windows receipt for head `e3397e416` (pull/3038/head, default pool, dev and release run in parallel, Windows 11 build 26100, WARP and the VM's hardware adapter). ``` x2w_pipe.py win2025 3038 --regex '^startup_(compute_dispatch|stream_consumer|stream_draw|run_ps1|gfx2hlsl|native_graphics|list_cost_bench|view_token)' (on 75aa29d3) x2w_pipe.py win2025 3038 --regex '^(startup_(compute_dispatch|stream_consumer|run_ps1)|native_(compute_clear|direct_container|startup_request_cache))' (on e3397e41) ``` - First run on the plain merge (`75aa29d3`): 370/372 passed on dev and on release. The two red tests, `startup_compute_dispatch_native_{warp,hardware}`, were a real conflict between the two sides: main moved the runtime request revision to `x2w-startup-shader-29` / `29cs`, while the C++ reader on cpp-migration, two fixtures and one doc still hashed revision 28 ("compute request key mismatch"). `e3397e416` moves them to 29. - Second run (`e3397e41`): 23/24 passed on dev and on release. `startup_compute_dispatch_native_warp` skips (no 32-lane waves on WARP) and `_hardware` skips on the VM adapter; `native_compute_clear`, `native_direct_container` and `native_startup_request_cache_warp` pass. - One red remains: `native_startup_request_cache_hardware`, debug layer "Shader wants wave lane count of 32 but maximum wave lane count for device is 4". The VM adapter has 4-lane waves. It fails the same way on an unrelated cpp-migration PR head (#3018, `fb760133`), so it is not caused by this merge; the test needs a wave-size skip. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-27 10:07 UTC · original · edited 2026-11-27 10:14 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-27T10:14:36.365005Z e3397e4 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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-27 10:07 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3038#issuecomment-7215501175) · edited 2026-11-27 10:14 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"e3397e4167d760d66b42fc82118484624de87641","has_any_findings":true,"has_unresolved_findings":true,"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-27T10:14:36.365005Z">2026-11-27T10:14:36.365005Z</relative-time> | `e3397e4` | 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>
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-27 10:14 UTC · original

Thanks for the independent Windows receipt and for isolating the four-lane adapter failure. The sync through main 8a901eb2 already landed on cpp-migration as b8f49259. It accepts current revision-29 and archived revision-28 cache requests. On the RTX 4060 Laptop, the cache hardware test passed in Debug and Release /O2; the two separate wave32 fixtures reported their WARP capability skips. Please close this overlapping draft. The four-lane skip in native_startup_request_cache_hardware can be handled as a separate focused change against the current branch.

**@⁠R0Y00** on GitHub · 2026-11-27 10:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3038#issuecomment-7215645015) Thanks for the independent Windows receipt and for isolating the four-lane adapter failure. The sync through `main` `8a901eb2` already landed on `cpp-migration` as `b8f49259`. It accepts current revision-29 and archived revision-28 cache requests. On the RTX 4060 Laptop, the cache hardware test passed in Debug and Release `/O2`; the two separate wave32 fixtures reported their WARP capability skips. Please close this overlapping draft. The four-lane skip in `native_startup_request_cache_hardware` can be handled as a separate focused change against the current branch.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-27 10:14 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3397e4167

ℹ️ 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".

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".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-27 10:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3038#pullrequestreview-6086585975) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `e3397e4167` <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". 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". </details>
@ -7503,0 +7848,4 @@
'lowered in this slice' % (name, tok))
raise Unsupported('%s descriptor %s is not four constant SGPRs' % (name, tok))
words = ['0x%08xu' % (value & 0xffffffff) for value in values]
base = ((values[1] & 0xff) << 32) | values[0]
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-27 10:14 UTC · original

P2 Badge Decode the BVH base field in 256-byte units

For a constant T# describing byte base 0x100000, the encoded base is 0x1000: both bvh_model.descriptor() and the native fixture's descriptor_for() store base >> 8. This code instead emits srv 0 bvh base 0x1000 ..., so the manifest names the wrong allocation. The later vals[0] & 0xff check also rejects valid 256-byte-aligned bases such as 0x123400. Reconstruct the byte address with the missing left shift and validate alignment on that address rather than on the encoded units.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-27 10:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3038#discussion_r4718118568) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Decode the BVH base field in 256-byte units** For a constant T# describing byte base `0x100000`, the encoded base is `0x1000`: both `bvh_model.descriptor()` and the native fixture's `descriptor_for()` store `base >> 8`. This code instead emits `srv 0 bvh base 0x1000 ...`, so the manifest names the wrong allocation. The later `vals[0] & 0xff` check also rejects valid 256-byte-aligned bases such as `0x123400`. Reconstruct the byte address with the missing left shift and validate alignment on that address rather than on the encoded units. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
@ -7503,0 +7883,4 @@
node = self.const_u32(cs[0])
node_reg = reg_range(cs[0])
if node is None and node_reg and node_reg[0] == 'v' and not getattr(self, 'has_branches', True):
node = getattr(self, 'vconst', {}).get(node_reg[1])
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-27 10:14 UTC · original

P2 Badge Invalidate cached node literals on every VGPR write

In a straight-line compute shader, v_mov_b32 v16, 5, v_mov_b32 v28, 0x15, then v_swap_b32 v16, v28 leaves vconst[16] equal to 5 because op_v_swap_b32() emits register writes directly without calling set_v(). A subsequent image_bvh_intersect_ray therefore hardcodes node 0x05 even though the actual operand is 0x15, intersecting the node at offset 0 instead of offset 128. Update or invalidate the literal cache for all VGPR destination writes, including direct-emission helpers, before using it to fold the node operand.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-27 10:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3038#discussion_r4718118576) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Invalidate cached node literals on every VGPR write** In a straight-line compute shader, `v_mov_b32 v16, 5`, `v_mov_b32 v28, 0x15`, then `v_swap_b32 v16, v28` leaves `vconst[16]` equal to 5 because `op_v_swap_b32()` emits register writes directly without calling `set_v()`. A subsequent `image_bvh_intersect_ray` therefore hardcodes node `0x05` even though the actual operand is `0x15`, intersecting the node at offset 0 instead of offset 128. Update or invalidate the literal cache for all VGPR destination writes, including direct-emission helpers, before using it to fold the node operand. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-27 10:16 UTC · original

Thanks for preparing the branch sync. We merged cpp-migration into main in #3039 (91cbedd6), so I’m closing this sync PR.

One change is worth following up separately: e3397e41 updates the native startup request keys and fixtures to revision 29. On current main, tests/native_direct_container_check.py still constructs a revision-28 key. Please carry the revision alignment into a focused PR against main and verify that the runtime producer and offline compiler accept the same graphics and compute requests. The original commit remains linked here for reference.

**@⁠R0Y00** on GitHub · 2026-11-27 10:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3038#issuecomment-7215691329) Thanks for preparing the branch sync. We merged cpp-migration into main in #3039 (91cbedd6), so I’m closing this sync PR. One change is worth following up separately: e3397e41 updates the native startup request keys and fixtures to revision 29. On current main, tests/native_direct_container_check.py still constructs a revision-28 key. Please carry the revision alignment into a focused PR against main and verify that the runtime producer and offline compiler accept the same graphics and compute requests. The original commit remains linked here for reference.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.